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

void delete_callbacks_for_context(void *ctx)

{
  callback *pcVar1;
  callback *ptr;
  callback *pcVar2;
  callback *pcVar3;
  
  ptr = (callback *)0x0;
  pcVar2 = (callback *)0x0;
  while (pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0) {
    cbhead = ptr->next;
    if (ptr->ctx == ctx) {
      safefree(ptr);
      ptr = pcVar1;
      pcVar2 = pcVar3;
    }
    else {
      pcVar2 = ptr;
      if (pcVar3 != (callback *)0x0) {
        pcVar1->next = ptr;
        pcVar2 = pcVar3;
      }
    }
  }
  cbhead = pcVar3;
  cbtail = pcVar1;
  return;
}



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

void FUN_000157f0(int param_1)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  puVar2 = (undefined4 *)0x0;
  puVar3 = (undefined4 *)0x0;
  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {
    DAT_00085098 = (undefined4 *)*puVar2;
    if (puVar2[2] == param_1) {
      FUN_0001c820(puVar2);
      puVar2 = puVar1;
      puVar3 = puVar4;
    }
    else {
      puVar3 = puVar2;
      if (puVar4 != (undefined4 *)0x0) {
        *puVar1 = puVar2;
        puVar3 = puVar4;
      }
    }
  }
  DAT_00085098 = puVar4;
  DAT_00085094 = puVar1;
  return;
}


