
char * dupstr(char *s)

{
  int iVar1;
  void *pvVar2;
  char *pcVar3;
  
  if (s != (char *)0x0) {
    iVar1 = (*(code *)PTR_strlen_000adc28)();
    pvVar2 = safemalloc(iVar1 + 1,1);
    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);
    return pcVar3;
  }
  return (char *)0x0;
}



undefined4 dupstr(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  if (param_1 != 0) {
    iVar1 = (*(code *)PTR_strlen_000adc28)();
    uVar2 = safemalloc(iVar1 + 1,1);
    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);
    return uVar2;
  }
  return 0;
}


lui gp,0x9
addiu gp,gp,0x30b4
addu gp,gp,t9
beq a0,zero,0x00022240
_lw t9,-0x7668(gp)
addiu sp,sp,-0x20
sw ra,0x1c(sp)
sw s0,0x18(sp)
sw gp,0x10(sp)
jalr t9
_or s0,a0,zero
li a1,0x1
lw gp,0x10(sp)
lw t9,-0x7e7c(gp)
bal 0x00022094
_addiu a0,v0,0x1
or a1,s0,zero
lw gp,0x10(sp)
lw t9,-0x761c(gp)
jalr t9
_or a0,v0,zero
lw ra,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
or v1,zero,zero
jr ra
_or v0,v1,zero
(translation_unit "undefined4 dupstr(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 dupstr(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" type_identifier (function_declarator "dupstr(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (if_statement "if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_strlen_000adc28)();" (assignment_expression "iVar1 = (*(code *)PTR_strlen_000adc28)()" identifier = (call_expression "(*(code *)PTR_strlen_000adc28)()" (parenthesized_expression "(*(code *)PTR_strlen_000adc28)" ( (pointer_expression "*(code *)PTR_strlen_000adc28" * (cast_expression "(code *)PTR_strlen_000adc28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "uVar2 = safemalloc(iVar1 + 1,1);" (assignment_expression "uVar2 = safemalloc(iVar1 + 1,1)" identifier = (call_expression "safemalloc(iVar1 + 1,1)" identifier (argument_list "(iVar1 + 1,1)" ( (binary_expression "iVar1 + 1" identifier + number_literal) , number_literal )))) ;) (expression_statement "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);" (assignment_expression "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" identifier = (call_expression "(*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_000adc74)" ( (pointer_expression "*(code *)PTR_strcpy_000adc74" * (cast_expression "(code *)PTR_strcpy_000adc74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar2,param_1)" ( identifier , identifier )))) ;) (return_statement "return uVar2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "char * dupstr(char *s)\n\n{\n  int iVar1;\n  void *pvVar2;\n  char *pcVar3;\n  \n  if (s != (char *)0x0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    pvVar2 = safemalloc(iVar1 + 1,1);\n    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);\n    return pcVar3;\n  }\n  return (char *)0x0;\n}\n\n" (function_definition "char * dupstr(char *s)\n\n{\n  int iVar1;\n  void *pvVar2;\n  char *pcVar3;\n  \n  if (s != (char *)0x0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    pvVar2 = safemalloc(iVar1 + 1,1);\n    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);\n    return pcVar3;\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* dupstr(char *s)" * (function_declarator "dupstr(char *s)" identifier (parameter_list "(char *s)" ( (parameter_declaration "char *s" primitive_type (pointer_declarator "*s" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  void *pvVar2;\n  char *pcVar3;\n  \n  if (s != (char *)0x0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    pvVar2 = safemalloc(iVar1 + 1,1);\n    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);\n    return pcVar3;\n  }\n  return (char *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (if_statement "if (s != (char *)0x0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    pvVar2 = safemalloc(iVar1 + 1,1);\n    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);\n    return pcVar3;\n  }" if (parenthesized_expression "(s != (char *)0x0)" ( (binary_expression "s != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    pvVar2 = safemalloc(iVar1 + 1,1);\n    pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);\n    return pcVar3;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_strlen_000adc28)();" (assignment_expression "iVar1 = (*(code *)PTR_strlen_000adc28)()" identifier = (call_expression "(*(code *)PTR_strlen_000adc28)()" (parenthesized_expression "(*(code *)PTR_strlen_000adc28)" ( (pointer_expression "*(code *)PTR_strlen_000adc28" * (cast_expression "(code *)PTR_strlen_000adc28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "pvVar2 = safemalloc(iVar1 + 1,1);" (assignment_expression "pvVar2 = safemalloc(iVar1 + 1,1)" identifier = (call_expression "safemalloc(iVar1 + 1,1)" identifier (argument_list "(iVar1 + 1,1)" ( (binary_expression "iVar1 + 1" identifier + number_literal) , number_literal )))) ;) (expression_statement "pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s)" identifier = (cast_expression "(char *)(*(code *)PTR_strcpy_000adc74)(pvVar2,s)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_strcpy_000adc74)(pvVar2,s)" (parenthesized_expression "(*(code *)PTR_strcpy_000adc74)" ( (pointer_expression "*(code *)PTR_strcpy_000adc74" * (cast_expression "(code *)PTR_strcpy_000adc74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pvVar2,s)" ( identifier , identifier ))))) ;) (return_statement "return pcVar3;" return identifier ;) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "undefined4 dupstr(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 dupstr(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" type_identifier (function_declarator "dupstr(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (if_statement "if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_strlen_000adc28)();" (assignment_expression "iVar1 = (*(code *)PTR_strlen_000adc28)()" identifier = (call_expression "(*(code *)PTR_strlen_000adc28)()" (parenthesized_expression "(*(code *)PTR_strlen_000adc28)" ( (pointer_expression "*(code *)PTR_strlen_000adc28" * (cast_expression "(code *)PTR_strlen_000adc28" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "uVar2 = safemalloc(iVar1 + 1,1);" (assignment_expression "uVar2 = safemalloc(iVar1 + 1,1)" identifier = (call_expression "safemalloc(iVar1 + 1,1)" identifier (argument_list "(iVar1 + 1,1)" ( (binary_expression "iVar1 + 1" identifier + number_literal) , number_literal )))) ;) (expression_statement "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);" (assignment_expression "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" identifier = (call_expression "(*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_000adc74)" ( (pointer_expression "*(code *)PTR_strcpy_000adc74" * (cast_expression "(code *)PTR_strcpy_000adc74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar2,param_1)" ( identifier , identifier )))) ;) (return_statement "return uVar2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT )))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "undefined4 dupstr(int param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "dupstr(int param_1)" (identifier "dupstr") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (if_statement "if (param_1 != 0) {\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" (if "if") (parenthesized_expression "(param_1 != 0)" (( "(") (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = (*(code *)PTR_strlen_000adc28)();\n    uVar2 = safemalloc(iVar1 + 1,1);\n    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);\n    return uVar2;\n  }" ({ "{") (expression_statement "iVar1 = (*(code *)PTR_strlen_000adc28)();" (assignment_expression "iVar1 = (*(code *)PTR_strlen_000adc28)()" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_strlen_000adc28)()" (parenthesized_expression "(*(code *)PTR_strlen_000adc28)" (( "(") (pointer_expression "*(code *)PTR_strlen_000adc28" (* "*") (cast_expression "(code *)PTR_strlen_000adc28" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_000adc28"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "uVar2 = safemalloc(iVar1 + 1,1);" (assignment_expression "uVar2 = safemalloc(iVar1 + 1,1)" (identifier "uVar2") (= "=") (call_expression "safemalloc(iVar1 + 1,1)" (identifier "safemalloc") (argument_list "(iVar1 + 1,1)" (( "(") (binary_expression "iVar1 + 1" (identifier "iVar1") (+ "+") (number_literal "1")) (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);" (assignment_expression "uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" (identifier "uVar2") (= "=") (call_expression "(*(code *)PTR_strcpy_000adc74)(uVar2,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_000adc74)" (( "(") (pointer_expression "*(code *)PTR_strcpy_000adc74" (* "*") (cast_expression "(code *)PTR_strcpy_000adc74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strcpy_000adc74"))) () ")")) (argument_list "(uVar2,param_1)" (( "(") (identifier "uVar2") (, ",") (identifier "param_1") () ")")))) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

char * function_1(char *var_1)

{
  int var_3;
  void *pvVar2;
  char *pcVar3;
  
  if (var_1 != (char *)0x0) {
    var_3 = (*(type_1 *)PTR_strlen_000adc28)();
    pvVar2 = var_2(var_3 + 1,1);
    pcVar3 = (char *)(*(type_1 *)PTR_strcpy_000adc74)(pvVar2,var_1);
    return pcVar3;
  }
  return (char *)0x0;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (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)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (number_literal))))) (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))))) (return_statement (identifier)))) (return_statement (number_literal)))))

undefined4 MASKED(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  if (param_1 != 0) {
    iVar1 = (*(code *)PTR_strlen_000adc28)();
    uVar2 = safemalloc(iVar1 + 1,1);
    uVar2 = (*(code *)PTR_strcpy_000adc74)(uVar2,param_1);
    return uVar2;
  }
  return 0;
}

