
/* WARNING: Unknown calling convention */

char * freadptr(FILE *fp,size_t *sizep)

{
  char *pcVar1;
  size_t sVar2;
  
  if (fp->_IO_write_base < fp->_IO_write_ptr) {
    return (char *)0x0;
  }
  pcVar1 = fp->_IO_read_ptr;
  sVar2 = (int)fp->_IO_read_end - (int)pcVar1;
  if (sVar2 != 0) {
    *sizep = sVar2;
    return pcVar1;
  }
  return (char *)0x0;
}



int freadptr(int param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  
  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {
    return 0;
  }
  iVar1 = *(int *)(param_1 + 4);
  iVar2 = *(int *)(param_1 + 8) - iVar1;
  if (iVar2 != 0) {
    *param_2 = iVar2;
    return iVar1;
  }
  return 0;
}


lw v0,0x14(a0)
lw v1,0x10(a0)
sltu v0,v1,v0
bne v0,zero,0x000176a0
_nop
lw v0,0x4(a0)
lw v1,0x8(a0)
subu v1,v1,v0
beq v1,zero,0x000176a8
_nop
jr ra
_sw v1,0x0(a1)
jr ra
_or v0,zero,zero
jr ra
_or v0,zero,zero
(translation_unit "int freadptr(int param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}\n\n" (function_definition "int freadptr(int param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" primitive_type (function_declarator "freadptr(int param_1,int *param_2)" identifier (parameter_list "(int param_1,int *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14))" ( (binary_expression "*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)" (pointer_expression "*(uint *)(param_1 + 0x10)" * (cast_expression "(uint *)(param_1 + 0x10)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) < (pointer_expression "*(uint *)(param_1 + 0x14)" * (cast_expression "(uint *)(param_1 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = *(int *)(param_1 + 4);" (assignment_expression "iVar1 = *(int *)(param_1 + 4)" identifier = (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 8) - iVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - iVar1" identifier = (binary_expression "*(int *)(param_1 + 8) - iVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    *param_2 = iVar2;\n    return iVar1;\n  }" { (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nchar * freadptr(FILE *fp,size_t *sizep)\n\n{\n  char *pcVar1;\n  size_t sVar2;\n  \n  if (fp->_IO_write_base < fp->_IO_write_ptr) {\n    return (char *)0x0;\n  }\n  pcVar1 = fp->_IO_read_ptr;\n  sVar2 = (int)fp->_IO_read_end - (int)pcVar1;\n  if (sVar2 != 0) {\n    *sizep = sVar2;\n    return pcVar1;\n  }\n  return (char *)0x0;\n}\n\n" comment (function_definition "char * freadptr(FILE *fp,size_t *sizep)\n\n{\n  char *pcVar1;\n  size_t sVar2;\n  \n  if (fp->_IO_write_base < fp->_IO_write_ptr) {\n    return (char *)0x0;\n  }\n  pcVar1 = fp->_IO_read_ptr;\n  sVar2 = (int)fp->_IO_read_end - (int)pcVar1;\n  if (sVar2 != 0) {\n    *sizep = sVar2;\n    return pcVar1;\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* freadptr(FILE *fp,size_t *sizep)" * (function_declarator "freadptr(FILE *fp,size_t *sizep)" identifier (parameter_list "(FILE *fp,size_t *sizep)" ( (parameter_declaration "FILE *fp" type_identifier (pointer_declarator "*fp" * identifier)) , (parameter_declaration "size_t *sizep" primitive_type (pointer_declarator "*sizep" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  size_t sVar2;\n  \n  if (fp->_IO_write_base < fp->_IO_write_ptr) {\n    return (char *)0x0;\n  }\n  pcVar1 = fp->_IO_read_ptr;\n  sVar2 = (int)fp->_IO_read_end - (int)pcVar1;\n  if (sVar2 != 0) {\n    *sizep = sVar2;\n    return pcVar1;\n  }\n  return (char *)0x0;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (if_statement "if (fp->_IO_write_base < fp->_IO_write_ptr) {\n    return (char *)0x0;\n  }" if (parenthesized_expression "(fp->_IO_write_base < fp->_IO_write_ptr)" ( (binary_expression "fp->_IO_write_base < fp->_IO_write_ptr" (field_expression "fp->_IO_write_base" identifier -> field_identifier) < (field_expression "fp->_IO_write_ptr" identifier -> field_identifier)) )) (compound_statement "{\n    return (char *)0x0;\n  }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar1 = fp->_IO_read_ptr;" (assignment_expression "pcVar1 = fp->_IO_read_ptr" identifier = (field_expression "fp->_IO_read_ptr" identifier -> field_identifier)) ;) (expression_statement "sVar2 = (int)fp->_IO_read_end - (int)pcVar1;" (assignment_expression "sVar2 = (int)fp->_IO_read_end - (int)pcVar1" identifier = (binary_expression "(int)fp->_IO_read_end - (int)pcVar1" (cast_expression "(int)fp->_IO_read_end" ( (type_descriptor "int" primitive_type) ) (field_expression "fp->_IO_read_end" identifier -> field_identifier)) - (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (sVar2 != 0) {\n    *sizep = sVar2;\n    return pcVar1;\n  }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    *sizep = sVar2;\n    return pcVar1;\n  }" { (expression_statement "*sizep = sVar2;" (assignment_expression "*sizep = sVar2" (pointer_expression "*sizep" * identifier) = identifier) ;) (return_statement "return pcVar1;" return identifier ;) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int freadptr(int param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}\n\n" (function_definition "int freadptr(int param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" primitive_type (function_declarator "freadptr(int param_1,int *param_2)" identifier (parameter_list "(int param_1,int *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14))" ( (binary_expression "*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)" (pointer_expression "*(uint *)(param_1 + 0x10)" * (cast_expression "(uint *)(param_1 + 0x10)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) < (pointer_expression "*(uint *)(param_1 + 0x14)" * (cast_expression "(uint *)(param_1 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = *(int *)(param_1 + 4);" (assignment_expression "iVar1 = *(int *)(param_1 + 4)" identifier = (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 8) - iVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - iVar1" identifier = (binary_expression "*(int *)(param_1 + 8) - iVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    *param_2 = iVar2;\n    return iVar1;\n  }" { (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "int freadptr(int param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "freadptr(int param_1,int *param_2)" (identifier "freadptr") (parameter_list "(int param_1,int *param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }\n  iVar1 = *(int *)(param_1 + 4);\n  iVar2 = *(int *)(param_1 + 8) - iVar1;\n  if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14))" (( "(") (binary_expression "*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)" (pointer_expression "*(uint *)(param_1 + 0x10)" (* "*") (cast_expression "(uint *)(param_1 + 0x10)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (< "<") (pointer_expression "*(uint *)(param_1 + 0x14)" (* "*") (cast_expression "(uint *)(param_1 + 0x14)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar1 = *(int *)(param_1 + 4);" (assignment_expression "iVar1 = *(int *)(param_1 + 4)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "iVar2 = *(int *)(param_1 + 8) - iVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - iVar1" (identifier "iVar2") (= "=") (binary_expression "*(int *)(param_1 + 8) - iVar1" (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (- "-") (identifier "iVar1"))) (; ";")) (if_statement "if (iVar2 != 0) {\n    *param_2 = iVar2;\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    *param_2 = iVar2;\n    return iVar1;\n  }" ({ "{") (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "iVar2")) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))
(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (return_statement (identifier)))) (return_statement (number_literal)))))

int MASKED(int param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  
  if (*(uint *)(param_1 + 0x10) < *(uint *)(param_1 + 0x14)) {
    return 0;
  }
  iVar1 = *(int *)(param_1 + 4);
  iVar2 = *(int *)(param_1 + 8) - iVar1;
  if (iVar2 != 0) {
    *param_2 = iVar2;
    return iVar1;
  }
  return 0;
}

