
/* WARNING: Unknown calling convention */

int re_string_char_size_at(re_string_t *pstr,Idx idx)

{
  wint_t *pwVar1;
  int iVar2;
  wint_t *pwVar3;
  
  if (idx + 1 < pstr->valid_len) {
    if (pstr->wcs[idx + 1] == 0xffffffff) {
      iVar2 = 1;
      pwVar3 = pstr->wcs + idx;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == pstr->valid_len - idx) {
          return iVar2;
        }
        pwVar1 = pwVar3 + 2;
        pwVar3 = pwVar3 + 1;
      } while (*pwVar1 == 0xffffffff);
      return iVar2;
    }
  }
  return 1;
}



int FUN_00480cd8(int param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = (param_2 + 1) * 4;
  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {
    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {
      iVar2 = 1;
      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {
          return iVar2;
        }
        piVar1 = (int *)(iVar3 + 8);
        iVar3 = iVar3 + 4;
      } while (*piVar1 == -1);
      return iVar2;
    }
  }
  return 1;
}


lw v0,0x1c(a0)
addiu a2,a1,0x1
slt v1,a2,v0
beq v1,zero,0x00480d38
_sll a2,a2,0x2
lw v1,0x8(a0)
li a0,-0x1
addu a3,v1,a2
lw a3,0x0(a3)
bne a3,a0,0x00480d38
_addiu a2,a2,-0x4
subu a1,v0,a1
addu v1,v1,a2
li v0,0x1
b 0x00480d24
_li a2,-0x1
lw a0,0x4(v1)
bne a0,a2,0x00480d30
_nop
addiu v0,v0,0x1
bne v0,a1,0x00480d18
_addiu v1,v1,0x4
jr ra
_nop
jr ra
_li v0,0x1
(translation_unit "int FUN_00480cd8(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}\n\n" (function_definition "int FUN_00480cd8(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" primitive_type (function_declarator "FUN_00480cd8(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 identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = (param_2 + 1) * 4;" (assignment_expression "iVar3 = (param_2 + 1) * 4" identifier = (binary_expression "(param_2 + 1) * 4" (parenthesized_expression "(param_2 + 1)" ( (binary_expression "param_2 + 1" identifier + number_literal) )) * number_literal)) ;) (if_statement "if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(param_2 + 1 < *(int *)(param_1 + 0x1c))" ( (binary_expression "param_2 + 1 < *(int *)(param_1 + 0x1c)" (binary_expression "param_2 + 1" identifier + number_literal) < (pointer_expression "*(int *)(param_1 + 0x1c)" * (cast_expression "(int *)(param_1 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) )) (compound_statement "{\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" { (if_statement "if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" if (parenthesized_expression "(*(int *)(*(int *)(param_1 + 8) + iVar3) == -1)" ( (binary_expression "*(int *)(*(int *)(param_1 + 8) + iVar3) == -1" (pointer_expression "*(int *)(*(int *)(param_1 + 8) + iVar3)" * (cast_expression "(int *)(*(int *)(param_1 + 8) + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 8) + iVar3)" ( (binary_expression "*(int *)(param_1 + 8) + iVar3" (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) )))) == number_literal) )) (compound_statement "{\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" { (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (expression_statement "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;" (assignment_expression "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4" identifier = (binary_expression "*(int *)(param_1 + 8) + iVar3 + -4" (binary_expression "*(int *)(param_1 + 8) + iVar3" (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) + number_literal)) ;) (do_statement "do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);" do (compound_statement "{\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }" if (parenthesized_expression "(iVar2 == *(int *)(param_1 + 0x1c) - param_2)" ( (binary_expression "iVar2 == *(int *)(param_1 + 0x1c) - param_2" identifier == (binary_expression "*(int *)(param_1 + 0x1c) - param_2" (pointer_expression "*(int *)(param_1 + 0x1c)" * (cast_expression "(int *)(param_1 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) - identifier)) )) (compound_statement "{\n          return iVar2;\n        }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "piVar1 = (int *)(iVar3 + 8);" (assignment_expression "piVar1 = (int *)(iVar3 + 8)" identifier = (cast_expression "(int *)(iVar3 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 8)" ( (binary_expression "iVar3 + 8" identifier + number_literal) )))) ;) (expression_statement "iVar3 = iVar3 + 4;" (assignment_expression "iVar3 = iVar3 + 4" identifier = (binary_expression "iVar3 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(*piVar1 == -1)" ( (binary_expression "*piVar1 == -1" (pointer_expression "*piVar1" * identifier) == number_literal) )) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint re_string_char_size_at(re_string_t *pstr,Idx idx)\n\n{\n  wint_t *pwVar1;\n  int iVar2;\n  wint_t *pwVar3;\n  \n  if (idx + 1 < pstr->valid_len) {\n    if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }\n  }\n  return 1;\n}\n\n" comment (function_definition "int re_string_char_size_at(re_string_t *pstr,Idx idx)\n\n{\n  wint_t *pwVar1;\n  int iVar2;\n  wint_t *pwVar3;\n  \n  if (idx + 1 < pstr->valid_len) {\n    if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }\n  }\n  return 1;\n}" primitive_type (function_declarator "re_string_char_size_at(re_string_t *pstr,Idx idx)" identifier (parameter_list "(re_string_t *pstr,Idx idx)" ( (parameter_declaration "re_string_t *pstr" type_identifier (pointer_declarator "*pstr" * identifier)) , (parameter_declaration "Idx idx" type_identifier identifier) ))) (compound_statement "{\n  wint_t *pwVar1;\n  int iVar2;\n  wint_t *pwVar3;\n  \n  if (idx + 1 < pstr->valid_len) {\n    if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }\n  }\n  return 1;\n}" { (declaration "wint_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wint_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (if_statement "if (idx + 1 < pstr->valid_len) {\n    if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(idx + 1 < pstr->valid_len)" ( (binary_expression "idx + 1 < pstr->valid_len" (binary_expression "idx + 1" identifier + number_literal) < (field_expression "pstr->valid_len" identifier -> field_identifier)) )) (compound_statement "{\n    if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }\n  }" { (if_statement "if (pstr->wcs[idx + 1] == 0xffffffff) {\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }" if (parenthesized_expression "(pstr->wcs[idx + 1] == 0xffffffff)" ( (binary_expression "pstr->wcs[idx + 1] == 0xffffffff" (subscript_expression "pstr->wcs[idx + 1]" (field_expression "pstr->wcs" identifier -> field_identifier) [ (binary_expression "idx + 1" identifier + number_literal) ]) == number_literal) )) (compound_statement "{\n      iVar2 = 1;\n      pwVar3 = pstr->wcs + idx;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);\n      return iVar2;\n    }" { (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (expression_statement "pwVar3 = pstr->wcs + idx;" (assignment_expression "pwVar3 = pstr->wcs + idx" identifier = (binary_expression "pstr->wcs + idx" (field_expression "pstr->wcs" identifier -> field_identifier) + identifier)) ;) (do_statement "do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      } while (*pwVar1 == 0xffffffff);" do (compound_statement "{\n        iVar2 = iVar2 + 1;\n        if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }\n        pwVar1 = pwVar3 + 2;\n        pwVar3 = pwVar3 + 1;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == pstr->valid_len - idx) {\n          return iVar2;\n        }" if (parenthesized_expression "(iVar2 == pstr->valid_len - idx)" ( (binary_expression "iVar2 == pstr->valid_len - idx" identifier == (binary_expression "pstr->valid_len - idx" (field_expression "pstr->valid_len" identifier -> field_identifier) - identifier)) )) (compound_statement "{\n          return iVar2;\n        }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "pwVar1 = pwVar3 + 2;" (assignment_expression "pwVar1 = pwVar3 + 2" identifier = (binary_expression "pwVar3 + 2" identifier + number_literal)) ;) (expression_statement "pwVar3 = pwVar3 + 1;" (assignment_expression "pwVar3 = pwVar3 + 1" identifier = (binary_expression "pwVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(*pwVar1 == 0xffffffff)" ( (binary_expression "*pwVar1 == 0xffffffff" (pointer_expression "*pwVar1" * identifier) == number_literal) )) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "int FUN_00480cd8(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}\n\n" (function_definition "int FUN_00480cd8(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" primitive_type (function_declarator "FUN_00480cd8(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 identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = (param_2 + 1) * 4;" (assignment_expression "iVar3 = (param_2 + 1) * 4" identifier = (binary_expression "(param_2 + 1) * 4" (parenthesized_expression "(param_2 + 1)" ( (binary_expression "param_2 + 1" identifier + number_literal) )) * number_literal)) ;) (if_statement "if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(param_2 + 1 < *(int *)(param_1 + 0x1c))" ( (binary_expression "param_2 + 1 < *(int *)(param_1 + 0x1c)" (binary_expression "param_2 + 1" identifier + number_literal) < (pointer_expression "*(int *)(param_1 + 0x1c)" * (cast_expression "(int *)(param_1 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) )) (compound_statement "{\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" { (if_statement "if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" if (parenthesized_expression "(*(int *)(*(int *)(param_1 + 8) + iVar3) == -1)" ( (binary_expression "*(int *)(*(int *)(param_1 + 8) + iVar3) == -1" (pointer_expression "*(int *)(*(int *)(param_1 + 8) + iVar3)" * (cast_expression "(int *)(*(int *)(param_1 + 8) + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 8) + iVar3)" ( (binary_expression "*(int *)(param_1 + 8) + iVar3" (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) )))) == number_literal) )) (compound_statement "{\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" { (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (expression_statement "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;" (assignment_expression "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4" identifier = (binary_expression "*(int *)(param_1 + 8) + iVar3 + -4" (binary_expression "*(int *)(param_1 + 8) + iVar3" (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) + number_literal)) ;) (do_statement "do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);" do (compound_statement "{\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }" if (parenthesized_expression "(iVar2 == *(int *)(param_1 + 0x1c) - param_2)" ( (binary_expression "iVar2 == *(int *)(param_1 + 0x1c) - param_2" identifier == (binary_expression "*(int *)(param_1 + 0x1c) - param_2" (pointer_expression "*(int *)(param_1 + 0x1c)" * (cast_expression "(int *)(param_1 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) - identifier)) )) (compound_statement "{\n          return iVar2;\n        }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "piVar1 = (int *)(iVar3 + 8);" (assignment_expression "piVar1 = (int *)(iVar3 + 8)" identifier = (cast_expression "(int *)(iVar3 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 8)" ( (binary_expression "iVar3 + 8" identifier + number_literal) )))) ;) (expression_statement "iVar3 = iVar3 + 4;" (assignment_expression "iVar3 = iVar3 + 4" identifier = (binary_expression "iVar3 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(*piVar1 == -1)" ( (binary_expression "*piVar1 == -1" (pointer_expression "*piVar1" * identifier) == number_literal) )) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) * LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) )))) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) + LIT)) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) ;) (return_statement return IDENT ;) })) })) (return_statement return LIT ;) })))
(function_definition "int FUN_00480cd8(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" (primitive_type "int") (function_declarator "FUN_00480cd8(int param_1,int param_2)" (identifier "FUN_00480cd8") (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") (identifier "param_2")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = (param_2 + 1) * 4;\n  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }\n  return 1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar3 = (param_2 + 1) * 4;" (assignment_expression "iVar3 = (param_2 + 1) * 4" (identifier "iVar3") (= "=") (binary_expression "(param_2 + 1) * 4" (parenthesized_expression "(param_2 + 1)" (( "(") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1")) () ")")) (* "*") (number_literal "4"))) (; ";")) (if_statement "if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" (if "if") (parenthesized_expression "(param_2 + 1 < *(int *)(param_1 + 0x1c))" (( "(") (binary_expression "param_2 + 1 < *(int *)(param_1 + 0x1c)" (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1")) (< "<") (pointer_expression "*(int *)(param_1 + 0x1c)" (* "*") (cast_expression "(int *)(param_1 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")"))))) () ")")) (compound_statement "{\n    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }\n  }" ({ "{") (if_statement "if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(*(int *)(*(int *)(param_1 + 8) + iVar3) == -1)" (( "(") (binary_expression "*(int *)(*(int *)(param_1 + 8) + iVar3) == -1" (pointer_expression "*(int *)(*(int *)(param_1 + 8) + iVar3)" (* "*") (cast_expression "(int *)(*(int *)(param_1 + 8) + iVar3)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(param_1 + 8) + iVar3)" (( "(") (binary_expression "*(int *)(param_1 + 8) + iVar3" (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 "iVar3")) () ")")))) (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      iVar2 = 1;\n      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;\n      do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);\n      return iVar2;\n    }" ({ "{") (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" (identifier "iVar2") (= "=") (number_literal "1")) (; ";")) (expression_statement "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;" (assignment_expression "iVar3 = *(int *)(param_1 + 8) + iVar3 + -4" (identifier "iVar3") (= "=") (binary_expression "*(int *)(param_1 + 8) + iVar3 + -4" (binary_expression "*(int *)(param_1 + 8) + iVar3" (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 "iVar3")) (+ "+") (number_literal "-4"))) (; ";")) (do_statement "do {\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      } while (*piVar1 == -1);" (do "do") (compound_statement "{\n        iVar2 = iVar2 + 1;\n        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }\n        piVar1 = (int *)(iVar3 + 8);\n        iVar3 = iVar3 + 4;\n      }" ({ "{") (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {\n          return iVar2;\n        }" (if "if") (parenthesized_expression "(iVar2 == *(int *)(param_1 + 0x1c) - param_2)" (( "(") (binary_expression "iVar2 == *(int *)(param_1 + 0x1c) - param_2" (identifier "iVar2") (== "==") (binary_expression "*(int *)(param_1 + 0x1c) - param_2" (pointer_expression "*(int *)(param_1 + 0x1c)" (* "*") (cast_expression "(int *)(param_1 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (- "-") (identifier "param_2"))) () ")")) (compound_statement "{\n          return iVar2;\n        }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "piVar1 = (int *)(iVar3 + 8);" (assignment_expression "piVar1 = (int *)(iVar3 + 8)" (identifier "piVar1") (= "=") (cast_expression "(int *)(iVar3 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 8)" (( "(") (binary_expression "iVar3 + 8" (identifier "iVar3") (+ "+") (number_literal "8")) () ")")))) (; ";")) (expression_statement "iVar3 = iVar3 + 4;" (assignment_expression "iVar3 = iVar3 + 4" (identifier "iVar3") (= "=") (binary_expression "iVar3 + 4" (identifier "iVar3") (+ "+") (number_literal "4"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*piVar1 == -1)" (( "(") (binary_expression "*piVar1 == -1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (== "==") (number_literal "-1")) () ")")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (} "}"))) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(type_1 *pstr,type_2 var_1)

{
  type_3 *pwVar1;
  int var_2;
  type_3 *var_3;
  
  if (var_1 + 1 < pstr->valid_len) {
    if (pstr->wcs[var_1 + 1] == 0xffffffff) {
      var_2 = 1;
      var_3 = pstr->wcs + var_1;
      do {
        var_2 = var_2 + 1;
        if (var_2 == pstr->valid_len - var_1) {
          return var_2;
        }
        pwVar1 = var_3 + 2;
        var_3 = var_3 + 1;
      } while (*pwVar1 == 0xffffffff);
      return var_2;
    }
  }
  return 1;
}


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

int MASKED(int param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = (param_2 + 1) * 4;
  if (param_2 + 1 < *(int *)(param_1 + 0x1c)) {
    if (*(int *)(*(int *)(param_1 + 8) + iVar3) == -1) {
      iVar2 = 1;
      iVar3 = *(int *)(param_1 + 8) + iVar3 + -4;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == *(int *)(param_1 + 0x1c) - param_2) {
          return iVar2;
        }
        piVar1 = (int *)(iVar3 + 8);
        iVar3 = iVar3 + 4;
      } while (*piVar1 == -1);
      return iVar2;
    }
  }
  return 1;
}

