
int xatexit(_func_void *fn)

{
  int iVar1;
  xatexit *pxVar2;
  long lVar3;
  xatexit *pxVar4;
  int iVar5;
  
  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {
    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;
  }
  pxVar2 = xatexit_head;
  iVar1 = xatexit_head->ind;
  lVar3 = (long)iVar1;
  iVar5 = iVar1 + 1;
  if (0x1f < iVar1) {
    pxVar4 = (xatexit *)malloc(0x110);
    if (pxVar4 == (xatexit *)0x0) {
      return -1;
    }
    pxVar4->next = pxVar2;
    iVar5 = 1;
    pxVar4->ind = 0;
    lVar3 = 0;
    xatexit_head = pxVar4;
  }
  pxVar2 = xatexit_head;
  xatexit_head->ind = iVar5;
  pxVar2->fns[lVar3] = fn;
  return 0;
}



undefined8 FUN_0012fb20(undefined8 param_1)

{
  int iVar1;
  undefined *puVar2;
  long lVar3;
  undefined8 *puVar4;
  int iVar5;
  
  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {
    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;
  }
  puVar2 = PTR_DAT_0017aa00;
  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);
  lVar3 = (long)iVar1;
  iVar5 = iVar1 + 1;
  if (0x1f < iVar1) {
    puVar4 = (undefined8 *)malloc(0x110);
    if (puVar4 == (undefined8 *)0x0) {
      return 0xffffffff;
    }
    *puVar4 = puVar2;
    iVar5 = 1;
    *(undefined4 *)(puVar4 + 1) = 0;
    lVar3 = 0;
    PTR_DAT_0017aa00 = (undefined *)puVar4;
  }
  puVar2 = PTR_DAT_0017aa00;
  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;
  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;
  return 0;
}


