
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void __regparm3 term_print_finish(Terminal *term)

{
  bufchain *ch;
  int iVar1;
  int in_GS_OFFSET;
  char c;
  void *data;
  int len;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x4016b;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((term->printing != 0) || (term->only_printing != 0)) {
    ch = &term->printer_buf;
    while( true ) {
      iVar1 = bufchain_size(ch);
      if (iVar1 < 6) break;
      bufchain_prefix(ch,&data,&len);
      if (iVar1 + -4 <= len) {
        len = iVar1 + -5;
      }
      printer_job_data(term->print_job,data,len);
      bufchain_consume(ch,len);
    }
    while( true ) {
      iVar1 = bufchain_size(ch);
      if (iVar1 < 1) break;
      bufchain_prefix(ch,&data,&len);
                    /* WARNING: Load size is inaccurate */
      c = *data;
      if ((c & 0x7fU) == 0x1b) {
        bufchain_consume(ch,iVar1);
        break;
      }
      printer_job_data(term->print_job,&c,1);
      bufchain_consume(ch,1);
    }
    printer_finish_job(term->print_job);
    term->print_job = (printer_job *)0x0;
    term->only_printing = 0;
    term->printing = 0;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

void __regparm3 FUN_00040160(int param_1)

{
  int iVar1;
  int iVar2;
  int in_GS_OFFSET;
  byte local_29;
  byte *local_28;
  int local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x4016b;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {
    iVar1 = param_1 + 0xf8;
    while( true ) {
      iVar2 = FUN_000310e0(iVar1);
      if (iVar2 < 6) break;
      FUN_00031310(iVar1,&local_28,&local_24);
      if (iVar2 + -4 <= local_24) {
        local_24 = iVar2 + -5;
      }
      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);
      FUN_00031250(iVar1,local_24);
    }
    while( true ) {
      iVar2 = FUN_000310e0(iVar1);
      if (iVar2 < 1) break;
      FUN_00031310(iVar1,&local_28,&local_24);
      local_29 = *local_28;
      if ((local_29 & 0x7f) == 0x1b) {
        FUN_00031250(iVar1,iVar2);
        break;
      }
      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);
      FUN_00031250(iVar1,1);
    }
    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));
    *(undefined4 *)(param_1 + 0x104) = 0;
    *(undefined4 *)(param_1 + 0xf0) = 0;
    *(undefined4 *)(param_1 + 0xec) = 0;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00077880();
}


