
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

ARRAY * array_quote_escapes(ARRAY *array)

{
  ARRAY *pAVar1;
  void *__ptr;
  char *pcVar2;
  ARRAY *pAVar3;
  ARRAY *pAVar4;
  
  if (array == (ARRAY *)0x0) {
    return (ARRAY *)0x0;
  }
  pAVar1 = (ARRAY *)array->head;
  pAVar3 = pAVar1;
  if (pAVar1 != (ARRAY *)0x0) {
    if (array->num_elements == 0) {
      return (ARRAY *)0x0;
    }
    pAVar4 = (ARRAY *)pAVar1->num_elements;
    pAVar3 = array;
    if (pAVar1 != pAVar4) {
      do {
        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));
        __ptr = *(void **)((int)&pAVar4->max_index + 4);
        if (__ptr != (void *)0x0) {
          free(__ptr);
        }
        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;
        pAVar4 = (ARRAY *)pAVar4->num_elements;
      } while ((ARRAY *)array->head != pAVar4);
    }
  }
  return pAVar3;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int array_quote_escapes(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == 0) {
    return 0;
  }
  iVar1 = *(int *)(param_1 + 0x14);
  iVar3 = iVar1;
  if (iVar1 != 0) {
    if (*(int *)(param_1 + 0xc) == 0) {
      return 0;
    }
    iVar4 = *(int *)(iVar1 + 0xc);
    iVar3 = param_1;
    if (iVar1 != iVar4) {
      do {
        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));
        if (*(void **)(iVar4 + 8) != (void *)0x0) {
          free(*(void **)(iVar4 + 8));
        }
        *(undefined4 *)(iVar4 + 8) = uVar2;
        iVar4 = *(int *)(iVar4 + 0xc);
      } while (*(int *)(param_1 + 0x14) != iVar4);
    }
  }
  return iVar3;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00031ed0
