
size_t hash_get_entries(Hash_table *table,void **buffer,size_t buffer_size)

{
  uint uVar1;
  uint uVar2;
  hash_entry *phVar3;
  hash_entry *phVar4;
  
  phVar3 = table->bucket;
  phVar4 = table->bucket_limit;
  uVar1 = 0;
  uVar2 = uVar1;
  if (phVar3 < phVar4) {
    do {
      uVar1 = uVar2;
      if (phVar3->data != (void *)0x0) {
        if (buffer_size <= uVar2) {
          return uVar2;
        }
        buffer[uVar2] = phVar3->data;
        phVar4 = phVar3->next;
        uVar1 = uVar2 + 1;
        if (phVar4 == (hash_entry *)0x0) {
          phVar4 = table->bucket_limit;
        }
        else {
          if (buffer_size <= uVar1) {
            return uVar1;
          }
          buffer[uVar1] = phVar4->data;
          uVar1 = uVar2 + 2;
          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {
            if (buffer_size == uVar1) {
              return buffer_size;
            }
            buffer[uVar1] = phVar4->data;
            uVar1 = uVar1 + 1;
          }
          phVar4 = table->bucket_limit;
        }
      }
      phVar3 = phVar3 + 1;
      uVar2 = uVar1;
    } while (phVar3 < phVar4);
  }
  return uVar1;
}



uint FUN_00012c20(uint *param_1,int param_2,uint param_3)

{
  undefined4 *puVar1;
  uint uVar2;
  uint uVar3;
  int *piVar4;
  int *piVar5;
  
  piVar4 = (int *)*param_1;
  piVar5 = (int *)param_1[1];
  uVar2 = 0;
  uVar3 = uVar2;
  if (piVar4 < piVar5) {
    do {
      uVar2 = uVar3;
      if (*piVar4 != 0) {
        if (param_3 <= uVar3) {
          return uVar3;
        }
        *(int *)(param_2 + uVar3 * 4) = *piVar4;
        puVar1 = (undefined4 *)piVar4[1];
        uVar2 = uVar3 + 1;
        if (puVar1 == (undefined4 *)0x0) {
          piVar5 = (int *)param_1[1];
        }
        else {
          if (param_3 <= uVar2) {
            return uVar2;
          }
          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;
          uVar2 = uVar3 + 2;
          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;
              puVar1 = (undefined4 *)puVar1[1]) {
            if (param_3 == uVar2) {
              return param_3;
            }
            uVar2 = uVar2 + 1;
            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;
          }
          piVar5 = (int *)param_1[1];
        }
      }
      piVar4 = piVar4 + 2;
      uVar3 = uVar2;
    } while (piVar4 < piVar5);
  }
  return uVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