PUSH EBP
PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x0001b410
ADD EBX,0x85639
SUB ESP,0x2c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
MOV EAX,dword ptr [EDI + 0xec]
TEST EAX,EAX
JNZ 0x00040198
MOV EAX,dword ptr [EDI + 0xf0]
TEST EAX,EAX
JZ 0x000402aa
LEA EAX,[ESP + 0x18]
LEA ESI,[EDI + 0xf8]
MOV dword ptr [ESP + 0x8],EAX
LEA EAX,[ESP + 0x14]
MOV dword ptr [ESP + 0xc],EAX
JMP 0x000401f8
SUB ESP,0x4
PUSH dword ptr [ESP + 0xc]
PUSH dword ptr [ESP + 0x14]
PUSH ESI
CALL 0x00031310
MOV EDX,dword ptr [ESP + 0x28]
LEA ECX,[EBP + -0x4]
ADD ESP,0x10
CMP ECX,EDX
JG 0x000401d6
LEA EDX,[EBP + -0x5]
MOV dword ptr [ESP + 0x18],EDX
SUB ESP,0x4
PUSH EDX
PUSH dword ptr [ESP + 0x1c]
PUSH dword ptr [EDI + 0x104]
CALL 0x00072a40
POP ECX
POP EBP
PUSH dword ptr [ESP + 0x20]
PUSH ESI
CALL 0x00031250
ADD ESP,0x10
SUB ESP,0xc
PUSH ESI
CALL 0x000310e0
ADD ESP,0x10
MOV EBP,EAX
CMP EAX,0x5
JG 0x000401b0
LEA EAX,[ESP + 0x18]
MOV dword ptr [ESP + 0x8],EAX
LEA EAX,[ESP + 0x14]
MOV dword ptr [ESP + 0xc],EAX
JMP 0x00040269
SUB ESP,0x4
PUSH dword ptr [ESP + 0xc]
PUSH dword ptr [ESP + 0x14]
PUSH ESI
CALL 0x00031310
MOV EDX,dword ptr [ESP + 0x24]
MOVZX EDX,byte ptr [EDX]
MOV byte ptr [ESP + 0x23],DL
AND EDX,0x7f
ADD ESP,0x10
CMP DL,0x1b
JZ 0x000402c0
SUB ESP,0x4
PUSH 0x1
LEA EAX,[ESP + 0x1b]
PUSH EAX
PUSH dword ptr [EDI + 0x104]
CALL 0x00072a40
POP EAX
POP EDX
PUSH 0x1
PUSH ESI
CALL 0x00031250
ADD ESP,0x10
SUB ESP,0xc
PUSH ESI
CALL 0x000310e0
ADD ESP,0x10
MOV EBP,EAX
TEST EAX,EAX
JG 0x00040220
SUB ESP,0xc
PUSH dword ptr [EDI + 0x104]
CALL 0x00072a70
ADD ESP,0x10
MOV dword ptr [EDI + 0x104],0x0
MOV dword ptr [EDI + 0xf0],0x0
MOV dword ptr [EDI + 0xec],0x0
MOV EAX,dword ptr [ESP + 0x1c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x000402cf
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x8
PUSH EBP
PUSH ESI
CALL 0x00031250
ADD ESP,0x10
JMP 0x0004027b
CALL 0x00077880
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_00040160(int param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00077880();\n}\n\n" comment (function_definition "void __regparm3 FUN_00040160(int param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00077880();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00040160(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00077880();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "byte local_29;" type_identifier identifier ;) (declaration "byte *local_28;" type_identifier (pointer_declarator "*local_28" * identifier) ;) (declaration "int local_24;" primitive_type identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x4016b;" (assignment_expression "uStack_14 = 0x4016b" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" if (parenthesized_expression "((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0))" ( (binary_expression "(*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)" (parenthesized_expression "(*(int *)(param_1 + 0xec) != 0)" ( (binary_expression "*(int *)(param_1 + 0xec) != 0" (pointer_expression "*(int *)(param_1 + 0xec)" * (cast_expression "(int *)(param_1 + 0xec)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xec)" ( (binary_expression "param_1 + 0xec" identifier + number_literal) )))) != number_literal) )) || (parenthesized_expression "(*(int *)(param_1 + 0xf0) != 0)" ( (binary_expression "*(int *)(param_1 + 0xf0) != 0" (pointer_expression "*(int *)(param_1 + 0xf0)" * (cast_expression "(int *)(param_1 + 0xf0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) != number_literal) ))) )) (compound_statement "{\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" { (expression_statement "iVar1 = param_1 + 0xf8;" (assignment_expression "iVar1 = param_1 + 0xf8" identifier = (binary_expression "param_1 + 0xf8" identifier + number_literal)) ;) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" { (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" identifier = (call_expression "FUN_000310e0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar2 < 6) break;" if (parenthesized_expression "(iVar2 < 6)" ( (binary_expression "iVar2 < 6" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" identifier (argument_list "(iVar1,&local_28,&local_24)" ( identifier , (pointer_expression "&local_28" & identifier) , (pointer_expression "&local_24" & identifier) ))) ;) (if_statement "if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }" if (parenthesized_expression "(iVar2 + -4 <= local_24)" ( (binary_expression "iVar2 + -4 <= local_24" (binary_expression "iVar2 + -4" identifier + number_literal) <= identifier) )) (compound_statement "{\n        local_24 = iVar2 + -5;\n      }" { (expression_statement "local_24 = iVar2 + -5;" (assignment_expression "local_24 = iVar2 + -5" identifier = (binary_expression "iVar2 + -5" identifier + number_literal)) ;) })) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) , identifier , identifier ))) ;) (expression_statement "FUN_00031250(iVar1,local_24);" (call_expression "FUN_00031250(iVar1,local_24)" identifier (argument_list "(iVar1,local_24)" ( identifier , identifier ))) ;) })) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" { (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" identifier = (call_expression "FUN_000310e0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar2 < 1) break;" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" identifier (argument_list "(iVar1,&local_28,&local_24)" ( identifier , (pointer_expression "&local_28" & identifier) , (pointer_expression "&local_24" & identifier) ))) ;) (expression_statement "local_29 = *local_28;" (assignment_expression "local_29 = *local_28" identifier = (pointer_expression "*local_28" * identifier)) ;) (if_statement "if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" if (parenthesized_expression "((local_29 & 0x7f) == 0x1b)" ( (binary_expression "(local_29 & 0x7f) == 0x1b" (parenthesized_expression "(local_29 & 0x7f)" ( (binary_expression "local_29 & 0x7f" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" { (expression_statement "FUN_00031250(iVar1,iVar2);" (call_expression "FUN_00031250(iVar1,iVar2)" identifier (argument_list "(iVar1,iVar2)" ( identifier , identifier ))) ;) (break_statement "break;" break ;) })) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104),&local_29,1)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) , (pointer_expression "&local_29" & identifier) , number_literal ))) ;) (expression_statement "FUN_00031250(iVar1,1);" (call_expression "FUN_00031250(iVar1,1)" identifier (argument_list "(iVar1,1)" ( identifier , number_literal ))) ;) })) (expression_statement "FUN_00072a70(*(undefined4 *)(param_1 + 0x104));" (call_expression "FUN_00072a70(*(undefined4 *)(param_1 + 0x104))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x104) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x104) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xf0) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xf0) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xf0)" * (cast_expression "(undefined4 *)(param_1 + 0xf0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xec) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xec) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xec)" * (cast_expression "(undefined4 *)(param_1 + 0xec)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xec)" ( (binary_expression "param_1 + 0xec" identifier + number_literal) )))) = number_literal) ;) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "FUN_00077880();" (call_expression "FUN_00077880()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid __regparm3 term_print_finish(Terminal *term)\n\n{\n  bufchain *ch;\n  int iVar1;\n  int in_GS_OFFSET;\n  char c;\n  void *data;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((term->printing != 0) || (term->only_printing != 0)) {\n    ch = &term->printer_buf;\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }\n    printer_finish_job(term->print_job);\n    term->print_job = (printer_job *)0x0;\n    term->only_printing = 0;\n    term->printing = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "void __regparm3 term_print_finish(Terminal *term)\n\n{\n  bufchain *ch;\n  int iVar1;\n  int in_GS_OFFSET;\n  char c;\n  void *data;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((term->printing != 0) || (term->only_printing != 0)) {\n    ch = &term->printer_buf;\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }\n    printer_finish_job(term->print_job);\n    term->print_job = (printer_job *)0x0;\n    term->only_printing = 0;\n    term->printing = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "term_print_finish(Terminal *term)" identifier (parameter_list "(Terminal *term)" ( (parameter_declaration "Terminal *term" type_identifier (pointer_declarator "*term" * identifier)) ))) (compound_statement "{\n  bufchain *ch;\n  int iVar1;\n  int in_GS_OFFSET;\n  char c;\n  void *data;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((term->printing != 0) || (term->only_printing != 0)) {\n    ch = &term->printer_buf;\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }\n    printer_finish_job(term->print_job);\n    term->print_job = (printer_job *)0x0;\n    term->only_printing = 0;\n    term->printing = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "bufchain *ch;" type_identifier (pointer_declarator "*ch" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char c;" primitive_type identifier ;) (declaration "void *data;" primitive_type (pointer_declarator "*data" * identifier) ;) (declaration "int len;" primitive_type identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x4016b;" (assignment_expression "uStack_14 = 0x4016b" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((term->printing != 0) || (term->only_printing != 0)) {\n    ch = &term->printer_buf;\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }\n    printer_finish_job(term->print_job);\n    term->print_job = (printer_job *)0x0;\n    term->only_printing = 0;\n    term->printing = 0;\n  }" if (parenthesized_expression "((term->printing != 0) || (term->only_printing != 0))" ( (binary_expression "(term->printing != 0) || (term->only_printing != 0)" (parenthesized_expression "(term->printing != 0)" ( (binary_expression "term->printing != 0" (field_expression "term->printing" identifier -> field_identifier) != number_literal) )) || (parenthesized_expression "(term->only_printing != 0)" ( (binary_expression "term->only_printing != 0" (field_expression "term->only_printing" identifier -> field_identifier) != number_literal) ))) )) (compound_statement "{\n    ch = &term->printer_buf;\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }\n    while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }\n    printer_finish_job(term->print_job);\n    term->print_job = (printer_job *)0x0;\n    term->only_printing = 0;\n    term->printing = 0;\n  }" { (expression_statement "ch = &term->printer_buf;" (assignment_expression "ch = &term->printer_buf" identifier = (pointer_expression "&term->printer_buf" & (field_expression "term->printer_buf" identifier -> field_identifier))) ;) (while_statement "while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 6) break;\n      bufchain_prefix(ch,&data,&len);\n      if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }\n      printer_job_data(term->print_job,data,len);\n      bufchain_consume(ch,len);\n    }" { (expression_statement "iVar1 = bufchain_size(ch);" (assignment_expression "iVar1 = bufchain_size(ch)" identifier = (call_expression "bufchain_size(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (if_statement "if (iVar1 < 6) break;" if (parenthesized_expression "(iVar1 < 6)" ( (binary_expression "iVar1 < 6" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "bufchain_prefix(ch,&data,&len);" (call_expression "bufchain_prefix(ch,&data,&len)" identifier (argument_list "(ch,&data,&len)" ( identifier , (pointer_expression "&data" & identifier) , (pointer_expression "&len" & identifier) ))) ;) (if_statement "if (iVar1 + -4 <= len) {\n        len = iVar1 + -5;\n      }" if (parenthesized_expression "(iVar1 + -4 <= len)" ( (binary_expression "iVar1 + -4 <= len" (binary_expression "iVar1 + -4" identifier + number_literal) <= identifier) )) (compound_statement "{\n        len = iVar1 + -5;\n      }" { (expression_statement "len = iVar1 + -5;" (assignment_expression "len = iVar1 + -5" identifier = (binary_expression "iVar1 + -5" identifier + number_literal)) ;) })) (expression_statement "printer_job_data(term->print_job,data,len);" (call_expression "printer_job_data(term->print_job,data,len)" identifier (argument_list "(term->print_job,data,len)" ( (field_expression "term->print_job" identifier -> field_identifier) , identifier , identifier ))) ;) (expression_statement "bufchain_consume(ch,len);" (call_expression "bufchain_consume(ch,len)" identifier (argument_list "(ch,len)" ( identifier , identifier ))) ;) })) (while_statement "while( true ) {\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar1 = bufchain_size(ch);\n      if (iVar1 < 1) break;\n      bufchain_prefix(ch,&data,&len);\n                    /* WARNING: Load size is inaccurate */\n      c = *data;\n      if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }\n      printer_job_data(term->print_job,&c,1);\n      bufchain_consume(ch,1);\n    }" { (expression_statement "iVar1 = bufchain_size(ch);" (assignment_expression "iVar1 = bufchain_size(ch)" identifier = (call_expression "bufchain_size(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (if_statement "if (iVar1 < 1) break;" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "bufchain_prefix(ch,&data,&len);" (call_expression "bufchain_prefix(ch,&data,&len)" identifier (argument_list "(ch,&data,&len)" ( identifier , (pointer_expression "&data" & identifier) , (pointer_expression "&len" & identifier) ))) ;) comment (expression_statement "c = *data;" (assignment_expression "c = *data" identifier = (pointer_expression "*data" * identifier)) ;) (if_statement "if ((c & 0x7fU) == 0x1b) {\n        bufchain_consume(ch,iVar1);\n        break;\n      }" if (parenthesized_expression "((c & 0x7fU) == 0x1b)" ( (binary_expression "(c & 0x7fU) == 0x1b" (parenthesized_expression "(c & 0x7fU)" ( (binary_expression "c & 0x7fU" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        bufchain_consume(ch,iVar1);\n        break;\n      }" { (expression_statement "bufchain_consume(ch,iVar1);" (call_expression "bufchain_consume(ch,iVar1)" identifier (argument_list "(ch,iVar1)" ( identifier , identifier ))) ;) (break_statement "break;" break ;) })) (expression_statement "printer_job_data(term->print_job,&c,1);" (call_expression "printer_job_data(term->print_job,&c,1)" identifier (argument_list "(term->print_job,&c,1)" ( (field_expression "term->print_job" identifier -> field_identifier) , (pointer_expression "&c" & identifier) , number_literal ))) ;) (expression_statement "bufchain_consume(ch,1);" (call_expression "bufchain_consume(ch,1)" identifier (argument_list "(ch,1)" ( identifier , number_literal ))) ;) })) (expression_statement "printer_finish_job(term->print_job);" (call_expression "printer_finish_job(term->print_job)" identifier (argument_list "(term->print_job)" ( (field_expression "term->print_job" identifier -> field_identifier) ))) ;) (expression_statement "term->print_job = (printer_job *)0x0;" (assignment_expression "term->print_job = (printer_job *)0x0" (field_expression "term->print_job" identifier -> field_identifier) = (cast_expression "(printer_job *)0x0" ( (type_descriptor "printer_job *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "term->only_printing = 0;" (assignment_expression "term->only_printing = 0" (field_expression "term->only_printing" identifier -> field_identifier) = number_literal) ;) (expression_statement "term->printing = 0;" (assignment_expression "term->printing = 0" (field_expression "term->printing" identifier -> field_identifier) = number_literal) ;) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void __regparm3 FUN_00040160(int param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00077880();\n}\n\n" (function_definition "void __regparm3 FUN_00040160(int param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00077880();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00040160(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00077880();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "byte local_29;" type_identifier identifier ;) (declaration "byte *local_28;" type_identifier (pointer_declarator "*local_28" * identifier) ;) (declaration "int local_24;" primitive_type identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x4016b;" (assignment_expression "uStack_14 = 0x4016b" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" if (parenthesized_expression "((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0))" ( (binary_expression "(*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)" (parenthesized_expression "(*(int *)(param_1 + 0xec) != 0)" ( (binary_expression "*(int *)(param_1 + 0xec) != 0" (pointer_expression "*(int *)(param_1 + 0xec)" * (cast_expression "(int *)(param_1 + 0xec)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xec)" ( (binary_expression "param_1 + 0xec" identifier + number_literal) )))) != number_literal) )) || (parenthesized_expression "(*(int *)(param_1 + 0xf0) != 0)" ( (binary_expression "*(int *)(param_1 + 0xf0) != 0" (pointer_expression "*(int *)(param_1 + 0xf0)" * (cast_expression "(int *)(param_1 + 0xf0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) != number_literal) ))) )) (compound_statement "{\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" { (expression_statement "iVar1 = param_1 + 0xf8;" (assignment_expression "iVar1 = param_1 + 0xf8" identifier = (binary_expression "param_1 + 0xf8" identifier + number_literal)) ;) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" { (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" identifier = (call_expression "FUN_000310e0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar2 < 6) break;" if (parenthesized_expression "(iVar2 < 6)" ( (binary_expression "iVar2 < 6" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" identifier (argument_list "(iVar1,&local_28,&local_24)" ( identifier , (pointer_expression "&local_28" & identifier) , (pointer_expression "&local_24" & identifier) ))) ;) (if_statement "if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }" if (parenthesized_expression "(iVar2 + -4 <= local_24)" ( (binary_expression "iVar2 + -4 <= local_24" (binary_expression "iVar2 + -4" identifier + number_literal) <= identifier) )) (compound_statement "{\n        local_24 = iVar2 + -5;\n      }" { (expression_statement "local_24 = iVar2 + -5;" (assignment_expression "local_24 = iVar2 + -5" identifier = (binary_expression "iVar2 + -5" identifier + number_literal)) ;) })) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) , identifier , identifier ))) ;) (expression_statement "FUN_00031250(iVar1,local_24);" (call_expression "FUN_00031250(iVar1,local_24)" identifier (argument_list "(iVar1,local_24)" ( identifier , identifier ))) ;) })) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" { (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" identifier = (call_expression "FUN_000310e0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (iVar2 < 1) break;" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" identifier (argument_list "(iVar1,&local_28,&local_24)" ( identifier , (pointer_expression "&local_28" & identifier) , (pointer_expression "&local_24" & identifier) ))) ;) (expression_statement "local_29 = *local_28;" (assignment_expression "local_29 = *local_28" identifier = (pointer_expression "*local_28" * identifier)) ;) (if_statement "if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" if (parenthesized_expression "((local_29 & 0x7f) == 0x1b)" ( (binary_expression "(local_29 & 0x7f) == 0x1b" (parenthesized_expression "(local_29 & 0x7f)" ( (binary_expression "local_29 & 0x7f" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" { (expression_statement "FUN_00031250(iVar1,iVar2);" (call_expression "FUN_00031250(iVar1,iVar2)" identifier (argument_list "(iVar1,iVar2)" ( identifier , identifier ))) ;) (break_statement "break;" break ;) })) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104),&local_29,1)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) , (pointer_expression "&local_29" & identifier) , number_literal ))) ;) (expression_statement "FUN_00031250(iVar1,1);" (call_expression "FUN_00031250(iVar1,1)" identifier (argument_list "(iVar1,1)" ( identifier , number_literal ))) ;) })) (expression_statement "FUN_00072a70(*(undefined4 *)(param_1 + 0x104));" (call_expression "FUN_00072a70(*(undefined4 *)(param_1 + 0x104))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x104))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x104) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x104) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x104)" * (cast_expression "(undefined4 *)(param_1 + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x104)" ( (binary_expression "param_1 + 0x104" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xf0) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xf0) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xf0)" * (cast_expression "(undefined4 *)(param_1 + 0xf0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xec) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xec) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xec)" * (cast_expression "(undefined4 *)(param_1 + 0xec)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xec)" ( (binary_expression "param_1 + 0xec" identifier + number_literal) )))) = number_literal) ;) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "FUN_00077880();" (call_expression "FUN_00077880()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) || (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , (pointer_expression & IDENT) ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) })) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , (pointer_expression & IDENT) ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (break_statement break ;) })) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression & IDENT) , LIT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (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) )))) = 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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void __regparm3 FUN_00040160(int param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00077880();\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00040160(int param_1)" (identifier "FUN_00040160") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  byte local_29;\n  byte *local_28;\n  int local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x4016b;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00077880();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "byte local_29;" (type_identifier "byte") (identifier "local_29") (; ";")) (declaration "byte *local_28;" (type_identifier "byte") (pointer_declarator "*local_28" (* "*") (identifier "local_28")) (; ";")) (declaration "int local_24;" (primitive_type "int") (identifier "local_24") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x4016b;" (assignment_expression "uStack_14 = 0x4016b" (identifier "uStack_14") (= "=") (number_literal "0x4016b")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" (if "if") (parenthesized_expression "((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0))" (( "(") (binary_expression "(*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)" (parenthesized_expression "(*(int *)(param_1 + 0xec) != 0)" (( "(") (binary_expression "*(int *)(param_1 + 0xec) != 0" (pointer_expression "*(int *)(param_1 + 0xec)" (* "*") (cast_expression "(int *)(param_1 + 0xec)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xec)" (( "(") (binary_expression "param_1 + 0xec" (identifier "param_1") (+ "+") (number_literal "0xec")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(*(int *)(param_1 + 0xf0) != 0)" (( "(") (binary_expression "*(int *)(param_1 + 0xf0) != 0" (pointer_expression "*(int *)(param_1 + 0xf0)" (* "*") (cast_expression "(int *)(param_1 + 0xf0)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf0)" (( "(") (binary_expression "param_1 + 0xf0" (identifier "param_1") (+ "+") (number_literal "0xf0")) () ")")))) (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    iVar1 = param_1 + 0xf8;\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }\n    while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }\n    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));\n    *(undefined4 *)(param_1 + 0x104) = 0;\n    *(undefined4 *)(param_1 + 0xf0) = 0;\n    *(undefined4 *)(param_1 + 0xec) = 0;\n  }" ({ "{") (expression_statement "iVar1 = param_1 + 0xf8;" (assignment_expression "iVar1 = param_1 + 0xf8" (identifier "iVar1") (= "=") (binary_expression "param_1 + 0xf8" (identifier "param_1") (+ "+") (number_literal "0xf8"))) (; ";")) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 6) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);\n      FUN_00031250(iVar1,local_24);\n    }" ({ "{") (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" (identifier "iVar2") (= "=") (call_expression "FUN_000310e0(iVar1)" (identifier "FUN_000310e0") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (if_statement "if (iVar2 < 6) break;" (if "if") (parenthesized_expression "(iVar2 < 6)" (( "(") (binary_expression "iVar2 < 6" (identifier "iVar2") (< "<") (number_literal "6")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" (identifier "FUN_00031310") (argument_list "(iVar1,&local_28,&local_24)" (( "(") (identifier "iVar1") (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) (, ",") (pointer_expression "&local_24" (& "&") (identifier "local_24")) () ")"))) (; ";")) (if_statement "if (iVar2 + -4 <= local_24) {\n        local_24 = iVar2 + -5;\n      }" (if "if") (parenthesized_expression "(iVar2 + -4 <= local_24)" (( "(") (binary_expression "iVar2 + -4 <= local_24" (binary_expression "iVar2 + -4" (identifier "iVar2") (+ "+") (number_literal "-4")) (<= "<=") (identifier "local_24")) () ")")) (compound_statement "{\n        local_24 = iVar2 + -5;\n      }" ({ "{") (expression_statement "local_24 = iVar2 + -5;" (assignment_expression "local_24 = iVar2 + -5" (identifier "local_24") (= "=") (binary_expression "iVar2 + -5" (identifier "iVar2") (+ "+") (number_literal "-5"))) (; ";")) (} "}"))) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" (identifier "FUN_00072a40") (argument_list "(*(undefined4 *)(param_1 + 0x104),local_28,local_24)" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x104)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x104)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x104)" (( "(") (binary_expression "param_1 + 0x104" (identifier "param_1") (+ "+") (number_literal "0x104")) () ")")))) (, ",") (identifier "local_28") (, ",") (identifier "local_24") () ")"))) (; ";")) (expression_statement "FUN_00031250(iVar1,local_24);" (call_expression "FUN_00031250(iVar1,local_24)" (identifier "FUN_00031250") (argument_list "(iVar1,local_24)" (( "(") (identifier "iVar1") (, ",") (identifier "local_24") () ")"))) (; ";")) (} "}"))) (while_statement "while( true ) {\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      iVar2 = FUN_000310e0(iVar1);\n      if (iVar2 < 1) break;\n      FUN_00031310(iVar1,&local_28,&local_24);\n      local_29 = *local_28;\n      if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }\n      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);\n      FUN_00031250(iVar1,1);\n    }" ({ "{") (expression_statement "iVar2 = FUN_000310e0(iVar1);" (assignment_expression "iVar2 = FUN_000310e0(iVar1)" (identifier "iVar2") (= "=") (call_expression "FUN_000310e0(iVar1)" (identifier "FUN_000310e0") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (if_statement "if (iVar2 < 1) break;" (if "if") (parenthesized_expression "(iVar2 < 1)" (( "(") (binary_expression "iVar2 < 1" (identifier "iVar2") (< "<") (number_literal "1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "FUN_00031310(iVar1,&local_28,&local_24);" (call_expression "FUN_00031310(iVar1,&local_28,&local_24)" (identifier "FUN_00031310") (argument_list "(iVar1,&local_28,&local_24)" (( "(") (identifier "iVar1") (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) (, ",") (pointer_expression "&local_24" (& "&") (identifier "local_24")) () ")"))) (; ";")) (expression_statement "local_29 = *local_28;" (assignment_expression "local_29 = *local_28" (identifier "local_29") (= "=") (pointer_expression "*local_28" (* "*") (identifier "local_28"))) (; ";")) (if_statement "if ((local_29 & 0x7f) == 0x1b) {\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" (if "if") (parenthesized_expression "((local_29 & 0x7f) == 0x1b)" (( "(") (binary_expression "(local_29 & 0x7f) == 0x1b" (parenthesized_expression "(local_29 & 0x7f)" (( "(") (binary_expression "local_29 & 0x7f" (identifier "local_29") (& "&") (number_literal "0x7f")) () ")")) (== "==") (number_literal "0x1b")) () ")")) (compound_statement "{\n        FUN_00031250(iVar1,iVar2);\n        break;\n      }" ({ "{") (expression_statement "FUN_00031250(iVar1,iVar2);" (call_expression "FUN_00031250(iVar1,iVar2)" (identifier "FUN_00031250") (argument_list "(iVar1,iVar2)" (( "(") (identifier "iVar1") (, ",") (identifier "iVar2") () ")"))) (; ";")) (break_statement "break;" (break "break") (; ";")) (} "}"))) (expression_statement "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);" (call_expression "FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1)" (identifier "FUN_00072a40") (argument_list "(*(undefined4 *)(param_1 + 0x104),&local_29,1)" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x104)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x104)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x104)" (( "(") (binary_expression "param_1 + 0x104" (identifier "param_1") (+ "+") (number_literal "0x104")) () ")")))) (, ",") (pointer_expression "&local_29" (& "&") (identifier "local_29")) (, ",") (number_literal "1") () ")"))) (; ";")) (expression_statement "FUN_00031250(iVar1,1);" (call_expression "FUN_00031250(iVar1,1)" (identifier "FUN_00031250") (argument_list "(iVar1,1)" (( "(") (identifier "iVar1") (, ",") (number_literal "1") () ")"))) (; ";")) (} "}"))) (expression_statement "FUN_00072a70(*(undefined4 *)(param_1 + 0x104));" (call_expression "FUN_00072a70(*(undefined4 *)(param_1 + 0x104))" (identifier "FUN_00072a70") (argument_list "(*(undefined4 *)(param_1 + 0x104))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x104)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x104)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x104)" (( "(") (binary_expression "param_1 + 0x104" (identifier "param_1") (+ "+") (number_literal "0x104")) () ")")))) () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x104) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x104) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x104)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x104)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x104)" (( "(") (binary_expression "param_1 + 0x104" (identifier "param_1") (+ "+") (number_literal "0x104")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xf0) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xf0) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xf0)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xf0)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf0)" (( "(") (binary_expression "param_1 + 0xf0" (identifier "param_1") (+ "+") (number_literal "0xf0")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xec) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xec) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xec)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xec)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xec)" (( "(") (binary_expression "param_1 + 0xec" (identifier "param_1") (+ "+") (number_literal "0xec")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_00077880();" (call_expression "FUN_00077880()" (identifier "FUN_00077880") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void __regparm3 function_1(type_1 *term)

{
  type_2 *ch;
  int var_3;
  int var_1;
  char var_8;
  void *data;
  int var_5;
  int var_10;
  type_3 uStack_14;
  
  uStack_14 = 0x4016b;
  var_10 = *(int *)(var_1 + 0x14);
  if ((term->printing != 0) || (term->only_printing != 0)) {
    ch = &term->printer_buf;
    while( true ) {
      var_3 = var_2(ch);
      if (var_3 < 6) break;
      var_4(ch,&data,&var_5);
      if (var_3 + -4 <= var_5) {
        var_5 = var_3 + -5;
      }
      var_6(term->print_job,data,var_5);
      var_7(ch,var_5);
    }
    while( true ) {
      var_3 = var_2(ch);
      if (var_3 < 1) break;
      var_4(ch,&data,&var_5);
                    /* WARNING: Load size is inaccurate */
      var_8 = *data;
      if ((var_8 & 0x7fU) == 0x1b) {
        var_7(ch,var_3);
        break;
      }
      var_6(term->print_job,&var_8,1);
      var_7(ch,1);
    }
    var_9(term->print_job);
    term->print_job = (type_4 *)0x0;
    term->only_printing = 0;
    term->printing = 0;
  }
  if (var_10 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_11();
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) 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: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (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))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (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))) right: (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 (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (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))))) (identifier) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (break_statement))) (expression_statement (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))))) (pointer_expression argument: (identifier)) (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))))) (expression_statement (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)))))))) (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: (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: (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))))) (if_statement condition: (parenthesized_expression (binary_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))))))) consequence: (compound_statement (return_statement))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

