
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */

void disable_extended_io(void)

{
  int iVar1;
  int iVar2;
  termios *ptVar3;
  int in_GS_OFFSET;
  termios term;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  ptVar3 = &term;
  for (iVar2 = 0xf; iVar2 != 0; iVar2 = iVar2 + -1) {
    ptVar3->c_iflag = 0;
    ptVar3 = (termios *)((int)ptVar3 + 4);
  }
  tcgetattr(0,(termios *)&term);
  term.c_lflag = term.c_lflag & 0xffff7fff;
  term.c_oflag = term.c_oflag & 0xfffffffe;
  tcsetattr(0,0,(termios *)&term);
  if (iVar1 == *(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 FUN_0002d0f0(void)

{
  int iVar1;
  termios *ptVar2;
  int in_GS_OFFSET;
  termios local_4c;
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x2d0fc;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  ptVar2 = &local_4c;
  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {
    ptVar2->c_iflag = 0;
    ptVar2 = (termios *)((int)ptVar2 + 4);
  }
  tcgetattr(0,&local_4c);
  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;
  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;
  tcsetattr(0,0,&local_4c);
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0005a8b0();
}


PUSH EDI
MOV ECX,0xf
PUSH EBX
CALL 0x00015680
ADD EBX,0x4dad4
SUB ESP,0x44
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x3c],EAX
XOR EAX,EAX
MOV EDI,ESP
SUB ESP,0x8
STOSD.REP ES:EDI
LEA EDI,[ESP + 0x8]
PUSH EDI
PUSH 0x0
CALL 0x00013a00
AND dword ptr [ESP + 0x1c],0xffff7fff
AND dword ptr [ESP + 0x14],0xfffffffe
ADD ESP,0xc
PUSH EDI
PUSH 0x0
PUSH 0x0
CALL 0x000134f0
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x3c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x0002d154
ADD ESP,0x44
POP EBX
POP EDI
RET
CALL 0x0005a8b0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0002d0f0(void)\n\n{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005a8b0();\n}\n\n" comment (function_definition "void FUN_0002d0f0(void)\n\n{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005a8b0();\n}" primitive_type (function_declarator "FUN_0002d0f0(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005a8b0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "termios *ptVar2;" type_identifier (pointer_declarator "*ptVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "termios local_4c;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x2d0fc;" (assignment_expression "uStack_c = 0x2d0fc" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(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) ))))) ;) (expression_statement "ptVar2 = &local_4c;" (assignment_expression "ptVar2 = &local_4c" identifier = (pointer_expression "&local_4c" & identifier)) ;) (for_statement "for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" for ( (assignment_expression "iVar1 = 0xf" identifier = number_literal) ; (binary_expression "iVar1 != 0" identifier != number_literal) ; (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ) (compound_statement "{\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" { (expression_statement "ptVar2->c_iflag = 0;" (assignment_expression "ptVar2->c_iflag = 0" (field_expression "ptVar2->c_iflag" identifier -> field_identifier) = number_literal) ;) (expression_statement "ptVar2 = (termios *)((int)ptVar2 + 4);" (assignment_expression "ptVar2 = (termios *)((int)ptVar2 + 4)" identifier = (cast_expression "(termios *)((int)ptVar2 + 4)" ( (type_descriptor "termios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ptVar2 + 4)" ( (binary_expression "(int)ptVar2 + 4" (cast_expression "(int)ptVar2" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) })) (expression_statement "tcgetattr(0,&local_4c);" (call_expression "tcgetattr(0,&local_4c)" identifier (argument_list "(0,&local_4c)" ( number_literal , (pointer_expression "&local_4c" & identifier) ))) ;) (expression_statement "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;" (assignment_expression "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" identifier . field_identifier) = (binary_expression "local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;" (assignment_expression "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" identifier . field_identifier) = (binary_expression "local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "tcsetattr(0,0,&local_4c);" (call_expression "tcsetattr(0,0,&local_4c)" identifier (argument_list "(0,0,&local_4c)" ( number_literal , number_literal , (pointer_expression "&local_4c" & identifier) ))) ;) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(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_0005a8b0();" (call_expression "FUN_0005a8b0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention -- yet parameter storage is locked */\n\nvoid disable_extended_io(void)\n\n{\n  int iVar1;\n  int iVar2;\n  termios *ptVar3;\n  int in_GS_OFFSET;\n  termios term;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar3 = &term;\n  for (iVar2 = 0xf; iVar2 != 0; iVar2 = iVar2 + -1) {\n    ptVar3->c_iflag = 0;\n    ptVar3 = (termios *)((int)ptVar3 + 4);\n  }\n  tcgetattr(0,(termios *)&term);\n  term.c_lflag = term.c_lflag & 0xffff7fff;\n  term.c_oflag = term.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,(termios *)&term);\n  if (iVar1 == *(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 disable_extended_io(void)\n\n{\n  int iVar1;\n  int iVar2;\n  termios *ptVar3;\n  int in_GS_OFFSET;\n  termios term;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar3 = &term;\n  for (iVar2 = 0xf; iVar2 != 0; iVar2 = iVar2 + -1) {\n    ptVar3->c_iflag = 0;\n    ptVar3 = (termios *)((int)ptVar3 + 4);\n  }\n  tcgetattr(0,(termios *)&term);\n  term.c_lflag = term.c_lflag & 0xffff7fff;\n  term.c_oflag = term.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,(termios *)&term);\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "disable_extended_io(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  termios *ptVar3;\n  int in_GS_OFFSET;\n  termios term;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar3 = &term;\n  for (iVar2 = 0xf; iVar2 != 0; iVar2 = iVar2 + -1) {\n    ptVar3->c_iflag = 0;\n    ptVar3 = (termios *)((int)ptVar3 + 4);\n  }\n  tcgetattr(0,(termios *)&term);\n  term.c_lflag = term.c_lflag & 0xffff7fff;\n  term.c_oflag = term.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,(termios *)&term);\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "termios *ptVar3;" type_identifier (pointer_declarator "*ptVar3" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "termios term;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(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) ))))) ;) (expression_statement "ptVar3 = &term;" (assignment_expression "ptVar3 = &term" identifier = (pointer_expression "&term" & identifier)) ;) (for_statement "for (iVar2 = 0xf; iVar2 != 0; iVar2 = iVar2 + -1) {\n    ptVar3->c_iflag = 0;\n    ptVar3 = (termios *)((int)ptVar3 + 4);\n  }" for ( (assignment_expression "iVar2 = 0xf" identifier = number_literal) ; (binary_expression "iVar2 != 0" identifier != number_literal) ; (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ) (compound_statement "{\n    ptVar3->c_iflag = 0;\n    ptVar3 = (termios *)((int)ptVar3 + 4);\n  }" { (expression_statement "ptVar3->c_iflag = 0;" (assignment_expression "ptVar3->c_iflag = 0" (field_expression "ptVar3->c_iflag" identifier -> field_identifier) = number_literal) ;) (expression_statement "ptVar3 = (termios *)((int)ptVar3 + 4);" (assignment_expression "ptVar3 = (termios *)((int)ptVar3 + 4)" identifier = (cast_expression "(termios *)((int)ptVar3 + 4)" ( (type_descriptor "termios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ptVar3 + 4)" ( (binary_expression "(int)ptVar3 + 4" (cast_expression "(int)ptVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) })) (expression_statement "tcgetattr(0,(termios *)&term);" (call_expression "tcgetattr(0,(termios *)&term)" identifier (argument_list "(0,(termios *)&term)" ( number_literal , (cast_expression "(termios *)&term" ( (type_descriptor "termios *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&term" & identifier)) ))) ;) (expression_statement "term.c_lflag = term.c_lflag & 0xffff7fff;" (assignment_expression "term.c_lflag = term.c_lflag & 0xffff7fff" (field_expression "term.c_lflag" identifier . field_identifier) = (binary_expression "term.c_lflag & 0xffff7fff" (field_expression "term.c_lflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "term.c_oflag = term.c_oflag & 0xfffffffe;" (assignment_expression "term.c_oflag = term.c_oflag & 0xfffffffe" (field_expression "term.c_oflag" identifier . field_identifier) = (binary_expression "term.c_oflag & 0xfffffffe" (field_expression "term.c_oflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "tcsetattr(0,0,(termios *)&term);" (call_expression "tcsetattr(0,0,(termios *)&term)" identifier (argument_list "(0,0,(termios *)&term)" ( number_literal , number_literal , (cast_expression "(termios *)&term" ( (type_descriptor "termios *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&term" & identifier)) ))) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(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 FUN_0002d0f0(void)\n\n{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005a8b0();\n}\n\n" (function_definition "void FUN_0002d0f0(void)\n\n{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005a8b0();\n}" primitive_type (function_declarator "FUN_0002d0f0(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005a8b0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "termios *ptVar2;" type_identifier (pointer_declarator "*ptVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "termios local_4c;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x2d0fc;" (assignment_expression "uStack_c = 0x2d0fc" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(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) ))))) ;) (expression_statement "ptVar2 = &local_4c;" (assignment_expression "ptVar2 = &local_4c" identifier = (pointer_expression "&local_4c" & identifier)) ;) (for_statement "for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" for ( (assignment_expression "iVar1 = 0xf" identifier = number_literal) ; (binary_expression "iVar1 != 0" identifier != number_literal) ; (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ) (compound_statement "{\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" { (expression_statement "ptVar2->c_iflag = 0;" (assignment_expression "ptVar2->c_iflag = 0" (field_expression "ptVar2->c_iflag" identifier -> field_identifier) = number_literal) ;) (expression_statement "ptVar2 = (termios *)((int)ptVar2 + 4);" (assignment_expression "ptVar2 = (termios *)((int)ptVar2 + 4)" identifier = (cast_expression "(termios *)((int)ptVar2 + 4)" ( (type_descriptor "termios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ptVar2 + 4)" ( (binary_expression "(int)ptVar2 + 4" (cast_expression "(int)ptVar2" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) })) (expression_statement "tcgetattr(0,&local_4c);" (call_expression "tcgetattr(0,&local_4c)" identifier (argument_list "(0,&local_4c)" ( number_literal , (pointer_expression "&local_4c" & identifier) ))) ;) (expression_statement "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;" (assignment_expression "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" identifier . field_identifier) = (binary_expression "local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;" (assignment_expression "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" identifier . field_identifier) = (binary_expression "local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" identifier . field_identifier) & number_literal)) ;) (expression_statement "tcsetattr(0,0,&local_4c);" (call_expression "tcsetattr(0,0,&local_4c)" identifier (argument_list "(0,0,&local_4c)" ( number_literal , number_literal , (pointer_expression "&local_4c" & identifier) ))) ;) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(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_0005a8b0();" (call_expression "FUN_0005a8b0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE 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) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;) (for_statement for ( (assignment_expression IDENT = LIT) ; (binary_expression IDENT != LIT) ; (assignment_expression IDENT = (binary_expression IDENT + LIT)) ) (compound_statement { (expression_statement (assignment_expression (field_expression IDENT -> field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) })) (expression_statement (call_expression IDENT (argument_list ( LIT , (pointer_expression & IDENT) ))) ;) (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = (binary_expression (field_expression IDENT . field_identifier) & LIT)) ;) (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = (binary_expression (field_expression IDENT . field_identifier) & LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( LIT , LIT , (pointer_expression & IDENT) ))) ;) (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 FUN_0002d0f0(void)\n\n{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005a8b0();\n}" (primitive_type "void") (function_declarator "FUN_0002d0f0(void)" (identifier "FUN_0002d0f0") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  int iVar1;\n  termios *ptVar2;\n  int in_GS_OFFSET;\n  termios local_4c;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x2d0fc;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  ptVar2 = &local_4c;\n  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }\n  tcgetattr(0,&local_4c);\n  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;\n  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;\n  tcsetattr(0,0,&local_4c);\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005a8b0();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "termios *ptVar2;" (type_identifier "termios") (pointer_declarator "*ptVar2" (* "*") (identifier "ptVar2")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "termios local_4c;" (type_identifier "termios") (identifier "local_4c") (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (declaration "undefined4 uStack_c;" (type_identifier "undefined4") (identifier "uStack_c") (; ";")) (expression_statement "uStack_c = 0x2d0fc;" (assignment_expression "uStack_c = 0x2d0fc" (identifier "uStack_c") (= "=") (number_literal "0x2d0fc")) (; ";")) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (= "=") (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")) () ")"))))) (; ";")) (expression_statement "ptVar2 = &local_4c;" (assignment_expression "ptVar2 = &local_4c" (identifier "ptVar2") (= "=") (pointer_expression "&local_4c" (& "&") (identifier "local_4c"))) (; ";")) (for_statement "for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" (for "for") (( "(") (assignment_expression "iVar1 = 0xf" (identifier "iVar1") (= "=") (number_literal "0xf")) (; ";") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) (; ";") (assignment_expression "iVar1 = iVar1 + -1" (identifier "iVar1") (= "=") (binary_expression "iVar1 + -1" (identifier "iVar1") (+ "+") (number_literal "-1"))) () ")") (compound_statement "{\n    ptVar2->c_iflag = 0;\n    ptVar2 = (termios *)((int)ptVar2 + 4);\n  }" ({ "{") (expression_statement "ptVar2->c_iflag = 0;" (assignment_expression "ptVar2->c_iflag = 0" (field_expression "ptVar2->c_iflag" (identifier "ptVar2") (-> "->") (field_identifier "c_iflag")) (= "=") (number_literal "0")) (; ";")) (expression_statement "ptVar2 = (termios *)((int)ptVar2 + 4);" (assignment_expression "ptVar2 = (termios *)((int)ptVar2 + 4)" (identifier "ptVar2") (= "=") (cast_expression "(termios *)((int)ptVar2 + 4)" (( "(") (type_descriptor "termios *" (type_identifier "termios") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)ptVar2 + 4)" (( "(") (binary_expression "(int)ptVar2 + 4" (cast_expression "(int)ptVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "ptVar2")) (+ "+") (number_literal "4")) () ")")))) (; ";")) (} "}"))) (expression_statement "tcgetattr(0,&local_4c);" (call_expression "tcgetattr(0,&local_4c)" (identifier "tcgetattr") (argument_list "(0,&local_4c)" (( "(") (number_literal "0") (, ",") (pointer_expression "&local_4c" (& "&") (identifier "local_4c")) () ")"))) (; ";")) (expression_statement "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;" (assignment_expression "local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" (identifier "local_4c") (. ".") (field_identifier "c_lflag")) (= "=") (binary_expression "local_4c.c_lflag & 0xffff7fff" (field_expression "local_4c.c_lflag" (identifier "local_4c") (. ".") (field_identifier "c_lflag")) (& "&") (number_literal "0xffff7fff"))) (; ";")) (expression_statement "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;" (assignment_expression "local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" (identifier "local_4c") (. ".") (field_identifier "c_oflag")) (= "=") (binary_expression "local_4c.c_oflag & 0xfffffffe" (field_expression "local_4c.c_oflag" (identifier "local_4c") (. ".") (field_identifier "c_oflag")) (& "&") (number_literal "0xfffffffe"))) (; ";")) (expression_statement "tcsetattr(0,0,&local_4c);" (call_expression "tcsetattr(0,0,&local_4c)" (identifier "tcsetattr") (argument_list "(0,0,&local_4c)" (( "(") (number_literal "0") (, ",") (number_literal "0") (, ",") (pointer_expression "&local_4c" (& "&") (identifier "local_4c")) () ")"))) (; ";")) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (== "==") (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_0005a8b0();" (call_expression "FUN_0005a8b0()" (identifier "FUN_0005a8b0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */

void function_1(void)

{
  int var_5;
  int var_2;
  type_1 *ptVar3;
  int var_1;
  type_1 term;
  
  var_5 = *(int *)(var_1 + 0x14);
  ptVar3 = &term;
  for (var_2 = 0xf; var_2 != 0; var_2 = var_2 + -1) {
    ptVar3->c_iflag = 0;
    ptVar3 = (type_1 *)((int)ptVar3 + 4);
  }
  var_3(0,(type_1 *)&term);
  term.c_lflag = term.c_lflag & 0xffff7fff;
  term.c_oflag = term.c_oflag & 0xfffffffe;
  var_4(0,0,(type_1 *)&term);
  if (var_5 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_6();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) 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))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (for_statement initializer: (assignment_expression left: (identifier) right: (number_literal)) condition: (binary_expression left: (identifier) right: (number_literal)) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal) (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal)))) (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal) (number_literal) (pointer_expression argument: (identifier))))) (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 MASKED(void)

{
  int iVar1;
  termios *ptVar2;
  int in_GS_OFFSET;
  termios local_4c;
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x2d0fc;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  ptVar2 = &local_4c;
  for (iVar1 = 0xf; iVar1 != 0; iVar1 = iVar1 + -1) {
    ptVar2->c_iflag = 0;
    ptVar2 = (termios *)((int)ptVar2 + 4);
  }
  tcgetattr(0,&local_4c);
  local_4c.c_lflag = local_4c.c_lflag & 0xffff7fff;
  local_4c.c_oflag = local_4c.c_oflag & 0xfffffffe;
  tcsetattr(0,0,&local_4c);
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0005a8b0();
}

