
void set_winsize(int tty)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  undefined4 uVar5;
  undefined *puVar6;
  winsize w;
  
  puVar6 = PTR___stack_chk_guard_001464dc;
  uVar5 = 0x40087468;
  iVar1 = *(int *)PTR___stack_chk_guard_001464dc;
  iVar4 = tty;
  iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w);
  if (iVar2 == 0) {
    uVar5 = 0x80087467;
    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);
    iVar4 = tty;
  }
  if (iVar1 == *(int *)puVar6) {
    return;
  }
  puVar6 = PTR___stack_chk_fail_00146488;
  (*(code *)PTR___stack_chk_fail_00146488)();
  while( true ) {
    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);
    if (-1 < iVar1) {
      return;
    }
    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();
    if (*piVar3 != 4) break;
    *piVar3 = 0;
  }
  return;
}



int FUN_000e94b0(undefined4 param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined *puVar5;
  undefined1 auStack_1c [8];
  int local_14;
  
  puVar5 = PTR___stack_chk_guard_001464dc;
  uVar4 = 0x40087468;
  local_14 = *(int *)PTR___stack_chk_guard_001464dc;
  uVar3 = param_1;
  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);
  if (iVar1 == 0) {
    uVar4 = 0x80087467;
    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);
    uVar3 = param_1;
  }
  if (local_14 == *(int *)puVar5) {
    return *(int *)puVar5;
  }
  puVar5 = PTR___stack_chk_fail_00146488;
  (*(code *)PTR___stack_chk_fail_00146488)();
  while( true ) {
    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);
    if (-1 < iVar1) {
      return 0;
    }
    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();
    if (*piVar2 != 4) break;
    *piVar2 = 0;
  }
  return -1;
}