PUSH RBP
MOV RBP,RDI
PUSH RBX
SUB RSP,0x8
MOV RAX,qword ptr [0x00179fd8]
CMP qword ptr [RAX],0x0
JZ 0x0012fb90
MOV RBX,qword ptr [0x0017aa00]
MOVSXD RAX,dword ptr [RBX + 0x8]
LEA EDX,[RAX + 0x1]
CMP EAX,0x1f
JG 0x0012fb60
MOV dword ptr [RBX + 0x8],EDX
MOV qword ptr [RBX + RAX*0x8 + 0x10],RBP
XOR EAX,EAX
ADD RSP,0x8
POP RBX
POP RBP
RET
MOV EDI,0x110
CALL 0x001097b0
TEST RAX,RAX
JZ 0x0012fb9c
MOV qword ptr [RAX],RBX
MOV EDX,0x1
MOV RBX,RAX
MOV dword ptr [RAX + 0x8],0x0
MOV qword ptr [0x0017aa00],RAX
XOR EAX,EAX
JMP 0x0012fb49
LEA RCX,[0x12fad0]
MOV qword ptr [RAX],RCX
JMP 0x0012fb36
MOV EAX,0xffffffff
JMP 0x0012fb53
(translation_unit "undefined8 FUN_0012fb20(undefined8 param_1)\n\n{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_0012fb20(undefined8 param_1)\n\n{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" type_identifier (function_declarator "FUN_0012fb20(undefined8 param_1)" identifier (parameter_list "(undefined8 param_1)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" if (parenthesized_expression "(*(long *)PTR__xexit_cleanup_00179fd8 == 0)" ( (binary_expression "*(long *)PTR__xexit_cleanup_00179fd8 == 0" (pointer_expression "*(long *)PTR__xexit_cleanup_00179fd8" * (cast_expression "(long *)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) == number_literal) )) (compound_statement "{\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" { (expression_statement "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;" (assignment_expression "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0" (pointer_expression "*(code **)PTR__xexit_cleanup_00179fd8" * (cast_expression "(code **)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) })) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" identifier = identifier) ;) (expression_statement "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);" (assignment_expression "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8)" identifier = (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" * (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" ( (binary_expression "PTR_DAT_0017aa00 + 8" identifier + number_literal) ))))) ;) (expression_statement "lVar3 = (long)iVar1;" (assignment_expression "lVar3 = (long)iVar1" identifier = (cast_expression "(long)iVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "iVar5 = iVar1 + 1;" (assignment_expression "iVar5 = iVar1 + 1" identifier = (binary_expression "iVar1 + 1" identifier + number_literal)) ;) (if_statement "if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" if (parenthesized_expression "(0x1f < iVar1)" ( (binary_expression "0x1f < iVar1" number_literal < identifier) )) (compound_statement "{\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" { (expression_statement "puVar4 = (undefined8 *)malloc(0x110);" (assignment_expression "puVar4 = (undefined8 *)malloc(0x110)" identifier = (cast_expression "(undefined8 *)malloc(0x110)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x110)" identifier (argument_list "(0x110)" ( number_literal ))))) ;) (if_statement "if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(puVar4 == (undefined8 *)0x0)" ( (binary_expression "puVar4 == (undefined8 *)0x0" identifier == (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "*puVar4 = puVar2;" (assignment_expression "*puVar4 = puVar2" (pointer_expression "*puVar4" * identifier) = identifier) ;) (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) (expression_statement "*(undefined4 *)(puVar4 + 1) = 0;" (assignment_expression "*(undefined4 *)(puVar4 + 1) = 0" (pointer_expression "*(undefined4 *)(puVar4 + 1)" * (cast_expression "(undefined4 *)(puVar4 + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 1)" ( (binary_expression "puVar4 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "PTR_DAT_0017aa00 = (undefined *)puVar4;" (assignment_expression "PTR_DAT_0017aa00 = (undefined *)puVar4" identifier = (cast_expression "(undefined *)puVar4" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" identifier = identifier) ;) (expression_statement "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5;" (assignment_expression "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5" (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" * (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" ( (binary_expression "PTR_DAT_0017aa00 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;" (assignment_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1" (pointer_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" * (cast_expression "(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar2 + lVar3 * 8 + 0x10)" ( (binary_expression "puVar2 + lVar3 * 8 + 0x10" (binary_expression "puVar2 + lVar3 * 8" identifier + (binary_expression "lVar3 * 8" identifier * number_literal)) + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int xatexit(_func_void *fn)\n\n{\n  int iVar1;\n  xatexit *pxVar2;\n  long lVar3;\n  xatexit *pxVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;\n  }\n  pxVar2 = xatexit_head;\n  iVar1 = xatexit_head->ind;\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    pxVar4 = (xatexit *)malloc(0x110);\n    if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }\n    pxVar4->next = pxVar2;\n    iVar5 = 1;\n    pxVar4->ind = 0;\n    lVar3 = 0;\n    xatexit_head = pxVar4;\n  }\n  pxVar2 = xatexit_head;\n  xatexit_head->ind = iVar5;\n  pxVar2->fns[lVar3] = fn;\n  return 0;\n}\n\n" (function_definition "int xatexit(_func_void *fn)\n\n{\n  int iVar1;\n  xatexit *pxVar2;\n  long lVar3;\n  xatexit *pxVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;\n  }\n  pxVar2 = xatexit_head;\n  iVar1 = xatexit_head->ind;\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    pxVar4 = (xatexit *)malloc(0x110);\n    if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }\n    pxVar4->next = pxVar2;\n    iVar5 = 1;\n    pxVar4->ind = 0;\n    lVar3 = 0;\n    xatexit_head = pxVar4;\n  }\n  pxVar2 = xatexit_head;\n  xatexit_head->ind = iVar5;\n  pxVar2->fns[lVar3] = fn;\n  return 0;\n}" primitive_type (function_declarator "xatexit(_func_void *fn)" identifier (parameter_list "(_func_void *fn)" ( (parameter_declaration "_func_void *fn" type_identifier (pointer_declarator "*fn" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  xatexit *pxVar2;\n  long lVar3;\n  xatexit *pxVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;\n  }\n  pxVar2 = xatexit_head;\n  iVar1 = xatexit_head->ind;\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    pxVar4 = (xatexit *)malloc(0x110);\n    if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }\n    pxVar4->next = pxVar2;\n    iVar5 = 1;\n    pxVar4->ind = 0;\n    lVar3 = 0;\n    xatexit_head = pxVar4;\n  }\n  pxVar2 = xatexit_head;\n  xatexit_head->ind = iVar5;\n  pxVar2->fns[lVar3] = fn;\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "xatexit *pxVar2;" type_identifier (pointer_declarator "*pxVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "xatexit *pxVar4;" type_identifier (pointer_declarator "*pxVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;\n  }" if (parenthesized_expression "(*(long *)PTR__xexit_cleanup_00179fd8 == 0)" ( (binary_expression "*(long *)PTR__xexit_cleanup_00179fd8 == 0" (pointer_expression "*(long *)PTR__xexit_cleanup_00179fd8" * (cast_expression "(long *)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) == number_literal) )) (compound_statement "{\n    *(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;\n  }" { (expression_statement "*(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;" (assignment_expression "*(code **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup" (pointer_expression "*(code **)PTR__xexit_cleanup_00179fd8" * (cast_expression "(code **)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) })) (expression_statement "pxVar2 = xatexit_head;" (assignment_expression "pxVar2 = xatexit_head" identifier = identifier) ;) (expression_statement "iVar1 = xatexit_head->ind;" (assignment_expression "iVar1 = xatexit_head->ind" identifier = (field_expression "xatexit_head->ind" identifier -> field_identifier)) ;) (expression_statement "lVar3 = (long)iVar1;" (assignment_expression "lVar3 = (long)iVar1" identifier = (cast_expression "(long)iVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "iVar5 = iVar1 + 1;" (assignment_expression "iVar5 = iVar1 + 1" identifier = (binary_expression "iVar1 + 1" identifier + number_literal)) ;) (if_statement "if (0x1f < iVar1) {\n    pxVar4 = (xatexit *)malloc(0x110);\n    if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }\n    pxVar4->next = pxVar2;\n    iVar5 = 1;\n    pxVar4->ind = 0;\n    lVar3 = 0;\n    xatexit_head = pxVar4;\n  }" if (parenthesized_expression "(0x1f < iVar1)" ( (binary_expression "0x1f < iVar1" number_literal < identifier) )) (compound_statement "{\n    pxVar4 = (xatexit *)malloc(0x110);\n    if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }\n    pxVar4->next = pxVar2;\n    iVar5 = 1;\n    pxVar4->ind = 0;\n    lVar3 = 0;\n    xatexit_head = pxVar4;\n  }" { (expression_statement "pxVar4 = (xatexit *)malloc(0x110);" (assignment_expression "pxVar4 = (xatexit *)malloc(0x110)" identifier = (cast_expression "(xatexit *)malloc(0x110)" ( (type_descriptor "xatexit *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x110)" identifier (argument_list "(0x110)" ( number_literal ))))) ;) (if_statement "if (pxVar4 == (xatexit *)0x0) {\n      return -1;\n    }" if (parenthesized_expression "(pxVar4 == (xatexit *)0x0)" ( (binary_expression "pxVar4 == (xatexit *)0x0" identifier == (cast_expression "(xatexit *)0x0" ( (type_descriptor "xatexit *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "pxVar4->next = pxVar2;" (assignment_expression "pxVar4->next = pxVar2" (field_expression "pxVar4->next" identifier -> field_identifier) = identifier) ;) (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) (expression_statement "pxVar4->ind = 0;" (assignment_expression "pxVar4->ind = 0" (field_expression "pxVar4->ind" identifier -> field_identifier) = number_literal) ;) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "xatexit_head = pxVar4;" (assignment_expression "xatexit_head = pxVar4" identifier = identifier) ;) })) (expression_statement "pxVar2 = xatexit_head;" (assignment_expression "pxVar2 = xatexit_head" identifier = identifier) ;) (expression_statement "xatexit_head->ind = iVar5;" (assignment_expression "xatexit_head->ind = iVar5" (field_expression "xatexit_head->ind" identifier -> field_identifier) = identifier) ;) (expression_statement "pxVar2->fns[lVar3] = fn;" (assignment_expression "pxVar2->fns[lVar3] = fn" (subscript_expression "pxVar2->fns[lVar3]" (field_expression "pxVar2->fns" identifier -> field_identifier) [ identifier ]) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined8 FUN_0012fb20(undefined8 param_1)\n\n{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_0012fb20(undefined8 param_1)\n\n{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" type_identifier (function_declarator "FUN_0012fb20(undefined8 param_1)" identifier (parameter_list "(undefined8 param_1)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" if (parenthesized_expression "(*(long *)PTR__xexit_cleanup_00179fd8 == 0)" ( (binary_expression "*(long *)PTR__xexit_cleanup_00179fd8 == 0" (pointer_expression "*(long *)PTR__xexit_cleanup_00179fd8" * (cast_expression "(long *)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) == number_literal) )) (compound_statement "{\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" { (expression_statement "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;" (assignment_expression "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0" (pointer_expression "*(code **)PTR__xexit_cleanup_00179fd8" * (cast_expression "(code **)PTR__xexit_cleanup_00179fd8" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) })) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" identifier = identifier) ;) (expression_statement "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);" (assignment_expression "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8)" identifier = (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" * (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" ( (binary_expression "PTR_DAT_0017aa00 + 8" identifier + number_literal) ))))) ;) (expression_statement "lVar3 = (long)iVar1;" (assignment_expression "lVar3 = (long)iVar1" identifier = (cast_expression "(long)iVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "iVar5 = iVar1 + 1;" (assignment_expression "iVar5 = iVar1 + 1" identifier = (binary_expression "iVar1 + 1" identifier + number_literal)) ;) (if_statement "if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" if (parenthesized_expression "(0x1f < iVar1)" ( (binary_expression "0x1f < iVar1" number_literal < identifier) )) (compound_statement "{\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" { (expression_statement "puVar4 = (undefined8 *)malloc(0x110);" (assignment_expression "puVar4 = (undefined8 *)malloc(0x110)" identifier = (cast_expression "(undefined8 *)malloc(0x110)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(0x110)" identifier (argument_list "(0x110)" ( number_literal ))))) ;) (if_statement "if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(puVar4 == (undefined8 *)0x0)" ( (binary_expression "puVar4 == (undefined8 *)0x0" identifier == (cast_expression "(undefined8 *)0x0" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "*puVar4 = puVar2;" (assignment_expression "*puVar4 = puVar2" (pointer_expression "*puVar4" * identifier) = identifier) ;) (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) (expression_statement "*(undefined4 *)(puVar4 + 1) = 0;" (assignment_expression "*(undefined4 *)(puVar4 + 1) = 0" (pointer_expression "*(undefined4 *)(puVar4 + 1)" * (cast_expression "(undefined4 *)(puVar4 + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 1)" ( (binary_expression "puVar4 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "PTR_DAT_0017aa00 = (undefined *)puVar4;" (assignment_expression "PTR_DAT_0017aa00 = (undefined *)puVar4" identifier = (cast_expression "(undefined *)puVar4" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" identifier = identifier) ;) (expression_statement "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5;" (assignment_expression "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5" (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" * (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" ( (binary_expression "PTR_DAT_0017aa00 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;" (assignment_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1" (pointer_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" * (cast_expression "(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar2 + lVar3 * 8 + 0x10)" ( (binary_expression "puVar2 + lVar3 * 8 + 0x10" (binary_expression "puVar2 + lVar3 * 8" identifier + (binary_expression "lVar3 * 8" identifier * number_literal)) + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) IDENT)) == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT)) = IDENT) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (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 = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + (binary_expression IDENT * LIT)) + LIT) )))) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined8 FUN_0012fb20(undefined8 param_1)\n\n{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" (type_identifier "undefined8") (function_declarator "FUN_0012fb20(undefined8 param_1)" (identifier "FUN_0012fb20") (parameter_list "(undefined8 param_1)" (( "(") (parameter_declaration "undefined8 param_1" (type_identifier "undefined8") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined *puVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  int iVar5;\n  \n  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);\n  lVar3 = (long)iVar1;\n  iVar5 = iVar1 + 1;\n  if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }\n  puVar2 = PTR_DAT_0017aa00;\n  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;\n  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined *puVar2;" (type_identifier "undefined") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "undefined8 *puVar4;" (type_identifier "undefined8") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (if_statement "if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" (if "if") (parenthesized_expression "(*(long *)PTR__xexit_cleanup_00179fd8 == 0)" (( "(") (binary_expression "*(long *)PTR__xexit_cleanup_00179fd8 == 0" (pointer_expression "*(long *)PTR__xexit_cleanup_00179fd8" (* "*") (cast_expression "(long *)PTR__xexit_cleanup_00179fd8" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR__xexit_cleanup_00179fd8"))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;\n  }" ({ "{") (expression_statement "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;" (assignment_expression "*(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0" (pointer_expression "*(code **)PTR__xexit_cleanup_00179fd8" (* "*") (cast_expression "(code **)PTR__xexit_cleanup_00179fd8" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "PTR__xexit_cleanup_00179fd8"))) (= "=") (identifier "FUN_0012fad0")) (; ";")) (} "}"))) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" (identifier "puVar2") (= "=") (identifier "PTR_DAT_0017aa00")) (; ";")) (expression_statement "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);" (assignment_expression "iVar1 = *(int *)(PTR_DAT_0017aa00 + 8)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" (* "*") (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" (( "(") (binary_expression "PTR_DAT_0017aa00 + 8" (identifier "PTR_DAT_0017aa00") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "lVar3 = (long)iVar1;" (assignment_expression "lVar3 = (long)iVar1" (identifier "lVar3") (= "=") (cast_expression "(long)iVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "iVar1"))) (; ";")) (expression_statement "iVar5 = iVar1 + 1;" (assignment_expression "iVar5 = iVar1 + 1" (identifier "iVar5") (= "=") (binary_expression "iVar1 + 1" (identifier "iVar1") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (0x1f < iVar1) {\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" (if "if") (parenthesized_expression "(0x1f < iVar1)" (( "(") (binary_expression "0x1f < iVar1" (number_literal "0x1f") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n    puVar4 = (undefined8 *)malloc(0x110);\n    if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }\n    *puVar4 = puVar2;\n    iVar5 = 1;\n    *(undefined4 *)(puVar4 + 1) = 0;\n    lVar3 = 0;\n    PTR_DAT_0017aa00 = (undefined *)puVar4;\n  }" ({ "{") (expression_statement "puVar4 = (undefined8 *)malloc(0x110);" (assignment_expression "puVar4 = (undefined8 *)malloc(0x110)" (identifier "puVar4") (= "=") (cast_expression "(undefined8 *)malloc(0x110)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "malloc(0x110)" (identifier "malloc") (argument_list "(0x110)" (( "(") (number_literal "0x110") () ")"))))) (; ";")) (if_statement "if (puVar4 == (undefined8 *)0x0) {\n      return 0xffffffff;\n    }" (if "if") (parenthesized_expression "(puVar4 == (undefined8 *)0x0)" (( "(") (binary_expression "puVar4 == (undefined8 *)0x0" (identifier "puVar4") (== "==") (cast_expression "(undefined8 *)0x0" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return 0xffffffff;\n    }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (expression_statement "*puVar4 = puVar2;" (assignment_expression "*puVar4 = puVar2" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (identifier "puVar2")) (; ";")) (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" (identifier "iVar5") (= "=") (number_literal "1")) (; ";")) (expression_statement "*(undefined4 *)(puVar4 + 1) = 0;" (assignment_expression "*(undefined4 *)(puVar4 + 1) = 0" (pointer_expression "*(undefined4 *)(puVar4 + 1)" (* "*") (cast_expression "(undefined4 *)(puVar4 + 1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar4 + 1)" (( "(") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "PTR_DAT_0017aa00 = (undefined *)puVar4;" (assignment_expression "PTR_DAT_0017aa00 = (undefined *)puVar4" (identifier "PTR_DAT_0017aa00") (= "=") (cast_expression "(undefined *)puVar4" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) (; ";")) (} "}"))) (expression_statement "puVar2 = PTR_DAT_0017aa00;" (assignment_expression "puVar2 = PTR_DAT_0017aa00" (identifier "puVar2") (= "=") (identifier "PTR_DAT_0017aa00")) (; ";")) (expression_statement "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5;" (assignment_expression "*(int *)(PTR_DAT_0017aa00 + 8) = iVar5" (pointer_expression "*(int *)(PTR_DAT_0017aa00 + 8)" (* "*") (cast_expression "(int *)(PTR_DAT_0017aa00 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0017aa00 + 8)" (( "(") (binary_expression "PTR_DAT_0017aa00 + 8" (identifier "PTR_DAT_0017aa00") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "iVar5")) (; ";")) (expression_statement "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;" (assignment_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1" (pointer_expression "*(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" (* "*") (cast_expression "(undefined8 *)(puVar2 + lVar3 * 8 + 0x10)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar2 + lVar3 * 8 + 0x10)" (( "(") (binary_expression "puVar2 + lVar3 * 8 + 0x10" (binary_expression "puVar2 + lVar3 * 8" (identifier "puVar2") (+ "+") (binary_expression "lVar3 * 8" (identifier "lVar3") (* "*") (number_literal "8"))) (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "param_1")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

int function_1(type_1 *fn)

{
  int var_1;
  function_1 *pxVar2;
  long lVar3;
  function_1 *var_3;
  int iVar5;
  
  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {
    *(type_2 **)PTR__xexit_cleanup_00179fd8 = xatexit_cleanup;
  }
  pxVar2 = xatexit_head;
  var_1 = xatexit_head->ind;
  lVar3 = (long)var_1;
  iVar5 = var_1 + 1;
  if (0x1f < var_1) {
    var_3 = (function_1 *)var_2(0x110);
    if (var_3 == (function_1 *)0x0) {
      return -1;
    }
    var_3->next = pxVar2;
    iVar5 = 1;
    var_3->ind = 0;
    lVar3 = 0;
    xatexit_head = var_3;
  }
  pxVar2 = xatexit_head;
  xatexit_head->ind = iVar5;
  pxVar2->fns[lVar3] = fn;
  return 0;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (identifier))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (identifier))) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) 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))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_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: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_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))) (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: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))) right: (identifier))) (return_statement (number_literal)))))

undefined8 MASKED(undefined8 param_1)

{
  int iVar1;
  undefined *puVar2;
  long lVar3;
  undefined8 *puVar4;
  int iVar5;
  
  if (*(long *)PTR__xexit_cleanup_00179fd8 == 0) {
    *(code **)PTR__xexit_cleanup_00179fd8 = FUN_0012fad0;
  }
  puVar2 = PTR_DAT_0017aa00;
  iVar1 = *(int *)(PTR_DAT_0017aa00 + 8);
  lVar3 = (long)iVar1;
  iVar5 = iVar1 + 1;
  if (0x1f < iVar1) {
    puVar4 = (undefined8 *)malloc(0x110);
    if (puVar4 == (undefined8 *)0x0) {
      return 0xffffffff;
    }
    *puVar4 = puVar2;
    iVar5 = 1;
    *(undefined4 *)(puVar4 + 1) = 0;
    lVar3 = 0;
    PTR_DAT_0017aa00 = (undefined *)puVar4;
  }
  puVar2 = PTR_DAT_0017aa00;
  *(int *)(PTR_DAT_0017aa00 + 8) = iVar5;
  *(undefined8 *)(puVar2 + lVar3 * 8 + 0x10) = param_1;
  return 0;
}

