
int findIndexOfRun(uchar *level,int start,int count,int tlevel)

{
  byte bVar1;
  
  if (start < count) {
    bVar1 = level[start];
    while( true ) {
      if (tlevel == (uint)bVar1) {
        return start;
      }
      start = start + 1;
      if (count == start) break;
      bVar1 = level[start];
    }
  }
  return count;
}



int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)

{
  byte bVar1;
  
  if (param_2 < param_3) {
    bVar1 = *(byte *)(param_1 + param_2);
    while( true ) {
      if (param_4 == bVar1) {
        return param_2;
      }
      param_2 = param_2 + 1;
      if (param_3 == param_2) break;
      bVar1 = *(byte *)(param_1 + param_2);
    }
  }
  return param_3;
}


PUSH ESI
PUSH EBX
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x14]
MOV ESI,dword ptr [ESP + 0xc]
MOV EBX,dword ptr [ESP + 0x18]
CMP EDX,EAX
JGE 0x0002c1bf
MOVZX ECX,byte ptr [ESI + EDX*0x1]
CMP EBX,ECX
JNZ 0x0002c1b8
JMP 0x0002c1c8
MOVZX ECX,byte ptr [ESI + EDX*0x1]
CMP ECX,EBX
JZ 0x0002c1c8
ADD EDX,0x1
CMP EAX,EDX
JNZ 0x0002c1b0
POP EBX
POP ESI
RET
MOV EAX,EDX
POP EBX
POP ESI
RET
(translation_unit "int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)\n\n{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}\n\n" (function_definition "int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)\n\n{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" primitive_type (function_declarator "FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,uint param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (if_statement "if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" { (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" identifier = (pointer_expression "*(byte *)(param_1 + param_2)" * (cast_expression "(byte *)(param_1 + param_2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) ))))) ;) (while_statement "while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" { (if_statement "if (param_4 == bVar1) {\n        return param_2;\n      }" if (parenthesized_expression "(param_4 == bVar1)" ( (binary_expression "param_4 == bVar1" identifier == identifier) )) (compound_statement "{\n        return param_2;\n      }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (if_statement "if (param_3 == param_2) break;" if (parenthesized_expression "(param_3 == param_2)" ( (binary_expression "param_3 == param_2" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" identifier = (pointer_expression "*(byte *)(param_1 + param_2)" * (cast_expression "(byte *)(param_1 + param_2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) ))))) ;) })) })) (return_statement "return param_3;" return identifier ;) })))
(translation_unit "int findIndexOfRun(uchar *level,int start,int count,int tlevel)\n\n{\n  byte bVar1;\n  \n  if (start < count) {\n    bVar1 = level[start];\n    while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }\n  }\n  return count;\n}\n\n" (function_definition "int findIndexOfRun(uchar *level,int start,int count,int tlevel)\n\n{\n  byte bVar1;\n  \n  if (start < count) {\n    bVar1 = level[start];\n    while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }\n  }\n  return count;\n}" primitive_type (function_declarator "findIndexOfRun(uchar *level,int start,int count,int tlevel)" identifier (parameter_list "(uchar *level,int start,int count,int tlevel)" ( (parameter_declaration "uchar *level" type_identifier (pointer_declarator "*level" * identifier)) , (parameter_declaration "int start" primitive_type identifier) , (parameter_declaration "int count" primitive_type identifier) , (parameter_declaration "int tlevel" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  \n  if (start < count) {\n    bVar1 = level[start];\n    while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }\n  }\n  return count;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (if_statement "if (start < count) {\n    bVar1 = level[start];\n    while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }\n  }" if (parenthesized_expression "(start < count)" ( (binary_expression "start < count" identifier < identifier) )) (compound_statement "{\n    bVar1 = level[start];\n    while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }\n  }" { (expression_statement "bVar1 = level[start];" (assignment_expression "bVar1 = level[start]" identifier = (subscript_expression "level[start]" identifier [ identifier ])) ;) (while_statement "while( true ) {\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (tlevel == (uint)bVar1) {\n        return start;\n      }\n      start = start + 1;\n      if (count == start) break;\n      bVar1 = level[start];\n    }" { (if_statement "if (tlevel == (uint)bVar1) {\n        return start;\n      }" if (parenthesized_expression "(tlevel == (uint)bVar1)" ( (binary_expression "tlevel == (uint)bVar1" identifier == (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) )) (compound_statement "{\n        return start;\n      }" { (return_statement "return start;" return identifier ;) })) (expression_statement "start = start + 1;" (assignment_expression "start = start + 1" identifier = (binary_expression "start + 1" identifier + number_literal)) ;) (if_statement "if (count == start) break;" if (parenthesized_expression "(count == start)" ( (binary_expression "count == start" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "bVar1 = level[start];" (assignment_expression "bVar1 = level[start]" identifier = (subscript_expression "level[start]" identifier [ identifier ])) ;) })) })) (return_statement "return count;" return identifier ;) })))
(translation_unit "int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)\n\n{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}\n\n" (function_definition "int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)\n\n{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" primitive_type (function_declarator "FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,uint param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (if_statement "if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" { (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" identifier = (pointer_expression "*(byte *)(param_1 + param_2)" * (cast_expression "(byte *)(param_1 + param_2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) ))))) ;) (while_statement "while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" { (if_statement "if (param_4 == bVar1) {\n        return param_2;\n      }" if (parenthesized_expression "(param_4 == bVar1)" ( (binary_expression "param_4 == bVar1" identifier == identifier) )) (compound_statement "{\n        return param_2;\n      }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (if_statement "if (param_3 == param_2) break;" if (parenthesized_expression "(param_3 == param_2)" ( (binary_expression "param_3 == param_2" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" identifier = (pointer_expression "*(byte *)(param_1 + param_2)" * (cast_expression "(byte *)(param_1 + param_2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) ))))) ;) })) })) (return_statement "return param_3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)\n\n{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" (primitive_type "int") (function_declarator "FUN_0002c190(int param_1,int param_2,int param_3,uint param_4)" (identifier "FUN_0002c190") (parameter_list "(int param_1,int param_2,int param_3,uint param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  byte bVar1;\n  \n  if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }\n  return param_3;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (if_statement "if (param_2 < param_3) {\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    bVar1 = *(byte *)(param_1 + param_2);\n    while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }\n  }" ({ "{") (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" (identifier "bVar1") (= "=") (pointer_expression "*(byte *)(param_1 + param_2)" (* "*") (cast_expression "(byte *)(param_1 + param_2)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + param_2)" (( "(") (binary_expression "param_1 + param_2" (identifier "param_1") (+ "+") (identifier "param_2")) () ")"))))) (; ";")) (while_statement "while( true ) {\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      if (param_4 == bVar1) {\n        return param_2;\n      }\n      param_2 = param_2 + 1;\n      if (param_3 == param_2) break;\n      bVar1 = *(byte *)(param_1 + param_2);\n    }" ({ "{") (if_statement "if (param_4 == bVar1) {\n        return param_2;\n      }" (if "if") (parenthesized_expression "(param_4 == bVar1)" (( "(") (binary_expression "param_4 == bVar1" (identifier "param_4") (== "==") (identifier "bVar1")) () ")")) (compound_statement "{\n        return param_2;\n      }" ({ "{") (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (param_3 == param_2) break;" (if "if") (parenthesized_expression "(param_3 == param_2)" (( "(") (binary_expression "param_3 == param_2" (identifier "param_3") (== "==") (identifier "param_2")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "bVar1 = *(byte *)(param_1 + param_2);" (assignment_expression "bVar1 = *(byte *)(param_1 + param_2)" (identifier "bVar1") (= "=") (pointer_expression "*(byte *)(param_1 + param_2)" (* "*") (cast_expression "(byte *)(param_1 + param_2)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + param_2)" (( "(") (binary_expression "param_1 + param_2" (identifier "param_1") (+ "+") (identifier "param_2")) () ")"))))) (; ";")) (} "}"))) (} "}"))) (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}")))

int function_1(type_1 *level,int var_1,int var_2,int var_3)

{
  type_2 bVar1;
  
  if (var_1 < var_2) {
    bVar1 = level[var_1];
    while( true ) {
      if (var_3 == (type_3)bVar1) {
        return var_1;
      }
      var_1 = var_1 + 1;
      if (var_2 == var_1) break;
      bVar1 = level[var_1];
    }
  }
  return var_2;
}


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

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

{
  byte bVar1;
  
  if (param_2 < param_3) {
    bVar1 = *(byte *)(param_1 + param_2);
    while( true ) {
      if (param_4 == bVar1) {
        return param_2;
      }
      param_2 = param_2 + 1;
      if (param_3 == param_2) break;
      bVar1 = *(byte *)(param_1 + param_2);
    }
  }
  return param_3;
}