lui gp,0x6
addiu gp,gp,0x3090
addu gp,gp,t9
addiu sp,sp,-0x38
lw t9,-0x6104(gp)
lui a1,0x4008
sw s0,0x28(sp)
addiu a1,a1,0x7468
lw s0,-0x6064(gp)
sw s1,0x2c(sp)
addiu s1,sp,0x1c
sw gp,0x10(sp)
sw s2,0x30(sp)
or a2,s1,zero
sw ra,0x34(sp)
or s2,a0,zero
lw v0,0x0(s0)
sw v0,0x24(sp)
jalr t9
_nop
beq v0,zero,0x000e952c
_lw gp,0x10(sp)
lw v1,0x24(sp)
lw v0,0x0(s0)
bne v1,v0,0x000e954c
_lw ra,0x34(sp)
lw s2,0x30(sp)
lw s1,0x2c(sp)
lw s0,0x28(sp)
jr ra
_addiu sp,sp,0x38
lui a1,0x8008
lw t9,-0x6104(gp)
or a2,s1,zero
addiu a1,a1,0x7467
jalr t9
_or a0,s2,zero
b 0x000e9508
_lw gp,0x10(sp)
lw t9,-0x60b8(gp)
jalr t9
_nop
(translation_unit "int FUN_000e94b0(undefined4 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}\n\n" (function_definition "int FUN_000e94b0(undefined4 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" primitive_type (function_declarator "FUN_000e94b0(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "undefined *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "undefined1 auStack_1c [8];" type_identifier (array_declarator "auStack_1c [8]" identifier [ number_literal ]) ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "puVar5 = PTR___stack_chk_guard_001464dc;" (assignment_expression "puVar5 = PTR___stack_chk_guard_001464dc" identifier = identifier) ;) (expression_statement "uVar4 = 0x40087468;" (assignment_expression "uVar4 = 0x40087468" identifier = number_literal) ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_001464dc;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_001464dc" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_001464dc" * (cast_expression "(int *)PTR___stack_chk_guard_001464dc" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" identifier = identifier) ;) (expression_statement "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);" (assignment_expression "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" identifier = (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x40087468,auStack_1c)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" { (expression_statement "uVar4 = 0x80087467;" (assignment_expression "uVar4 = 0x80087467" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);" (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x80087467,auStack_1c)" ( identifier , number_literal , identifier ))) ;) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" identifier = identifier) ;) })) (if_statement "if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }" if (parenthesized_expression "(local_14 == *(int *)puVar5)" ( (binary_expression "local_14 == *(int *)puVar5" identifier == (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return *(int *)puVar5;\n  }" { (return_statement "return *(int *)puVar5;" return (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "puVar5 = PTR___stack_chk_fail_00146488;" (assignment_expression "puVar5 = PTR___stack_chk_fail_00146488" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_00146488)();" (call_expression "(*(code *)PTR___stack_chk_fail_00146488)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_00146488)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_00146488" * (cast_expression "(code *)PTR___stack_chk_fail_00146488" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (while_statement "while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" { (expression_statement "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);" (assignment_expression "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" identifier = (call_expression "(**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" (parenthesized_expression "(**(code **)(puVar5 + 0x5ceac))" ( (pointer_expression "**(code **)(puVar5 + 0x5ceac)" * (pointer_expression "*(code **)(puVar5 + 0x5ceac)" * (cast_expression "(code **)(puVar5 + 0x5ceac)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x5ceac)" ( (binary_expression "puVar5 + 0x5ceac" identifier + number_literal) ))))) )) (argument_list "(uVar3,0x540f,uVar4)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return 0;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();" (assignment_expression "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))()" identifier = (cast_expression "(int *)(**(code **)(puVar5 + 0x5cde4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar5 + 0x5cde4))()" (parenthesized_expression "(**(code **)(puVar5 + 0x5cde4))" ( (pointer_expression "**(code **)(puVar5 + 0x5cde4)" * (pointer_expression "*(code **)(puVar5 + 0x5cde4)" * (cast_expression "(code **)(puVar5 + 0x5cde4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x5cde4)" ( (binary_expression "puVar5 + 0x5cde4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar2 != 4) break;" if (parenthesized_expression "(*piVar2 != 4)" ( (binary_expression "*piVar2 != 4" (pointer_expression "*piVar2" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) })) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "void set_winsize(int tty)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined *puVar6;\n  winsize w;\n  \n  puVar6 = PTR___stack_chk_guard_001464dc;\n  uVar5 = 0x40087468;\n  iVar1 = *(int *)PTR___stack_chk_guard_001464dc;\n  iVar4 = tty;\n  iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w);\n  if (iVar2 == 0) {\n    uVar5 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);\n    iVar4 = tty;\n  }\n  if (iVar1 == *(int *)puVar6) {\n    return;\n  }\n  puVar6 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);\n    if (-1 < iVar1) {\n      return;\n    }\n    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();\n    if (*piVar3 != 4) break;\n    *piVar3 = 0;\n  }\n  return;\n}\n\n" (function_definition "void set_winsize(int tty)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined *puVar6;\n  winsize w;\n  \n  puVar6 = PTR___stack_chk_guard_001464dc;\n  uVar5 = 0x40087468;\n  iVar1 = *(int *)PTR___stack_chk_guard_001464dc;\n  iVar4 = tty;\n  iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w);\n  if (iVar2 == 0) {\n    uVar5 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);\n    iVar4 = tty;\n  }\n  if (iVar1 == *(int *)puVar6) {\n    return;\n  }\n  puVar6 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);\n    if (-1 < iVar1) {\n      return;\n    }\n    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();\n    if (*piVar3 != 4) break;\n    *piVar3 = 0;\n  }\n  return;\n}" primitive_type (function_declarator "set_winsize(int tty)" identifier (parameter_list "(int tty)" ( (parameter_declaration "int tty" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined *puVar6;\n  winsize w;\n  \n  puVar6 = PTR___stack_chk_guard_001464dc;\n  uVar5 = 0x40087468;\n  iVar1 = *(int *)PTR___stack_chk_guard_001464dc;\n  iVar4 = tty;\n  iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w);\n  if (iVar2 == 0) {\n    uVar5 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);\n    iVar4 = tty;\n  }\n  if (iVar1 == *(int *)puVar6) {\n    return;\n  }\n  puVar6 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);\n    if (-1 < iVar1) {\n      return;\n    }\n    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();\n    if (*piVar3 != 4) break;\n    *piVar3 = 0;\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "winsize w;" type_identifier identifier ;) (expression_statement "puVar6 = PTR___stack_chk_guard_001464dc;" (assignment_expression "puVar6 = PTR___stack_chk_guard_001464dc" identifier = identifier) ;) (expression_statement "uVar5 = 0x40087468;" (assignment_expression "uVar5 = 0x40087468" identifier = number_literal) ;) (expression_statement "iVar1 = *(int *)PTR___stack_chk_guard_001464dc;" (assignment_expression "iVar1 = *(int *)PTR___stack_chk_guard_001464dc" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_001464dc" * (cast_expression "(int *)PTR___stack_chk_guard_001464dc" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar4 = tty;" (assignment_expression "iVar4 = tty" identifier = identifier) ;) (expression_statement "iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w);" (assignment_expression "iVar2 = (*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w)" identifier = (call_expression "(*(code *)PTR_ioctl_0014643c)(tty,0x40087468,&w)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(tty,0x40087468,&w)" ( identifier , number_literal , (pointer_expression "&w" & identifier) )))) ;) (if_statement "if (iVar2 == 0) {\n    uVar5 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);\n    iVar4 = tty;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar5 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);\n    iVar4 = tty;\n  }" { (expression_statement "uVar5 = 0x80087467;" (assignment_expression "uVar5 = 0x80087467" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w);" (call_expression "(*(code *)PTR_ioctl_0014643c)(tty,0x80087467,&w)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(tty,0x80087467,&w)" ( identifier , number_literal , (pointer_expression "&w" & identifier) ))) ;) (expression_statement "iVar4 = tty;" (assignment_expression "iVar4 = tty" identifier = identifier) ;) })) (if_statement "if (iVar1 == *(int *)puVar6) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)puVar6)" ( (binary_expression "iVar1 == *(int *)puVar6" identifier == (pointer_expression "*(int *)puVar6" * (cast_expression "(int *)puVar6" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "puVar6 = PTR___stack_chk_fail_00146488;" (assignment_expression "puVar6 = PTR___stack_chk_fail_00146488" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_00146488)();" (call_expression "(*(code *)PTR___stack_chk_fail_00146488)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_00146488)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_00146488" * (cast_expression "(code *)PTR___stack_chk_fail_00146488" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (while_statement "while( true ) {\n    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);\n    if (-1 < iVar1) {\n      return;\n    }\n    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();\n    if (*piVar3 != 4) break;\n    *piVar3 = 0;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);\n    if (-1 < iVar1) {\n      return;\n    }\n    piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();\n    if (*piVar3 != 4) break;\n    *piVar3 = 0;\n  }" { (expression_statement "iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5);" (assignment_expression "iVar1 = (**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5)" identifier = (call_expression "(**(code **)(puVar6 + 0x5ceac))(iVar4,0x540f,uVar5)" (parenthesized_expression "(**(code **)(puVar6 + 0x5ceac))" ( (pointer_expression "**(code **)(puVar6 + 0x5ceac)" * (pointer_expression "*(code **)(puVar6 + 0x5ceac)" * (cast_expression "(code **)(puVar6 + 0x5ceac)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x5ceac)" ( (binary_expression "puVar6 + 0x5ceac" identifier + number_literal) ))))) )) (argument_list "(iVar4,0x540f,uVar5)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))();" (assignment_expression "piVar3 = (int *)(**(code **)(puVar6 + 0x5cde4))()" identifier = (cast_expression "(int *)(**(code **)(puVar6 + 0x5cde4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar6 + 0x5cde4))()" (parenthesized_expression "(**(code **)(puVar6 + 0x5cde4))" ( (pointer_expression "**(code **)(puVar6 + 0x5cde4)" * (pointer_expression "*(code **)(puVar6 + 0x5cde4)" * (cast_expression "(code **)(puVar6 + 0x5cde4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x5cde4)" ( (binary_expression "puVar6 + 0x5cde4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar3 != 4) break;" if (parenthesized_expression "(*piVar3 != 4)" ( (binary_expression "*piVar3 != 4" (pointer_expression "*piVar3" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "*piVar3 = 0;" (assignment_expression "*piVar3 = 0" (pointer_expression "*piVar3" * identifier) = number_literal) ;) })) (return_statement "return;" return ;) })))
(translation_unit "int FUN_000e94b0(undefined4 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}\n\n" (function_definition "int FUN_000e94b0(undefined4 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" primitive_type (function_declarator "FUN_000e94b0(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "undefined *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "undefined1 auStack_1c [8];" type_identifier (array_declarator "auStack_1c [8]" identifier [ number_literal ]) ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "puVar5 = PTR___stack_chk_guard_001464dc;" (assignment_expression "puVar5 = PTR___stack_chk_guard_001464dc" identifier = identifier) ;) (expression_statement "uVar4 = 0x40087468;" (assignment_expression "uVar4 = 0x40087468" identifier = number_literal) ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_001464dc;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_001464dc" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_001464dc" * (cast_expression "(int *)PTR___stack_chk_guard_001464dc" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" identifier = identifier) ;) (expression_statement "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);" (assignment_expression "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" identifier = (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x40087468,auStack_1c)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" { (expression_statement "uVar4 = 0x80087467;" (assignment_expression "uVar4 = 0x80087467" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);" (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" ( (pointer_expression "*(code *)PTR_ioctl_0014643c" * (cast_expression "(code *)PTR_ioctl_0014643c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x80087467,auStack_1c)" ( identifier , number_literal , identifier ))) ;) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" identifier = identifier) ;) })) (if_statement "if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }" if (parenthesized_expression "(local_14 == *(int *)puVar5)" ( (binary_expression "local_14 == *(int *)puVar5" identifier == (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return *(int *)puVar5;\n  }" { (return_statement "return *(int *)puVar5;" return (pointer_expression "*(int *)puVar5" * (cast_expression "(int *)puVar5" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) })) (expression_statement "puVar5 = PTR___stack_chk_fail_00146488;" (assignment_expression "puVar5 = PTR___stack_chk_fail_00146488" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_00146488)();" (call_expression "(*(code *)PTR___stack_chk_fail_00146488)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_00146488)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_00146488" * (cast_expression "(code *)PTR___stack_chk_fail_00146488" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (while_statement "while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" { (expression_statement "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);" (assignment_expression "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" identifier = (call_expression "(**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" (parenthesized_expression "(**(code **)(puVar5 + 0x5ceac))" ( (pointer_expression "**(code **)(puVar5 + 0x5ceac)" * (pointer_expression "*(code **)(puVar5 + 0x5ceac)" * (cast_expression "(code **)(puVar5 + 0x5ceac)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x5ceac)" ( (binary_expression "puVar5 + 0x5ceac" identifier + number_literal) ))))) )) (argument_list "(uVar3,0x540f,uVar4)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return 0;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();" (assignment_expression "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))()" identifier = (cast_expression "(int *)(**(code **)(puVar5 + 0x5cde4))()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)(puVar5 + 0x5cde4))()" (parenthesized_expression "(**(code **)(puVar5 + 0x5cde4))" ( (pointer_expression "**(code **)(puVar5 + 0x5cde4)" * (pointer_expression "*(code **)(puVar5 + 0x5cde4)" * (cast_expression "(code **)(puVar5 + 0x5cde4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar5 + 0x5cde4)" ( (binary_expression "puVar5 + 0x5cde4" identifier + number_literal) ))))) )) (argument_list "()" ( ))))) ;) (if_statement "if (*piVar2 != 4) break;" if (parenthesized_expression "(*piVar2 != 4)" ( (binary_expression "*piVar2 != 4" (pointer_expression "*piVar2" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) })) (return_statement "return -1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (return_statement return (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (break_statement break ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (return_statement return LIT ;) })))
(function_definition "int FUN_000e94b0(undefined4 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" (primitive_type "int") (function_declarator "FUN_000e94b0(undefined4 param_1)" (identifier "FUN_000e94b0") (parameter_list "(undefined4 param_1)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  undefined *puVar5;\n  undefined1 auStack_1c [8];\n  int local_14;\n  \n  puVar5 = PTR___stack_chk_guard_001464dc;\n  uVar4 = 0x40087468;\n  local_14 = *(int *)PTR___stack_chk_guard_001464dc;\n  uVar3 = param_1;\n  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);\n  if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }\n  if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }\n  puVar5 = PTR___stack_chk_fail_00146488;\n  (*(code *)PTR___stack_chk_fail_00146488)();\n  while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }\n  return -1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "undefined *puVar5;" (type_identifier "undefined") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "undefined1 auStack_1c [8];" (type_identifier "undefined1") (array_declarator "auStack_1c [8]" (identifier "auStack_1c") ([ "[") (number_literal "8") (] "]")) (; ";")) (declaration "int local_14;" (primitive_type "int") (identifier "local_14") (; ";")) (expression_statement "puVar5 = PTR___stack_chk_guard_001464dc;" (assignment_expression "puVar5 = PTR___stack_chk_guard_001464dc" (identifier "puVar5") (= "=") (identifier "PTR___stack_chk_guard_001464dc")) (; ";")) (expression_statement "uVar4 = 0x40087468;" (assignment_expression "uVar4 = 0x40087468" (identifier "uVar4") (= "=") (number_literal "0x40087468")) (; ";")) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_001464dc;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_001464dc" (identifier "local_14") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_001464dc" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_001464dc" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_001464dc")))) (; ";")) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" (identifier "uVar3") (= "=") (identifier "param_1")) (; ";")) (expression_statement "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);" (assignment_expression "iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" (( "(") (pointer_expression "*(code *)PTR_ioctl_0014643c" (* "*") (cast_expression "(code *)PTR_ioctl_0014643c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_ioctl_0014643c"))) () ")")) (argument_list "(param_1,0x40087468,auStack_1c)" (( "(") (identifier "param_1") (, ",") (number_literal "0x40087468") (, ",") (identifier "auStack_1c") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar4 = 0x80087467;\n    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);\n    uVar3 = param_1;\n  }" ({ "{") (expression_statement "uVar4 = 0x80087467;" (assignment_expression "uVar4 = 0x80087467" (identifier "uVar4") (= "=") (number_literal "0x80087467")) (; ";")) (expression_statement "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);" (call_expression "(*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c)" (parenthesized_expression "(*(code *)PTR_ioctl_0014643c)" (( "(") (pointer_expression "*(code *)PTR_ioctl_0014643c" (* "*") (cast_expression "(code *)PTR_ioctl_0014643c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_ioctl_0014643c"))) () ")")) (argument_list "(param_1,0x80087467,auStack_1c)" (( "(") (identifier "param_1") (, ",") (number_literal "0x80087467") (, ",") (identifier "auStack_1c") () ")"))) (; ";")) (expression_statement "uVar3 = param_1;" (assignment_expression "uVar3 = param_1" (identifier "uVar3") (= "=") (identifier "param_1")) (; ";")) (} "}"))) (if_statement "if (local_14 == *(int *)puVar5) {\n    return *(int *)puVar5;\n  }" (if "if") (parenthesized_expression "(local_14 == *(int *)puVar5)" (( "(") (binary_expression "local_14 == *(int *)puVar5" (identifier "local_14") (== "==") (pointer_expression "*(int *)puVar5" (* "*") (cast_expression "(int *)puVar5" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar5")))) () ")")) (compound_statement "{\n    return *(int *)puVar5;\n  }" ({ "{") (return_statement "return *(int *)puVar5;" (return "return") (pointer_expression "*(int *)puVar5" (* "*") (cast_expression "(int *)puVar5" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar5"))) (; ";")) (} "}"))) (expression_statement "puVar5 = PTR___stack_chk_fail_00146488;" (assignment_expression "puVar5 = PTR___stack_chk_fail_00146488" (identifier "puVar5") (= "=") (identifier "PTR___stack_chk_fail_00146488")) (; ";")) (expression_statement "(*(code *)PTR___stack_chk_fail_00146488)();" (call_expression "(*(code *)PTR___stack_chk_fail_00146488)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_00146488)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_00146488" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_00146488" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_00146488"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (while_statement "while( true ) {\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);\n    if (-1 < iVar1) {\n      return 0;\n    }\n    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();\n    if (*piVar2 != 4) break;\n    *piVar2 = 0;\n  }" ({ "{") (expression_statement "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);" (assignment_expression "iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" (identifier "iVar1") (= "=") (call_expression "(**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4)" (parenthesized_expression "(**(code **)(puVar5 + 0x5ceac))" (( "(") (pointer_expression "**(code **)(puVar5 + 0x5ceac)" (* "*") (pointer_expression "*(code **)(puVar5 + 0x5ceac)" (* "*") (cast_expression "(code **)(puVar5 + 0x5ceac)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar5 + 0x5ceac)" (( "(") (binary_expression "puVar5 + 0x5ceac" (identifier "puVar5") (+ "+") (number_literal "0x5ceac")) () ")"))))) () ")")) (argument_list "(uVar3,0x540f,uVar4)" (( "(") (identifier "uVar3") (, ",") (number_literal "0x540f") (, ",") (identifier "uVar4") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();" (assignment_expression "piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))()" (identifier "piVar2") (= "=") (cast_expression "(int *)(**(code **)(puVar5 + 0x5cde4))()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(**(code **)(puVar5 + 0x5cde4))()" (parenthesized_expression "(**(code **)(puVar5 + 0x5cde4))" (( "(") (pointer_expression "**(code **)(puVar5 + 0x5cde4)" (* "*") (pointer_expression "*(code **)(puVar5 + 0x5cde4)" (* "*") (cast_expression "(code **)(puVar5 + 0x5cde4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar5 + 0x5cde4)" (( "(") (binary_expression "puVar5 + 0x5cde4" (identifier "puVar5") (+ "+") (number_literal "0x5cde4")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (*piVar2 != 4) break;" (if "if") (parenthesized_expression "(*piVar2 != 4)" (( "(") (binary_expression "*piVar2 != 4" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "4")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}")))

void function_1(int tty)

{
  int var_2;
  int var_1;
  int *piVar3;
  int iVar4;
  type_1 uVar5;
  type_2 *var_3;
  type_3 w;
  
  var_3 = PTR___stack_chk_guard_001464dc;
  uVar5 = 0x40087468;
  var_2 = *(int *)PTR___stack_chk_guard_001464dc;
  iVar4 = tty;
  var_1 = (*(type_4 *)PTR_ioctl_0014643c)(tty,0x40087468,&w);
  if (var_1 == 0) {
    uVar5 = 0x80087467;
    (*(type_4 *)PTR_ioctl_0014643c)(tty,0x80087467,&w);
    iVar4 = tty;
  }
  if (var_2 == *(int *)var_3) {
    return;
  }
  var_3 = PTR___stack_chk_fail_00146488;
  (*(type_4 *)PTR___stack_chk_fail_00146488)();
  while( true ) {
    var_2 = (**(type_4 **)(var_3 + 0x5ceac))(iVar4,0x540f,uVar5);
    if (-1 < var_2) {
      return;
    }
    piVar3 = (int *)(**(type_4 **)(var_3 + 0x5cde4))();
    if (*piVar3 != 4) break;
    *piVar3 = 0;
  }
  return;
}


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

int MASKED(undefined4 param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined *puVar5;
  undefined1 auStack_1c [8];
  int local_14;
  
  puVar5 = PTR___stack_chk_guard_001464dc;
  uVar4 = 0x40087468;
  local_14 = *(int *)PTR___stack_chk_guard_001464dc;
  uVar3 = param_1;
  iVar1 = (*(code *)PTR_ioctl_0014643c)(param_1,0x40087468,auStack_1c);
  if (iVar1 == 0) {
    uVar4 = 0x80087467;
    (*(code *)PTR_ioctl_0014643c)(param_1,0x80087467,auStack_1c);
    uVar3 = param_1;
  }
  if (local_14 == *(int *)puVar5) {
    return *(int *)puVar5;
  }
  puVar5 = PTR___stack_chk_fail_00146488;
  (*(code *)PTR___stack_chk_fail_00146488)();
  while( true ) {
    iVar1 = (**(code **)(puVar5 + 0x5ceac))(uVar3,0x540f,uVar4);
    if (-1 < iVar1) {
      return 0;
    }
    piVar2 = (int *)(**(code **)(puVar5 + 0x5cde4))();
    if (*piVar2 != 4) break;
    *piVar2 = 0;
  }
  return -1;
}

