
/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int __regparm3 fts5HashEntrySort(Fts5Hash *pHash,char *pTerm,int nTerm,Fts5HashEntry **ppSorted)

{
  int *p;
  int iVar1;
  Fts5HashEntry *pLeft;
  Fts5HashEntry *pFVar2;
  uint uVar3;
  Fts5HashEntry *pFVar4;
  int *piVar5;
  int *piVar6;
  undefined4 *puVar7;
  byte bVar8;
  int local_2c;
  
  bVar8 = 0;
  *ppSorted = (Fts5HashEntry *)0x0;
  p = (int *)sqlite3_malloc64(0x80);
  if (p == (int *)0x0) {
    return 7;
  }
  *p = 0;
  p[0x1f] = 0;
  puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc);
  for (uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2; uVar3 != 0;
      uVar3 = uVar3 - 1) {
    *puVar7 = 0;
    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;
  }
  if (0 < pHash->nSlot) {
    local_2c = 0;
    do {
      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;
          pFVar2 = pFVar2->pHashNext) {
        while ((pTerm != (char *)0x0 &&
               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))
              ) {
          pFVar2 = pFVar2->pHashNext;
          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;
        }
        pFVar2->pScanNext = (Fts5HashEntry *)0x0;
        pFVar4 = (Fts5HashEntry *)*p;
        pLeft = pFVar2;
        piVar5 = p;
        if (pFVar4 == (Fts5HashEntry *)0x0) {
          *p = (int)pFVar2;
        }
        else {
          do {
            pLeft = fts5HashEntryMerge(pLeft,pFVar4);
            piVar6 = piVar5 + 1;
            *piVar5 = 0;
            pFVar4 = (Fts5HashEntry *)*piVar6;
            piVar5 = piVar6;
          } while (pFVar4 != (Fts5HashEntry *)0x0);
          *piVar6 = (int)pLeft;
        }
      }
LAB_00040a8d:
      local_2c = local_2c + 1;
    } while (local_2c < pHash->nSlot);
  }
  pFVar2 = (Fts5HashEntry *)0x0;
  piVar5 = p;
  do {
    pFVar4 = (Fts5HashEntry *)*piVar5;
    piVar5 = piVar5 + 1;
    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);
  } while (p + 0x20 != piVar5);
  pHash->nEntry = 0;
  sqlite3_free(p);
  *ppSorted = pFVar2;
  return 0;
}



/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

undefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  uint uVar4;
  int *piVar5;
  int *piVar6;
  undefined4 *puVar7;
  int *piVar8;
  byte bVar9;
  int local_2c;
  
  bVar9 = 0;
  *param_4 = 0;
  piVar1 = (int *)FUN_0003f0c0(0x80,0);
  if (piVar1 == (int *)0x0) {
    return 7;
  }
  *piVar1 = 0;
  piVar1[0x1f] = 0;
  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);
  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;
      uVar4 != 0; uVar4 = uVar4 - 1) {
    *puVar7 = 0;
    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
  }
  if (0 < *(int *)(param_1 + 0xc)) {
    local_2c = 0;
    do {
      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;
          piVar8 = (int *)*piVar8) {
        while ((param_2 != (void *)0x0 &&
               ((piVar8[5] + 1 < (int)param_3 ||
                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {
          piVar8 = (int *)*piVar8;
          if (piVar8 == (int *)0x0) goto LAB_00040a8d;
        }
        piVar8[1] = 0;
        piVar5 = piVar1;
        if (*piVar1 == 0) {
          *piVar1 = (int)piVar8;
        }
        else {
          do {
            iVar2 = FUN_0001faa0();
            piVar6 = piVar5 + 1;
            *piVar5 = 0;
            piVar5 = piVar6;
          } while (*piVar6 != 0);
          *piVar6 = iVar2;
        }
      }
LAB_00040a8d:
      local_2c = local_2c + 1;
    } while (local_2c < *(int *)(param_1 + 0xc));
  }
  piVar8 = piVar1;
  do {
    piVar8 = piVar8 + 1;
    uVar3 = FUN_0001faa0();
  } while (piVar1 + 0x20 != piVar8);
  *(undefined4 *)(param_1 + 8) = 0;
  FUN_00024cc0(piVar1);
  *param_4 = uVar3;
  return 0;
}


PUSH EBP
MOV EBP,ECX
PUSH EDI
PUSH ESI
CALL 0x000196f9
ADD ESI,0x10853a
PUSH EBX
SUB ESP,0x24
MOV ECX,dword ptr [ESP + 0x38]
MOV dword ptr [ESP + 0x14],EAX
MOV dword ptr [ESP + 0xc],ESI
MOV EBX,ESI
MOV ESI,EDX
MOV dword ptr [ECX],0x0
PUSH 0x0
PUSH 0x80
CALL 0x0003f0c0
MOV dword ptr [ESP + 0x18],EAX
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00040b00
LEA EDI,[EAX + 0x4]
MOV ECX,EAX
MOV dword ptr [EAX],0x0
AND EDI,0xfffffffc
MOV dword ptr [EAX + 0x7c],0x0
XOR EAX,EAX
SUB ECX,EDI
SUB ECX,-0x80
SHR ECX,0x2
STOSD.REP ES:EDI
MOV EAX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [EAX + 0xc]
TEST EAX,EAX
JLE 0x00040aa1
MOV dword ptr [ESP],0x0
LEA ESI,[ESI]
MOV EAX,dword ptr [ESP + 0xc]
MOV ECX,dword ptr [ESP]
MOV EAX,dword ptr [EAX + 0x14]
MOV EDI,dword ptr [EAX + ECX*0x4]
TEST EDI,EDI
JNZ 0x00040a51
JMP 0x00040a8d
MOV EAX,dword ptr [EDI + 0x14]
ADD EAX,0x1
CMP EAX,EBP
JL 0x00040a4b
SUB ESP,0x4
LEA EAX,[EDI + 0x28]
PUSH EBP
PUSH ESI
PUSH EAX
MOV EBX,dword ptr [ESP + 0x14]
CALL 0x00014110
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00040a55
MOV EDI,dword ptr [EDI]
TEST EDI,EDI
JZ 0x00040a8d
TEST ESI,ESI
JNZ 0x00040a28
MOV EBX,dword ptr [ESP + 0x8]
MOV dword ptr [EDI + 0x4],0x0
MOV EAX,EDI
MOV EDX,dword ptr [EBX]
TEST EDX,EDX
JZ 0x00040af8
LEA ESI,[ESI]
CALL 0x0001faa0
ADD EBX,0x4
MOV dword ptr [EBX + -0x4],0x0
MOV EDX,dword ptr [EBX]
TEST EDX,EDX
JNZ 0x00040a70
MOV dword ptr [EBX],EAX
MOV EDI,dword ptr [EDI]
TEST EDI,EDI
JNZ 0x00040a51
MOV ECX,dword ptr [ESP + 0xc]
ADD dword ptr [ESP],0x1
MOV EAX,dword ptr [ESP]
CMP dword ptr [ECX + 0xc],EAX
JG 0x00040a10
MOV EAX,dword ptr [ESP + 0x8]
MOV EDI,EAX
LEA ESI,[EAX + 0x80]
XOR EAX,EAX
NOP
MOV EDX,dword ptr [EDI]
ADD EDI,0x4
CALL 0x0001faa0
CMP ESI,EDI
JNZ 0x00040ab0
MOV dword ptr [ESP],EAX
MOV EAX,dword ptr [ESP + 0xc]
SUB ESP,0xc
MOV dword ptr [EAX + 0x8],0x0
PUSH dword ptr [ESP + 0x14]
MOV EBX,dword ptr [ESP + 0x14]
CALL 0x00024cc0
MOV EAX,dword ptr [ESP + 0x10]
MOV ECX,dword ptr [ESP + 0x40]
ADD ESP,0x10
MOV dword ptr [ECX],EAX
ADD ESP,0x1c
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EBX,dword ptr [ESP + 0x8]
MOV dword ptr [EBX],EAX
JMP 0x00040a87
ADD ESP,0x1c
MOV EAX,0x7
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nundefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}\n\n" comment (function_definition "undefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "undefined4 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "int *piVar8;" primitive_type (pointer_declarator "*piVar8" * identifier) ;) (declaration "byte bVar9;" type_identifier identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" identifier = number_literal) ;) (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) (expression_statement "piVar1 = (int *)FUN_0003f0c0(0x80,0);" (assignment_expression "piVar1 = (int *)FUN_0003f0c0(0x80,0)" identifier = (cast_expression "(int *)FUN_0003f0c0(0x80,0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0003f0c0(0x80,0)" identifier (argument_list "(0x80,0)" ( number_literal , number_literal ))))) ;) (if_statement "if (piVar1 == (int *)0x0) {\n    return 7;\n  }" if (parenthesized_expression "(piVar1 == (int *)0x0)" ( (binary_expression "piVar1 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return 7;\n  }" { (return_statement "return 7;" return number_literal ;) })) (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (expression_statement "piVar1[0x1f] = 0;" (assignment_expression "piVar1[0x1f] = 0" (subscript_expression "piVar1[0x1f]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);" (assignment_expression "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" identifier = (cast_expression "(undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" ( (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(piVar1 + 1)" ( (binary_expression "piVar1 + 1" identifier + number_literal) ))) & number_literal) )))) ;) (for_statement "for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" for ( (assignment_expression "uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" identifier = (binary_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" (call_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" ( (binary_expression "(int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" (cast_expression "(int)piVar1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" ( (binary_expression "0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)" number_literal - (cast_expression "(int)((uint)(piVar1 + 1) & 0xfffffffc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" ( (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(piVar1 + 1)" ( (binary_expression "piVar1 + 1" identifier + number_literal) ))) & number_literal) )))) ))) ))) >> number_literal)) ; (binary_expression "uVar4 != 0" identifier != number_literal) ; (assignment_expression "uVar4 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ) (compound_statement "{\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" { (expression_statement "*puVar7 = 0;" (assignment_expression "*puVar7 = 0" (pointer_expression "*puVar7" * identifier) = number_literal) ;) (expression_statement "puVar7 = puVar7 + (uint)bVar9 * -2 + 1;" (assignment_expression "puVar7 = puVar7 + (uint)bVar9 * -2 + 1" identifier = (binary_expression "puVar7 + (uint)bVar9 * -2 + 1" (binary_expression "puVar7 + (uint)bVar9 * -2" identifier + (binary_expression "(uint)bVar9 * -2" (cast_expression "(uint)bVar9" ( (type_descriptor "uint" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) })) (if_statement "if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" if (parenthesized_expression "(0 < *(int *)(param_1 + 0xc))" ( (binary_expression "0 < *(int *)(param_1 + 0xc)" number_literal < (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" { (expression_statement "local_2c = 0;" (assignment_expression "local_2c = 0" identifier = number_literal) ;) (do_statement "do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));" do (compound_statement "{\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    }" { (for_statement "for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" for ( (assignment_expression "piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" identifier = (pointer_expression "*(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" * (cast_expression "(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(param_1 + 0x14) + local_2c * 4)" ( (binary_expression "*(int *)(param_1 + 0x14) + local_2c * 4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + (binary_expression "local_2c * 4" identifier * number_literal)) ))))) ; (binary_expression "piVar8 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "piVar8 = (int *)*piVar8" identifier = (cast_expression "(int *)*piVar8" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar8" * identifier))) ) (compound_statement "{\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" { (while_statement "while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" while (parenthesized_expression "((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))))" ( (parenthesized_expression "(param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))" ( (binary_expression "param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" (binary_expression "param_2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) && (parenthesized_expression "((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" ( (parenthesized_expression "(piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))" ( (binary_expression "piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" (binary_expression "piVar8[5] + 1 < (int)param_3" (binary_expression "piVar8[5] + 1" (subscript_expression "piVar8[5]" identifier [ number_literal ]) + number_literal) < (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) || (parenthesized_expression "(iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" ( (comma_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0" (assignment_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3)" identifier = (call_expression "memcmp(piVar8 + 10,param_2,param_3)" identifier (argument_list "(piVar8 + 10,param_2,param_3)" ( (binary_expression "piVar8 + 10" identifier + number_literal) , identifier , identifier )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) ))) )) )) (compound_statement "{\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" { (expression_statement "piVar8 = (int *)*piVar8;" (assignment_expression "piVar8 = (int *)*piVar8" identifier = (cast_expression "(int *)*piVar8" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar8" * identifier))) ;) (if_statement "if (piVar8 == (int *)0x0) goto LAB_00040a8d;" if (parenthesized_expression "(piVar8 == (int *)0x0)" ( (binary_expression "piVar8 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00040a8d;" goto statement_identifier ;)) })) (expression_statement "piVar8[1] = 0;" (assignment_expression "piVar8[1] = 0" (subscript_expression "piVar8[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar5 = piVar1;" (assignment_expression "piVar5 = piVar1" identifier = identifier) ;) (if_statement "if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" if (parenthesized_expression "(*piVar1 == 0)" ( (binary_expression "*piVar1 == 0" (pointer_expression "*piVar1" * identifier) == number_literal) )) (compound_statement "{\n          *piVar1 = (int)piVar8;\n        }" { (expression_statement "*piVar1 = (int)piVar8;" (assignment_expression "*piVar1 = (int)piVar8" (pointer_expression "*piVar1" * identifier) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" else (compound_statement "{\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" { (do_statement "do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);" do (compound_statement "{\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          }" { (expression_statement "iVar2 = FUN_0001faa0();" (assignment_expression "iVar2 = FUN_0001faa0()" identifier = (call_expression "FUN_0001faa0()" identifier (argument_list "()" ( )))) ;) (expression_statement "piVar6 = piVar5 + 1;" (assignment_expression "piVar6 = piVar5 + 1" identifier = (binary_expression "piVar5 + 1" identifier + number_literal)) ;) (expression_statement "*piVar5 = 0;" (assignment_expression "*piVar5 = 0" (pointer_expression "*piVar5" * identifier) = number_literal) ;) (expression_statement "piVar5 = piVar6;" (assignment_expression "piVar5 = piVar6" identifier = identifier) ;) }) while (parenthesized_expression "(*piVar6 != 0)" ( (binary_expression "*piVar6 != 0" (pointer_expression "*piVar6" * identifier) != number_literal) )) ;) (expression_statement "*piVar6 = iVar2;" (assignment_expression "*piVar6 = iVar2" (pointer_expression "*piVar6" * identifier) = identifier) ;) }))) })) (labeled_statement "LAB_00040a8d:\n      local_2c = local_2c + 1;" statement_identifier : (expression_statement "local_2c = local_2c + 1;" (assignment_expression "local_2c = local_2c + 1" identifier = (binary_expression "local_2c + 1" identifier + number_literal)) ;)) }) while (parenthesized_expression "(local_2c < *(int *)(param_1 + 0xc))" ( (binary_expression "local_2c < *(int *)(param_1 + 0xc)" identifier < (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) ;) })) (expression_statement "piVar8 = piVar1;" (assignment_expression "piVar8 = piVar1" identifier = identifier) ;) (do_statement "do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);" do (compound_statement "{\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  }" { (expression_statement "piVar8 = piVar8 + 1;" (assignment_expression "piVar8 = piVar8 + 1" identifier = (binary_expression "piVar8 + 1" identifier + number_literal)) ;) (expression_statement "uVar3 = FUN_0001faa0();" (assignment_expression "uVar3 = FUN_0001faa0()" identifier = (call_expression "FUN_0001faa0()" identifier (argument_list "()" ( )))) ;) }) while (parenthesized_expression "(piVar1 + 0x20 != piVar8)" ( (binary_expression "piVar1 + 0x20 != piVar8" (binary_expression "piVar1 + 0x20" identifier + number_literal) != identifier) )) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_00024cc0(piVar1);" (call_expression "FUN_00024cc0(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "*param_4 = uVar3;" (assignment_expression "*param_4 = uVar3" (pointer_expression "*param_4" * identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nint __regparm3 fts5HashEntrySort(Fts5Hash *pHash,char *pTerm,int nTerm,Fts5HashEntry **ppSorted)\n\n{\n  int *p;\n  int iVar1;\n  Fts5HashEntry *pLeft;\n  Fts5HashEntry *pFVar2;\n  uint uVar3;\n  Fts5HashEntry *pFVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  byte bVar8;\n  int local_2c;\n  \n  bVar8 = 0;\n  *ppSorted = (Fts5HashEntry *)0x0;\n  p = (int *)sqlite3_malloc64(0x80);\n  if (p == (int *)0x0) {\n    return 7;\n  }\n  *p = 0;\n  p[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc);\n  for (uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2; uVar3 != 0;\n      uVar3 = uVar3 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;\n  }\n  if (0 < pHash->nSlot) {\n    local_2c = 0;\n    do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);\n  }\n  pFVar2 = (Fts5HashEntry *)0x0;\n  piVar5 = p;\n  do {\n    pFVar4 = (Fts5HashEntry *)*piVar5;\n    piVar5 = piVar5 + 1;\n    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);\n  } while (p + 0x20 != piVar5);\n  pHash->nEntry = 0;\n  sqlite3_free(p);\n  *ppSorted = pFVar2;\n  return 0;\n}\n\n" comment (function_definition "int __regparm3 fts5HashEntrySort(Fts5Hash *pHash,char *pTerm,int nTerm,Fts5HashEntry **ppSorted)\n\n{\n  int *p;\n  int iVar1;\n  Fts5HashEntry *pLeft;\n  Fts5HashEntry *pFVar2;\n  uint uVar3;\n  Fts5HashEntry *pFVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  byte bVar8;\n  int local_2c;\n  \n  bVar8 = 0;\n  *ppSorted = (Fts5HashEntry *)0x0;\n  p = (int *)sqlite3_malloc64(0x80);\n  if (p == (int *)0x0) {\n    return 7;\n  }\n  *p = 0;\n  p[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc);\n  for (uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2; uVar3 != 0;\n      uVar3 = uVar3 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;\n  }\n  if (0 < pHash->nSlot) {\n    local_2c = 0;\n    do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);\n  }\n  pFVar2 = (Fts5HashEntry *)0x0;\n  piVar5 = p;\n  do {\n    pFVar4 = (Fts5HashEntry *)*piVar5;\n    piVar5 = piVar5 + 1;\n    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);\n  } while (p + 0x20 != piVar5);\n  pHash->nEntry = 0;\n  sqlite3_free(p);\n  *ppSorted = pFVar2;\n  return 0;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "fts5HashEntrySort(Fts5Hash *pHash,char *pTerm,int nTerm,Fts5HashEntry **ppSorted)" identifier (parameter_list "(Fts5Hash *pHash,char *pTerm,int nTerm,Fts5HashEntry **ppSorted)" ( (parameter_declaration "Fts5Hash *pHash" type_identifier (pointer_declarator "*pHash" * identifier)) , (parameter_declaration "char *pTerm" primitive_type (pointer_declarator "*pTerm" * identifier)) , (parameter_declaration "int nTerm" primitive_type identifier) , (parameter_declaration "Fts5HashEntry **ppSorted" type_identifier (pointer_declarator "**ppSorted" * (pointer_declarator "*ppSorted" * identifier))) ))) (compound_statement "{\n  int *p;\n  int iVar1;\n  Fts5HashEntry *pLeft;\n  Fts5HashEntry *pFVar2;\n  uint uVar3;\n  Fts5HashEntry *pFVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  byte bVar8;\n  int local_2c;\n  \n  bVar8 = 0;\n  *ppSorted = (Fts5HashEntry *)0x0;\n  p = (int *)sqlite3_malloc64(0x80);\n  if (p == (int *)0x0) {\n    return 7;\n  }\n  *p = 0;\n  p[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc);\n  for (uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2; uVar3 != 0;\n      uVar3 = uVar3 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;\n  }\n  if (0 < pHash->nSlot) {\n    local_2c = 0;\n    do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);\n  }\n  pFVar2 = (Fts5HashEntry *)0x0;\n  piVar5 = p;\n  do {\n    pFVar4 = (Fts5HashEntry *)*piVar5;\n    piVar5 = piVar5 + 1;\n    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);\n  } while (p + 0x20 != piVar5);\n  pHash->nEntry = 0;\n  sqlite3_free(p);\n  *ppSorted = pFVar2;\n  return 0;\n}" { (declaration "int *p;" primitive_type (pointer_declarator "*p" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "Fts5HashEntry *pLeft;" type_identifier (pointer_declarator "*pLeft" * identifier) ;) (declaration "Fts5HashEntry *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "Fts5HashEntry *pFVar4;" type_identifier (pointer_declarator "*pFVar4" * identifier) ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "undefined4 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "byte bVar8;" type_identifier identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" identifier = number_literal) ;) (expression_statement "*ppSorted = (Fts5HashEntry *)0x0;" (assignment_expression "*ppSorted = (Fts5HashEntry *)0x0" (pointer_expression "*ppSorted" * identifier) = (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "p = (int *)sqlite3_malloc64(0x80);" (assignment_expression "p = (int *)sqlite3_malloc64(0x80)" identifier = (cast_expression "(int *)sqlite3_malloc64(0x80)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3_malloc64(0x80)" identifier (argument_list "(0x80)" ( number_literal ))))) ;) (if_statement "if (p == (int *)0x0) {\n    return 7;\n  }" if (parenthesized_expression "(p == (int *)0x0)" ( (binary_expression "p == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return 7;\n  }" { (return_statement "return 7;" return number_literal ;) })) (expression_statement "*p = 0;" (assignment_expression "*p = 0" (pointer_expression "*p" * identifier) = number_literal) ;) (expression_statement "p[0x1f] = 0;" (assignment_expression "p[0x1f] = 0" (subscript_expression "p[0x1f]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc);" (assignment_expression "puVar7 = (undefined4 *)((uint)(p + 1) & 0xfffffffc)" identifier = (cast_expression "(undefined4 *)((uint)(p + 1) & 0xfffffffc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((uint)(p + 1) & 0xfffffffc)" ( (binary_expression "(uint)(p + 1) & 0xfffffffc" (call_expression "(uint)(p + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(p + 1)" ( (binary_expression "p + 1" identifier + number_literal) ))) & number_literal) )))) ;) (for_statement "for (uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2; uVar3 != 0;\n      uVar3 = uVar3 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;\n  }" for ( (assignment_expression "uVar3 = (uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2" identifier = (binary_expression "(uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))) >> 2" (call_expression "(uint)((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc)))" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc)))" ( (binary_expression "(int)p + (0x80 - (int)((uint)(p + 1) & 0xfffffffc))" (cast_expression "(int)p" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x80 - (int)((uint)(p + 1) & 0xfffffffc))" ( (binary_expression "0x80 - (int)((uint)(p + 1) & 0xfffffffc)" number_literal - (cast_expression "(int)((uint)(p + 1) & 0xfffffffc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((uint)(p + 1) & 0xfffffffc)" ( (binary_expression "(uint)(p + 1) & 0xfffffffc" (call_expression "(uint)(p + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(p + 1)" ( (binary_expression "p + 1" identifier + number_literal) ))) & number_literal) )))) ))) ))) >> number_literal)) ; (binary_expression "uVar3 != 0" identifier != number_literal) ; (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ) (compound_statement "{\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar8 * -2 + 1;\n  }" { (expression_statement "*puVar7 = 0;" (assignment_expression "*puVar7 = 0" (pointer_expression "*puVar7" * identifier) = number_literal) ;) (expression_statement "puVar7 = puVar7 + (uint)bVar8 * -2 + 1;" (assignment_expression "puVar7 = puVar7 + (uint)bVar8 * -2 + 1" identifier = (binary_expression "puVar7 + (uint)bVar8 * -2 + 1" (binary_expression "puVar7 + (uint)bVar8 * -2" identifier + (binary_expression "(uint)bVar8 * -2" (cast_expression "(uint)bVar8" ( (type_descriptor "uint" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) })) (if_statement "if (0 < pHash->nSlot) {\n    local_2c = 0;\n    do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);\n  }" if (parenthesized_expression "(0 < pHash->nSlot)" ( (binary_expression "0 < pHash->nSlot" number_literal < (field_expression "pHash->nSlot" identifier -> field_identifier)) )) (compound_statement "{\n    local_2c = 0;\n    do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);\n  }" { (expression_statement "local_2c = 0;" (assignment_expression "local_2c = 0" identifier = number_literal) ;) (do_statement "do {\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < pHash->nSlot);" do (compound_statement "{\n      for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    }" { (for_statement "for (pFVar2 = pHash->aSlot[local_2c]; pFVar2 != (Fts5HashEntry *)0x0;\n          pFVar2 = pFVar2->pHashNext) {\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }" for ( (assignment_expression "pFVar2 = pHash->aSlot[local_2c]" identifier = (subscript_expression "pHash->aSlot[local_2c]" (field_expression "pHash->aSlot" identifier -> field_identifier) [ identifier ])) ; (binary_expression "pFVar2 != (Fts5HashEntry *)0x0" identifier != (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "pFVar2 = pFVar2->pHashNext" identifier = (field_expression "pFVar2->pHashNext" identifier -> field_identifier)) ) (compound_statement "{\n        while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }\n        pFVar2->pScanNext = (Fts5HashEntry *)0x0;\n        pFVar4 = (Fts5HashEntry *)*p;\n        pLeft = pFVar2;\n        piVar5 = p;\n        if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }\n      }" { (while_statement "while ((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              ) {\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }" while (parenthesized_expression "((pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))\n              )" ( (parenthesized_expression "(pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))))" ( (binary_expression "pTerm != (char *)0x0 &&\n               ((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0)))" (binary_expression "pTerm != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) && (parenthesized_expression "((pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0)))" ( (parenthesized_expression "(pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0))" ( (binary_expression "pFVar2->nKey + 1 < nTerm || (iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0)" (binary_expression "pFVar2->nKey + 1 < nTerm" (binary_expression "pFVar2->nKey + 1" (field_expression "pFVar2->nKey" identifier -> field_identifier) + number_literal) < identifier) || (parenthesized_expression "(iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0)" ( (comma_expression "iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm), iVar1 != 0" (assignment_expression "iVar1 = memcmp(pFVar2 + 1,pTerm,nTerm)" identifier = (call_expression "memcmp(pFVar2 + 1,pTerm,nTerm)" identifier (argument_list "(pFVar2 + 1,pTerm,nTerm)" ( (binary_expression "pFVar2 + 1" identifier + number_literal) , identifier , identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) ))) )) )) (compound_statement "{\n          pFVar2 = pFVar2->pHashNext;\n          if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;\n        }" { (expression_statement "pFVar2 = pFVar2->pHashNext;" (assignment_expression "pFVar2 = pFVar2->pHashNext" identifier = (field_expression "pFVar2->pHashNext" identifier -> field_identifier)) ;) (if_statement "if (pFVar2 == (Fts5HashEntry *)0x0) goto LAB_00040a8d;" if (parenthesized_expression "(pFVar2 == (Fts5HashEntry *)0x0)" ( (binary_expression "pFVar2 == (Fts5HashEntry *)0x0" identifier == (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00040a8d;" goto statement_identifier ;)) })) (expression_statement "pFVar2->pScanNext = (Fts5HashEntry *)0x0;" (assignment_expression "pFVar2->pScanNext = (Fts5HashEntry *)0x0" (field_expression "pFVar2->pScanNext" identifier -> field_identifier) = (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pFVar4 = (Fts5HashEntry *)*p;" (assignment_expression "pFVar4 = (Fts5HashEntry *)*p" identifier = (cast_expression "(Fts5HashEntry *)*p" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*p" * identifier))) ;) (expression_statement "pLeft = pFVar2;" (assignment_expression "pLeft = pFVar2" identifier = identifier) ;) (expression_statement "piVar5 = p;" (assignment_expression "piVar5 = p" identifier = identifier) ;) (if_statement "if (pFVar4 == (Fts5HashEntry *)0x0) {\n          *p = (int)pFVar2;\n        }\n        else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }" if (parenthesized_expression "(pFVar4 == (Fts5HashEntry *)0x0)" ( (binary_expression "pFVar4 == (Fts5HashEntry *)0x0" identifier == (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          *p = (int)pFVar2;\n        }" { (expression_statement "*p = (int)pFVar2;" (assignment_expression "*p = (int)pFVar2" (pointer_expression "*p" * identifier) = (cast_expression "(int)pFVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }" else (compound_statement "{\n          do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);\n          *piVar6 = (int)pLeft;\n        }" { (do_statement "do {\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          } while (pFVar4 != (Fts5HashEntry *)0x0);" do (compound_statement "{\n            pLeft = fts5HashEntryMerge(pLeft,pFVar4);\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            pFVar4 = (Fts5HashEntry *)*piVar6;\n            piVar5 = piVar6;\n          }" { (expression_statement "pLeft = fts5HashEntryMerge(pLeft,pFVar4);" (assignment_expression "pLeft = fts5HashEntryMerge(pLeft,pFVar4)" identifier = (call_expression "fts5HashEntryMerge(pLeft,pFVar4)" identifier (argument_list "(pLeft,pFVar4)" ( identifier , identifier )))) ;) (expression_statement "piVar6 = piVar5 + 1;" (assignment_expression "piVar6 = piVar5 + 1" identifier = (binary_expression "piVar5 + 1" identifier + number_literal)) ;) (expression_statement "*piVar5 = 0;" (assignment_expression "*piVar5 = 0" (pointer_expression "*piVar5" * identifier) = number_literal) ;) (expression_statement "pFVar4 = (Fts5HashEntry *)*piVar6;" (assignment_expression "pFVar4 = (Fts5HashEntry *)*piVar6" identifier = (cast_expression "(Fts5HashEntry *)*piVar6" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar6" * identifier))) ;) (expression_statement "piVar5 = piVar6;" (assignment_expression "piVar5 = piVar6" identifier = identifier) ;) }) while (parenthesized_expression "(pFVar4 != (Fts5HashEntry *)0x0)" ( (binary_expression "pFVar4 != (Fts5HashEntry *)0x0" identifier != (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) ;) (expression_statement "*piVar6 = (int)pLeft;" (assignment_expression "*piVar6 = (int)pLeft" (pointer_expression "*piVar6" * identifier) = (cast_expression "(int)pLeft" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }))) })) (labeled_statement "LAB_00040a8d:\n      local_2c = local_2c + 1;" statement_identifier : (expression_statement "local_2c = local_2c + 1;" (assignment_expression "local_2c = local_2c + 1" identifier = (binary_expression "local_2c + 1" identifier + number_literal)) ;)) }) while (parenthesized_expression "(local_2c < pHash->nSlot)" ( (binary_expression "local_2c < pHash->nSlot" identifier < (field_expression "pHash->nSlot" identifier -> field_identifier)) )) ;) })) (expression_statement "pFVar2 = (Fts5HashEntry *)0x0;" (assignment_expression "pFVar2 = (Fts5HashEntry *)0x0" identifier = (cast_expression "(Fts5HashEntry *)0x0" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "piVar5 = p;" (assignment_expression "piVar5 = p" identifier = identifier) ;) (do_statement "do {\n    pFVar4 = (Fts5HashEntry *)*piVar5;\n    piVar5 = piVar5 + 1;\n    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);\n  } while (p + 0x20 != piVar5);" do (compound_statement "{\n    pFVar4 = (Fts5HashEntry *)*piVar5;\n    piVar5 = piVar5 + 1;\n    pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);\n  }" { (expression_statement "pFVar4 = (Fts5HashEntry *)*piVar5;" (assignment_expression "pFVar4 = (Fts5HashEntry *)*piVar5" identifier = (cast_expression "(Fts5HashEntry *)*piVar5" ( (type_descriptor "Fts5HashEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar5" * identifier))) ;) (expression_statement "piVar5 = piVar5 + 1;" (assignment_expression "piVar5 = piVar5 + 1" identifier = (binary_expression "piVar5 + 1" identifier + number_literal)) ;) (expression_statement "pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4);" (assignment_expression "pFVar2 = fts5HashEntryMerge(pFVar2,pFVar4)" identifier = (call_expression "fts5HashEntryMerge(pFVar2,pFVar4)" identifier (argument_list "(pFVar2,pFVar4)" ( identifier , identifier )))) ;) }) while (parenthesized_expression "(p + 0x20 != piVar5)" ( (binary_expression "p + 0x20 != piVar5" (binary_expression "p + 0x20" identifier + number_literal) != identifier) )) ;) (expression_statement "pHash->nEntry = 0;" (assignment_expression "pHash->nEntry = 0" (field_expression "pHash->nEntry" identifier -> field_identifier) = number_literal) ;) (expression_statement "sqlite3_free(p);" (call_expression "sqlite3_free(p)" identifier (argument_list "(p)" ( identifier ))) ;) (expression_statement "*ppSorted = pFVar2;" (assignment_expression "*ppSorted = pFVar2" (pointer_expression "*ppSorted" * identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int *piVar5;" primitive_type (pointer_declarator "*piVar5" * identifier) ;) (declaration "int *piVar6;" primitive_type (pointer_declarator "*piVar6" * identifier) ;) (declaration "undefined4 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "int *piVar8;" primitive_type (pointer_declarator "*piVar8" * identifier) ;) (declaration "byte bVar9;" type_identifier identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" identifier = number_literal) ;) (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) (expression_statement "piVar1 = (int *)FUN_0003f0c0(0x80,0);" (assignment_expression "piVar1 = (int *)FUN_0003f0c0(0x80,0)" identifier = (cast_expression "(int *)FUN_0003f0c0(0x80,0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0003f0c0(0x80,0)" identifier (argument_list "(0x80,0)" ( number_literal , number_literal ))))) ;) (if_statement "if (piVar1 == (int *)0x0) {\n    return 7;\n  }" if (parenthesized_expression "(piVar1 == (int *)0x0)" ( (binary_expression "piVar1 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    return 7;\n  }" { (return_statement "return 7;" return number_literal ;) })) (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (expression_statement "piVar1[0x1f] = 0;" (assignment_expression "piVar1[0x1f] = 0" (subscript_expression "piVar1[0x1f]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);" (assignment_expression "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" identifier = (cast_expression "(undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" ( (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(piVar1 + 1)" ( (binary_expression "piVar1 + 1" identifier + number_literal) ))) & number_literal) )))) ;) (for_statement "for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" for ( (assignment_expression "uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" identifier = (binary_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" (call_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" ( (binary_expression "(int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" (cast_expression "(int)piVar1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" ( (binary_expression "0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)" number_literal - (cast_expression "(int)((uint)(piVar1 + 1) & 0xfffffffc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" ( (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(piVar1 + 1)" ( (binary_expression "piVar1 + 1" identifier + number_literal) ))) & number_literal) )))) ))) ))) >> number_literal)) ; (binary_expression "uVar4 != 0" identifier != number_literal) ; (assignment_expression "uVar4 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ) (compound_statement "{\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" { (expression_statement "*puVar7 = 0;" (assignment_expression "*puVar7 = 0" (pointer_expression "*puVar7" * identifier) = number_literal) ;) (expression_statement "puVar7 = puVar7 + (uint)bVar9 * -2 + 1;" (assignment_expression "puVar7 = puVar7 + (uint)bVar9 * -2 + 1" identifier = (binary_expression "puVar7 + (uint)bVar9 * -2 + 1" (binary_expression "puVar7 + (uint)bVar9 * -2" identifier + (binary_expression "(uint)bVar9 * -2" (cast_expression "(uint)bVar9" ( (type_descriptor "uint" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) })) (if_statement "if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" if (parenthesized_expression "(0 < *(int *)(param_1 + 0xc))" ( (binary_expression "0 < *(int *)(param_1 + 0xc)" number_literal < (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" { (expression_statement "local_2c = 0;" (assignment_expression "local_2c = 0" identifier = number_literal) ;) (do_statement "do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));" do (compound_statement "{\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    }" { (for_statement "for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" for ( (assignment_expression "piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" identifier = (pointer_expression "*(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" * (cast_expression "(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(param_1 + 0x14) + local_2c * 4)" ( (binary_expression "*(int *)(param_1 + 0x14) + local_2c * 4" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + (binary_expression "local_2c * 4" identifier * number_literal)) ))))) ; (binary_expression "piVar8 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ; (assignment_expression "piVar8 = (int *)*piVar8" identifier = (cast_expression "(int *)*piVar8" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar8" * identifier))) ) (compound_statement "{\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" { (while_statement "while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" while (parenthesized_expression "((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))))" ( (parenthesized_expression "(param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))" ( (binary_expression "param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" (binary_expression "param_2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) && (parenthesized_expression "((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" ( (parenthesized_expression "(piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))" ( (binary_expression "piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" (binary_expression "piVar8[5] + 1 < (int)param_3" (binary_expression "piVar8[5] + 1" (subscript_expression "piVar8[5]" identifier [ number_literal ]) + number_literal) < (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) || (parenthesized_expression "(iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" ( (comma_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0" (assignment_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3)" identifier = (call_expression "memcmp(piVar8 + 10,param_2,param_3)" identifier (argument_list "(piVar8 + 10,param_2,param_3)" ( (binary_expression "piVar8 + 10" identifier + number_literal) , identifier , identifier )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) ))) )) )) (compound_statement "{\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" { (expression_statement "piVar8 = (int *)*piVar8;" (assignment_expression "piVar8 = (int *)*piVar8" identifier = (cast_expression "(int *)*piVar8" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar8" * identifier))) ;) (if_statement "if (piVar8 == (int *)0x0) goto LAB_00040a8d;" if (parenthesized_expression "(piVar8 == (int *)0x0)" ( (binary_expression "piVar8 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_00040a8d;" goto statement_identifier ;)) })) (expression_statement "piVar8[1] = 0;" (assignment_expression "piVar8[1] = 0" (subscript_expression "piVar8[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar5 = piVar1;" (assignment_expression "piVar5 = piVar1" identifier = identifier) ;) (if_statement "if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" if (parenthesized_expression "(*piVar1 == 0)" ( (binary_expression "*piVar1 == 0" (pointer_expression "*piVar1" * identifier) == number_literal) )) (compound_statement "{\n          *piVar1 = (int)piVar8;\n        }" { (expression_statement "*piVar1 = (int)piVar8;" (assignment_expression "*piVar1 = (int)piVar8" (pointer_expression "*piVar1" * identifier) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" else (compound_statement "{\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" { (do_statement "do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);" do (compound_statement "{\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          }" { (expression_statement "iVar2 = FUN_0001faa0();" (assignment_expression "iVar2 = FUN_0001faa0()" identifier = (call_expression "FUN_0001faa0()" identifier (argument_list "()" ( )))) ;) (expression_statement "piVar6 = piVar5 + 1;" (assignment_expression "piVar6 = piVar5 + 1" identifier = (binary_expression "piVar5 + 1" identifier + number_literal)) ;) (expression_statement "*piVar5 = 0;" (assignment_expression "*piVar5 = 0" (pointer_expression "*piVar5" * identifier) = number_literal) ;) (expression_statement "piVar5 = piVar6;" (assignment_expression "piVar5 = piVar6" identifier = identifier) ;) }) while (parenthesized_expression "(*piVar6 != 0)" ( (binary_expression "*piVar6 != 0" (pointer_expression "*piVar6" * identifier) != number_literal) )) ;) (expression_statement "*piVar6 = iVar2;" (assignment_expression "*piVar6 = iVar2" (pointer_expression "*piVar6" * identifier) = identifier) ;) }))) })) (labeled_statement "LAB_00040a8d:\n      local_2c = local_2c + 1;" statement_identifier : (expression_statement "local_2c = local_2c + 1;" (assignment_expression "local_2c = local_2c + 1" identifier = (binary_expression "local_2c + 1" identifier + number_literal)) ;)) }) while (parenthesized_expression "(local_2c < *(int *)(param_1 + 0xc))" ( (binary_expression "local_2c < *(int *)(param_1 + 0xc)" identifier < (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) ;) })) (expression_statement "piVar8 = piVar1;" (assignment_expression "piVar8 = piVar1" identifier = identifier) ;) (do_statement "do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);" do (compound_statement "{\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  }" { (expression_statement "piVar8 = piVar8 + 1;" (assignment_expression "piVar8 = piVar8 + 1" identifier = (binary_expression "piVar8 + 1" identifier + number_literal)) ;) (expression_statement "uVar3 = FUN_0001faa0();" (assignment_expression "uVar3 = FUN_0001faa0()" identifier = (call_expression "FUN_0001faa0()" identifier (argument_list "()" ( )))) ;) }) while (parenthesized_expression "(piVar1 + 0x20 != piVar8)" ( (binary_expression "piVar1 + 0x20 != piVar8" (binary_expression "piVar1 + 0x20" identifier + number_literal) != identifier) )) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_00024cc0(piVar1);" (call_expression "FUN_00024cc0(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "*param_4 = uVar3;" (assignment_expression "*param_4 = uVar3" (pointer_expression "*param_4" * identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT + LIT) ))) & LIT) )))) ;) (for_statement for ( (assignment_expression IDENT = (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT + LIT) ))) & LIT) )))) ))) ))) >> LIT)) ; (binary_expression IDENT != LIT) ; (assignment_expression IDENT = (binary_expression IDENT - LIT)) ) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * LIT)) + LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (for_statement for ( (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (binary_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 *)) ) (pointer_expression * IDENT))) ) (compound_statement { (while_statement while (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) < (cast_expression ( (type_descriptor TYPE) ) IDENT)) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT , IDENT )))) , (binary_expression IDENT != LIT)) ))) )) ))) )) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }) (else_clause else (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }))) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;)) }) while (parenthesized_expression ( (binary_expression IDENT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) != IDENT) )) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 __regparm3 FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00040990(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" (identifier "FUN_00040990") (parameter_list "(int param_1,void *param_2,size_t param_3,undefined4 *param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 *param_4" (type_identifier "undefined4") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int *piVar5;\n  int *piVar6;\n  undefined4 *puVar7;\n  int *piVar8;\n  byte bVar9;\n  int local_2c;\n  \n  bVar9 = 0;\n  *param_4 = 0;\n  piVar1 = (int *)FUN_0003f0c0(0x80,0);\n  if (piVar1 == (int *)0x0) {\n    return 7;\n  }\n  *piVar1 = 0;\n  piVar1[0x1f] = 0;\n  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);\n  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }\n  if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }\n  piVar8 = piVar1;\n  do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);\n  *(undefined4 *)(param_1 + 8) = 0;\n  FUN_00024cc0(piVar1);\n  *param_4 = uVar3;\n  return 0;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "int *piVar5;" (primitive_type "int") (pointer_declarator "*piVar5" (* "*") (identifier "piVar5")) (; ";")) (declaration "int *piVar6;" (primitive_type "int") (pointer_declarator "*piVar6" (* "*") (identifier "piVar6")) (; ";")) (declaration "undefined4 *puVar7;" (type_identifier "undefined4") (pointer_declarator "*puVar7" (* "*") (identifier "puVar7")) (; ";")) (declaration "int *piVar8;" (primitive_type "int") (pointer_declarator "*piVar8" (* "*") (identifier "piVar8")) (; ";")) (declaration "byte bVar9;" (type_identifier "byte") (identifier "bVar9") (; ";")) (declaration "int local_2c;" (primitive_type "int") (identifier "local_2c") (; ";")) (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" (identifier "bVar9") (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar1 = (int *)FUN_0003f0c0(0x80,0);" (assignment_expression "piVar1 = (int *)FUN_0003f0c0(0x80,0)" (identifier "piVar1") (= "=") (cast_expression "(int *)FUN_0003f0c0(0x80,0)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0003f0c0(0x80,0)" (identifier "FUN_0003f0c0") (argument_list "(0x80,0)" (( "(") (number_literal "0x80") (, ",") (number_literal "0") () ")"))))) (; ";")) (if_statement "if (piVar1 == (int *)0x0) {\n    return 7;\n  }" (if "if") (parenthesized_expression "(piVar1 == (int *)0x0)" (( "(") (binary_expression "piVar1 == (int *)0x0" (identifier "piVar1") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    return 7;\n  }" ({ "{") (return_statement "return 7;" (return "return") (number_literal "7") (; ";")) (} "}"))) (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar1[0x1f] = 0;" (assignment_expression "piVar1[0x1f] = 0" (subscript_expression "piVar1[0x1f]" (identifier "piVar1") ([ "[") (number_literal "0x1f") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);" (assignment_expression "puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" (identifier "puVar7") (= "=") (cast_expression "(undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" (( "(") (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(piVar1 + 1)" (( "(") (binary_expression "piVar1 + 1" (identifier "piVar1") (+ "+") (number_literal "1")) () ")"))) (& "&") (number_literal "0xfffffffc")) () ")")))) (; ";")) (for_statement "for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;\n      uVar4 != 0; uVar4 = uVar4 - 1) {\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" (for "for") (( "(") (assignment_expression "uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" (identifier "uVar4") (= "=") (binary_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2" (call_expression "(uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)))" (( "(") (binary_expression "(int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" (cast_expression "(int)piVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar1")) (+ "+") (parenthesized_expression "(0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))" (( "(") (binary_expression "0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc)" (number_literal "0x80") (- "-") (cast_expression "(int)((uint)(piVar1 + 1) & 0xfffffffc)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((uint)(piVar1 + 1) & 0xfffffffc)" (( "(") (binary_expression "(uint)(piVar1 + 1) & 0xfffffffc" (call_expression "(uint)(piVar1 + 1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(piVar1 + 1)" (( "(") (binary_expression "piVar1 + 1" (identifier "piVar1") (+ "+") (number_literal "1")) () ")"))) (& "&") (number_literal "0xfffffffc")) () ")")))) () ")"))) () ")"))) (>> ">>") (number_literal "2"))) (; ";") (binary_expression "uVar4 != 0" (identifier "uVar4") (!= "!=") (number_literal "0")) (; ";") (assignment_expression "uVar4 = uVar4 - 1" (identifier "uVar4") (= "=") (binary_expression "uVar4 - 1" (identifier "uVar4") (- "-") (number_literal "1"))) () ")") (compound_statement "{\n    *puVar7 = 0;\n    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;\n  }" ({ "{") (expression_statement "*puVar7 = 0;" (assignment_expression "*puVar7 = 0" (pointer_expression "*puVar7" (* "*") (identifier "puVar7")) (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar7 = puVar7 + (uint)bVar9 * -2 + 1;" (assignment_expression "puVar7 = puVar7 + (uint)bVar9 * -2 + 1" (identifier "puVar7") (= "=") (binary_expression "puVar7 + (uint)bVar9 * -2 + 1" (binary_expression "puVar7 + (uint)bVar9 * -2" (identifier "puVar7") (+ "+") (binary_expression "(uint)bVar9 * -2" (cast_expression "(uint)bVar9" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar9")) (* "*") (number_literal "-2"))) (+ "+") (number_literal "1"))) (; ";")) (} "}"))) (if_statement "if (0 < *(int *)(param_1 + 0xc)) {\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" (if "if") (parenthesized_expression "(0 < *(int *)(param_1 + 0xc))" (( "(") (binary_expression "0 < *(int *)(param_1 + 0xc)" (number_literal "0") (< "<") (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) () ")")) (compound_statement "{\n    local_2c = 0;\n    do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));\n  }" ({ "{") (expression_statement "local_2c = 0;" (assignment_expression "local_2c = 0" (identifier "local_2c") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    } while (local_2c < *(int *)(param_1 + 0xc));" (do "do") (compound_statement "{\n      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }\nLAB_00040a8d:\n      local_2c = local_2c + 1;\n    }" ({ "{") (for_statement "for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;\n          piVar8 = (int *)*piVar8) {\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" (for "for") (( "(") (assignment_expression "piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" (identifier "piVar8") (= "=") (pointer_expression "*(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" (* "*") (cast_expression "(int **)(*(int *)(param_1 + 0x14) + local_2c * 4)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*(int *)(param_1 + 0x14) + local_2c * 4)" (( "(") (binary_expression "*(int *)(param_1 + 0x14) + local_2c * 4" (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (binary_expression "local_2c * 4" (identifier "local_2c") (* "*") (number_literal "4"))) () ")"))))) (; ";") (binary_expression "piVar8 != (int *)0x0" (identifier "piVar8") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";") (assignment_expression "piVar8 = (int *)*piVar8" (identifier "piVar8") (= "=") (cast_expression "(int *)*piVar8" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*piVar8" (* "*") (identifier "piVar8")))) () ")") (compound_statement "{\n        while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }\n        piVar8[1] = 0;\n        piVar5 = piVar1;\n        if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }\n      }" ({ "{") (while_statement "while ((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" (while "while") (parenthesized_expression "((param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))))" (( "(") (parenthesized_expression "(param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))" (( "(") (binary_expression "param_2 != (void *)0x0 &&\n               ((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" (binary_expression "param_2 != (void *)0x0" (identifier "param_2") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (&& "&&") (parenthesized_expression "((piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)))" (( "(") (parenthesized_expression "(piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))" (( "(") (binary_expression "piVar8[5] + 1 < (int)param_3 ||\n                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" (binary_expression "piVar8[5] + 1 < (int)param_3" (binary_expression "piVar8[5] + 1" (subscript_expression "piVar8[5]" (identifier "piVar8") ([ "[") (number_literal "5") (] "]")) (+ "+") (number_literal "1")) (< "<") (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3"))) (|| "||") (parenthesized_expression "(iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0)" (( "(") (comma_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0" (assignment_expression "iVar2 = memcmp(piVar8 + 10,param_2,param_3)" (identifier "iVar2") (= "=") (call_expression "memcmp(piVar8 + 10,param_2,param_3)" (identifier "memcmp") (argument_list "(piVar8 + 10,param_2,param_3)" (( "(") (binary_expression "piVar8 + 10" (identifier "piVar8") (+ "+") (number_literal "10")) (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (, ",") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0"))) () ")"))) () ")")) () ")"))) () ")")) () ")")) (compound_statement "{\n          piVar8 = (int *)*piVar8;\n          if (piVar8 == (int *)0x0) goto LAB_00040a8d;\n        }" ({ "{") (expression_statement "piVar8 = (int *)*piVar8;" (assignment_expression "piVar8 = (int *)*piVar8" (identifier "piVar8") (= "=") (cast_expression "(int *)*piVar8" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*piVar8" (* "*") (identifier "piVar8")))) (; ";")) (if_statement "if (piVar8 == (int *)0x0) goto LAB_00040a8d;" (if "if") (parenthesized_expression "(piVar8 == (int *)0x0)" (( "(") (binary_expression "piVar8 == (int *)0x0" (identifier "piVar8") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_00040a8d;" (goto "goto") (statement_identifier "LAB_00040a8d") (; ";"))) (} "}"))) (expression_statement "piVar8[1] = 0;" (assignment_expression "piVar8[1] = 0" (subscript_expression "piVar8[1]" (identifier "piVar8") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar5 = piVar1;" (assignment_expression "piVar5 = piVar1" (identifier "piVar5") (= "=") (identifier "piVar1")) (; ";")) (if_statement "if (*piVar1 == 0) {\n          *piVar1 = (int)piVar8;\n        }\n        else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" (if "if") (parenthesized_expression "(*piVar1 == 0)" (( "(") (binary_expression "*piVar1 == 0" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          *piVar1 = (int)piVar8;\n        }" ({ "{") (expression_statement "*piVar1 = (int)piVar8;" (assignment_expression "*piVar1 = (int)piVar8" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (cast_expression "(int)piVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar8"))) (; ";")) (} "}")) (else_clause "else {\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" (else "else") (compound_statement "{\n          do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);\n          *piVar6 = iVar2;\n        }" ({ "{") (do_statement "do {\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          } while (*piVar6 != 0);" (do "do") (compound_statement "{\n            iVar2 = FUN_0001faa0();\n            piVar6 = piVar5 + 1;\n            *piVar5 = 0;\n            piVar5 = piVar6;\n          }" ({ "{") (expression_statement "iVar2 = FUN_0001faa0();" (assignment_expression "iVar2 = FUN_0001faa0()" (identifier "iVar2") (= "=") (call_expression "FUN_0001faa0()" (identifier "FUN_0001faa0") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "piVar6 = piVar5 + 1;" (assignment_expression "piVar6 = piVar5 + 1" (identifier "piVar6") (= "=") (binary_expression "piVar5 + 1" (identifier "piVar5") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*piVar5 = 0;" (assignment_expression "*piVar5 = 0" (pointer_expression "*piVar5" (* "*") (identifier "piVar5")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar5 = piVar6;" (assignment_expression "piVar5 = piVar6" (identifier "piVar5") (= "=") (identifier "piVar6")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*piVar6 != 0)" (( "(") (binary_expression "*piVar6 != 0" (pointer_expression "*piVar6" (* "*") (identifier "piVar6")) (!= "!=") (number_literal "0")) () ")")) (; ";")) (expression_statement "*piVar6 = iVar2;" (assignment_expression "*piVar6 = iVar2" (pointer_expression "*piVar6" (* "*") (identifier "piVar6")) (= "=") (identifier "iVar2")) (; ";")) (} "}")))) (} "}"))) (labeled_statement "LAB_00040a8d:\n      local_2c = local_2c + 1;" (statement_identifier "LAB_00040a8d") (: ":") (expression_statement "local_2c = local_2c + 1;" (assignment_expression "local_2c = local_2c + 1" (identifier "local_2c") (= "=") (binary_expression "local_2c + 1" (identifier "local_2c") (+ "+") (number_literal "1"))) (; ";"))) (} "}")) (while "while") (parenthesized_expression "(local_2c < *(int *)(param_1 + 0xc))" (( "(") (binary_expression "local_2c < *(int *)(param_1 + 0xc)" (identifier "local_2c") (< "<") (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) () ")")) (; ";")) (} "}"))) (expression_statement "piVar8 = piVar1;" (assignment_expression "piVar8 = piVar1" (identifier "piVar8") (= "=") (identifier "piVar1")) (; ";")) (do_statement "do {\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  } while (piVar1 + 0x20 != piVar8);" (do "do") (compound_statement "{\n    piVar8 = piVar8 + 1;\n    uVar3 = FUN_0001faa0();\n  }" ({ "{") (expression_statement "piVar8 = piVar8 + 1;" (assignment_expression "piVar8 = piVar8 + 1" (identifier "piVar8") (= "=") (binary_expression "piVar8 + 1" (identifier "piVar8") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar3 = FUN_0001faa0();" (assignment_expression "uVar3 = FUN_0001faa0()" (identifier "uVar3") (= "=") (call_expression "FUN_0001faa0()" (identifier "FUN_0001faa0") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(piVar1 + 0x20 != piVar8)" (( "(") (binary_expression "piVar1 + 0x20 != piVar8" (binary_expression "piVar1 + 0x20" (identifier "piVar1") (+ "+") (number_literal "0x20")) (!= "!=") (identifier "piVar8")) () ")")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "FUN_00024cc0(piVar1);" (call_expression "FUN_00024cc0(piVar1)" (identifier "FUN_00024cc0") (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")"))) (; ";")) (expression_statement "*param_4 = uVar3;" (assignment_expression "*param_4 = uVar3" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (identifier "uVar3")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int __regparm3 function_1(type_1 *pHash,char *var_6,int var_7,type_2 **ppSorted)

{
  int *var_2;
  int var_9;
  type_2 *pLeft;
  type_2 *var_5;
  type_3 var_3;
  type_2 *var_10;
  int *var_12;
  int *piVar6;
  type_4 *var_4;
  type_5 bVar8;
  int var_13;
  
  bVar8 = 0;
  *ppSorted = (type_2 *)0x0;
  var_2 = (int *)var_1(0x80);
  if (var_2 == (int *)0x0) {
    return 7;
  }
  *var_2 = 0;
  var_2[0x1f] = 0;
  var_4 = (type_4 *)((type_3)(var_2 + 1) & 0xfffffffc);
  for (var_3 = (type_3)((int)var_2 + (0x80 - (int)((type_3)(var_2 + 1) & 0xfffffffc))) >> 2; var_3 != 0;
      var_3 = var_3 - 1) {
    *var_4 = 0;
    var_4 = var_4 + (type_3)bVar8 * -2 + 1;
  }
  if (0 < pHash->nSlot) {
    var_13 = 0;
    do {
      for (var_5 = pHash->aSlot[var_13]; var_5 != (type_2 *)0x0;
          var_5 = var_5->pHashNext) {
        while ((var_6 != (char *)0x0 &&
               ((var_5->nKey + 1 < var_7 || (var_9 = var_8(var_5 + 1,var_6,var_7), var_9 != 0))))
              ) {
          var_5 = var_5->pHashNext;
          if (var_5 == (type_2 *)0x0) goto LAB_00040a8d;
        }
        var_5->pScanNext = (type_2 *)0x0;
        var_10 = (type_2 *)*var_2;
        pLeft = var_5;
        var_12 = var_2;
        if (var_10 == (type_2 *)0x0) {
          *var_2 = (int)var_5;
        }
        else {
          do {
            pLeft = var_11(pLeft,var_10);
            piVar6 = var_12 + 1;
            *var_12 = 0;
            var_10 = (type_2 *)*piVar6;
            var_12 = piVar6;
          } while (var_10 != (type_2 *)0x0);
          *piVar6 = (int)pLeft;
        }
      }
LAB_00040a8d:
      var_13 = var_13 + 1;
    } while (var_13 < pHash->nSlot);
  }
  var_5 = (type_2 *)0x0;
  var_12 = var_2;
  do {
    var_10 = (type_2 *)*var_12;
    var_12 = var_12 + 1;
    var_5 = var_11(var_5,var_10);
  } while (var_2 + 0x20 != var_12);
  pHash->nEntry = 0;
  var_14(var_2);
  *ppSorted = var_5;
  return 0;
}


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

/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

undefined4 __regparm3 MASKED(int param_1,void *param_2,size_t param_3,undefined4 *param_4)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  uint uVar4;
  int *piVar5;
  int *piVar6;
  undefined4 *puVar7;
  int *piVar8;
  byte bVar9;
  int local_2c;
  
  bVar9 = 0;
  *param_4 = 0;
  piVar1 = (int *)FUN_0003f0c0(0x80,0);
  if (piVar1 == (int *)0x0) {
    return 7;
  }
  *piVar1 = 0;
  piVar1[0x1f] = 0;
  puVar7 = (undefined4 *)((uint)(piVar1 + 1) & 0xfffffffc);
  for (uVar4 = (uint)((int)piVar1 + (0x80 - (int)((uint)(piVar1 + 1) & 0xfffffffc))) >> 2;
      uVar4 != 0; uVar4 = uVar4 - 1) {
    *puVar7 = 0;
    puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
  }
  if (0 < *(int *)(param_1 + 0xc)) {
    local_2c = 0;
    do {
      for (piVar8 = *(int **)(*(int *)(param_1 + 0x14) + local_2c * 4); piVar8 != (int *)0x0;
          piVar8 = (int *)*piVar8) {
        while ((param_2 != (void *)0x0 &&
               ((piVar8[5] + 1 < (int)param_3 ||
                (iVar2 = memcmp(piVar8 + 10,param_2,param_3), iVar2 != 0))))) {
          piVar8 = (int *)*piVar8;
          if (piVar8 == (int *)0x0) goto LAB_00040a8d;
        }
        piVar8[1] = 0;
        piVar5 = piVar1;
        if (*piVar1 == 0) {
          *piVar1 = (int)piVar8;
        }
        else {
          do {
            iVar2 = FUN_0001faa0();
            piVar6 = piVar5 + 1;
            *piVar5 = 0;
            piVar5 = piVar6;
          } while (*piVar6 != 0);
          *piVar6 = iVar2;
        }
      }
LAB_00040a8d:
      local_2c = local_2c + 1;
    } while (local_2c < *(int *)(param_1 + 0xc));
  }
  piVar8 = piVar1;
  do {
    piVar8 = piVar8 + 1;
    uVar3 = FUN_0001faa0();
  } while (piVar1 + 0x20 != piVar8);
  *(undefined4 *)(param_1 + 8) = 0;
  FUN_00024cc0(piVar1);
  *param_4 = uVar3;
  return 0;
}