PUSH EBP
PUSH EDI
XOR EDI,EDI
PUSH ESI
XOR ESI,ESI
PUSH EBX
CALL 0x00015340
ADD EBX,0x6f4eb
SUB ESP,0xc
MOV EBP,dword ptr [ESP + 0x20]
MOV EAX,dword ptr [EBX + 0x3b0]
TEST EAX,EAX
JZ 0x0001582f
MOV EDX,dword ptr [EAX]
MOV dword ptr [EBX + 0x3b0],EDX
CMP dword ptr [EAX + 0x8],EBP
JZ 0x00015850
TEST EDI,EDI
JZ 0x00015848
MOV dword ptr [ESI],EAX
MOV ESI,EAX
MOV EAX,EDX
TEST EAX,EAX
JNZ 0x00015814
MOV dword ptr [EBX + 0x3b0],EDI
MOV dword ptr [EBX + 0x3ac],ESI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV ESI,EAX
MOV EDI,EAX
MOV EAX,EDX
JMP 0x00015810
SUB ESP,0xc
PUSH EAX
CALL 0x0001c820
MOV EAX,dword ptr [EBX + 0x3b0]
ADD ESP,0x10
JMP 0x00015810
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_000157f0(int param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}\n\n" comment (function_definition "void FUN_000157f0(int param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" primitive_type (function_declarator "FUN_000157f0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" while (parenthesized_expression "(puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0)" ( (comma_expression "puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar4 = puVar3" identifier = identifier) , (comma_expression "puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar1 = puVar2" identifier = identifier) , (comma_expression "puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar2 = DAT_00085098" identifier = identifier) , (binary_expression "puVar2 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))))) )) (compound_statement "{\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" { (expression_statement "DAT_00085098 = (undefined4 *)*puVar2;" (assignment_expression "DAT_00085098 = (undefined4 *)*puVar2" identifier = (cast_expression "(undefined4 *)*puVar2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar2" * identifier))) ;) (if_statement "if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" if (parenthesized_expression "(puVar2[2] == param_1)" ( (binary_expression "puVar2[2] == param_1" (subscript_expression "puVar2[2]" identifier [ number_literal ]) == identifier) )) (compound_statement "{\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }" { (expression_statement "FUN_0001c820(puVar2);" (call_expression "FUN_0001c820(puVar2)" identifier (argument_list "(puVar2)" ( identifier ))) ;) (expression_statement "puVar2 = puVar1;" (assignment_expression "puVar2 = puVar1" identifier = identifier) ;) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" identifier = identifier) ;) }) (else_clause "else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" else (compound_statement "{\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" { (expression_statement "puVar3 = puVar2;" (assignment_expression "puVar3 = puVar2" identifier = identifier) ;) (if_statement "if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" if (parenthesized_expression "(puVar4 != (undefined4 *)0x0)" ( (binary_expression "puVar4 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" { (expression_statement "*puVar1 = puVar2;" (assignment_expression "*puVar1 = puVar2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" identifier = identifier) ;) })) }))) })) (expression_statement "DAT_00085098 = puVar4;" (assignment_expression "DAT_00085098 = puVar4" identifier = identifier) ;) (expression_statement "DAT_00085094 = puVar1;" (assignment_expression "DAT_00085094 = puVar1" identifier = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid delete_callbacks_for_context(void *ctx)\n\n{\n  callback *pcVar1;\n  callback *ptr;\n  callback *pcVar2;\n  callback *pcVar3;\n  \n  ptr = (callback *)0x0;\n  pcVar2 = (callback *)0x0;\n  while (pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0) {\n    cbhead = ptr->next;\n    if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }\n  }\n  cbhead = pcVar3;\n  cbtail = pcVar1;\n  return;\n}\n\n" comment comment (function_definition "void delete_callbacks_for_context(void *ctx)\n\n{\n  callback *pcVar1;\n  callback *ptr;\n  callback *pcVar2;\n  callback *pcVar3;\n  \n  ptr = (callback *)0x0;\n  pcVar2 = (callback *)0x0;\n  while (pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0) {\n    cbhead = ptr->next;\n    if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }\n  }\n  cbhead = pcVar3;\n  cbtail = pcVar1;\n  return;\n}" primitive_type (function_declarator "delete_callbacks_for_context(void *ctx)" identifier (parameter_list "(void *ctx)" ( (parameter_declaration "void *ctx" primitive_type (pointer_declarator "*ctx" * identifier)) ))) (compound_statement "{\n  callback *pcVar1;\n  callback *ptr;\n  callback *pcVar2;\n  callback *pcVar3;\n  \n  ptr = (callback *)0x0;\n  pcVar2 = (callback *)0x0;\n  while (pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0) {\n    cbhead = ptr->next;\n    if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }\n  }\n  cbhead = pcVar3;\n  cbtail = pcVar1;\n  return;\n}" { (declaration "callback *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "callback *ptr;" type_identifier (pointer_declarator "*ptr" * identifier) ;) (declaration "callback *pcVar2;" type_identifier (pointer_declarator "*pcVar2" * identifier) ;) (declaration "callback *pcVar3;" type_identifier (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "ptr = (callback *)0x0;" (assignment_expression "ptr = (callback *)0x0" identifier = (cast_expression "(callback *)0x0" ( (type_descriptor "callback *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pcVar2 = (callback *)0x0;" (assignment_expression "pcVar2 = (callback *)0x0" identifier = (cast_expression "(callback *)0x0" ( (type_descriptor "callback *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while (pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0) {\n    cbhead = ptr->next;\n    if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }\n  }" while (parenthesized_expression "(pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0)" ( (comma_expression "pcVar3 = pcVar2, pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0" (assignment_expression "pcVar3 = pcVar2" identifier = identifier) , (comma_expression "pcVar1 = ptr, ptr = cbhead, ptr != (callback *)0x0" (assignment_expression "pcVar1 = ptr" identifier = identifier) , (comma_expression "ptr = cbhead, ptr != (callback *)0x0" (assignment_expression "ptr = cbhead" identifier = identifier) , (binary_expression "ptr != (callback *)0x0" identifier != (cast_expression "(callback *)0x0" ( (type_descriptor "callback *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))))) )) (compound_statement "{\n    cbhead = ptr->next;\n    if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }\n  }" { (expression_statement "cbhead = ptr->next;" (assignment_expression "cbhead = ptr->next" identifier = (field_expression "ptr->next" identifier -> field_identifier)) ;) (if_statement "if (ptr->ctx == ctx) {\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }\n    else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }" if (parenthesized_expression "(ptr->ctx == ctx)" ( (binary_expression "ptr->ctx == ctx" (field_expression "ptr->ctx" identifier -> field_identifier) == identifier) )) (compound_statement "{\n      safefree(ptr);\n      ptr = pcVar1;\n      pcVar2 = pcVar3;\n    }" { (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) (expression_statement "ptr = pcVar1;" (assignment_expression "ptr = pcVar1" identifier = identifier) ;) (expression_statement "pcVar2 = pcVar3;" (assignment_expression "pcVar2 = pcVar3" identifier = identifier) ;) }) (else_clause "else {\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }" else (compound_statement "{\n      pcVar2 = ptr;\n      if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }\n    }" { (expression_statement "pcVar2 = ptr;" (assignment_expression "pcVar2 = ptr" identifier = identifier) ;) (if_statement "if (pcVar3 != (callback *)0x0) {\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }" if (parenthesized_expression "(pcVar3 != (callback *)0x0)" ( (binary_expression "pcVar3 != (callback *)0x0" identifier != (cast_expression "(callback *)0x0" ( (type_descriptor "callback *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        pcVar1->next = ptr;\n        pcVar2 = pcVar3;\n      }" { (expression_statement "pcVar1->next = ptr;" (assignment_expression "pcVar1->next = ptr" (field_expression "pcVar1->next" identifier -> field_identifier) = identifier) ;) (expression_statement "pcVar2 = pcVar3;" (assignment_expression "pcVar2 = pcVar3" identifier = identifier) ;) })) }))) })) (expression_statement "cbhead = pcVar3;" (assignment_expression "cbhead = pcVar3" identifier = identifier) ;) (expression_statement "cbtail = pcVar1;" (assignment_expression "cbtail = pcVar1" identifier = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_000157f0(int param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}\n\n" (function_definition "void FUN_000157f0(int param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" primitive_type (function_declarator "FUN_000157f0(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (while_statement "while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" while (parenthesized_expression "(puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0)" ( (comma_expression "puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar4 = puVar3" identifier = identifier) , (comma_expression "puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar1 = puVar2" identifier = identifier) , (comma_expression "puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar2 = DAT_00085098" identifier = identifier) , (binary_expression "puVar2 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))))) )) (compound_statement "{\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" { (expression_statement "DAT_00085098 = (undefined4 *)*puVar2;" (assignment_expression "DAT_00085098 = (undefined4 *)*puVar2" identifier = (cast_expression "(undefined4 *)*puVar2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar2" * identifier))) ;) (if_statement "if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" if (parenthesized_expression "(puVar2[2] == param_1)" ( (binary_expression "puVar2[2] == param_1" (subscript_expression "puVar2[2]" identifier [ number_literal ]) == identifier) )) (compound_statement "{\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }" { (expression_statement "FUN_0001c820(puVar2);" (call_expression "FUN_0001c820(puVar2)" identifier (argument_list "(puVar2)" ( identifier ))) ;) (expression_statement "puVar2 = puVar1;" (assignment_expression "puVar2 = puVar1" identifier = identifier) ;) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" identifier = identifier) ;) }) (else_clause "else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" else (compound_statement "{\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" { (expression_statement "puVar3 = puVar2;" (assignment_expression "puVar3 = puVar2" identifier = identifier) ;) (if_statement "if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" if (parenthesized_expression "(puVar4 != (undefined4 *)0x0)" ( (binary_expression "puVar4 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" { (expression_statement "*puVar1 = puVar2;" (assignment_expression "*puVar1 = puVar2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" identifier = identifier) ;) })) }))) })) (expression_statement "DAT_00085098 = puVar4;" (assignment_expression "DAT_00085098 = puVar4" identifier = identifier) ;) (expression_statement "DAT_00085094 = puVar1;" (assignment_expression "DAT_00085094 = puVar1" identifier = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (comma_expression (assignment_expression IDENT = IDENT) , (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) }))) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (return_statement return ;) })))
(function_definition "void FUN_000157f0(int param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000157f0(int param_1)" (identifier "FUN_000157f0") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  undefined4 *puVar4;\n  \n  puVar2 = (undefined4 *)0x0;\n  puVar3 = (undefined4 *)0x0;\n  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }\n  DAT_00085098 = puVar4;\n  DAT_00085094 = puVar1;\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "undefined4 *puVar4;" (type_identifier "undefined4") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (expression_statement "puVar2 = (undefined4 *)0x0;" (assignment_expression "puVar2 = (undefined4 *)0x0" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (while_statement "while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" (while "while") (parenthesized_expression "(puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0)" (( "(") (comma_expression "puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar4 = puVar3" (identifier "puVar4") (= "=") (identifier "puVar3")) (, ",") (comma_expression "puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar1 = puVar2" (identifier "puVar1") (= "=") (identifier "puVar2")) (, ",") (comma_expression "puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0" (assignment_expression "puVar2 = DAT_00085098" (identifier "puVar2") (= "=") (identifier "DAT_00085098")) (, ",") (binary_expression "puVar2 != (undefined4 *)0x0" (identifier "puVar2") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))))) () ")")) (compound_statement "{\n    DAT_00085098 = (undefined4 *)*puVar2;\n    if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }\n  }" ({ "{") (expression_statement "DAT_00085098 = (undefined4 *)*puVar2;" (assignment_expression "DAT_00085098 = (undefined4 *)*puVar2" (identifier "DAT_00085098") (= "=") (cast_expression "(undefined4 *)*puVar2" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar2" (* "*") (identifier "puVar2")))) (; ";")) (if_statement "if (puVar2[2] == param_1) {\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }\n    else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" (if "if") (parenthesized_expression "(puVar2[2] == param_1)" (( "(") (binary_expression "puVar2[2] == param_1" (subscript_expression "puVar2[2]" (identifier "puVar2") ([ "[") (number_literal "2") (] "]")) (== "==") (identifier "param_1")) () ")")) (compound_statement "{\n      FUN_0001c820(puVar2);\n      puVar2 = puVar1;\n      puVar3 = puVar4;\n    }" ({ "{") (expression_statement "FUN_0001c820(puVar2);" (call_expression "FUN_0001c820(puVar2)" (identifier "FUN_0001c820") (argument_list "(puVar2)" (( "(") (identifier "puVar2") () ")"))) (; ";")) (expression_statement "puVar2 = puVar1;" (assignment_expression "puVar2 = puVar1" (identifier "puVar2") (= "=") (identifier "puVar1")) (; ";")) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" (identifier "puVar3") (= "=") (identifier "puVar4")) (; ";")) (} "}")) (else_clause "else {\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" (else "else") (compound_statement "{\n      puVar3 = puVar2;\n      if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }\n    }" ({ "{") (expression_statement "puVar3 = puVar2;" (assignment_expression "puVar3 = puVar2" (identifier "puVar3") (= "=") (identifier "puVar2")) (; ";")) (if_statement "if (puVar4 != (undefined4 *)0x0) {\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" (if "if") (parenthesized_expression "(puVar4 != (undefined4 *)0x0)" (( "(") (binary_expression "puVar4 != (undefined4 *)0x0" (identifier "puVar4") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        *puVar1 = puVar2;\n        puVar3 = puVar4;\n      }" ({ "{") (expression_statement "*puVar1 = puVar2;" (assignment_expression "*puVar1 = puVar2" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (identifier "puVar2")) (; ";")) (expression_statement "puVar3 = puVar4;" (assignment_expression "puVar3 = puVar4" (identifier "puVar3") (= "=") (identifier "puVar4")) (; ";")) (} "}"))) (} "}")))) (} "}"))) (expression_statement "DAT_00085098 = puVar4;" (assignment_expression "DAT_00085098 = puVar4" (identifier "DAT_00085098") (= "=") (identifier "puVar4")) (; ";")) (expression_statement "DAT_00085094 = puVar1;" (assignment_expression "DAT_00085094 = puVar1" (identifier "DAT_00085094") (= "=") (identifier "puVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(void *var_2)

{
  type_1 *pcVar1;
  type_1 *var_1;
  type_1 *pcVar2;
  type_1 *var_4;
  
  var_1 = (type_1 *)0x0;
  pcVar2 = (type_1 *)0x0;
  while (var_4 = pcVar2, pcVar1 = var_1, var_1 = cbhead, var_1 != (type_1 *)0x0) {
    cbhead = var_1->next;
    if (var_1->var_2 == var_2) {
      var_3(var_1);
      var_1 = pcVar1;
      pcVar2 = var_4;
    }
    else {
      pcVar2 = var_1;
      if (var_4 != (type_1 *)0x0) {
        pcVar1->next = var_1;
        pcVar2 = var_4;
      }
    }
  }
  cbhead = var_4;
  cbtail = pcVar1;
  return;
}


(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (identifier)) right: (comma_expression left: (assignment_expression left: (identifier) right: (identifier)) right: (comma_expression left: (assignment_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (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 (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (return_statement))))

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

void MASKED(int param_1)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  puVar2 = (undefined4 *)0x0;
  puVar3 = (undefined4 *)0x0;
  while (puVar4 = puVar3, puVar1 = puVar2, puVar2 = DAT_00085098, puVar2 != (undefined4 *)0x0) {
    DAT_00085098 = (undefined4 *)*puVar2;
    if (puVar2[2] == param_1) {
      FUN_0001c820(puVar2);
      puVar2 = puVar1;
      puVar3 = puVar4;
    }
    else {
      puVar3 = puVar2;
      if (puVar4 != (undefined4 *)0x0) {
        *puVar1 = puVar2;
        puVar3 = puVar4;
      }
    }
  }
  DAT_00085098 = puVar4;
  DAT_00085094 = puVar1;
  return;
}