MOV EAX,dword ptr [ESP + 0x14]
MOV EBX,dword ptr [ESP + 0x18]
MOV EDX,dword ptr [ESP + 0x1c]
MOV ECX,dword ptr [EAX]
MOV EDI,dword ptr [EAX + 0x4]
XOR EAX,EAX
CMP EDI,ECX
JBE 0x00012c48
MOV ESI,dword ptr [ECX]
TEST ESI,ESI
JNZ 0x00012c50
ADD ECX,0x8
CMP ECX,EDI
JC 0x00012c3b
POP EBX
POP ESI
POP EDI
POP EBP
RET
CMP EDX,EAX
JBE 0x00012c48
MOV dword ptr [EBX + EAX*0x4],ESI
MOV ESI,dword ptr [ECX + 0x4]
LEA EBP,[EAX + 0x1]
TEST ESI,ESI
JZ 0x00012c9e
CMP EDX,EBP
JBE 0x00012c95
MOV EDI,dword ptr [ESI]
ADD EAX,0x2
MOV dword ptr [EBX + EBP*0x4],EDI
MOV ESI,dword ptr [ESI + 0x4]
TEST ESI,ESI
JZ 0x00012c8c
LEA ESI,[ESI]
CMP EDX,EAX
JZ 0x00012c97
MOV EDI,dword ptr [ESI]
ADD EAX,0x1
MOV dword ptr [EBX + EAX*0x4 + -0x4],EDI
MOV ESI,dword ptr [ESI + 0x4]
TEST ESI,ESI
JNZ 0x00012c78
MOV EDI,dword ptr [ESP + 0x14]
MOV EDI,dword ptr [EDI + 0x4]
JMP 0x00012c41
MOV EDX,EBP
POP EBX
MOV EAX,EDX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [ESP + 0x14]
MOV EDI,dword ptr [EAX + 0x4]
MOV EAX,EBP
JMP 0x00012c41
(translation_unit "uint FUN_00012c20(uint *param_1,int param_2,uint param_3)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_00012c20(uint *param_1,int param_2,uint param_3)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00012c20(uint *param_1,int param_2,uint param_3)" identifier (parameter_list "(uint *param_1,int param_2,uint param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (expression_statement "piVar4 = (int *)*param_1;" (assignment_expression "piVar4 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" identifier = identifier) ;) (if_statement "if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" if (parenthesized_expression "(piVar4 < piVar5)" ( (binary_expression "piVar4 < piVar5" identifier < identifier) )) (compound_statement "{\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" { (do_statement "do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);" do (compound_statement "{\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    }" { (expression_statement "uVar2 = uVar3;" (assignment_expression "uVar2 = uVar3" identifier = identifier) ;) (if_statement "if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" if (parenthesized_expression "(*piVar4 != 0)" ( (binary_expression "*piVar4 != 0" (pointer_expression "*piVar4" * identifier) != number_literal) )) (compound_statement "{\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" { (if_statement "if (param_3 <= uVar3) {\n          return uVar3;\n        }" if (parenthesized_expression "(param_3 <= uVar3)" ( (binary_expression "param_3 <= uVar3" identifier <= identifier) )) (compound_statement "{\n          return uVar3;\n        }" { (return_statement "return uVar3;" return identifier ;) })) (expression_statement "*(int *)(param_2 + uVar3 * 4) = *piVar4;" (assignment_expression "*(int *)(param_2 + uVar3 * 4) = *piVar4" (pointer_expression "*(int *)(param_2 + uVar3 * 4)" * (cast_expression "(int *)(param_2 + uVar3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + uVar3 * 4)" ( (binary_expression "param_2 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) )))) = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "puVar1 = (undefined4 *)piVar4[1];" (assignment_expression "puVar1 = (undefined4 *)piVar4[1]" identifier = (cast_expression "(undefined4 *)piVar4[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar4[1]" identifier [ number_literal ]))) ;) (expression_statement "uVar2 = uVar3 + 1;" (assignment_expression "uVar2 = uVar3 + 1" identifier = (binary_expression "uVar3 + 1" identifier + number_literal)) ;) (if_statement "if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" if (parenthesized_expression "(puVar1 == (undefined4 *)0x0)" ( (binary_expression "puVar1 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          piVar5 = (int *)param_1[1];\n        }" { (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) }) (else_clause "else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" else (compound_statement "{\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" { (if_statement "if (param_3 <= uVar2) {\n            return uVar2;\n          }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n            return uVar2;\n          }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + uVar2 * 4)" * (cast_expression "(undefined4 *)(param_2 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + uVar2 * 4)" ( (binary_expression "param_2 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "uVar2 = uVar3 + 2;" (assignment_expression "uVar2 = uVar3 + 2" identifier = (binary_expression "uVar3 + 2" identifier + number_literal)) ;) (for_statement "for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" for ( (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" identifier = (cast_expression "(undefined4 *)puVar1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar1[1]" identifier [ number_literal ]))) ; (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" identifier = (cast_expression "(undefined4 *)puVar1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar1[1]" identifier [ number_literal ]))) ) (compound_statement "{\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" { (if_statement "if (param_3 == uVar2) {\n              return param_3;\n            }" if (parenthesized_expression "(param_3 == uVar2)" ( (binary_expression "param_3 == uVar2" identifier == identifier) )) (compound_statement "{\n              return param_3;\n            }" { (return_statement "return param_3;" return identifier ;) })) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (expression_statement "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4)" * (cast_expression "(undefined4 *)(param_2 + -4 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + -4 + uVar2 * 4)" ( (binary_expression "param_2 + -4 + uVar2 * 4" (binary_expression "param_2 + -4" identifier + number_literal) + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) = (pointer_expression "*puVar1" * identifier)) ;) })) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) }))) })) (expression_statement "piVar4 = piVar4 + 2;" (assignment_expression "piVar4 = piVar4 + 2" identifier = (binary_expression "piVar4 + 2" identifier + number_literal)) ;) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" identifier = identifier) ;) }) while (parenthesized_expression "(piVar4 < piVar5)" ( (binary_expression "piVar4 < piVar5" identifier < identifier) )) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "size_t hash_get_entries(Hash_table *table,void **buffer,size_t buffer_size)\n\n{\n  uint uVar1;\n  uint uVar2;\n  hash_entry *phVar3;\n  hash_entry *phVar4;\n  \n  phVar3 = table->bucket;\n  phVar4 = table->bucket_limit;\n  uVar1 = 0;\n  uVar2 = uVar1;\n  if (phVar3 < phVar4) {\n    do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);\n  }\n  return uVar1;\n}\n\n" (function_definition "size_t hash_get_entries(Hash_table *table,void **buffer,size_t buffer_size)\n\n{\n  uint uVar1;\n  uint uVar2;\n  hash_entry *phVar3;\n  hash_entry *phVar4;\n  \n  phVar3 = table->bucket;\n  phVar4 = table->bucket_limit;\n  uVar1 = 0;\n  uVar2 = uVar1;\n  if (phVar3 < phVar4) {\n    do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);\n  }\n  return uVar1;\n}" primitive_type (function_declarator "hash_get_entries(Hash_table *table,void **buffer,size_t buffer_size)" identifier (parameter_list "(Hash_table *table,void **buffer,size_t buffer_size)" ( (parameter_declaration "Hash_table *table" type_identifier (pointer_declarator "*table" * identifier)) , (parameter_declaration "void **buffer" primitive_type (pointer_declarator "**buffer" * (pointer_declarator "*buffer" * identifier))) , (parameter_declaration "size_t buffer_size" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  hash_entry *phVar3;\n  hash_entry *phVar4;\n  \n  phVar3 = table->bucket;\n  phVar4 = table->bucket_limit;\n  uVar1 = 0;\n  uVar2 = uVar1;\n  if (phVar3 < phVar4) {\n    do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);\n  }\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "hash_entry *phVar3;" type_identifier (pointer_declarator "*phVar3" * identifier) ;) (declaration "hash_entry *phVar4;" type_identifier (pointer_declarator "*phVar4" * identifier) ;) (expression_statement "phVar3 = table->bucket;" (assignment_expression "phVar3 = table->bucket" identifier = (field_expression "table->bucket" identifier -> field_identifier)) ;) (expression_statement "phVar4 = table->bucket_limit;" (assignment_expression "phVar4 = table->bucket_limit" identifier = (field_expression "table->bucket_limit" identifier -> field_identifier)) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "uVar2 = uVar1;" (assignment_expression "uVar2 = uVar1" identifier = identifier) ;) (if_statement "if (phVar3 < phVar4) {\n    do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);\n  }" if (parenthesized_expression "(phVar3 < phVar4)" ( (binary_expression "phVar3 < phVar4" identifier < identifier) )) (compound_statement "{\n    do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);\n  }" { (do_statement "do {\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    } while (phVar3 < phVar4);" do (compound_statement "{\n      uVar1 = uVar2;\n      if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }\n      phVar3 = phVar3 + 1;\n      uVar2 = uVar1;\n    }" { (expression_statement "uVar1 = uVar2;" (assignment_expression "uVar1 = uVar2" identifier = identifier) ;) (if_statement "if (phVar3->data != (void *)0x0) {\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }" if (parenthesized_expression "(phVar3->data != (void *)0x0)" ( (binary_expression "phVar3->data != (void *)0x0" (field_expression "phVar3->data" identifier -> field_identifier) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        if (buffer_size <= uVar2) {\n          return uVar2;\n        }\n        buffer[uVar2] = phVar3->data;\n        phVar4 = phVar3->next;\n        uVar1 = uVar2 + 1;\n        if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }\n      }" { (if_statement "if (buffer_size <= uVar2) {\n          return uVar2;\n        }" if (parenthesized_expression "(buffer_size <= uVar2)" ( (binary_expression "buffer_size <= uVar2" identifier <= identifier) )) (compound_statement "{\n          return uVar2;\n        }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "buffer[uVar2] = phVar3->data;" (assignment_expression "buffer[uVar2] = phVar3->data" (subscript_expression "buffer[uVar2]" identifier [ identifier ]) = (field_expression "phVar3->data" identifier -> field_identifier)) ;) (expression_statement "phVar4 = phVar3->next;" (assignment_expression "phVar4 = phVar3->next" identifier = (field_expression "phVar3->next" identifier -> field_identifier)) ;) (expression_statement "uVar1 = uVar2 + 1;" (assignment_expression "uVar1 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (if_statement "if (phVar4 == (hash_entry *)0x0) {\n          phVar4 = table->bucket_limit;\n        }\n        else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }" if (parenthesized_expression "(phVar4 == (hash_entry *)0x0)" ( (binary_expression "phVar4 == (hash_entry *)0x0" identifier == (cast_expression "(hash_entry *)0x0" ( (type_descriptor "hash_entry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          phVar4 = table->bucket_limit;\n        }" { (expression_statement "phVar4 = table->bucket_limit;" (assignment_expression "phVar4 = table->bucket_limit" identifier = (field_expression "table->bucket_limit" identifier -> field_identifier)) ;) }) (else_clause "else {\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }" else (compound_statement "{\n          if (buffer_size <= uVar1) {\n            return uVar1;\n          }\n          buffer[uVar1] = phVar4->data;\n          uVar1 = uVar2 + 2;\n          for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }\n          phVar4 = table->bucket_limit;\n        }" { (if_statement "if (buffer_size <= uVar1) {\n            return uVar1;\n          }" if (parenthesized_expression "(buffer_size <= uVar1)" ( (binary_expression "buffer_size <= uVar1" identifier <= identifier) )) (compound_statement "{\n            return uVar1;\n          }" { (return_statement "return uVar1;" return identifier ;) })) (expression_statement "buffer[uVar1] = phVar4->data;" (assignment_expression "buffer[uVar1] = phVar4->data" (subscript_expression "buffer[uVar1]" identifier [ identifier ]) = (field_expression "phVar4->data" identifier -> field_identifier)) ;) (expression_statement "uVar1 = uVar2 + 2;" (assignment_expression "uVar1 = uVar2 + 2" identifier = (binary_expression "uVar2 + 2" identifier + number_literal)) ;) (for_statement "for (phVar4 = phVar4->next; phVar4 != (hash_entry *)0x0; phVar4 = phVar4->next) {\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }" for ( (assignment_expression "phVar4 = phVar4->next" identifier = (field_expression "phVar4->next" identifier -> field_identifier)) ; (binary_expression "phVar4 != (hash_entry *)0x0" identifier != (cast_expression "(hash_entry *)0x0" ( (type_descriptor "hash_entry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "phVar4 = phVar4->next" identifier = (field_expression "phVar4->next" identifier -> field_identifier)) ) (compound_statement "{\n            if (buffer_size == uVar1) {\n              return buffer_size;\n            }\n            buffer[uVar1] = phVar4->data;\n            uVar1 = uVar1 + 1;\n          }" { (if_statement "if (buffer_size == uVar1) {\n              return buffer_size;\n            }" if (parenthesized_expression "(buffer_size == uVar1)" ( (binary_expression "buffer_size == uVar1" identifier == identifier) )) (compound_statement "{\n              return buffer_size;\n            }" { (return_statement "return buffer_size;" return identifier ;) })) (expression_statement "buffer[uVar1] = phVar4->data;" (assignment_expression "buffer[uVar1] = phVar4->data" (subscript_expression "buffer[uVar1]" identifier [ identifier ]) = (field_expression "phVar4->data" identifier -> field_identifier)) ;) (expression_statement "uVar1 = uVar1 + 1;" (assignment_expression "uVar1 = uVar1 + 1" identifier = (binary_expression "uVar1 + 1" identifier + number_literal)) ;) })) (expression_statement "phVar4 = table->bucket_limit;" (assignment_expression "phVar4 = table->bucket_limit" identifier = (field_expression "table->bucket_limit" identifier -> field_identifier)) ;) }))) })) (expression_statement "phVar3 = phVar3 + 1;" (assignment_expression "phVar3 = phVar3 + 1" identifier = (binary_expression "phVar3 + 1" identifier + number_literal)) ;) (expression_statement "uVar2 = uVar1;" (assignment_expression "uVar2 = uVar1" identifier = identifier) ;) }) while (parenthesized_expression "(phVar3 < phVar4)" ( (binary_expression "phVar3 < phVar4" identifier < identifier) )) ;) })) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "uint FUN_00012c20(uint *param_1,int param_2,uint param_3)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_00012c20(uint *param_1,int param_2,uint param_3)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00012c20(uint *param_1,int param_2,uint param_3)" identifier (parameter_list "(uint *param_1,int param_2,uint param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (expression_statement "piVar4 = (int *)*param_1;" (assignment_expression "piVar4 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" identifier = identifier) ;) (if_statement "if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" if (parenthesized_expression "(piVar4 < piVar5)" ( (binary_expression "piVar4 < piVar5" identifier < identifier) )) (compound_statement "{\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" { (do_statement "do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);" do (compound_statement "{\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    }" { (expression_statement "uVar2 = uVar3;" (assignment_expression "uVar2 = uVar3" identifier = identifier) ;) (if_statement "if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" if (parenthesized_expression "(*piVar4 != 0)" ( (binary_expression "*piVar4 != 0" (pointer_expression "*piVar4" * identifier) != number_literal) )) (compound_statement "{\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" { (if_statement "if (param_3 <= uVar3) {\n          return uVar3;\n        }" if (parenthesized_expression "(param_3 <= uVar3)" ( (binary_expression "param_3 <= uVar3" identifier <= identifier) )) (compound_statement "{\n          return uVar3;\n        }" { (return_statement "return uVar3;" return identifier ;) })) (expression_statement "*(int *)(param_2 + uVar3 * 4) = *piVar4;" (assignment_expression "*(int *)(param_2 + uVar3 * 4) = *piVar4" (pointer_expression "*(int *)(param_2 + uVar3 * 4)" * (cast_expression "(int *)(param_2 + uVar3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + uVar3 * 4)" ( (binary_expression "param_2 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) )))) = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "puVar1 = (undefined4 *)piVar4[1];" (assignment_expression "puVar1 = (undefined4 *)piVar4[1]" identifier = (cast_expression "(undefined4 *)piVar4[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar4[1]" identifier [ number_literal ]))) ;) (expression_statement "uVar2 = uVar3 + 1;" (assignment_expression "uVar2 = uVar3 + 1" identifier = (binary_expression "uVar3 + 1" identifier + number_literal)) ;) (if_statement "if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" if (parenthesized_expression "(puVar1 == (undefined4 *)0x0)" ( (binary_expression "puVar1 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          piVar5 = (int *)param_1[1];\n        }" { (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) }) (else_clause "else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" else (compound_statement "{\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" { (if_statement "if (param_3 <= uVar2) {\n            return uVar2;\n          }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n            return uVar2;\n          }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + uVar2 * 4)" * (cast_expression "(undefined4 *)(param_2 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + uVar2 * 4)" ( (binary_expression "param_2 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) = (pointer_expression "*puVar1" * identifier)) ;) (expression_statement "uVar2 = uVar3 + 2;" (assignment_expression "uVar2 = uVar3 + 2" identifier = (binary_expression "uVar3 + 2" identifier + number_literal)) ;) (for_statement "for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" for ( (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" identifier = (cast_expression "(undefined4 *)puVar1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar1[1]" identifier [ number_literal ]))) ; (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" identifier = (cast_expression "(undefined4 *)puVar1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar1[1]" identifier [ number_literal ]))) ) (compound_statement "{\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" { (if_statement "if (param_3 == uVar2) {\n              return param_3;\n            }" if (parenthesized_expression "(param_3 == uVar2)" ( (binary_expression "param_3 == uVar2" identifier == identifier) )) (compound_statement "{\n              return param_3;\n            }" { (return_statement "return param_3;" return identifier ;) })) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (expression_statement "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4)" * (cast_expression "(undefined4 *)(param_2 + -4 + uVar2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + -4 + uVar2 * 4)" ( (binary_expression "param_2 + -4 + uVar2 * 4" (binary_expression "param_2 + -4" identifier + number_literal) + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) = (pointer_expression "*puVar1" * identifier)) ;) })) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" identifier = (cast_expression "(int *)param_1[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) }))) })) (expression_statement "piVar4 = piVar4 + 2;" (assignment_expression "piVar4 = piVar4 + 2" identifier = (binary_expression "piVar4 + 2" identifier + number_literal)) ;) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" identifier = identifier) ;) }) while (parenthesized_expression "(piVar4 < piVar5)" ( (binary_expression "piVar4 < piVar5" identifier < identifier) )) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (for_statement for ( (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ; (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ; (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ) (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)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + (binary_expression IDENT * LIT)) )))) = (pointer_expression * IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }))) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_00012c20(uint *param_1,int param_2,uint param_3)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" (type_identifier "uint") (function_declarator "FUN_00012c20(uint *param_1,int param_2,uint param_3)" (identifier "FUN_00012c20") (parameter_list "(uint *param_1,int param_2,uint param_3)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  uint uVar3;\n  int *piVar4;\n  int *piVar5;\n  \n  piVar4 = (int *)*param_1;\n  piVar5 = (int *)param_1[1];\n  uVar2 = 0;\n  uVar3 = uVar2;\n  if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }\n  return uVar2;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "int *piVar5;" (primitive_type "int") (pointer_declarator "*piVar5" (* "*") (identifier "piVar5")) (; ";")) (expression_statement "piVar4 = (int *)*param_1;" (assignment_expression "piVar4 = (int *)*param_1" (identifier "piVar4") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" (identifier "piVar5") (= "=") (cast_expression "(int *)param_1[1]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" (identifier "uVar3") (= "=") (identifier "uVar2")) (; ";")) (if_statement "if (piVar4 < piVar5) {\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" (if "if") (parenthesized_expression "(piVar4 < piVar5)" (( "(") (binary_expression "piVar4 < piVar5" (identifier "piVar4") (< "<") (identifier "piVar5")) () ")")) (compound_statement "{\n    do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);\n  }" ({ "{") (do_statement "do {\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    } while (piVar4 < piVar5);" (do "do") (compound_statement "{\n      uVar2 = uVar3;\n      if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }\n      piVar4 = piVar4 + 2;\n      uVar3 = uVar2;\n    }" ({ "{") (expression_statement "uVar2 = uVar3;" (assignment_expression "uVar2 = uVar3" (identifier "uVar2") (= "=") (identifier "uVar3")) (; ";")) (if_statement "if (*piVar4 != 0) {\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" (if "if") (parenthesized_expression "(*piVar4 != 0)" (( "(") (binary_expression "*piVar4 != 0" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        if (param_3 <= uVar3) {\n          return uVar3;\n        }\n        *(int *)(param_2 + uVar3 * 4) = *piVar4;\n        puVar1 = (undefined4 *)piVar4[1];\n        uVar2 = uVar3 + 1;\n        if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }\n      }" ({ "{") (if_statement "if (param_3 <= uVar3) {\n          return uVar3;\n        }" (if "if") (parenthesized_expression "(param_3 <= uVar3)" (( "(") (binary_expression "param_3 <= uVar3" (identifier "param_3") (<= "<=") (identifier "uVar3")) () ")")) (compound_statement "{\n          return uVar3;\n        }" ({ "{") (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}"))) (expression_statement "*(int *)(param_2 + uVar3 * 4) = *piVar4;" (assignment_expression "*(int *)(param_2 + uVar3 * 4) = *piVar4" (pointer_expression "*(int *)(param_2 + uVar3 * 4)" (* "*") (cast_expression "(int *)(param_2 + uVar3 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + uVar3 * 4)" (( "(") (binary_expression "param_2 + uVar3 * 4" (identifier "param_2") (+ "+") (binary_expression "uVar3 * 4" (identifier "uVar3") (* "*") (number_literal "4"))) () ")")))) (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (expression_statement "puVar1 = (undefined4 *)piVar4[1];" (assignment_expression "puVar1 = (undefined4 *)piVar4[1]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)piVar4[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar4[1]" (identifier "piVar4") ([ "[") (number_literal "1") (] "]")))) (; ";")) (expression_statement "uVar2 = uVar3 + 1;" (assignment_expression "uVar2 = uVar3 + 1" (identifier "uVar2") (= "=") (binary_expression "uVar3 + 1" (identifier "uVar3") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (puVar1 == (undefined4 *)0x0) {\n          piVar5 = (int *)param_1[1];\n        }\n        else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" (if "if") (parenthesized_expression "(puVar1 == (undefined4 *)0x0)" (( "(") (binary_expression "puVar1 == (undefined4 *)0x0" (identifier "puVar1") (== "==") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n          piVar5 = (int *)param_1[1];\n        }" ({ "{") (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" (identifier "piVar5") (= "=") (cast_expression "(int *)param_1[1]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (} "}")) (else_clause "else {\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" (else "else") (compound_statement "{\n          if (param_3 <= uVar2) {\n            return uVar2;\n          }\n          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;\n          uVar2 = uVar3 + 2;\n          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }\n          piVar5 = (int *)param_1[1];\n        }" ({ "{") (if_statement "if (param_3 <= uVar2) {\n            return uVar2;\n          }" (if "if") (parenthesized_expression "(param_3 <= uVar2)" (( "(") (binary_expression "param_3 <= uVar2" (identifier "param_3") (<= "<=") (identifier "uVar2")) () ")")) (compound_statement "{\n            return uVar2;\n          }" ({ "{") (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (expression_statement "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + uVar2 * 4)" (* "*") (cast_expression "(undefined4 *)(param_2 + uVar2 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + uVar2 * 4)" (( "(") (binary_expression "param_2 + uVar2 * 4" (identifier "param_2") (+ "+") (binary_expression "uVar2 * 4" (identifier "uVar2") (* "*") (number_literal "4"))) () ")")))) (= "=") (pointer_expression "*puVar1" (* "*") (identifier "puVar1"))) (; ";")) (expression_statement "uVar2 = uVar3 + 2;" (assignment_expression "uVar2 = uVar3 + 2" (identifier "uVar2") (= "=") (binary_expression "uVar3 + 2" (identifier "uVar3") (+ "+") (number_literal "2"))) (; ";")) (for_statement "for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;\n              puVar1 = (undefined4 *)puVar1[1]) {\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" (for "for") (( "(") (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)puVar1[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")))) (; ";") (binary_expression "puVar1 != (undefined4 *)0x0" (identifier "puVar1") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";") (assignment_expression "puVar1 = (undefined4 *)puVar1[1]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)puVar1[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")))) () ")") (compound_statement "{\n            if (param_3 == uVar2) {\n              return param_3;\n            }\n            uVar2 = uVar2 + 1;\n            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;\n          }" ({ "{") (if_statement "if (param_3 == uVar2) {\n              return param_3;\n            }" (if "if") (parenthesized_expression "(param_3 == uVar2)" (( "(") (binary_expression "param_3 == uVar2" (identifier "param_3") (== "==") (identifier "uVar2")) () ")")) (compound_statement "{\n              return param_3;\n            }" ({ "{") (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}"))) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" (identifier "uVar2") (= "=") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;" (assignment_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1" (pointer_expression "*(undefined4 *)(param_2 + -4 + uVar2 * 4)" (* "*") (cast_expression "(undefined4 *)(param_2 + -4 + uVar2 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + -4 + uVar2 * 4)" (( "(") (binary_expression "param_2 + -4 + uVar2 * 4" (binary_expression "param_2 + -4" (identifier "param_2") (+ "+") (number_literal "-4")) (+ "+") (binary_expression "uVar2 * 4" (identifier "uVar2") (* "*") (number_literal "4"))) () ")")))) (= "=") (pointer_expression "*puVar1" (* "*") (identifier "puVar1"))) (; ";")) (} "}"))) (expression_statement "piVar5 = (int *)param_1[1];" (assignment_expression "piVar5 = (int *)param_1[1]" (identifier "piVar5") (= "=") (cast_expression "(int *)param_1[1]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (} "}")))) (} "}"))) (expression_statement "piVar4 = piVar4 + 2;" (assignment_expression "piVar4 = piVar4 + 2" (identifier "piVar4") (= "=") (binary_expression "piVar4 + 2" (identifier "piVar4") (+ "+") (number_literal "2"))) (; ";")) (expression_statement "uVar3 = uVar2;" (assignment_expression "uVar3 = uVar2" (identifier "uVar3") (= "=") (identifier "uVar2")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(piVar4 < piVar5)" (( "(") (binary_expression "piVar4 < piVar5" (identifier "piVar4") (< "<") (identifier "piVar5")) () ")")) (; ";")) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

size_t function_1(type_1 *table,void **buffer,size_t var_3)

{
  type_2 var_5;
  type_2 var_4;
  type_3 *var_1;
  type_3 *var_2;
  
  var_1 = table->bucket;
  var_2 = table->bucket_limit;
  var_5 = 0;
  var_4 = var_5;
  if (var_1 < var_2) {
    do {
      var_5 = var_4;
      if (var_1->data != (void *)0x0) {
        if (var_3 <= var_4) {
          return var_4;
        }
        buffer[var_4] = var_1->data;
        var_2 = var_1->next;
        var_5 = var_4 + 1;
        if (var_2 == (type_3 *)0x0) {
          var_2 = table->bucket_limit;
        }
        else {
          if (var_3 <= var_5) {
            return var_5;
          }
          buffer[var_5] = var_2->data;
          var_5 = var_4 + 2;
          for (var_2 = var_2->next; var_2 != (type_3 *)0x0; var_2 = var_2->next) {
            if (var_3 == var_5) {
              return var_3;
            }
            buffer[var_5] = var_2->data;
            var_5 = var_5 + 1;
          }
          var_2 = table->bucket_limit;
        }
      }
      var_1 = var_1 + 1;
      var_4 = var_5;
    } while (var_1 < var_2);
  }
  return var_5;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_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: (binary_expression left: (identifier) right: (number_literal)))))) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_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: (binary_expression left: (identifier) right: (number_literal)))))) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (for_statement initializer: (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))) condition: (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))) update: (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))) 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)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (return_statement (identifier)))))

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

