
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 walIndexAppend(Wal *pWal,u32 iFrame,u32 iPage)

{
  int iVar1;
  u32 uVar2;
  int iVar3;
  u32 *puVar4;
  ht_slot *phVar5;
  u32 *__s;
  u32 *puVar6;
  uint uVar7;
  int in_GS_OFFSET;
  WalHashLoc sLoc;
  
  uVar7 = iFrame + 0x21 >> 0xc;
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)
     ) {
    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);
    if (uVar7 != 0) goto LAB_000398e9;
LAB_000399b7:
    __s = sLoc.aPgno + 0x22;
    sLoc.iZero = 0;
    puVar6 = sLoc.aPgno + 0x21;
    puVar4 = sLoc.aPgno;
    sLoc.aPgno = puVar6;
    if (iFrame == 1) goto LAB_000399d3;
LAB_00039907:
    uVar2 = puVar6[iFrame];
    sLoc.aPgno = puVar6;
  }
  else {
    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);
    if (iVar3 != 0) goto LAB_00039973;
    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);
    if (uVar7 == 0) goto LAB_000399b7;
LAB_000398e9:
    sLoc.iZero = uVar7 * 0x1000 - 0x22;
    iFrame = iFrame - sLoc.iZero;
    puVar6 = sLoc.aPgno + -1;
    puVar4 = sLoc.aPgno;
    __s = sLoc.aPgno;
    sLoc.aPgno = puVar6;
    if (iFrame != 1) goto LAB_00039907;
LAB_000399d3:
    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));
    uVar2 = sLoc.aPgno[iFrame];
  }
  if (uVar2 != 0) {
    walCleanupHash(pWal);
  }
  uVar7 = iPage * 0x17f & 0x1fff;
  phVar5 = sLoc.aHash + uVar7;
  uVar2 = iFrame;
  if (*phVar5 == 0) {
LAB_00039964:
    sLoc.aPgno[iFrame] = iPage;
    iVar3 = 0;
    *phVar5 = (ht_slot)iFrame;
  }
  else {
    for (; uVar2 != 0; uVar2 = uVar2 - 1) {
      uVar7 = uVar7 + 1 & 0x1fff;
      phVar5 = sLoc.aHash + uVar7;
      if (*phVar5 == 0) goto LAB_00039964;
    }
    iVar3 = sqlite3CorruptError(0xec56);
  }
LAB_00039973:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 FUN_00039890(int param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  short *psVar5;
  void *__s;
  void *pvVar6;
  uint uVar7;
  int in_GS_OFFSET;
  int local_2c;
  void *local_28;
  
  uVar7 = param_2 + 0x21U >> 0xc;
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&
     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {
    local_2c = (int)local_28 + 0x4000;
    if (uVar7 != 0) goto LAB_000398e9;
LAB_000399b7:
    __s = (void *)((int)local_28 + 0x88);
    pvVar6 = (void *)((int)local_28 + 0x84);
    pvVar4 = local_28;
    local_28 = pvVar6;
    if (param_2 == 1) goto LAB_000399d3;
LAB_00039907:
    iVar3 = param_2 * 4;
    iVar2 = *(int *)((int)pvVar6 + iVar3);
  }
  else {
    iVar3 = FUN_0002ebd0();
    if (iVar3 != 0) goto LAB_00039973;
    local_2c = (int)local_28 + 0x4000;
    if (uVar7 == 0) goto LAB_000399b7;
LAB_000398e9:
    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);
    pvVar6 = (void *)((int)local_28 + -4);
    pvVar4 = local_28;
    __s = local_28;
    local_28 = pvVar6;
    if (param_2 != 1) goto LAB_00039907;
LAB_000399d3:
    iVar3 = param_2 * 4;
    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));
    iVar2 = *(int *)((int)local_28 + iVar3);
    pvVar6 = local_28;
  }
  if (iVar2 != 0) {
    FUN_0002ed20();
  }
  uVar7 = param_3 * 0x17f & 0x1fff;
  psVar5 = (short *)(local_2c + uVar7 * 2);
  iVar2 = param_2;
  if (*psVar5 == 0) {
LAB_00039964:
    *(int *)(iVar3 + (int)pvVar6) = param_3;
    iVar3 = 0;
    *psVar5 = (short)param_2;
  }
  else {
    for (; iVar2 != 0; iVar2 = iVar2 + -1) {
      uVar7 = uVar7 + 1 & 0x1fff;
      psVar5 = (short *)(local_2c + uVar7 * 2);
      if (*psVar5 == 0) goto LAB_00039964;
    }
    iVar3 = FUN_00037780();
  }
LAB_00039973:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000d1450();
}