ADD EBX,0xc82d7
SUB ESP,0xc
MOV EDI,dword ptr [ESP + 0x20]
TEST EDI,EDI
JZ 0x00081d90
MOV EAX,dword ptr [EDI + 0x14]
TEST EAX,EAX
JZ 0x00081d80
MOV EDX,dword ptr [EDI + 0xc]
TEST EDX,EDX
JZ 0x00081d90
MOV ESI,dword ptr [EAX + 0xc]
CMP EAX,ESI
JZ 0x00081d7e
NOP
SUB ESP,0xc
PUSH dword ptr [ESI + 0x8]
CALL 0x0006b1b0
MOV EDX,dword ptr [ESI + 0x8]
ADD ESP,0x10
MOV EBP,EAX
TEST EDX,EDX
JZ 0x00081d73
SUB ESP,0xc
PUSH EDX
CALL 0x0002f200
ADD ESP,0x10
MOV dword ptr [ESI + 0x8],EBP
MOV ESI,dword ptr [ESI + 0xc]
CMP dword ptr [EDI + 0x14],ESI
JNZ 0x00081d50
MOV EAX,EDI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD ESP,0xc
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint array_quote_escapes(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int array_quote_escapes(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "array_quote_escapes(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (if_statement "if (param_1 == 0) {\n    return 0;\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x14)" identifier = (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" identifier = identifier) ;) (if_statement "if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" { (if_statement "if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0xc) == 0)" ( (binary_expression "*(int *)(param_1 + 0xc) == 0" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar4 = *(int *)(iVar1 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar1 + 0xc)" identifier = (pointer_expression "*(int *)(iVar1 + 0xc)" * (cast_expression "(int *)(iVar1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = param_1;" (assignment_expression "iVar3 = param_1" identifier = identifier) ;) (if_statement "if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" if (parenthesized_expression "(iVar1 != iVar4)" ( (binary_expression "iVar1 != iVar4" identifier != identifier) )) (compound_statement "{\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" { (do_statement "do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);" do (compound_statement "{\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      }" { (expression_statement "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));" (assignment_expression "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8))" identifier = (call_expression "quote_escapes(*(undefined4 *)(iVar4 + 8))" identifier (argument_list "(*(undefined4 *)(iVar4 + 8))" ( (pointer_expression "*(undefined4 *)(iVar4 + 8)" * (cast_expression "(undefined4 *)(iVar4 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }" if (parenthesized_expression "(*(void **)(iVar4 + 8) != (void *)0x0)" ( (binary_expression "*(void **)(iVar4 + 8) != (void *)0x0" (pointer_expression "*(void **)(iVar4 + 8)" * (cast_expression "(void **)(iVar4 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          free(*(void **)(iVar4 + 8));\n        }" { (expression_statement "free(*(void **)(iVar4 + 8));" (call_expression "free(*(void **)(iVar4 + 8))" identifier (argument_list "(*(void **)(iVar4 + 8))" ( (pointer_expression "*(void **)(iVar4 + 8)" * (cast_expression "(void **)(iVar4 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) ))) ;) })) (expression_statement "*(undefined4 *)(iVar4 + 8) = uVar2;" (assignment_expression "*(undefined4 *)(iVar4 + 8) = uVar2" (pointer_expression "*(undefined4 *)(iVar4 + 8)" * (cast_expression "(undefined4 *)(iVar4 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar4 = *(int *)(iVar4 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar4 + 0xc)" identifier = (pointer_expression "*(int *)(iVar4 + 0xc)" * (cast_expression "(int *)(iVar4 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 0xc)" ( (binary_expression "iVar4 + 0xc" identifier + number_literal) ))))) ;) }) while (parenthesized_expression "(*(int *)(param_1 + 0x14) != iVar4)" ( (binary_expression "*(int *)(param_1 + 0x14) != iVar4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) != identifier) )) ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nARRAY * array_quote_escapes(ARRAY *array)\n\n{\n  ARRAY *pAVar1;\n  void *__ptr;\n  char *pcVar2;\n  ARRAY *pAVar3;\n  ARRAY *pAVar4;\n  \n  if (array == (ARRAY *)0x0) {\n    return (ARRAY *)0x0;\n  }\n  pAVar1 = (ARRAY *)array->head;\n  pAVar3 = pAVar1;\n  if (pAVar1 != (ARRAY *)0x0) {\n    if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }\n    pAVar4 = (ARRAY *)pAVar1->num_elements;\n    pAVar3 = array;\n    if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }\n  }\n  return pAVar3;\n}\n\n" comment comment (function_definition "ARRAY * array_quote_escapes(ARRAY *array)\n\n{\n  ARRAY *pAVar1;\n  void *__ptr;\n  char *pcVar2;\n  ARRAY *pAVar3;\n  ARRAY *pAVar4;\n  \n  if (array == (ARRAY *)0x0) {\n    return (ARRAY *)0x0;\n  }\n  pAVar1 = (ARRAY *)array->head;\n  pAVar3 = pAVar1;\n  if (pAVar1 != (ARRAY *)0x0) {\n    if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }\n    pAVar4 = (ARRAY *)pAVar1->num_elements;\n    pAVar3 = array;\n    if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }\n  }\n  return pAVar3;\n}" type_identifier (pointer_declarator "* array_quote_escapes(ARRAY *array)" * (function_declarator "array_quote_escapes(ARRAY *array)" identifier (parameter_list "(ARRAY *array)" ( (parameter_declaration "ARRAY *array" type_identifier (pointer_declarator "*array" * identifier)) )))) (compound_statement "{\n  ARRAY *pAVar1;\n  void *__ptr;\n  char *pcVar2;\n  ARRAY *pAVar3;\n  ARRAY *pAVar4;\n  \n  if (array == (ARRAY *)0x0) {\n    return (ARRAY *)0x0;\n  }\n  pAVar1 = (ARRAY *)array->head;\n  pAVar3 = pAVar1;\n  if (pAVar1 != (ARRAY *)0x0) {\n    if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }\n    pAVar4 = (ARRAY *)pAVar1->num_elements;\n    pAVar3 = array;\n    if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }\n  }\n  return pAVar3;\n}" { (declaration "ARRAY *pAVar1;" type_identifier (pointer_declarator "*pAVar1" * identifier) ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "ARRAY *pAVar3;" type_identifier (pointer_declarator "*pAVar3" * identifier) ;) (declaration "ARRAY *pAVar4;" type_identifier (pointer_declarator "*pAVar4" * identifier) ;) (if_statement "if (array == (ARRAY *)0x0) {\n    return (ARRAY *)0x0;\n  }" if (parenthesized_expression "(array == (ARRAY *)0x0)" ( (binary_expression "array == (ARRAY *)0x0" identifier == (cast_expression "(ARRAY *)0x0" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return (ARRAY *)0x0;\n  }" { (return_statement "return (ARRAY *)0x0;" return (cast_expression "(ARRAY *)0x0" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pAVar1 = (ARRAY *)array->head;" (assignment_expression "pAVar1 = (ARRAY *)array->head" identifier = (cast_expression "(ARRAY *)array->head" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "array->head" identifier -> field_identifier))) ;) (expression_statement "pAVar3 = pAVar1;" (assignment_expression "pAVar3 = pAVar1" identifier = identifier) ;) (if_statement "if (pAVar1 != (ARRAY *)0x0) {\n    if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }\n    pAVar4 = (ARRAY *)pAVar1->num_elements;\n    pAVar3 = array;\n    if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }\n  }" if (parenthesized_expression "(pAVar1 != (ARRAY *)0x0)" ( (binary_expression "pAVar1 != (ARRAY *)0x0" identifier != (cast_expression "(ARRAY *)0x0" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }\n    pAVar4 = (ARRAY *)pAVar1->num_elements;\n    pAVar3 = array;\n    if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }\n  }" { (if_statement "if (array->num_elements == 0) {\n      return (ARRAY *)0x0;\n    }" if (parenthesized_expression "(array->num_elements == 0)" ( (binary_expression "array->num_elements == 0" (field_expression "array->num_elements" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n      return (ARRAY *)0x0;\n    }" { (return_statement "return (ARRAY *)0x0;" return (cast_expression "(ARRAY *)0x0" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pAVar4 = (ARRAY *)pAVar1->num_elements;" (assignment_expression "pAVar4 = (ARRAY *)pAVar1->num_elements" identifier = (cast_expression "(ARRAY *)pAVar1->num_elements" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pAVar1->num_elements" identifier -> field_identifier))) ;) (expression_statement "pAVar3 = array;" (assignment_expression "pAVar3 = array" identifier = identifier) ;) (if_statement "if (pAVar1 != pAVar4) {\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }" if (parenthesized_expression "(pAVar1 != pAVar4)" ( (binary_expression "pAVar1 != pAVar4" identifier != identifier) )) (compound_statement "{\n      do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);\n    }" { (do_statement "do {\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      } while ((ARRAY *)array->head != pAVar4);" do (compound_statement "{\n        pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));\n        __ptr = *(void **)((int)&pAVar4->max_index + 4);\n        if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }\n        *(char **)((int)&pAVar4->max_index + 4) = pcVar2;\n        pAVar4 = (ARRAY *)pAVar4->num_elements;\n      }" { (expression_statement "pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4));" (assignment_expression "pcVar2 = quote_escapes(*(char **)((int)&pAVar4->max_index + 4))" identifier = (call_expression "quote_escapes(*(char **)((int)&pAVar4->max_index + 4))" identifier (argument_list "(*(char **)((int)&pAVar4->max_index + 4))" ( (pointer_expression "*(char **)((int)&pAVar4->max_index + 4)" * (cast_expression "(char **)((int)&pAVar4->max_index + 4)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)&pAVar4->max_index + 4)" ( (binary_expression "(int)&pAVar4->max_index + 4" (cast_expression "(int)&pAVar4->max_index" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pAVar4->max_index" & (field_expression "pAVar4->max_index" identifier -> field_identifier))) + number_literal) )))) )))) ;) (expression_statement "__ptr = *(void **)((int)&pAVar4->max_index + 4);" (assignment_expression "__ptr = *(void **)((int)&pAVar4->max_index + 4)" identifier = (pointer_expression "*(void **)((int)&pAVar4->max_index + 4)" * (cast_expression "(void **)((int)&pAVar4->max_index + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)&pAVar4->max_index + 4)" ( (binary_expression "(int)&pAVar4->max_index + 4" (cast_expression "(int)&pAVar4->max_index" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pAVar4->max_index" & (field_expression "pAVar4->max_index" identifier -> field_identifier))) + number_literal) ))))) ;) (if_statement "if (__ptr != (void *)0x0) {\n          free(__ptr);\n        }" if (parenthesized_expression "(__ptr != (void *)0x0)" ( (binary_expression "__ptr != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          free(__ptr);\n        }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) })) (expression_statement "*(char **)((int)&pAVar4->max_index + 4) = pcVar2;" (assignment_expression "*(char **)((int)&pAVar4->max_index + 4) = pcVar2" (pointer_expression "*(char **)((int)&pAVar4->max_index + 4)" * (cast_expression "(char **)((int)&pAVar4->max_index + 4)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)&pAVar4->max_index + 4)" ( (binary_expression "(int)&pAVar4->max_index + 4" (cast_expression "(int)&pAVar4->max_index" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pAVar4->max_index" & (field_expression "pAVar4->max_index" identifier -> field_identifier))) + number_literal) )))) = identifier) ;) (expression_statement "pAVar4 = (ARRAY *)pAVar4->num_elements;" (assignment_expression "pAVar4 = (ARRAY *)pAVar4->num_elements" identifier = (cast_expression "(ARRAY *)pAVar4->num_elements" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pAVar4->num_elements" identifier -> field_identifier))) ;) }) while (parenthesized_expression "((ARRAY *)array->head != pAVar4)" ( (binary_expression "(ARRAY *)array->head != pAVar4" (cast_expression "(ARRAY *)array->head" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "array->head" identifier -> field_identifier)) != identifier) )) ;) })) })) (return_statement "return pAVar3;" return identifier ;) })))
(translation_unit "int array_quote_escapes(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}\n\n" (function_definition "int array_quote_escapes(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "array_quote_escapes(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (if_statement "if (param_1 == 0) {\n    return 0;\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x14)" identifier = (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" identifier = identifier) ;) (if_statement "if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" { (if_statement "if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0xc) == 0)" ( (binary_expression "*(int *)(param_1 + 0xc) == 0" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar4 = *(int *)(iVar1 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar1 + 0xc)" identifier = (pointer_expression "*(int *)(iVar1 + 0xc)" * (cast_expression "(int *)(iVar1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = param_1;" (assignment_expression "iVar3 = param_1" identifier = identifier) ;) (if_statement "if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" if (parenthesized_expression "(iVar1 != iVar4)" ( (binary_expression "iVar1 != iVar4" identifier != identifier) )) (compound_statement "{\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" { (do_statement "do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);" do (compound_statement "{\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      }" { (expression_statement "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));" (assignment_expression "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8))" identifier = (call_expression "quote_escapes(*(undefined4 *)(iVar4 + 8))" identifier (argument_list "(*(undefined4 *)(iVar4 + 8))" ( (pointer_expression "*(undefined4 *)(iVar4 + 8)" * (cast_expression "(undefined4 *)(iVar4 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }" if (parenthesized_expression "(*(void **)(iVar4 + 8) != (void *)0x0)" ( (binary_expression "*(void **)(iVar4 + 8) != (void *)0x0" (pointer_expression "*(void **)(iVar4 + 8)" * (cast_expression "(void **)(iVar4 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          free(*(void **)(iVar4 + 8));\n        }" { (expression_statement "free(*(void **)(iVar4 + 8));" (call_expression "free(*(void **)(iVar4 + 8))" identifier (argument_list "(*(void **)(iVar4 + 8))" ( (pointer_expression "*(void **)(iVar4 + 8)" * (cast_expression "(void **)(iVar4 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) ))) ;) })) (expression_statement "*(undefined4 *)(iVar4 + 8) = uVar2;" (assignment_expression "*(undefined4 *)(iVar4 + 8) = uVar2" (pointer_expression "*(undefined4 *)(iVar4 + 8)" * (cast_expression "(undefined4 *)(iVar4 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 8)" ( (binary_expression "iVar4 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar4 = *(int *)(iVar4 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar4 + 0xc)" identifier = (pointer_expression "*(int *)(iVar4 + 0xc)" * (cast_expression "(int *)(iVar4 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + 0xc)" ( (binary_expression "iVar4 + 0xc" identifier + number_literal) ))))) ;) }) while (parenthesized_expression "(*(int *)(param_1 + 0x14) != iVar4)" ( (binary_expression "*(int *)(param_1 + 0x14) != iVar4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) != identifier) )) ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != IDENT) )) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int array_quote_escapes(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "array_quote_escapes(int param_1)" (identifier "array_quote_escapes") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int iVar3;\n  int iVar4;\n  \n  if (param_1 == 0) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 0x14);\n  iVar3 = iVar1;\n  if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }\n  return iVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (if_statement "if (param_1 == 0) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar1 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" (identifier "iVar3") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar1 != 0) {\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }\n    iVar4 = *(int *)(iVar1 + 0xc);\n    iVar3 = param_1;\n    if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }\n  }" ({ "{") (if_statement "if (*(int *)(param_1 + 0xc) == 0) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0xc) == 0)" (( "(") (binary_expression "*(int *)(param_1 + 0xc) == 0" (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar4 = *(int *)(iVar1 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar1 + 0xc)" (identifier "iVar4") (= "=") (pointer_expression "*(int *)(iVar1 + 0xc)" (* "*") (cast_expression "(int *)(iVar1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0xc)" (( "(") (binary_expression "iVar1 + 0xc" (identifier "iVar1") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "iVar3 = param_1;" (assignment_expression "iVar3 = param_1" (identifier "iVar3") (= "=") (identifier "param_1")) (; ";")) (if_statement "if (iVar1 != iVar4) {\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" (if "if") (parenthesized_expression "(iVar1 != iVar4)" (( "(") (binary_expression "iVar1 != iVar4" (identifier "iVar1") (!= "!=") (identifier "iVar4")) () ")")) (compound_statement "{\n      do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);\n    }" ({ "{") (do_statement "do {\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      } while (*(int *)(param_1 + 0x14) != iVar4);" (do "do") (compound_statement "{\n        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));\n        if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }\n        *(undefined4 *)(iVar4 + 8) = uVar2;\n        iVar4 = *(int *)(iVar4 + 0xc);\n      }" ({ "{") (expression_statement "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));" (assignment_expression "uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8))" (identifier "uVar2") (= "=") (call_expression "quote_escapes(*(undefined4 *)(iVar4 + 8))" (identifier "quote_escapes") (argument_list "(*(undefined4 *)(iVar4 + 8))" (( "(") (pointer_expression "*(undefined4 *)(iVar4 + 8)" (* "*") (cast_expression "(undefined4 *)(iVar4 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar4 + 8)" (( "(") (binary_expression "iVar4 + 8" (identifier "iVar4") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (if_statement "if (*(void **)(iVar4 + 8) != (void *)0x0) {\n          free(*(void **)(iVar4 + 8));\n        }" (if "if") (parenthesized_expression "(*(void **)(iVar4 + 8) != (void *)0x0)" (( "(") (binary_expression "*(void **)(iVar4 + 8) != (void *)0x0" (pointer_expression "*(void **)(iVar4 + 8)" (* "*") (cast_expression "(void **)(iVar4 + 8)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar4 + 8)" (( "(") (binary_expression "iVar4 + 8" (identifier "iVar4") (+ "+") (number_literal "8")) () ")")))) (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n          free(*(void **)(iVar4 + 8));\n        }" ({ "{") (expression_statement "free(*(void **)(iVar4 + 8));" (call_expression "free(*(void **)(iVar4 + 8))" (identifier "free") (argument_list "(*(void **)(iVar4 + 8))" (( "(") (pointer_expression "*(void **)(iVar4 + 8)" (* "*") (cast_expression "(void **)(iVar4 + 8)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar4 + 8)" (( "(") (binary_expression "iVar4 + 8" (identifier "iVar4") (+ "+") (number_literal "8")) () ")")))) () ")"))) (; ";")) (} "}"))) (expression_statement "*(undefined4 *)(iVar4 + 8) = uVar2;" (assignment_expression "*(undefined4 *)(iVar4 + 8) = uVar2" (pointer_expression "*(undefined4 *)(iVar4 + 8)" (* "*") (cast_expression "(undefined4 *)(iVar4 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar4 + 8)" (( "(") (binary_expression "iVar4 + 8" (identifier "iVar4") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "iVar4 = *(int *)(iVar4 + 0xc);" (assignment_expression "iVar4 = *(int *)(iVar4 + 0xc)" (identifier "iVar4") (= "=") (pointer_expression "*(int *)(iVar4 + 0xc)" (* "*") (cast_expression "(int *)(iVar4 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar4 + 0xc)" (( "(") (binary_expression "iVar4 + 0xc" (identifier "iVar4") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*(int *)(param_1 + 0x14) != iVar4)" (( "(") (binary_expression "*(int *)(param_1 + 0x14) != iVar4" (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (!= "!=") (identifier "iVar4")) () ")")) (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

type_1 * function_1(type_1 *var_1)

{
  type_1 *var_2;
  void *var_5;
  char *pcVar2;
  type_1 *pAVar3;
  type_1 *var_3;
  
  if (var_1 == (type_1 *)0x0) {
    return (type_1 *)0x0;
  }
  var_2 = (type_1 *)var_1->head;
  pAVar3 = var_2;
  if (var_2 != (type_1 *)0x0) {
    if (var_1->num_elements == 0) {
      return (type_1 *)0x0;
    }
    var_3 = (type_1 *)var_2->num_elements;
    pAVar3 = var_1;
    if (var_2 != var_3) {
      do {
        pcVar2 = var_4(*(char **)((int)&var_3->max_index + 4));
        var_5 = *(void **)((int)&var_3->max_index + 4);
        if (var_5 != (void *)0x0) {
          var_6(var_5);
        }
        *(char **)((int)&var_3->max_index + 4) = pcVar2;
        var_3 = (type_1 *)var_3->num_elements;
      } while ((type_1 *)var_1->head != var_3);
    }
  }
  return pAVar3;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))))))) (return_statement (identifier)))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int MASKED(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == 0) {
    return 0;
  }
  iVar1 = *(int *)(param_1 + 0x14);
  iVar3 = iVar1;
  if (iVar1 != 0) {
    if (*(int *)(param_1 + 0xc) == 0) {
      return 0;
    }
    iVar4 = *(int *)(iVar1 + 0xc);
    iVar3 = param_1;
    if (iVar1 != iVar4) {
      do {
        uVar2 = quote_escapes(*(undefined4 *)(iVar4 + 8));
        if (*(void **)(iVar4 + 8) != (void *)0x0) {
          free(*(void **)(iVar4 + 8));
        }
        *(undefined4 *)(iVar4 + 8) = uVar2;
        iVar4 = *(int *)(iVar4 + 0xc);
      } while (*(int *)(param_1 + 0x14) != iVar4);
    }
  }
  return iVar3;
}

