
pid_t safe_waitpid(pid_t pid,int *wstat,int options)

{
  undefined *puVar1;
  int iVar2;
  
  puVar1 = PTR_bb_errno_0012a214;
  do {
    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);
    if (iVar2 != -1) {
      return iVar2;
    }
  } while (**(int **)puVar1 == 4);
  return -1;
}



void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  
  puVar1 = PTR_DAT_0012a214;
  do {
    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);
    if (iVar2 != -1) {
      return;
    }
  } while (**(int **)puVar1 == 4);
  return;
}


lui gp,0x12
addiu gp,gp,-0x7d18
addu gp,gp,t9
addiu sp,sp,-0x38
sw s5,0x30(sp)
sw s4,0x2c(sp)
li s4,-0x1
sw s3,0x28(sp)
li s3,0x4
sw s2,0x24(sp)
or s2,a0,zero
sw s1,0x20(sp)
or s1,a1,zero
sw s0,0x1c(sp)
or s0,a2,zero
sw gp,0x10(sp)
sw ra,0x34(sp)
lw s5,-0x7f3c(gp)
lw t9,-0x712c(gp)
or a2,s0,zero
or a1,s1,zero
jalr t9
_or a0,s2,zero
bne v0,s4,0x00019edc
_lw gp,0x10(sp)
lw v1,0x0(s5)
lw v1,0x0(v1)
beq v1,s3,0x00019eb4
_lw t9,-0x712c(gp)
lw ra,0x34(sp)
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}\n\n" (function_definition "void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" primitive_type (function_declarator "FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);" do (compound_statement "{\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" identifier = (call_expression "(*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_waitpid_0012b024)" ( (pointer_expression "*(code *)PTR_waitpid_0012b024" * (cast_expression "(code *)PTR_waitpid_0012b024" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar2 != -1) {\n      return;\n    }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) }) while (parenthesized_expression "(**(int **)puVar1 == 4)" ( (binary_expression "**(int **)puVar1 == 4" (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) == number_literal) )) ;) (return_statement "return;" return ;) })))
(translation_unit "pid_t safe_waitpid(pid_t pid,int *wstat,int options)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);\n    if (iVar2 != -1) {\n      return iVar2;\n    }\n  } while (**(int **)puVar1 == 4);\n  return -1;\n}\n\n" (function_definition "pid_t safe_waitpid(pid_t pid,int *wstat,int options)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);\n    if (iVar2 != -1) {\n      return iVar2;\n    }\n  } while (**(int **)puVar1 == 4);\n  return -1;\n}" type_identifier (function_declarator "safe_waitpid(pid_t pid,int *wstat,int options)" identifier (parameter_list "(pid_t pid,int *wstat,int options)" ( (parameter_declaration "pid_t pid" type_identifier identifier) , (parameter_declaration "int *wstat" primitive_type (pointer_declarator "*wstat" * identifier)) , (parameter_declaration "int options" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_bb_errno_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);\n    if (iVar2 != -1) {\n      return iVar2;\n    }\n  } while (**(int **)puVar1 == 4);\n  return -1;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_bb_errno_0012a214;" (assignment_expression "puVar1 = PTR_bb_errno_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);\n    if (iVar2 != -1) {\n      return iVar2;\n    }\n  } while (**(int **)puVar1 == 4);" do (compound_statement "{\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);\n    if (iVar2 != -1) {\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options);" (assignment_expression "iVar2 = (*(code *)PTR_waitpid_0012b024)(pid,wstat,options)" identifier = (call_expression "(*(code *)PTR_waitpid_0012b024)(pid,wstat,options)" (parenthesized_expression "(*(code *)PTR_waitpid_0012b024)" ( (pointer_expression "*(code *)PTR_waitpid_0012b024" * (cast_expression "(code *)PTR_waitpid_0012b024" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pid,wstat,options)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar2 != -1) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) }) while (parenthesized_expression "(**(int **)puVar1 == 4)" ( (binary_expression "**(int **)puVar1 == 4" (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) == number_literal) )) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}\n\n" (function_definition "void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" primitive_type (function_declarator "FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" identifier = identifier) ;) (do_statement "do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);" do (compound_statement "{\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" identifier = (call_expression "(*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_waitpid_0012b024)" ( (pointer_expression "*(code *)PTR_waitpid_0012b024" * (cast_expression "(code *)PTR_waitpid_0012b024" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar2 != -1) {\n      return;\n    }" if (parenthesized_expression "(iVar2 != -1)" ( (binary_expression "iVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) }) while (parenthesized_expression "(**(int **)puVar1 == 4)" ( (binary_expression "**(int **)puVar1 == 4" (pointer_expression "**(int **)puVar1" * (pointer_expression "*(int **)puVar1" * (cast_expression "(int **)puVar1" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) == number_literal) )) ;) (return_statement "return;" return ;) })))
(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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (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 IDENT != LIT) )) (compound_statement { (return_statement return ;) })) }) while (parenthesized_expression ( (binary_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) == LIT) )) ;) (return_statement return ;) })))
(function_definition "void FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00019e68(undefined4 param_1,undefined4 param_2,undefined4 param_3)" (identifier "FUN_00019e68") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 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 "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  \n  puVar1 = PTR_DAT_0012a214;\n  do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);\n  return;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "puVar1 = PTR_DAT_0012a214;" (assignment_expression "puVar1 = PTR_DAT_0012a214" (identifier "puVar1") (= "=") (identifier "PTR_DAT_0012a214")) (; ";")) (do_statement "do {\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  } while (**(int **)puVar1 == 4);" (do "do") (compound_statement "{\n    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);\n    if (iVar2 != -1) {\n      return;\n    }\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);" (assignment_expression "iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_waitpid_0012b024)" (( "(") (pointer_expression "*(code *)PTR_waitpid_0012b024" (* "*") (cast_expression "(code *)PTR_waitpid_0012b024" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_waitpid_0012b024"))) () ")")) (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (iVar2 != -1) {\n      return;\n    }" (if "if") (parenthesized_expression "(iVar2 != -1)" (( "(") (binary_expression "iVar2 != -1" (identifier "iVar2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n      return;\n    }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(**(int **)puVar1 == 4)" (( "(") (binary_expression "**(int **)puVar1 == 4" (pointer_expression "**(int **)puVar1" (* "*") (pointer_expression "*(int **)puVar1" (* "*") (cast_expression "(int **)puVar1" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "puVar1")))) (== "==") (number_literal "4")) () ")")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

type_1 function_1(type_1 pid,int *wstat,int options)

{
  type_2 *puVar1;
  int var_1;
  
  puVar1 = PTR_bb_errno_0012a214;
  do {
    var_1 = (*(type_3 *)PTR_waitpid_0012b024)(pid,wstat,options);
    if (var_1 != -1) {
      return var_1;
    }
  } while (**(int **)puVar1 == 4);
  return -1;
}


(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (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: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement)))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (identifier)))) right: (number_literal)))) (return_statement))))

void MASKED(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  
  puVar1 = PTR_DAT_0012a214;
  do {
    iVar2 = (*(code *)PTR_waitpid_0012b024)(param_1,param_2,param_3);
    if (iVar2 != -1) {
      return;
    }
  } while (**(int **)puVar1 == 4);
  return;
}