PUSH EBP
PUSH EDI
LEA EDI,[EDX + 0x21]
PUSH ESI
PUSH EBX
MOV EBP,EAX
CALL 0x0001ddf0
ADD EBX,0xcc762
SUB ESP,0x2c
SHR EDI,0xc
MOV ESI,EDX
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
CMP EDI,dword ptr [EBP + 0x18]
MOV dword ptr [ESP + 0xc],ECX
JGE 0x00039990
MOV EAX,dword ptr [EBP + 0x20]
MOV EAX,dword ptr [EAX + EDI*0x4]
TEST EAX,EAX
MOV dword ptr [ESP + 0x14],EAX
JZ 0x00039990
LEA EDX,[EAX + 0x4000]
TEST EDI,EDI
MOV dword ptr [ESP + 0x10],EDX
JZ 0x000399b7
SHL EDI,0xc
MOV ECX,EAX
LEA EDX,[EDI + -0x22]
SUB ESI,EDX
MOV dword ptr [ESP + 0x18],EDX
LEA EDX,[ECX + -0x4]
CMP ESI,0x1
MOV dword ptr [ESP + 0x14],EDX
JZ 0x000399d3
LEA EDI,[ESI*0x4 + 0x0]
ADD EDX,EDI
MOV EAX,dword ptr [EDX]
TEST EAX,EAX
JNZ 0x00039a00
IMUL EAX,dword ptr [ESP + 0xc],0x17f
MOV EBX,dword ptr [ESP + 0x10]
AND EAX,0x1fff
LEA ECX,[EBX + EAX*0x2]
MOVZX EDX,word ptr [ECX]
TEST DX,DX
JZ 0x00039964
TEST ESI,ESI
JZ 0x00039a10
MOV EDX,ESI
JMP 0x00039951
SUB EDX,0x1
JZ 0x00039a10
ADD EAX,0x1
AND EAX,0x1fff
LEA ECX,[EBX + EAX*0x2]
MOVZX EBP,word ptr [ECX]
TEST BP,BP
JNZ 0x00039948
ADD EDI,dword ptr [ESP + 0x14]
MOV EAX,dword ptr [ESP + 0xc]
MOV dword ptr [EDI],EAX
XOR EAX,EAX
MOV word ptr [ECX],SI
MOV EBX,dword ptr [ESP + 0x1c]
XOR EBX,dword ptr GS:[0x14]
JNZ 0x00039a1f
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA ECX,[ESP + 0x14]
MOV EDX,EDI
MOV EAX,EBP
CALL 0x0002ebd0
TEST EAX,EAX
JNZ 0x00039973
MOV EAX,dword ptr [ESP + 0x14]
TEST EDI,EDI
LEA EDX,[EAX + 0x4000]
MOV dword ptr [ESP + 0x10],EDX
JNZ 0x000398e9
LEA ECX,[EAX + 0x88]
XOR EDX,EDX
CMP ESI,0x1
MOV dword ptr [ESP + 0x18],EDX
LEA EDX,[ECX + -0x4]
MOV dword ptr [ESP + 0x14],EDX
JNZ 0x00039907
ADD EAX,0x8000
SUB ESP,0x4
LEA EDI,[ESI*0x4 + 0x0]
SUB EAX,ECX
PUSH EAX
PUSH 0x0
PUSH ECX
CALL 0x000168b0
MOV EDX,dword ptr [ESP + 0x24]
ADD ESP,0x10
ADD EDX,EDI
MOV EAX,dword ptr [EDX]
TEST EAX,EAX
JZ 0x0003991a
MOV EAX,EBP
CALL 0x0002ed20
JMP 0x0003991a
MOV EAX,0xec56
CALL 0x00037780
JMP 0x00039973
CALL 0x000d1450
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 FUN_00039890(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000d1450();\n}\n\n" comment (function_definition "int __regparm3 FUN_00039890(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000d1450();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00039890(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000d1450();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "short *psVar5;" (sized_type_specifier "short" short) (pointer_declarator "*psVar5" * identifier) ;) (declaration "void *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "void *pvVar6;" primitive_type (pointer_declarator "*pvVar6" * identifier) ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (declaration "void *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (expression_statement "uVar7 = param_2 + 0x21U >> 0xc;" (assignment_expression "uVar7 = param_2 + 0x21U >> 0xc" identifier = (binary_expression "param_2 + 0x21U >> 0xc" (binary_expression "param_2 + 0x21U" identifier + number_literal) >> number_literal)) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" if (parenthesized_expression "(((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0))" ( (binary_expression "((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" (parenthesized_expression "((int)uVar7 < *(int *)(param_1 + 0x18))" ( (binary_expression "(int)uVar7 < *(int *)(param_1 + 0x18)" (cast_expression "(int)uVar7" ( (type_descriptor "int" primitive_type) ) identifier) < (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) )) && (parenthesized_expression "(local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" ( (comma_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0" (assignment_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" identifier = (pointer_expression "*(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" * (cast_expression "(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(param_1 + 0x20) + uVar7 * 4)" ( (binary_expression "*(int *)(param_1 + 0x20) + uVar7 * 4" (pointer_expression "*(int *)(param_1 + 0x20)" * (cast_expression "(int *)(param_1 + 0x20)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) + (binary_expression "uVar7 * 4" identifier * number_literal)) ))))) , (binary_expression "local_28 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }" { (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" identifier = (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal)) ;) (if_statement "if (uVar7 != 0) goto LAB_000398e9;" if (parenthesized_expression "(uVar7 != 0)" ( (binary_expression "uVar7 != 0" identifier != number_literal) )) (goto_statement "goto LAB_000398e9;" goto statement_identifier ;)) (labeled_statement "LAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);" statement_identifier : (expression_statement "__s = (void *)((int)local_28 + 0x88);" (assignment_expression "__s = (void *)((int)local_28 + 0x88)" identifier = (cast_expression "(void *)((int)local_28 + 0x88)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + 0x88)" ( (binary_expression "(int)local_28 + 0x88" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;)) (expression_statement "pvVar6 = (void *)((int)local_28 + 0x84);" (assignment_expression "pvVar6 = (void *)((int)local_28 + 0x84)" identifier = (cast_expression "(void *)((int)local_28 + 0x84)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + 0x84)" ( (binary_expression "(int)local_28 + 0x84" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" identifier = identifier) ;) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" identifier = identifier) ;) (if_statement "if (param_2 == 1) goto LAB_000399d3;" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (goto_statement "goto LAB_000399d3;" goto statement_identifier ;)) (labeled_statement "LAB_00039907:\n    iVar3 = param_2 * 4;" statement_identifier : (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;)) (expression_statement "iVar2 = *(int *)((int)pvVar6 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)pvVar6 + iVar3)" identifier = (pointer_expression "*(int *)((int)pvVar6 + iVar3)" * (cast_expression "(int *)((int)pvVar6 + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar6 + iVar3)" ( (binary_expression "(int)pvVar6 + iVar3" (cast_expression "(int)pvVar6" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))))) ;) }) (else_clause "else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" else (compound_statement "{\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" { (expression_statement "iVar3 = FUN_0002ebd0();" (assignment_expression "iVar3 = FUN_0002ebd0()" identifier = (call_expression "FUN_0002ebd0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar3 != 0) goto LAB_00039973;" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (goto_statement "goto LAB_00039973;" goto statement_identifier ;)) (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" identifier = (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal)) ;) (if_statement "if (uVar7 == 0) goto LAB_000399b7;" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000399b7;" goto statement_identifier ;)) (labeled_statement "LAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" statement_identifier : (expression_statement "param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" (assignment_expression "param_2 = param_2 - (uVar7 * 0x1000 + -0x22)" identifier = (binary_expression "param_2 - (uVar7 * 0x1000 + -0x22)" identifier - (parenthesized_expression "(uVar7 * 0x1000 + -0x22)" ( (binary_expression "uVar7 * 0x1000 + -0x22" (binary_expression "uVar7 * 0x1000" identifier * number_literal) + number_literal) )))) ;)) (expression_statement "pvVar6 = (void *)((int)local_28 + -4);" (assignment_expression "pvVar6 = (void *)((int)local_28 + -4)" identifier = (cast_expression "(void *)((int)local_28 + -4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + -4)" ( (binary_expression "(int)local_28 + -4" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" identifier = identifier) ;) (expression_statement "__s = local_28;" (assignment_expression "__s = local_28" identifier = identifier) ;) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" identifier = identifier) ;) (if_statement "if (param_2 != 1) goto LAB_00039907;" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (goto_statement "goto LAB_00039907;" goto statement_identifier ;)) (labeled_statement "LAB_000399d3:\n    iVar3 = param_2 * 4;" statement_identifier : (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;)) (expression_statement "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));" (call_expression "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" identifier (argument_list "(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" ( identifier , number_literal , (binary_expression "(int)pvVar4 + (0x8000 - (int)__s)" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x8000 - (int)__s)" ( (binary_expression "0x8000 - (int)__s" number_literal - (cast_expression "(int)__s" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) ;) (expression_statement "iVar2 = *(int *)((int)local_28 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)local_28 + iVar3)" identifier = (pointer_expression "*(int *)((int)local_28 + iVar3)" * (cast_expression "(int *)((int)local_28 + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + iVar3)" ( (binary_expression "(int)local_28 + iVar3" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))))) ;) (expression_statement "pvVar6 = local_28;" (assignment_expression "pvVar6 = local_28" identifier = identifier) ;) }))) (if_statement "if (iVar2 != 0) {\n    FUN_0002ed20();\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_0002ed20();\n  }" { (expression_statement "FUN_0002ed20();" (call_expression "FUN_0002ed20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar7 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar7 = param_3 * 0x17f & 0x1fff" identifier = (binary_expression "param_3 * 0x17f & 0x1fff" (binary_expression "param_3 * 0x17f" identifier * number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar7 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar7 * 2)" ( (binary_expression "local_2c + uVar7 * 2" identifier + (binary_expression "uVar7 * 2" identifier * number_literal)) )))) ;) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" identifier = identifier) ;) (if_statement "if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }" { (labeled_statement "LAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;" statement_identifier : (expression_statement "*(int *)(iVar3 + (int)pvVar6) = param_3;" (assignment_expression "*(int *)(iVar3 + (int)pvVar6) = param_3" (pointer_expression "*(int *)(iVar3 + (int)pvVar6)" * (cast_expression "(int *)(iVar3 + (int)pvVar6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + (int)pvVar6)" ( (binary_expression "iVar3 + (int)pvVar6" identifier + (cast_expression "(int)pvVar6" ( (type_descriptor "int" primitive_type) ) identifier)) )))) = identifier) ;)) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "*psVar5 = (short)param_2;" (assignment_expression "*psVar5 = (short)param_2" (pointer_expression "*psVar5" * identifier) = (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) }) (else_clause "else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" else (compound_statement "{\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" { (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" for ( ; (binary_expression "iVar2 != 0" identifier != number_literal) ; (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ) (compound_statement "{\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" { (expression_statement "uVar7 = uVar7 + 1 & 0x1fff;" (assignment_expression "uVar7 = uVar7 + 1 & 0x1fff" identifier = (binary_expression "uVar7 + 1 & 0x1fff" (binary_expression "uVar7 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar7 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar7 * 2)" ( (binary_expression "local_2c + uVar7 * 2" identifier + (binary_expression "uVar7 * 2" identifier * number_literal)) )))) ;) (if_statement "if (*psVar5 == 0) goto LAB_00039964;" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_00039964;" goto statement_identifier ;)) })) (expression_statement "iVar3 = FUN_00037780();" (assignment_expression "iVar3 = FUN_00037780()" identifier = (call_expression "FUN_00037780()" identifier (argument_list "()" ( )))) ;) }))) (labeled_statement "LAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) }))) comment (expression_statement "FUN_000d1450();" (call_expression "FUN_000d1450()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 walIndexAppend(Wal *pWal,u32 iFrame,u32 iPage)\n\n{\n  int iVar1;\n  u32 uVar2;\n  int iVar3;\n  u32 *puVar4;\n  ht_slot *phVar5;\n  u32 *__s;\n  u32 *puVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  uVar7 = iFrame + 0x21 >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)\n     ) {\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = sLoc.aPgno + 0x22;\n    sLoc.iZero = 0;\n    puVar6 = sLoc.aPgno + 0x21;\n    puVar4 = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame == 1) goto LAB_000399d3;\nLAB_00039907:\n    uVar2 = puVar6[iFrame];\n    sLoc.aPgno = puVar6;\n  }\n  else {\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }\n  if (uVar2 != 0) {\n    walCleanupHash(pWal);\n  }\n  uVar7 = iPage * 0x17f & 0x1fff;\n  phVar5 = sLoc.aHash + uVar7;\n  uVar2 = iFrame;\n  if (*phVar5 == 0) {\nLAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;\n    iVar3 = 0;\n    *phVar5 = (ht_slot)iFrame;\n  }\n  else {\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "int __regparm3 walIndexAppend(Wal *pWal,u32 iFrame,u32 iPage)\n\n{\n  int iVar1;\n  u32 uVar2;\n  int iVar3;\n  u32 *puVar4;\n  ht_slot *phVar5;\n  u32 *__s;\n  u32 *puVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  uVar7 = iFrame + 0x21 >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)\n     ) {\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = sLoc.aPgno + 0x22;\n    sLoc.iZero = 0;\n    puVar6 = sLoc.aPgno + 0x21;\n    puVar4 = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame == 1) goto LAB_000399d3;\nLAB_00039907:\n    uVar2 = puVar6[iFrame];\n    sLoc.aPgno = puVar6;\n  }\n  else {\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }\n  if (uVar2 != 0) {\n    walCleanupHash(pWal);\n  }\n  uVar7 = iPage * 0x17f & 0x1fff;\n  phVar5 = sLoc.aHash + uVar7;\n  uVar2 = iFrame;\n  if (*phVar5 == 0) {\nLAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;\n    iVar3 = 0;\n    *phVar5 = (ht_slot)iFrame;\n  }\n  else {\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "walIndexAppend(Wal *pWal,u32 iFrame,u32 iPage)" identifier (parameter_list "(Wal *pWal,u32 iFrame,u32 iPage)" ( (parameter_declaration "Wal *pWal" type_identifier (pointer_declarator "*pWal" * identifier)) , (parameter_declaration "u32 iFrame" type_identifier identifier) , (parameter_declaration "u32 iPage" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  u32 uVar2;\n  int iVar3;\n  u32 *puVar4;\n  ht_slot *phVar5;\n  u32 *__s;\n  u32 *puVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  uVar7 = iFrame + 0x21 >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)\n     ) {\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = sLoc.aPgno + 0x22;\n    sLoc.iZero = 0;\n    puVar6 = sLoc.aPgno + 0x21;\n    puVar4 = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame == 1) goto LAB_000399d3;\nLAB_00039907:\n    uVar2 = puVar6[iFrame];\n    sLoc.aPgno = puVar6;\n  }\n  else {\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }\n  if (uVar2 != 0) {\n    walCleanupHash(pWal);\n  }\n  uVar7 = iPage * 0x17f & 0x1fff;\n  phVar5 = sLoc.aHash + uVar7;\n  uVar2 = iFrame;\n  if (*phVar5 == 0) {\nLAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;\n    iVar3 = 0;\n    *phVar5 = (ht_slot)iFrame;\n  }\n  else {\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "u32 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "u32 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ht_slot *phVar5;" type_identifier (pointer_declarator "*phVar5" * identifier) ;) (declaration "u32 *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (declaration "u32 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "WalHashLoc sLoc;" type_identifier identifier ;) (expression_statement "uVar7 = iFrame + 0x21 >> 0xc;" (assignment_expression "uVar7 = iFrame + 0x21 >> 0xc" identifier = (binary_expression "iFrame + 0x21 >> 0xc" (binary_expression "iFrame + 0x21" identifier + number_literal) >> number_literal)) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)\n     ) {\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = sLoc.aPgno + 0x22;\n    sLoc.iZero = 0;\n    puVar6 = sLoc.aPgno + 0x21;\n    puVar4 = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame == 1) goto LAB_000399d3;\nLAB_00039907:\n    uVar2 = puVar6[iFrame];\n    sLoc.aPgno = puVar6;\n  }\n  else {\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }" if (parenthesized_expression "(((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)\n     )" ( (binary_expression "((int)uVar7 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)" (parenthesized_expression "((int)uVar7 < pWal->nWiData)" ( (binary_expression "(int)uVar7 < pWal->nWiData" (cast_expression "(int)uVar7" ( (type_descriptor "int" primitive_type) ) identifier) < (field_expression "pWal->nWiData" identifier -> field_identifier)) )) && (parenthesized_expression "(sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0)" ( (comma_expression "sLoc.aPgno = pWal->apWiData[uVar7], sLoc.aPgno != (u32 *)0x0" (assignment_expression "sLoc.aPgno = pWal->apWiData[uVar7]" (field_expression "sLoc.aPgno" identifier . field_identifier) = (subscript_expression "pWal->apWiData[uVar7]" (field_expression "pWal->apWiData" identifier -> field_identifier) [ identifier ])) , (binary_expression "sLoc.aPgno != (u32 *)0x0" (field_expression "sLoc.aPgno" identifier . field_identifier) != (cast_expression "(u32 *)0x0" ( (type_descriptor "u32 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = sLoc.aPgno + 0x22;\n    sLoc.iZero = 0;\n    puVar6 = sLoc.aPgno + 0x21;\n    puVar4 = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame == 1) goto LAB_000399d3;\nLAB_00039907:\n    uVar2 = puVar6[iFrame];\n    sLoc.aPgno = puVar6;\n  }" { (expression_statement "sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);" (assignment_expression "sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000)" (field_expression "sLoc.aHash" identifier . field_identifier) = (cast_expression "(ht_slot *)(sLoc.aPgno + 0x1000)" ( (type_descriptor "ht_slot *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(sLoc.aPgno + 0x1000)" ( (binary_expression "sLoc.aPgno + 0x1000" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal) )))) ;) (if_statement "if (uVar7 != 0) goto LAB_000398e9;" if (parenthesized_expression "(uVar7 != 0)" ( (binary_expression "uVar7 != 0" identifier != number_literal) )) (goto_statement "goto LAB_000398e9;" goto statement_identifier ;)) (labeled_statement "LAB_000399b7:\n    __s = sLoc.aPgno + 0x22;" statement_identifier : (expression_statement "__s = sLoc.aPgno + 0x22;" (assignment_expression "__s = sLoc.aPgno + 0x22" identifier = (binary_expression "sLoc.aPgno + 0x22" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal)) ;)) (expression_statement "sLoc.iZero = 0;" (assignment_expression "sLoc.iZero = 0" (field_expression "sLoc.iZero" identifier . field_identifier) = number_literal) ;) (expression_statement "puVar6 = sLoc.aPgno + 0x21;" (assignment_expression "puVar6 = sLoc.aPgno + 0x21" identifier = (binary_expression "sLoc.aPgno + 0x21" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal)) ;) (expression_statement "puVar4 = sLoc.aPgno;" (assignment_expression "puVar4 = sLoc.aPgno" identifier = (field_expression "sLoc.aPgno" identifier . field_identifier)) ;) (expression_statement "sLoc.aPgno = puVar6;" (assignment_expression "sLoc.aPgno = puVar6" (field_expression "sLoc.aPgno" identifier . field_identifier) = identifier) ;) (if_statement "if (iFrame == 1) goto LAB_000399d3;" if (parenthesized_expression "(iFrame == 1)" ( (binary_expression "iFrame == 1" identifier == number_literal) )) (goto_statement "goto LAB_000399d3;" goto statement_identifier ;)) (labeled_statement "LAB_00039907:\n    uVar2 = puVar6[iFrame];" statement_identifier : (expression_statement "uVar2 = puVar6[iFrame];" (assignment_expression "uVar2 = puVar6[iFrame]" identifier = (subscript_expression "puVar6[iFrame]" identifier [ identifier ])) ;)) (expression_statement "sLoc.aPgno = puVar6;" (assignment_expression "sLoc.aPgno = puVar6" (field_expression "sLoc.aPgno" identifier . field_identifier) = identifier) ;) }) (else_clause "else {\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }" else (compound_statement "{\n    iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);\n    if (iVar3 != 0) goto LAB_00039973;\n    sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;\n    iFrame = iFrame - sLoc.iZero;\n    puVar6 = sLoc.aPgno + -1;\n    puVar4 = sLoc.aPgno;\n    __s = sLoc.aPgno;\n    sLoc.aPgno = puVar6;\n    if (iFrame != 1) goto LAB_00039907;\nLAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));\n    uVar2 = sLoc.aPgno[iFrame];\n  }" { (expression_statement "iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno);" (assignment_expression "iVar3 = walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno)" identifier = (call_expression "walIndexPageRealloc(pWal,uVar7,&sLoc.aPgno)" identifier (argument_list "(pWal,uVar7,&sLoc.aPgno)" ( identifier , identifier , (pointer_expression "&sLoc.aPgno" & (field_expression "sLoc.aPgno" identifier . field_identifier)) )))) ;) (if_statement "if (iVar3 != 0) goto LAB_00039973;" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (goto_statement "goto LAB_00039973;" goto statement_identifier ;)) (expression_statement "sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000);" (assignment_expression "sLoc.aHash = (ht_slot *)(sLoc.aPgno + 0x1000)" (field_expression "sLoc.aHash" identifier . field_identifier) = (cast_expression "(ht_slot *)(sLoc.aPgno + 0x1000)" ( (type_descriptor "ht_slot *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(sLoc.aPgno + 0x1000)" ( (binary_expression "sLoc.aPgno + 0x1000" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal) )))) ;) (if_statement "if (uVar7 == 0) goto LAB_000399b7;" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000399b7;" goto statement_identifier ;)) (labeled_statement "LAB_000398e9:\n    sLoc.iZero = uVar7 * 0x1000 - 0x22;" statement_identifier : (expression_statement "sLoc.iZero = uVar7 * 0x1000 - 0x22;" (assignment_expression "sLoc.iZero = uVar7 * 0x1000 - 0x22" (field_expression "sLoc.iZero" identifier . field_identifier) = (binary_expression "uVar7 * 0x1000 - 0x22" (binary_expression "uVar7 * 0x1000" identifier * number_literal) - number_literal)) ;)) (expression_statement "iFrame = iFrame - sLoc.iZero;" (assignment_expression "iFrame = iFrame - sLoc.iZero" identifier = (binary_expression "iFrame - sLoc.iZero" identifier - (field_expression "sLoc.iZero" identifier . field_identifier))) ;) (expression_statement "puVar6 = sLoc.aPgno + -1;" (assignment_expression "puVar6 = sLoc.aPgno + -1" identifier = (binary_expression "sLoc.aPgno + -1" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal)) ;) (expression_statement "puVar4 = sLoc.aPgno;" (assignment_expression "puVar4 = sLoc.aPgno" identifier = (field_expression "sLoc.aPgno" identifier . field_identifier)) ;) (expression_statement "__s = sLoc.aPgno;" (assignment_expression "__s = sLoc.aPgno" identifier = (field_expression "sLoc.aPgno" identifier . field_identifier)) ;) (expression_statement "sLoc.aPgno = puVar6;" (assignment_expression "sLoc.aPgno = puVar6" (field_expression "sLoc.aPgno" identifier . field_identifier) = identifier) ;) (if_statement "if (iFrame != 1) goto LAB_00039907;" if (parenthesized_expression "(iFrame != 1)" ( (binary_expression "iFrame != 1" identifier != number_literal) )) (goto_statement "goto LAB_00039907;" goto statement_identifier ;)) (labeled_statement "LAB_000399d3:\n    memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));" statement_identifier : (expression_statement "memset(__s,0,(int)puVar4 + (0x8000 - (int)__s));" (call_expression "memset(__s,0,(int)puVar4 + (0x8000 - (int)__s))" identifier (argument_list "(__s,0,(int)puVar4 + (0x8000 - (int)__s))" ( identifier , number_literal , (binary_expression "(int)puVar4 + (0x8000 - (int)__s)" (cast_expression "(int)puVar4" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x8000 - (int)__s)" ( (binary_expression "0x8000 - (int)__s" number_literal - (cast_expression "(int)__s" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) ;)) (expression_statement "uVar2 = sLoc.aPgno[iFrame];" (assignment_expression "uVar2 = sLoc.aPgno[iFrame]" identifier = (subscript_expression "sLoc.aPgno[iFrame]" (field_expression "sLoc.aPgno" identifier . field_identifier) [ identifier ])) ;) }))) (if_statement "if (uVar2 != 0) {\n    walCleanupHash(pWal);\n  }" if (parenthesized_expression "(uVar2 != 0)" ( (binary_expression "uVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    walCleanupHash(pWal);\n  }" { (expression_statement "walCleanupHash(pWal);" (call_expression "walCleanupHash(pWal)" identifier (argument_list "(pWal)" ( identifier ))) ;) })) (expression_statement "uVar7 = iPage * 0x17f & 0x1fff;" (assignment_expression "uVar7 = iPage * 0x17f & 0x1fff" identifier = (binary_expression "iPage * 0x17f & 0x1fff" (binary_expression "iPage * 0x17f" identifier * number_literal) & number_literal)) ;) (expression_statement "phVar5 = sLoc.aHash + uVar7;" (assignment_expression "phVar5 = sLoc.aHash + uVar7" identifier = (binary_expression "sLoc.aHash + uVar7" (field_expression "sLoc.aHash" identifier . field_identifier) + identifier)) ;) (expression_statement "uVar2 = iFrame;" (assignment_expression "uVar2 = iFrame" identifier = identifier) ;) (if_statement "if (*phVar5 == 0) {\nLAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;\n    iVar3 = 0;\n    *phVar5 = (ht_slot)iFrame;\n  }\n  else {\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }" if (parenthesized_expression "(*phVar5 == 0)" ( (binary_expression "*phVar5 == 0" (pointer_expression "*phVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;\n    iVar3 = 0;\n    *phVar5 = (ht_slot)iFrame;\n  }" { (labeled_statement "LAB_00039964:\n    sLoc.aPgno[iFrame] = iPage;" statement_identifier : (expression_statement "sLoc.aPgno[iFrame] = iPage;" (assignment_expression "sLoc.aPgno[iFrame] = iPage" (subscript_expression "sLoc.aPgno[iFrame]" (field_expression "sLoc.aPgno" identifier . field_identifier) [ identifier ]) = identifier) ;)) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "*phVar5 = (ht_slot)iFrame;" (assignment_expression "*phVar5 = (ht_slot)iFrame" (pointer_expression "*phVar5" * identifier) = (cast_expression "(ht_slot)iFrame" ( (type_descriptor "ht_slot" type_identifier) ) identifier)) ;) }) (else_clause "else {\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }" else (compound_statement "{\n    for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = sqlite3CorruptError(0xec56);\n  }" { (for_statement "for (; uVar2 != 0; uVar2 = uVar2 - 1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }" for ( ; (binary_expression "uVar2 != 0" identifier != number_literal) ; (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ) (compound_statement "{\n      uVar7 = uVar7 + 1 & 0x1fff;\n      phVar5 = sLoc.aHash + uVar7;\n      if (*phVar5 == 0) goto LAB_00039964;\n    }" { (expression_statement "uVar7 = uVar7 + 1 & 0x1fff;" (assignment_expression "uVar7 = uVar7 + 1 & 0x1fff" identifier = (binary_expression "uVar7 + 1 & 0x1fff" (binary_expression "uVar7 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "phVar5 = sLoc.aHash + uVar7;" (assignment_expression "phVar5 = sLoc.aHash + uVar7" identifier = (binary_expression "sLoc.aHash + uVar7" (field_expression "sLoc.aHash" identifier . field_identifier) + identifier)) ;) (if_statement "if (*phVar5 == 0) goto LAB_00039964;" if (parenthesized_expression "(*phVar5 == 0)" ( (binary_expression "*phVar5 == 0" (pointer_expression "*phVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_00039964;" goto statement_identifier ;)) })) (expression_statement "iVar3 = sqlite3CorruptError(0xec56);" (assignment_expression "iVar3 = sqlite3CorruptError(0xec56)" identifier = (call_expression "sqlite3CorruptError(0xec56)" identifier (argument_list "(0xec56)" ( number_literal )))) ;) }))) (labeled_statement "LAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int __regparm3 FUN_00039890(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    \n  FUN_000d1450();\n}\n\n" (function_definition "int __regparm3 FUN_00039890(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    \n  FUN_000d1450();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00039890(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    \n  FUN_000d1450();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "short *psVar5;" (sized_type_specifier "short" short) (pointer_declarator "*psVar5" * identifier) ;) (declaration "void *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "void *pvVar6;" primitive_type (pointer_declarator "*pvVar6" * identifier) ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (declaration "void *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (expression_statement "uVar7 = param_2 + 0x21U >> 0xc;" (assignment_expression "uVar7 = param_2 + 0x21U >> 0xc" identifier = (binary_expression "param_2 + 0x21U >> 0xc" (binary_expression "param_2 + 0x21U" identifier + number_literal) >> number_literal)) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" if (parenthesized_expression "(((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0))" ( (binary_expression "((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" (parenthesized_expression "((int)uVar7 < *(int *)(param_1 + 0x18))" ( (binary_expression "(int)uVar7 < *(int *)(param_1 + 0x18)" (cast_expression "(int)uVar7" ( (type_descriptor "int" primitive_type) ) identifier) < (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) )) && (parenthesized_expression "(local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" ( (comma_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0" (assignment_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" identifier = (pointer_expression "*(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" * (cast_expression "(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)(param_1 + 0x20) + uVar7 * 4)" ( (binary_expression "*(int *)(param_1 + 0x20) + uVar7 * 4" (pointer_expression "*(int *)(param_1 + 0x20)" * (cast_expression "(int *)(param_1 + 0x20)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) + (binary_expression "uVar7 * 4" identifier * number_literal)) ))))) , (binary_expression "local_28 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }" { (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" identifier = (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal)) ;) (if_statement "if (uVar7 != 0) goto LAB_000398e9;" if (parenthesized_expression "(uVar7 != 0)" ( (binary_expression "uVar7 != 0" identifier != number_literal) )) (goto_statement "goto LAB_000398e9;" goto statement_identifier ;)) (labeled_statement "LAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);" statement_identifier : (expression_statement "__s = (void *)((int)local_28 + 0x88);" (assignment_expression "__s = (void *)((int)local_28 + 0x88)" identifier = (cast_expression "(void *)((int)local_28 + 0x88)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + 0x88)" ( (binary_expression "(int)local_28 + 0x88" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;)) (expression_statement "pvVar6 = (void *)((int)local_28 + 0x84);" (assignment_expression "pvVar6 = (void *)((int)local_28 + 0x84)" identifier = (cast_expression "(void *)((int)local_28 + 0x84)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + 0x84)" ( (binary_expression "(int)local_28 + 0x84" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" identifier = identifier) ;) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" identifier = identifier) ;) (if_statement "if (param_2 == 1) goto LAB_000399d3;" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (goto_statement "goto LAB_000399d3;" goto statement_identifier ;)) (labeled_statement "LAB_00039907:\n    iVar3 = param_2 * 4;" statement_identifier : (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;)) (expression_statement "iVar2 = *(int *)((int)pvVar6 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)pvVar6 + iVar3)" identifier = (pointer_expression "*(int *)((int)pvVar6 + iVar3)" * (cast_expression "(int *)((int)pvVar6 + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar6 + iVar3)" ( (binary_expression "(int)pvVar6 + iVar3" (cast_expression "(int)pvVar6" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))))) ;) }) (else_clause "else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" else (compound_statement "{\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" { (expression_statement "iVar3 = FUN_0002ebd0();" (assignment_expression "iVar3 = FUN_0002ebd0()" identifier = (call_expression "FUN_0002ebd0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar3 != 0) goto LAB_00039973;" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (goto_statement "goto LAB_00039973;" goto statement_identifier ;)) (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" identifier = (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal)) ;) (if_statement "if (uVar7 == 0) goto LAB_000399b7;" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000399b7;" goto statement_identifier ;)) (labeled_statement "LAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" statement_identifier : (expression_statement "param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" (assignment_expression "param_2 = param_2 - (uVar7 * 0x1000 + -0x22)" identifier = (binary_expression "param_2 - (uVar7 * 0x1000 + -0x22)" identifier - (parenthesized_expression "(uVar7 * 0x1000 + -0x22)" ( (binary_expression "uVar7 * 0x1000 + -0x22" (binary_expression "uVar7 * 0x1000" identifier * number_literal) + number_literal) )))) ;)) (expression_statement "pvVar6 = (void *)((int)local_28 + -4);" (assignment_expression "pvVar6 = (void *)((int)local_28 + -4)" identifier = (cast_expression "(void *)((int)local_28 + -4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + -4)" ( (binary_expression "(int)local_28 + -4" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" identifier = identifier) ;) (expression_statement "__s = local_28;" (assignment_expression "__s = local_28" identifier = identifier) ;) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" identifier = identifier) ;) (if_statement "if (param_2 != 1) goto LAB_00039907;" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (goto_statement "goto LAB_00039907;" goto statement_identifier ;)) (labeled_statement "LAB_000399d3:\n    iVar3 = param_2 * 4;" statement_identifier : (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;)) (expression_statement "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));" (call_expression "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" identifier (argument_list "(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" ( identifier , number_literal , (binary_expression "(int)pvVar4 + (0x8000 - (int)__s)" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x8000 - (int)__s)" ( (binary_expression "0x8000 - (int)__s" number_literal - (cast_expression "(int)__s" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) ;) (expression_statement "iVar2 = *(int *)((int)local_28 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)local_28 + iVar3)" identifier = (pointer_expression "*(int *)((int)local_28 + iVar3)" * (cast_expression "(int *)((int)local_28 + iVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)local_28 + iVar3)" ( (binary_expression "(int)local_28 + iVar3" (cast_expression "(int)local_28" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))))) ;) (expression_statement "pvVar6 = local_28;" (assignment_expression "pvVar6 = local_28" identifier = identifier) ;) }))) (if_statement "if (iVar2 != 0) {\n    FUN_0002ed20();\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_0002ed20();\n  }" { (expression_statement "FUN_0002ed20();" (call_expression "FUN_0002ed20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar7 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar7 = param_3 * 0x17f & 0x1fff" identifier = (binary_expression "param_3 * 0x17f & 0x1fff" (binary_expression "param_3 * 0x17f" identifier * number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar7 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar7 * 2)" ( (binary_expression "local_2c + uVar7 * 2" identifier + (binary_expression "uVar7 * 2" identifier * number_literal)) )))) ;) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" identifier = identifier) ;) (if_statement "if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }" { (labeled_statement "LAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;" statement_identifier : (expression_statement "*(int *)(iVar3 + (int)pvVar6) = param_3;" (assignment_expression "*(int *)(iVar3 + (int)pvVar6) = param_3" (pointer_expression "*(int *)(iVar3 + (int)pvVar6)" * (cast_expression "(int *)(iVar3 + (int)pvVar6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + (int)pvVar6)" ( (binary_expression "iVar3 + (int)pvVar6" identifier + (cast_expression "(int)pvVar6" ( (type_descriptor "int" primitive_type) ) identifier)) )))) = identifier) ;)) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "*psVar5 = (short)param_2;" (assignment_expression "*psVar5 = (short)param_2" (pointer_expression "*psVar5" * identifier) = (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) }) (else_clause "else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" else (compound_statement "{\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" { (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" for ( ; (binary_expression "iVar2 != 0" identifier != number_literal) ; (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ) (compound_statement "{\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" { (expression_statement "uVar7 = uVar7 + 1 & 0x1fff;" (assignment_expression "uVar7 = uVar7 + 1 & 0x1fff" identifier = (binary_expression "uVar7 + 1 & 0x1fff" (binary_expression "uVar7 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar7 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar7 * 2)" ( (binary_expression "local_2c + uVar7 * 2" identifier + (binary_expression "uVar7 * 2" identifier * number_literal)) )))) ;) (if_statement "if (*psVar5 == 0) goto LAB_00039964;" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_00039964;" goto statement_identifier ;)) })) (expression_statement "iVar3 = FUN_00037780();" (assignment_expression "iVar3 = FUN_00037780()" identifier = (call_expression "FUN_00037780()" identifier (argument_list "()" ( )))) ;) }))) (labeled_statement "LAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) }))) (expression_statement "FUN_000d1450();" (call_expression "FUN_000d1450()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier short) (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) >> LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) && (parenthesized_expression ( (comma_expression (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))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression (binary_expression IDENT * LIT) + LIT) )))) ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT * LIT) & LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (cast_expression ( (type_descriptor TYPE) ) IDENT)) )))) = IDENT) ;)) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) ;) }) (else_clause else (compound_statement { (for_statement for ( ; (binary_expression IDENT != LIT) ; (assignment_expression IDENT = (binary_expression IDENT + LIT)) ) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + LIT) & LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }))) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int __regparm3 FUN_00039890(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    \n  FUN_000d1450();\n}" (primitive_type "int") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00039890(int param_1,int param_2,int param_3)" (identifier "FUN_00039890") (parameter_list "(int param_1,int param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  void *pvVar4;\n  short *psVar5;\n  void *__s;\n  void *pvVar6;\n  uint uVar7;\n  int in_GS_OFFSET;\n  int local_2c;\n  void *local_28;\n  \n  uVar7 = param_2 + 0x21U >> 0xc;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }\n  if (iVar2 != 0) {\n    FUN_0002ed20();\n  }\n  uVar7 = param_3 * 0x17f & 0x1fff;\n  psVar5 = (short *)(local_2c + uVar7 * 2);\n  iVar2 = param_2;\n  if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }\nLAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }\n                    \n  FUN_000d1450();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "void *pvVar4;" (primitive_type "void") (pointer_declarator "*pvVar4" (* "*") (identifier "pvVar4")) (; ";")) (declaration "short *psVar5;" (sized_type_specifier "short" (short "short")) (pointer_declarator "*psVar5" (* "*") (identifier "psVar5")) (; ";")) (declaration "void *__s;" (primitive_type "void") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "void *pvVar6;" (primitive_type "void") (pointer_declarator "*pvVar6" (* "*") (identifier "pvVar6")) (; ";")) (declaration "uint uVar7;" (type_identifier "uint") (identifier "uVar7") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "int local_2c;" (primitive_type "int") (identifier "local_2c") (; ";")) (declaration "void *local_28;" (primitive_type "void") (pointer_declarator "*local_28" (* "*") (identifier "local_28")) (; ";")) (expression_statement "uVar7 = param_2 + 0x21U >> 0xc;" (assignment_expression "uVar7 = param_2 + 0x21U >> 0xc" (identifier "uVar7") (= "=") (binary_expression "param_2 + 0x21U >> 0xc" (binary_expression "param_2 + 0x21U" (identifier "param_2") (+ "+") (number_literal "0x21U")) (>> ">>") (number_literal "0xc"))) (; ";")) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }\n  else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" (if "if") (parenthesized_expression "(((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0))" (( "(") (binary_expression "((int)uVar7 < *(int *)(param_1 + 0x18)) &&\n     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" (parenthesized_expression "((int)uVar7 < *(int *)(param_1 + 0x18))" (( "(") (binary_expression "(int)uVar7 < *(int *)(param_1 + 0x18)" (cast_expression "(int)uVar7" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar7")) (< "<") (pointer_expression "*(int *)(param_1 + 0x18)" (* "*") (cast_expression "(int *)(param_1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) () ")")) (&& "&&") (parenthesized_expression "(local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)" (( "(") (comma_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0" (assignment_expression "local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" (identifier "local_28") (= "=") (pointer_expression "*(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" (* "*") (cast_expression "(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*(int *)(param_1 + 0x20) + uVar7 * 4)" (( "(") (binary_expression "*(int *)(param_1 + 0x20) + uVar7 * 4" (pointer_expression "*(int *)(param_1 + 0x20)" (* "*") (cast_expression "(int *)(param_1 + 0x20)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")")))) (+ "+") (binary_expression "uVar7 * 4" (identifier "uVar7") (* "*") (number_literal "4"))) () ")"))))) (, ",") (binary_expression "local_28 != (void *)0x0" (identifier "local_28") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) (compound_statement "{\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 != 0) goto LAB_000398e9;\nLAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);\n    pvVar6 = (void *)((int)local_28 + 0x84);\n    pvVar4 = local_28;\n    local_28 = pvVar6;\n    if (param_2 == 1) goto LAB_000399d3;\nLAB_00039907:\n    iVar3 = param_2 * 4;\n    iVar2 = *(int *)((int)pvVar6 + iVar3);\n  }" ({ "{") (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" (identifier "local_2c") (= "=") (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (number_literal "0x4000"))) (; ";")) (if_statement "if (uVar7 != 0) goto LAB_000398e9;" (if "if") (parenthesized_expression "(uVar7 != 0)" (( "(") (binary_expression "uVar7 != 0" (identifier "uVar7") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_000398e9;" (goto "goto") (statement_identifier "LAB_000398e9") (; ";"))) (labeled_statement "LAB_000399b7:\n    __s = (void *)((int)local_28 + 0x88);" (statement_identifier "LAB_000399b7") (: ":") (expression_statement "__s = (void *)((int)local_28 + 0x88);" (assignment_expression "__s = (void *)((int)local_28 + 0x88)" (identifier "__s") (= "=") (cast_expression "(void *)((int)local_28 + 0x88)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)local_28 + 0x88)" (( "(") (binary_expression "(int)local_28 + 0x88" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (number_literal "0x88")) () ")")))) (; ";"))) (expression_statement "pvVar6 = (void *)((int)local_28 + 0x84);" (assignment_expression "pvVar6 = (void *)((int)local_28 + 0x84)" (identifier "pvVar6") (= "=") (cast_expression "(void *)((int)local_28 + 0x84)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)local_28 + 0x84)" (( "(") (binary_expression "(int)local_28 + 0x84" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (number_literal "0x84")) () ")")))) (; ";")) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" (identifier "pvVar4") (= "=") (identifier "local_28")) (; ";")) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" (identifier "local_28") (= "=") (identifier "pvVar6")) (; ";")) (if_statement "if (param_2 == 1) goto LAB_000399d3;" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (goto_statement "goto LAB_000399d3;" (goto "goto") (statement_identifier "LAB_000399d3") (; ";"))) (labeled_statement "LAB_00039907:\n    iVar3 = param_2 * 4;" (statement_identifier "LAB_00039907") (: ":") (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" (identifier "iVar3") (= "=") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) (; ";"))) (expression_statement "iVar2 = *(int *)((int)pvVar6 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)pvVar6 + iVar3)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)((int)pvVar6 + iVar3)" (* "*") (cast_expression "(int *)((int)pvVar6 + iVar3)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)pvVar6 + iVar3)" (( "(") (binary_expression "(int)pvVar6 + iVar3" (cast_expression "(int)pvVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar6")) (+ "+") (identifier "iVar3")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" (else "else") (compound_statement "{\n    iVar3 = FUN_0002ebd0();\n    if (iVar3 != 0) goto LAB_00039973;\n    local_2c = (int)local_28 + 0x4000;\n    if (uVar7 == 0) goto LAB_000399b7;\nLAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);\n    pvVar6 = (void *)((int)local_28 + -4);\n    pvVar4 = local_28;\n    __s = local_28;\n    local_28 = pvVar6;\n    if (param_2 != 1) goto LAB_00039907;\nLAB_000399d3:\n    iVar3 = param_2 * 4;\n    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));\n    iVar2 = *(int *)((int)local_28 + iVar3);\n    pvVar6 = local_28;\n  }" ({ "{") (expression_statement "iVar3 = FUN_0002ebd0();" (assignment_expression "iVar3 = FUN_0002ebd0()" (identifier "iVar3") (= "=") (call_expression "FUN_0002ebd0()" (identifier "FUN_0002ebd0") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) goto LAB_00039973;" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_00039973;" (goto "goto") (statement_identifier "LAB_00039973") (; ";"))) (expression_statement "local_2c = (int)local_28 + 0x4000;" (assignment_expression "local_2c = (int)local_28 + 0x4000" (identifier "local_2c") (= "=") (binary_expression "(int)local_28 + 0x4000" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (number_literal "0x4000"))) (; ";")) (if_statement "if (uVar7 == 0) goto LAB_000399b7;" (if "if") (parenthesized_expression "(uVar7 == 0)" (( "(") (binary_expression "uVar7 == 0" (identifier "uVar7") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_000399b7;" (goto "goto") (statement_identifier "LAB_000399b7") (; ";"))) (labeled_statement "LAB_000398e9:\n    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" (statement_identifier "LAB_000398e9") (: ":") (expression_statement "param_2 = param_2 - (uVar7 * 0x1000 + -0x22);" (assignment_expression "param_2 = param_2 - (uVar7 * 0x1000 + -0x22)" (identifier "param_2") (= "=") (binary_expression "param_2 - (uVar7 * 0x1000 + -0x22)" (identifier "param_2") (- "-") (parenthesized_expression "(uVar7 * 0x1000 + -0x22)" (( "(") (binary_expression "uVar7 * 0x1000 + -0x22" (binary_expression "uVar7 * 0x1000" (identifier "uVar7") (* "*") (number_literal "0x1000")) (+ "+") (number_literal "-0x22")) () ")")))) (; ";"))) (expression_statement "pvVar6 = (void *)((int)local_28 + -4);" (assignment_expression "pvVar6 = (void *)((int)local_28 + -4)" (identifier "pvVar6") (= "=") (cast_expression "(void *)((int)local_28 + -4)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)local_28 + -4)" (( "(") (binary_expression "(int)local_28 + -4" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (number_literal "-4")) () ")")))) (; ";")) (expression_statement "pvVar4 = local_28;" (assignment_expression "pvVar4 = local_28" (identifier "pvVar4") (= "=") (identifier "local_28")) (; ";")) (expression_statement "__s = local_28;" (assignment_expression "__s = local_28" (identifier "__s") (= "=") (identifier "local_28")) (; ";")) (expression_statement "local_28 = pvVar6;" (assignment_expression "local_28 = pvVar6" (identifier "local_28") (= "=") (identifier "pvVar6")) (; ";")) (if_statement "if (param_2 != 1) goto LAB_00039907;" (if "if") (parenthesized_expression "(param_2 != 1)" (( "(") (binary_expression "param_2 != 1" (identifier "param_2") (!= "!=") (number_literal "1")) () ")")) (goto_statement "goto LAB_00039907;" (goto "goto") (statement_identifier "LAB_00039907") (; ";"))) (labeled_statement "LAB_000399d3:\n    iVar3 = param_2 * 4;" (statement_identifier "LAB_000399d3") (: ":") (expression_statement "iVar3 = param_2 * 4;" (assignment_expression "iVar3 = param_2 * 4" (identifier "iVar3") (= "=") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) (; ";"))) (expression_statement "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));" (call_expression "memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" (identifier "memset") (argument_list "(__s,0,(int)pvVar4 + (0x8000 - (int)__s))" (( "(") (identifier "__s") (, ",") (number_literal "0") (, ",") (binary_expression "(int)pvVar4 + (0x8000 - (int)__s)" (cast_expression "(int)pvVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar4")) (+ "+") (parenthesized_expression "(0x8000 - (int)__s)" (( "(") (binary_expression "0x8000 - (int)__s" (number_literal "0x8000") (- "-") (cast_expression "(int)__s" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__s"))) () ")"))) () ")"))) (; ";")) (expression_statement "iVar2 = *(int *)((int)local_28 + iVar3);" (assignment_expression "iVar2 = *(int *)((int)local_28 + iVar3)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)((int)local_28 + iVar3)" (* "*") (cast_expression "(int *)((int)local_28 + iVar3)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)local_28 + iVar3)" (( "(") (binary_expression "(int)local_28 + iVar3" (cast_expression "(int)local_28" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "local_28")) (+ "+") (identifier "iVar3")) () ")"))))) (; ";")) (expression_statement "pvVar6 = local_28;" (assignment_expression "pvVar6 = local_28" (identifier "pvVar6") (= "=") (identifier "local_28")) (; ";")) (} "}")))) (if_statement "if (iVar2 != 0) {\n    FUN_0002ed20();\n  }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_0002ed20();\n  }" ({ "{") (expression_statement "FUN_0002ed20();" (call_expression "FUN_0002ed20()" (identifier "FUN_0002ed20") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar7 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar7 = param_3 * 0x17f & 0x1fff" (identifier "uVar7") (= "=") (binary_expression "param_3 * 0x17f & 0x1fff" (binary_expression "param_3 * 0x17f" (identifier "param_3") (* "*") (number_literal "0x17f")) (& "&") (number_literal "0x1fff"))) (; ";")) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" (identifier "psVar5") (= "=") (cast_expression "(short *)(local_2c + uVar7 * 2)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_2c + uVar7 * 2)" (( "(") (binary_expression "local_2c + uVar7 * 2" (identifier "local_2c") (+ "+") (binary_expression "uVar7 * 2" (identifier "uVar7") (* "*") (number_literal "2"))) () ")")))) (; ";")) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" (identifier "iVar2") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (*psVar5 == 0) {\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }\n  else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" (if "if") (parenthesized_expression "(*psVar5 == 0)" (( "(") (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" (* "*") (identifier "psVar5")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;\n    iVar3 = 0;\n    *psVar5 = (short)param_2;\n  }" ({ "{") (labeled_statement "LAB_00039964:\n    *(int *)(iVar3 + (int)pvVar6) = param_3;" (statement_identifier "LAB_00039964") (: ":") (expression_statement "*(int *)(iVar3 + (int)pvVar6) = param_3;" (assignment_expression "*(int *)(iVar3 + (int)pvVar6) = param_3" (pointer_expression "*(int *)(iVar3 + (int)pvVar6)" (* "*") (cast_expression "(int *)(iVar3 + (int)pvVar6)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + (int)pvVar6)" (( "(") (binary_expression "iVar3 + (int)pvVar6" (identifier "iVar3") (+ "+") (cast_expression "(int)pvVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar6"))) () ")")))) (= "=") (identifier "param_3")) (; ";"))) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "*psVar5 = (short)param_2;" (assignment_expression "*psVar5 = (short)param_2" (pointer_expression "*psVar5" (* "*") (identifier "psVar5")) (= "=") (cast_expression "(short)param_2" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "param_2"))) (; ";")) (} "}")) (else_clause "else {\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" (else "else") (compound_statement "{\n    for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }\n    iVar3 = FUN_00037780();\n  }" ({ "{") (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" (for "for") (( "(") (; ";") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) (; ";") (assignment_expression "iVar2 = iVar2 + -1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) () ")") (compound_statement "{\n      uVar7 = uVar7 + 1 & 0x1fff;\n      psVar5 = (short *)(local_2c + uVar7 * 2);\n      if (*psVar5 == 0) goto LAB_00039964;\n    }" ({ "{") (expression_statement "uVar7 = uVar7 + 1 & 0x1fff;" (assignment_expression "uVar7 = uVar7 + 1 & 0x1fff" (identifier "uVar7") (= "=") (binary_expression "uVar7 + 1 & 0x1fff" (binary_expression "uVar7 + 1" (identifier "uVar7") (+ "+") (number_literal "1")) (& "&") (number_literal "0x1fff"))) (; ";")) (expression_statement "psVar5 = (short *)(local_2c + uVar7 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar7 * 2)" (identifier "psVar5") (= "=") (cast_expression "(short *)(local_2c + uVar7 * 2)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_2c + uVar7 * 2)" (( "(") (binary_expression "local_2c + uVar7 * 2" (identifier "local_2c") (+ "+") (binary_expression "uVar7 * 2" (identifier "uVar7") (* "*") (number_literal "2"))) () ")")))) (; ";")) (if_statement "if (*psVar5 == 0) goto LAB_00039964;" (if "if") (parenthesized_expression "(*psVar5 == 0)" (( "(") (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" (* "*") (identifier "psVar5")) (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00039964;" (goto "goto") (statement_identifier "LAB_00039964") (; ";"))) (} "}"))) (expression_statement "iVar3 = FUN_00037780();" (assignment_expression "iVar3 = FUN_00037780()" (identifier "iVar3") (= "=") (call_expression "FUN_00037780()" (identifier "FUN_00037780") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")))) (labeled_statement "LAB_00039973:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" (statement_identifier "LAB_00039973") (: ":") (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar3;\n  }" (if "if") (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return iVar3;\n  }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))) (expression_statement "FUN_000d1450();" (call_expression "FUN_000d1450()" (identifier "FUN_000d1450") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 function_1(type_1 *pWal,type_2 var_1,type_2 var_9)

{
  int var_11;
  type_2 var_7;
  int var_5;
  type_2 *puVar4;
  type_3 *phVar5;
  type_2 *__s;
  type_2 *puVar6;
  type_4 var_3;
  int var_2;
  type_5 sLoc;
  
  var_3 = var_1 + 0x21 >> 0xc;
  var_11 = *(int *)(var_2 + 0x14);
  if (((int)var_3 < pWal->nWiData) && (sLoc.aPgno = pWal->apWiData[var_3], sLoc.aPgno != (type_2 *)0x0)
     ) {
    sLoc.aHash = (type_3 *)(sLoc.aPgno + 0x1000);
    if (var_3 != 0) goto LAB_000398e9;
LAB_000399b7:
    __s = sLoc.aPgno + 0x22;
    sLoc.iZero = 0;
    puVar6 = sLoc.aPgno + 0x21;
    puVar4 = sLoc.aPgno;
    sLoc.aPgno = puVar6;
    if (var_1 == 1) goto LAB_000399d3;
LAB_00039907:
    var_7 = puVar6[var_1];
    sLoc.aPgno = puVar6;
  }
  else {
    var_5 = var_4(pWal,var_3,&sLoc.aPgno);
    if (var_5 != 0) goto LAB_00039973;
    sLoc.aHash = (type_3 *)(sLoc.aPgno + 0x1000);
    if (var_3 == 0) goto LAB_000399b7;
LAB_000398e9:
    sLoc.iZero = var_3 * 0x1000 - 0x22;
    var_1 = var_1 - sLoc.iZero;
    puVar6 = sLoc.aPgno + -1;
    puVar4 = sLoc.aPgno;
    __s = sLoc.aPgno;
    sLoc.aPgno = puVar6;
    if (var_1 != 1) goto LAB_00039907;
LAB_000399d3:
    var_6(__s,0,(int)puVar4 + (0x8000 - (int)__s));
    var_7 = sLoc.aPgno[var_1];
  }
  if (var_7 != 0) {
    var_8(pWal);
  }
  var_3 = var_9 * 0x17f & 0x1fff;
  phVar5 = sLoc.aHash + var_3;
  var_7 = var_1;
  if (*phVar5 == 0) {
LAB_00039964:
    sLoc.aPgno[var_1] = var_9;
    var_5 = 0;
    *phVar5 = (type_3)var_1;
  }
  else {
    for (; var_7 != 0; var_7 = var_7 - 1) {
      var_3 = var_3 + 1 & 0x1fff;
      phVar5 = sLoc.aHash + var_3;
      if (*phVar5 == 0) goto LAB_00039964;
    }
    var_5 = var_10(0xec56);
  }
LAB_00039973:
  if (var_11 == *(int *)(var_2 + 0x14)) {
    return var_5;
  }
                    /* WARNING: Subroutine does not return */
  var_12();
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 MASKED(int param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  short *psVar5;
  void *__s;
  void *pvVar6;
  uint uVar7;
  int in_GS_OFFSET;
  int local_2c;
  void *local_28;
  
  uVar7 = param_2 + 0x21U >> 0xc;
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (((int)uVar7 < *(int *)(param_1 + 0x18)) &&
     (local_28 = *(void **)(*(int *)(param_1 + 0x20) + uVar7 * 4), local_28 != (void *)0x0)) {
    local_2c = (int)local_28 + 0x4000;
    if (uVar7 != 0) goto LAB_000398e9;
LAB_000399b7:
    __s = (void *)((int)local_28 + 0x88);
    pvVar6 = (void *)((int)local_28 + 0x84);
    pvVar4 = local_28;
    local_28 = pvVar6;
    if (param_2 == 1) goto LAB_000399d3;
LAB_00039907:
    iVar3 = param_2 * 4;
    iVar2 = *(int *)((int)pvVar6 + iVar3);
  }
  else {
    iVar3 = FUN_0002ebd0();
    if (iVar3 != 0) goto LAB_00039973;
    local_2c = (int)local_28 + 0x4000;
    if (uVar7 == 0) goto LAB_000399b7;
LAB_000398e9:
    param_2 = param_2 - (uVar7 * 0x1000 + -0x22);
    pvVar6 = (void *)((int)local_28 + -4);
    pvVar4 = local_28;
    __s = local_28;
    local_28 = pvVar6;
    if (param_2 != 1) goto LAB_00039907;
LAB_000399d3:
    iVar3 = param_2 * 4;
    memset(__s,0,(int)pvVar4 + (0x8000 - (int)__s));
    iVar2 = *(int *)((int)local_28 + iVar3);
    pvVar6 = local_28;
  }
  if (iVar2 != 0) {
    FUN_0002ed20();
  }
  uVar7 = param_3 * 0x17f & 0x1fff;
  psVar5 = (short *)(local_2c + uVar7 * 2);
  iVar2 = param_2;
  if (*psVar5 == 0) {
LAB_00039964:
    *(int *)(iVar3 + (int)pvVar6) = param_3;
    iVar3 = 0;
    *psVar5 = (short)param_2;
  }
  else {
    for (; iVar2 != 0; iVar2 = iVar2 + -1) {
      uVar7 = uVar7 + 1 & 0x1fff;
      psVar5 = (short *)(local_2c + uVar7 * 2);
      if (*psVar5 == 0) goto LAB_00039964;
    }
    iVar3 = FUN_00037780();
  }
LAB_00039973:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000d1450();
}