{
  undefined4 *puVar1;
  uint uVar2;
  uint uVar3;
  int *piVar4;
  int *piVar5;
  
  piVar4 = (int *)*param_1;
  piVar5 = (int *)param_1[1];
  uVar2 = 0;
  uVar3 = uVar2;
  if (piVar4 < piVar5) {
    do {
      uVar2 = uVar3;
      if (*piVar4 != 0) {
        if (param_3 <= uVar3) {
          return uVar3;
        }
        *(int *)(param_2 + uVar3 * 4) = *piVar4;
        puVar1 = (undefined4 *)piVar4[1];
        uVar2 = uVar3 + 1;
        if (puVar1 == (undefined4 *)0x0) {
          piVar5 = (int *)param_1[1];
        }
        else {
          if (param_3 <= uVar2) {
            return uVar2;
          }
          *(undefined4 *)(param_2 + uVar2 * 4) = *puVar1;
          uVar2 = uVar3 + 2;
          for (puVar1 = (undefined4 *)puVar1[1]; puVar1 != (undefined4 *)0x0;
              puVar1 = (undefined4 *)puVar1[1]) {
            if (param_3 == uVar2) {
              return param_3;
            }
            uVar2 = uVar2 + 1;
            *(undefined4 *)(param_2 + -4 + uVar2 * 4) = *puVar1;
          }
          piVar5 = (int *)param_1[1];
        }
      }
      piVar4 = piVar4 + 2;
      uVar3 = uVar2;
    } while (piVar4 < piVar5);
  }
  return uVar2;
}