void __regparm3 MASKED(int param_1)

{
  int iVar1;
  int iVar2;
  int in_GS_OFFSET;
  byte local_29;
  byte *local_28;
  int local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x4016b;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((*(int *)(param_1 + 0xec) != 0) || (*(int *)(param_1 + 0xf0) != 0)) {
    iVar1 = param_1 + 0xf8;
    while( true ) {
      iVar2 = FUN_000310e0(iVar1);
      if (iVar2 < 6) break;
      FUN_00031310(iVar1,&local_28,&local_24);
      if (iVar2 + -4 <= local_24) {
        local_24 = iVar2 + -5;
      }
      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),local_28,local_24);
      FUN_00031250(iVar1,local_24);
    }
    while( true ) {
      iVar2 = FUN_000310e0(iVar1);
      if (iVar2 < 1) break;
      FUN_00031310(iVar1,&local_28,&local_24);
      local_29 = *local_28;
      if ((local_29 & 0x7f) == 0x1b) {
        FUN_00031250(iVar1,iVar2);
        break;
      }
      FUN_00072a40(*(undefined4 *)(param_1 + 0x104),&local_29,1);
      FUN_00031250(iVar1,1);
    }
    FUN_00072a70(*(undefined4 *)(param_1 + 0x104));
    *(undefined4 *)(param_1 + 0x104) = 0;
    *(undefined4 *)(param_1 + 0xf0) = 0;
    *(undefined4 *)(param_1 + 0xec) = 0;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00077880();
}

