
size_t safe_read(int fd,void *buf,size_t count)

{
  bool bVar1;
  size_t sVar2;
  int *piVar3;
  
  while( true ) {
    do {
      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);
      if (-1 < (int)sVar2) {
        return sVar2;
      }
      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();
      bVar1 = count < 0x7ff00001;
    } while (*piVar3 == 4);
    count = 0x7ff00000;
    if (*piVar3 != 0x16) break;
    if (bVar1) {
      return sVar2;
    }
  }
  return sVar2;
}



int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)

{
  bool bVar1;
  int iVar2;
  int *piVar3;
  
  while( true ) {
    do {
      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);
      if (-1 < iVar2) {
        return iVar2;
      }
      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();
      bVar1 = param_3 < 0x7ff00001;
    } while (*piVar3 == 4);
    param_3 = 0x7ff00000;
    if (*piVar3 != 0x16) break;
    if (bVar1) {
      return iVar2;
    }
  }
  return iVar2;
}


lui gp,0x3
addiu gp,gp,-0x1c00
addu gp,gp,t9
addiu sp,sp,-0x38
sw s2,0x20(sp)
lui s2,0x7ff0
sw s6,0x30(sp)
li s6,0x16
sw s5,0x2c(sp)
addiu s2,s2,0x1
li s5,0x4
sw s4,0x28(sp)
sw s3,0x24(sp)
or s4,a0,zero
sw s0,0x18(sp)
or s3,a1,zero
sw gp,0x10(sp)
or s0,a2,zero
sw ra,0x34(sp)
sw s1,0x1c(sp)
lw t9,-0x7d98(gp)
or a2,s0,zero
or a1,s3,zero
jalr t9
_or a0,s4,zero
lw gp,0x10(sp)
or s1,v0,zero
bgez v0,0x00015d6c
_lw t9,-0x7e4c(gp)
jalr t9
_nop
sltu v1,s0,s2
lw v0,0x0(v0)
beq v0,s5,0x00015d20
_lw gp,0x10(sp)
bne v0,s6,0x00015d6c
_lui s0,0x7ff0
beq v1,zero,0x00015d24
_lw t9,-0x7d98(gp)
lw ra,0x34(sp)
or v0,s1,zero
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "safe_read(undefined4 param_1,undefined4 param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (while_statement "while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" { (do_statement "do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);" do (compound_statement "{\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    }" { (expression_statement "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" identifier = (call_expression "(*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_read_0003c338)" ( (pointer_expression "*(code *)PTR_read_0003c338" * (cast_expression "(code *)PTR_read_0003c338" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (-1 < iVar2) {\n        return iVar2;\n      }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0003c284)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0003c284)()" (parenthesized_expression "(*(code *)PTR___errno_location_0003c284)" ( (pointer_expression "*(code *)PTR___errno_location_0003c284" * (cast_expression "(code *)PTR___errno_location_0003c284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "bVar1 = param_3 < 0x7ff00001;" (assignment_expression "bVar1 = param_3 < 0x7ff00001" identifier = (binary_expression "param_3 < 0x7ff00001" identifier < number_literal)) ;) }) while (parenthesized_expression "(*piVar3 == 4)" ( (binary_expression "*piVar3 == 4" (pointer_expression "*piVar3" * identifier) == number_literal) )) ;) (expression_statement "param_3 = 0x7ff00000;" (assignment_expression "param_3 = 0x7ff00000" identifier = number_literal) ;) (if_statement "if (*piVar3 != 0x16) break;" if (parenthesized_expression "(*piVar3 != 0x16)" ( (binary_expression "*piVar3 != 0x16" (pointer_expression "*piVar3" * identifier) != number_literal) )) (break_statement "break;" break ;)) (if_statement "if (bVar1) {\n      return iVar2;\n    }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "size_t safe_read(int fd,void *buf,size_t count)\n\n{\n  bool bVar1;\n  size_t sVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);\n    count = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return sVar2;\n    }\n  }\n  return sVar2;\n}\n\n" (function_definition "size_t safe_read(int fd,void *buf,size_t count)\n\n{\n  bool bVar1;\n  size_t sVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);\n    count = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return sVar2;\n    }\n  }\n  return sVar2;\n}" primitive_type (function_declarator "safe_read(int fd,void *buf,size_t count)" identifier (parameter_list "(int fd,void *buf,size_t count)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "void *buf" primitive_type (pointer_declarator "*buf" * identifier)) , (parameter_declaration "size_t count" primitive_type identifier) ))) (compound_statement "{\n  bool bVar1;\n  size_t sVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);\n    count = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return sVar2;\n    }\n  }\n  return sVar2;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (while_statement "while( true ) {\n    do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);\n    count = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return sVar2;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);\n    count = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return sVar2;\n    }\n  }" { (do_statement "do {\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    } while (*piVar3 == 4);" do (compound_statement "{\n      sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);\n      if (-1 < (int)sVar2) {\n        return sVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = count < 0x7ff00001;\n    }" { (expression_statement "sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count);" (assignment_expression "sVar2 = (*(code *)PTR_read_0003c338)(fd,buf,count)" identifier = (call_expression "(*(code *)PTR_read_0003c338)(fd,buf,count)" (parenthesized_expression "(*(code *)PTR_read_0003c338)" ( (pointer_expression "*(code *)PTR_read_0003c338" * (cast_expression "(code *)PTR_read_0003c338" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd,buf,count)" ( identifier , identifier , identifier )))) ;) (if_statement "if (-1 < (int)sVar2) {\n        return sVar2;\n      }" if (parenthesized_expression "(-1 < (int)sVar2)" ( (binary_expression "-1 < (int)sVar2" number_literal < (cast_expression "(int)sVar2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n        return sVar2;\n      }" { (return_statement "return sVar2;" return identifier ;) })) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0003c284)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0003c284)()" (parenthesized_expression "(*(code *)PTR___errno_location_0003c284)" ( (pointer_expression "*(code *)PTR___errno_location_0003c284" * (cast_expression "(code *)PTR___errno_location_0003c284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "bVar1 = count < 0x7ff00001;" (assignment_expression "bVar1 = count < 0x7ff00001" identifier = (binary_expression "count < 0x7ff00001" identifier < number_literal)) ;) }) while (parenthesized_expression "(*piVar3 == 4)" ( (binary_expression "*piVar3 == 4" (pointer_expression "*piVar3" * identifier) == number_literal) )) ;) (expression_statement "count = 0x7ff00000;" (assignment_expression "count = 0x7ff00000" identifier = number_literal) ;) (if_statement "if (*piVar3 != 0x16) break;" if (parenthesized_expression "(*piVar3 != 0x16)" ( (binary_expression "*piVar3 != 0x16" (pointer_expression "*piVar3" * identifier) != number_literal) )) (break_statement "break;" break ;)) (if_statement "if (bVar1) {\n      return sVar2;\n    }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n      return sVar2;\n    }" { (return_statement "return sVar2;" return identifier ;) })) })) (return_statement "return sVar2;" return identifier ;) })))
(translation_unit "int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "safe_read(undefined4 param_1,undefined4 param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (while_statement "while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" { (do_statement "do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);" do (compound_statement "{\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    }" { (expression_statement "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" identifier = (call_expression "(*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_read_0003c338)" ( (pointer_expression "*(code *)PTR_read_0003c338" * (cast_expression "(code *)PTR_read_0003c338" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (-1 < iVar2) {\n        return iVar2;\n      }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_0003c284)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_0003c284)()" (parenthesized_expression "(*(code *)PTR___errno_location_0003c284)" ( (pointer_expression "*(code *)PTR___errno_location_0003c284" * (cast_expression "(code *)PTR___errno_location_0003c284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "bVar1 = param_3 < 0x7ff00001;" (assignment_expression "bVar1 = param_3 < 0x7ff00001" identifier = (binary_expression "param_3 < 0x7ff00001" identifier < number_literal)) ;) }) while (parenthesized_expression "(*piVar3 == 4)" ( (binary_expression "*piVar3 == 4" (pointer_expression "*piVar3" * identifier) == number_literal) )) ;) (expression_statement "param_3 = 0x7ff00000;" (assignment_expression "param_3 = 0x7ff00000" identifier = number_literal) ;) (if_statement "if (*piVar3 != 0x16) break;" if (parenthesized_expression "(*piVar3 != 0x16)" ( (binary_expression "*piVar3 != 0x16" (pointer_expression "*piVar3" * identifier) != number_literal) )) (break_statement "break;" break ;)) (if_statement "if (bVar1) {\n      return iVar2;\n    }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT < LIT)) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (break_statement break ;)) (if_statement if (parenthesized_expression ( IDENT )) (compound_statement { (return_statement return IDENT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int safe_read(undefined4 param_1,undefined4 param_2,uint param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "safe_read(undefined4 param_1,undefined4 param_2,uint param_3)" (identifier "safe_read") (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  int *piVar3;\n  \n  while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" ({ "{") (declaration "bool bVar1;" (primitive_type "bool") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (while_statement "while( true ) {\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);\n    param_3 = 0x7ff00000;\n    if (*piVar3 != 0x16) break;\n    if (bVar1) {\n      return iVar2;\n    }\n  }" ({ "{") (do_statement "do {\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    } while (*piVar3 == 4);" (do "do") (compound_statement "{\n      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);\n      if (-1 < iVar2) {\n        return iVar2;\n      }\n      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();\n      bVar1 = param_3 < 0x7ff00001;\n    }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_read_0003c338)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_read_0003c338)" (( "(") (pointer_expression "*(code *)PTR_read_0003c338" (* "*") (cast_expression "(code *)PTR_read_0003c338" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_read_0003c338"))) () ")")) (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (-1 < iVar2) {\n        return iVar2;\n      }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n        return iVar2;\n      }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();" (assignment_expression "piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)()" (identifier "piVar3") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_0003c284)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_0003c284)()" (parenthesized_expression "(*(code *)PTR___errno_location_0003c284)" (( "(") (pointer_expression "*(code *)PTR___errno_location_0003c284" (* "*") (cast_expression "(code *)PTR___errno_location_0003c284" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_0003c284"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "bVar1 = param_3 < 0x7ff00001;" (assignment_expression "bVar1 = param_3 < 0x7ff00001" (identifier "bVar1") (= "=") (binary_expression "param_3 < 0x7ff00001" (identifier "param_3") (< "<") (number_literal "0x7ff00001"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*piVar3 == 4)" (( "(") (binary_expression "*piVar3 == 4" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (== "==") (number_literal "4")) () ")")) (; ";")) (expression_statement "param_3 = 0x7ff00000;" (assignment_expression "param_3 = 0x7ff00000" (identifier "param_3") (= "=") (number_literal "0x7ff00000")) (; ";")) (if_statement "if (*piVar3 != 0x16) break;" (if "if") (parenthesized_expression "(*piVar3 != 0x16)" (( "(") (binary_expression "*piVar3 != 0x16" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (!= "!=") (number_literal "0x16")) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if (bVar1) {\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(bVar1)" (( "(") (identifier "bVar1") () ")")) (compound_statement "{\n      return iVar2;\n    }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))
(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (do_statement body: (compound_statement (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) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (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: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (break_statement)) (if_statement condition: (parenthesized_expression (identifier)) consequence: (compound_statement (return_statement (identifier)))))) (return_statement (identifier)))))

int MASKED(undefined4 param_1,undefined4 param_2,uint param_3)

{
  bool bVar1;
  int iVar2;
  int *piVar3;
  
  while( true ) {
    do {
      iVar2 = (*(code *)PTR_read_0003c338)(param_1,param_2,param_3);
      if (-1 < iVar2) {
        return iVar2;
      }
      piVar3 = (int *)(*(code *)PTR___errno_location_0003c284)();
      bVar1 = param_3 < 0x7ff00001;
    } while (*piVar3 == 4);
    param_3 = 0x7ff00000;
    if (*piVar3 != 0x16) break;
    if (bVar1) {
      return iVar2;
    }
  }
  return iVar2;
}

