
/* 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;
  int iVar2;
  int iVar3;
  uint uVar4;
  ht_slot *phVar5;
  int iVar6;
  int in_GS_OFFSET;
  WalHashLoc sLoc;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc);
  if (iVar3 == 0) {
    iVar6 = iFrame - sLoc.iZero;
    if (iVar6 == 1) {
      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));
    }
    if (sLoc.aPgno[iVar6] != 0) {
      walCleanupHash(pWal);
    }
    uVar4 = iPage * 0x17f & 0x1fff;
    phVar5 = sLoc.aHash + uVar4;
    iVar2 = iVar6;
    if (*phVar5 == 0) {
LAB_0003a589:
      sLoc.aPgno[iVar6] = iPage;
      *phVar5 = (ht_slot)iVar6;
    }
    else {
      for (; iVar2 != 0; iVar2 = iVar2 + -1) {
        uVar4 = uVar4 + 1 & 0x1fff;
        phVar5 = sLoc.aHash + uVar4;
        if (*phVar5 == 0) goto LAB_0003a589;
      }
      iVar3 = sqlite3CorruptError(0xec56);
    }
  }
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return iVar3;
}



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

int __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  short *psVar5;
  int in_GS_OFFSET;
  int local_2c;
  int local_28;
  int local_24;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = FUN_0002daa0();
  if (iVar3 == 0) {
    param_2 = param_2 - local_24;
    if (param_2 == 1) {
      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));
    }
    if (*(int *)(local_28 + param_2 * 4) != 0) {
      FUN_0002daf0();
    }
    uVar4 = param_3 * 0x17f & 0x1fff;
    psVar5 = (short *)(local_2c + uVar4 * 2);
    iVar2 = param_2;
    if (*psVar5 == 0) {
LAB_0003a589:
      *(int *)(param_2 * 4 + local_28) = param_3;
      *psVar5 = (short)param_2;
    }
    else {
      for (; iVar2 != 0; iVar2 = iVar2 + -1) {
        uVar4 = uVar4 + 1 & 0x1fff;
        psVar5 = (short *)(local_2c + uVar4 * 2);
        if (*psVar5 == 0) goto LAB_0003a589;
      }
      iVar3 = FUN_000383f0();
    }
  }
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a9ea0();
  }
  return iVar3;
}


PUSH EBP
PUSH EDI
MOV EBP,EAX
PUSH ESI
PUSH EBX
MOV ESI,EDX
ADD EDX,0x21
SUB ESP,0x2c
SHR EDX,0xc
MOV dword ptr [ESP + 0x8],ECX
LEA ECX,[ESP + 0x10]
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
MOV EAX,EBP
CALL 0x0002daa0
CALL 0x0001d810
ADD EBX,0xa3aef
TEST EAX,EAX
MOV EDI,EAX
JNZ 0x0003a59a
SUB ESI,dword ptr [ESP + 0x18]
MOV EAX,dword ptr [ESP + 0x14]
CMP ESI,0x1
JZ 0x0003a5e0
LEA ECX,[ESI*0x4 + 0x0]
ADD EAX,ECX
MOV dword ptr [ESP + 0xc],ECX
MOV EAX,dword ptr [EAX]
TEST EAX,EAX
JNZ 0x0003a5d0
IMUL EAX,dword ptr [ESP + 0x8],0x17f
MOV EBP,dword ptr [ESP + 0x10]
AND EAX,0x1fff
LEA EBX,[EBP + EAX*0x2]
MOVZX EDX,word ptr [EBX]
TEST DX,DX
JZ 0x0003a589
TEST ESI,ESI
JZ 0x0003a5b8
MOV ECX,ESI
JMP 0x0003a575
SUB ECX,0x1
JZ 0x0003a5b8
ADD EAX,0x1
AND EAX,0x1fff
LEA EBX,[EBP + EAX*0x2]
MOVZX EDX,word ptr [EBX]
TEST DX,DX
JNZ 0x0003a570
MOV EAX,dword ptr [ESP + 0xc]
ADD EAX,dword ptr [ESP + 0x14]
MOV ECX,dword ptr [ESP + 0x8]
MOV dword ptr [EAX],ECX
MOV word ptr [EBX],SI
MOV EAX,EDI
MOV EDI,dword ptr [ESP + 0x1c]
XOR EDI,dword ptr GS:[0x14]
JNZ 0x0003a607
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,0xec56
CALL 0x000383f0
MOV EDI,EAX
JMP 0x0003a59a
MOV EAX,EBP
CALL 0x0002daf0
JMP 0x0003a545
MOV ECX,dword ptr [ESP + 0x10]
ADD EAX,0x4
SUB ESP,0x4
LEA EDX,[ECX + 0x4000]
SUB EDX,EAX
PUSH EDX
PUSH 0x0
PUSH EAX
CALL 0x000168b0
MOV EAX,dword ptr [ESP + 0x24]
ADD ESP,0x10
JMP 0x0003a52e
CALL 0x000a9ea0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a9ea0();\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a9ea0();\n  }\n  return iVar3;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier 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  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a9ea0();\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "short *psVar5;" (sized_type_specifier "short" short) (pointer_declarator "*psVar5" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "int local_24;" primitive_type identifier ;) (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) ))))) ;) (expression_statement "iVar3 = FUN_0002daa0();" (assignment_expression "iVar3 = FUN_0002daa0()" identifier = (call_expression "FUN_0002daa0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" { (expression_statement "param_2 = param_2 - local_24;" (assignment_expression "param_2 = param_2 - local_24" identifier = (binary_expression "param_2 - local_24" identifier - identifier)) ;) (if_statement "if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" { (expression_statement "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));" (call_expression "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" identifier (argument_list "((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" ( (cast_expression "(void *)(local_28 + 4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_28 + 4)" ( (binary_expression "local_28 + 4" identifier + number_literal) ))) , number_literal , (binary_expression "(local_2c + 0x4000) - (local_28 + 4)" (parenthesized_expression "(local_2c + 0x4000)" ( (binary_expression "local_2c + 0x4000" identifier + number_literal) )) - (parenthesized_expression "(local_28 + 4)" ( (binary_expression "local_28 + 4" identifier + number_literal) ))) ))) ;) })) (if_statement "if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }" if (parenthesized_expression "(*(int *)(local_28 + param_2 * 4) != 0)" ( (binary_expression "*(int *)(local_28 + param_2 * 4) != 0" (pointer_expression "*(int *)(local_28 + param_2 * 4)" * (cast_expression "(int *)(local_28 + param_2 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_28 + param_2 * 4)" ( (binary_expression "local_28 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) )))) != number_literal) )) (compound_statement "{\n      FUN_0002daf0();\n    }" { (expression_statement "FUN_0002daf0();" (call_expression "FUN_0002daf0()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar4 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar4 = 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 + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar4 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar4 * 2)" ( (binary_expression "local_2c + uVar4 * 2" identifier + (binary_expression "uVar4 * 2" identifier * number_literal)) )))) ;) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" identifier = identifier) ;) (if_statement "if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }" { (labeled_statement "LAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;" statement_identifier : (expression_statement "*(int *)(param_2 * 4 + local_28) = param_3;" (assignment_expression "*(int *)(param_2 * 4 + local_28) = param_3" (pointer_expression "*(int *)(param_2 * 4 + local_28)" * (cast_expression "(int *)(param_2 * 4 + local_28)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 * 4 + local_28)" ( (binary_expression "param_2 * 4 + local_28" (binary_expression "param_2 * 4" identifier * number_literal) + identifier) )))) = identifier) ;)) (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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" else (compound_statement "{\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" { (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }" { (expression_statement "uVar4 = uVar4 + 1 & 0x1fff;" (assignment_expression "uVar4 = uVar4 + 1 & 0x1fff" identifier = (binary_expression "uVar4 + 1 & 0x1fff" (binary_expression "uVar4 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar4 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar4 * 2)" ( (binary_expression "local_2c + uVar4 * 2" identifier + (binary_expression "uVar4 * 2" identifier * number_literal)) )))) ;) (if_statement "if (*psVar5 == 0) goto LAB_0003a589;" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_0003a589;" goto statement_identifier ;)) })) (expression_statement "iVar3 = FUN_000383f0();" (assignment_expression "iVar3 = FUN_000383f0()" identifier = (call_expression "FUN_000383f0()" identifier (argument_list "()" ( )))) ;) }))) })) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a9ea0();\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                    /* WARNING: Subroutine does not return */\n    FUN_000a9ea0();\n  }" { comment (expression_statement "FUN_000a9ea0();" (call_expression "FUN_000a9ea0()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(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  int iVar2;\n  int iVar3;\n  uint uVar4;\n  ht_slot *phVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc);\n  if (iVar3 == 0) {\n    iVar6 = iFrame - sLoc.iZero;\n    if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }\n    if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }\n    uVar4 = iPage * 0x17f & 0x1fff;\n    phVar5 = sLoc.aHash + uVar4;\n    iVar2 = iVar6;\n    if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int __regparm3 walIndexAppend(Wal *pWal,u32 iFrame,u32 iPage)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  ht_slot *phVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc);\n  if (iVar3 == 0) {\n    iVar6 = iFrame - sLoc.iZero;\n    if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }\n    if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }\n    uVar4 = iPage * 0x17f & 0x1fff;\n    phVar5 = sLoc.aHash + uVar4;\n    iVar2 = iVar6;\n    if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar3;\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  int iVar2;\n  int iVar3;\n  uint uVar4;\n  ht_slot *phVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  WalHashLoc sLoc;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc);\n  if (iVar3 == 0) {\n    iVar6 = iFrame - sLoc.iZero;\n    if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }\n    if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }\n    uVar4 = iPage * 0x17f & 0x1fff;\n    phVar5 = sLoc.aHash + uVar4;\n    iVar2 = iVar6;\n    if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "ht_slot *phVar5;" type_identifier (pointer_declarator "*phVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "WalHashLoc sLoc;" type_identifier identifier ;) (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) ))))) ;) (expression_statement "iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc);" (assignment_expression "iVar3 = walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc)" identifier = (call_expression "walHashGet(pWal,iFrame + 0x21 >> 0xc,&sLoc)" identifier (argument_list "(pWal,iFrame + 0x21 >> 0xc,&sLoc)" ( identifier , (binary_expression "iFrame + 0x21 >> 0xc" (binary_expression "iFrame + 0x21" identifier + number_literal) >> number_literal) , (pointer_expression "&sLoc" & identifier) )))) ;) (if_statement "if (iVar3 == 0) {\n    iVar6 = iFrame - sLoc.iZero;\n    if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }\n    if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }\n    uVar4 = iPage * 0x17f & 0x1fff;\n    phVar5 = sLoc.aHash + uVar4;\n    iVar2 = iVar6;\n    if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar6 = iFrame - sLoc.iZero;\n    if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }\n    if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }\n    uVar4 = iPage * 0x17f & 0x1fff;\n    phVar5 = sLoc.aHash + uVar4;\n    iVar2 = iVar6;\n    if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }\n  }" { (expression_statement "iVar6 = iFrame - sLoc.iZero;" (assignment_expression "iVar6 = iFrame - sLoc.iZero" identifier = (binary_expression "iFrame - sLoc.iZero" identifier - (field_expression "sLoc.iZero" identifier . field_identifier))) ;) (if_statement "if (iVar6 == 1) {\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }" if (parenthesized_expression "(iVar6 == 1)" ( (binary_expression "iVar6 == 1" identifier == number_literal) )) (compound_statement "{\n      memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));\n    }" { (expression_statement "memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));" (call_expression "memset(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)))" identifier (argument_list "(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)))" ( (binary_expression "sLoc.aPgno + 1" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal) , number_literal , (binary_expression "(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1))" (cast_expression "(int)sLoc.aHash" ( (type_descriptor "int" primitive_type) ) (field_expression "sLoc.aHash" identifier . field_identifier)) + (parenthesized_expression "(0x4000 - (int)(sLoc.aPgno + 1))" ( (binary_expression "0x4000 - (int)(sLoc.aPgno + 1)" number_literal - (cast_expression "(int)(sLoc.aPgno + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(sLoc.aPgno + 1)" ( (binary_expression "sLoc.aPgno + 1" (field_expression "sLoc.aPgno" identifier . field_identifier) + number_literal) )))) ))) ))) ;) })) (if_statement "if (sLoc.aPgno[iVar6] != 0) {\n      walCleanupHash(pWal);\n    }" if (parenthesized_expression "(sLoc.aPgno[iVar6] != 0)" ( (binary_expression "sLoc.aPgno[iVar6] != 0" (subscript_expression "sLoc.aPgno[iVar6]" (field_expression "sLoc.aPgno" identifier . field_identifier) [ identifier ]) != number_literal) )) (compound_statement "{\n      walCleanupHash(pWal);\n    }" { (expression_statement "walCleanupHash(pWal);" (call_expression "walCleanupHash(pWal)" identifier (argument_list "(pWal)" ( identifier ))) ;) })) (expression_statement "uVar4 = iPage * 0x17f & 0x1fff;" (assignment_expression "uVar4 = iPage * 0x17f & 0x1fff" identifier = (binary_expression "iPage * 0x17f & 0x1fff" (binary_expression "iPage * 0x17f" identifier * number_literal) & number_literal)) ;) (expression_statement "phVar5 = sLoc.aHash + uVar4;" (assignment_expression "phVar5 = sLoc.aHash + uVar4" identifier = (binary_expression "sLoc.aHash + uVar4" (field_expression "sLoc.aHash" identifier . field_identifier) + identifier)) ;) (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (if_statement "if (*phVar5 == 0) {\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }" if (parenthesized_expression "(*phVar5 == 0)" ( (binary_expression "*phVar5 == 0" (pointer_expression "*phVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;\n      *phVar5 = (ht_slot)iVar6;\n    }" { (labeled_statement "LAB_0003a589:\n      sLoc.aPgno[iVar6] = iPage;" statement_identifier : (expression_statement "sLoc.aPgno[iVar6] = iPage;" (assignment_expression "sLoc.aPgno[iVar6] = iPage" (subscript_expression "sLoc.aPgno[iVar6]" (field_expression "sLoc.aPgno" identifier . field_identifier) [ identifier ]) = identifier) ;)) (expression_statement "*phVar5 = (ht_slot)iVar6;" (assignment_expression "*phVar5 = (ht_slot)iVar6" (pointer_expression "*phVar5" * identifier) = (cast_expression "(ht_slot)iVar6" ( (type_descriptor "ht_slot" type_identifier) ) identifier)) ;) }) (else_clause "else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }" else (compound_statement "{\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = sqlite3CorruptError(0xec56);\n    }" { (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\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        uVar4 = uVar4 + 1 & 0x1fff;\n        phVar5 = sLoc.aHash + uVar4;\n        if (*phVar5 == 0) goto LAB_0003a589;\n      }" { (expression_statement "uVar4 = uVar4 + 1 & 0x1fff;" (assignment_expression "uVar4 = uVar4 + 1 & 0x1fff" identifier = (binary_expression "uVar4 + 1 & 0x1fff" (binary_expression "uVar4 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "phVar5 = sLoc.aHash + uVar4;" (assignment_expression "phVar5 = sLoc.aHash + uVar4" identifier = (binary_expression "sLoc.aHash + uVar4" (field_expression "sLoc.aHash" identifier . field_identifier) + identifier)) ;) (if_statement "if (*phVar5 == 0) goto LAB_0003a589;" if (parenthesized_expression "(*phVar5 == 0)" ( (binary_expression "*phVar5 == 0" (pointer_expression "*phVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_0003a589;" goto statement_identifier ;)) })) (expression_statement "iVar3 = sqlite3CorruptError(0xec56);" (assignment_expression "iVar3 = sqlite3CorruptError(0xec56)" identifier = (call_expression "sqlite3CorruptError(0xec56)" identifier (argument_list "(0xec56)" ( number_literal )))) ;) }))) })) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\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                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "int __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\n  }\n  return iVar3;\n}\n\n" (function_definition "int __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\n  }\n  return iVar3;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier 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  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "short *psVar5;" (sized_type_specifier "short" short) (pointer_declarator "*psVar5" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_2c;" primitive_type identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "int local_24;" primitive_type identifier ;) (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) ))))) ;) (expression_statement "iVar3 = FUN_0002daa0();" (assignment_expression "iVar3 = FUN_0002daa0()" identifier = (call_expression "FUN_0002daa0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" { (expression_statement "param_2 = param_2 - local_24;" (assignment_expression "param_2 = param_2 - local_24" identifier = (binary_expression "param_2 - local_24" identifier - identifier)) ;) (if_statement "if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" { (expression_statement "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));" (call_expression "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" identifier (argument_list "((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" ( (cast_expression "(void *)(local_28 + 4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_28 + 4)" ( (binary_expression "local_28 + 4" identifier + number_literal) ))) , number_literal , (binary_expression "(local_2c + 0x4000) - (local_28 + 4)" (parenthesized_expression "(local_2c + 0x4000)" ( (binary_expression "local_2c + 0x4000" identifier + number_literal) )) - (parenthesized_expression "(local_28 + 4)" ( (binary_expression "local_28 + 4" identifier + number_literal) ))) ))) ;) })) (if_statement "if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }" if (parenthesized_expression "(*(int *)(local_28 + param_2 * 4) != 0)" ( (binary_expression "*(int *)(local_28 + param_2 * 4) != 0" (pointer_expression "*(int *)(local_28 + param_2 * 4)" * (cast_expression "(int *)(local_28 + param_2 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_28 + param_2 * 4)" ( (binary_expression "local_28 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) )))) != number_literal) )) (compound_statement "{\n      FUN_0002daf0();\n    }" { (expression_statement "FUN_0002daf0();" (call_expression "FUN_0002daf0()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar4 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar4 = 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 + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar4 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar4 * 2)" ( (binary_expression "local_2c + uVar4 * 2" identifier + (binary_expression "uVar4 * 2" identifier * number_literal)) )))) ;) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" identifier = identifier) ;) (if_statement "if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (compound_statement "{\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }" { (labeled_statement "LAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;" statement_identifier : (expression_statement "*(int *)(param_2 * 4 + local_28) = param_3;" (assignment_expression "*(int *)(param_2 * 4 + local_28) = param_3" (pointer_expression "*(int *)(param_2 * 4 + local_28)" * (cast_expression "(int *)(param_2 * 4 + local_28)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 * 4 + local_28)" ( (binary_expression "param_2 * 4 + local_28" (binary_expression "param_2 * 4" identifier * number_literal) + identifier) )))) = identifier) ;)) (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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" else (compound_statement "{\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" { (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }" { (expression_statement "uVar4 = uVar4 + 1 & 0x1fff;" (assignment_expression "uVar4 = uVar4 + 1 & 0x1fff" identifier = (binary_expression "uVar4 + 1 & 0x1fff" (binary_expression "uVar4 + 1" identifier + number_literal) & number_literal)) ;) (expression_statement "psVar5 = (short *)(local_2c + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" identifier = (cast_expression "(short *)(local_2c + uVar4 * 2)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_2c + uVar4 * 2)" ( (binary_expression "local_2c + uVar4 * 2" identifier + (binary_expression "uVar4 * 2" identifier * number_literal)) )))) ;) (if_statement "if (*psVar5 == 0) goto LAB_0003a589;" if (parenthesized_expression "(*psVar5 == 0)" ( (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" * identifier) == number_literal) )) (goto_statement "goto LAB_0003a589;" goto statement_identifier ;)) })) (expression_statement "iVar3 = FUN_000383f0();" (assignment_expression "iVar3 = FUN_000383f0()" identifier = (call_expression "FUN_000383f0()" identifier (argument_list "()" ( )))) ;) }))) })) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\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                    \n    FUN_000a9ea0();\n  }" { (expression_statement "FUN_000a9ea0();" (call_expression "FUN_000a9ea0()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return iVar3;" return identifier ;) })))
(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 IDENT ;) (declaration (sized_type_specifier short) (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) , LIT , (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) - (parenthesized_expression ( (binary_expression IDENT + LIT) ))) ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) != 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 (binary_expression IDENT * LIT) + IDENT) )))) = IDENT) ;)) (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 ( )))) ;) }))) })) (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 { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (return_statement return IDENT ;) })))
(function_definition "int __regparm3 FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\n  }\n  return iVar3;\n}" (primitive_type "int") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0003a4e0(undefined4 param_1,int param_2,int param_3)" (identifier "FUN_0003a4e0") (parameter_list "(undefined4 param_1,int param_2,int param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (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  uint uVar4;\n  short *psVar5;\n  int in_GS_OFFSET;\n  int local_2c;\n  int local_28;\n  int local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar3 = FUN_0002daa0();\n  if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\n  }\n  return iVar3;\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 "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "short *psVar5;" (sized_type_specifier "short" (short "short")) (pointer_declarator "*psVar5" (* "*") (identifier "psVar5")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "int local_2c;" (primitive_type "int") (identifier "local_2c") (; ";")) (declaration "int local_28;" (primitive_type "int") (identifier "local_28") (; ";")) (declaration "int local_24;" (primitive_type "int") (identifier "local_24") (; ";")) (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")) () ")"))))) (; ";")) (expression_statement "iVar3 = FUN_0002daa0();" (assignment_expression "iVar3 = FUN_0002daa0()" (identifier "iVar3") (= "=") (call_expression "FUN_0002daa0()" (identifier "FUN_0002daa0") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar3 == 0) {\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    param_2 = param_2 - local_24;\n    if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }\n    if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }\n    uVar4 = param_3 * 0x17f & 0x1fff;\n    psVar5 = (short *)(local_2c + uVar4 * 2);\n    iVar2 = param_2;\n    if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }\n  }" ({ "{") (expression_statement "param_2 = param_2 - local_24;" (assignment_expression "param_2 = param_2 - local_24" (identifier "param_2") (= "=") (binary_expression "param_2 - local_24" (identifier "param_2") (- "-") (identifier "local_24"))) (; ";")) (if_statement "if (param_2 == 1) {\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));\n    }" ({ "{") (expression_statement "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));" (call_expression "memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" (identifier "memset") (argument_list "((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4))" (( "(") (cast_expression "(void *)(local_28 + 4)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_28 + 4)" (( "(") (binary_expression "local_28 + 4" (identifier "local_28") (+ "+") (number_literal "4")) () ")"))) (, ",") (number_literal "0") (, ",") (binary_expression "(local_2c + 0x4000) - (local_28 + 4)" (parenthesized_expression "(local_2c + 0x4000)" (( "(") (binary_expression "local_2c + 0x4000" (identifier "local_2c") (+ "+") (number_literal "0x4000")) () ")")) (- "-") (parenthesized_expression "(local_28 + 4)" (( "(") (binary_expression "local_28 + 4" (identifier "local_28") (+ "+") (number_literal "4")) () ")"))) () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(local_28 + param_2 * 4) != 0) {\n      FUN_0002daf0();\n    }" (if "if") (parenthesized_expression "(*(int *)(local_28 + param_2 * 4) != 0)" (( "(") (binary_expression "*(int *)(local_28 + param_2 * 4) != 0" (pointer_expression "*(int *)(local_28 + param_2 * 4)" (* "*") (cast_expression "(int *)(local_28 + param_2 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_28 + param_2 * 4)" (( "(") (binary_expression "local_28 + param_2 * 4" (identifier "local_28") (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0002daf0();\n    }" ({ "{") (expression_statement "FUN_0002daf0();" (call_expression "FUN_0002daf0()" (identifier "FUN_0002daf0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar4 = param_3 * 0x17f & 0x1fff;" (assignment_expression "uVar4 = param_3 * 0x17f & 0x1fff" (identifier "uVar4") (= "=") (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 + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" (identifier "psVar5") (= "=") (cast_expression "(short *)(local_2c + uVar4 * 2)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_2c + uVar4 * 2)" (( "(") (binary_expression "local_2c + uVar4 * 2" (identifier "local_2c") (+ "+") (binary_expression "uVar4 * 2" (identifier "uVar4") (* "*") (number_literal "2"))) () ")")))) (; ";")) (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" (identifier "iVar2") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (*psVar5 == 0) {\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }\n    else {\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" (if "if") (parenthesized_expression "(*psVar5 == 0)" (( "(") (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" (* "*") (identifier "psVar5")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;\n      *psVar5 = (short)param_2;\n    }" ({ "{") (labeled_statement "LAB_0003a589:\n      *(int *)(param_2 * 4 + local_28) = param_3;" (statement_identifier "LAB_0003a589") (: ":") (expression_statement "*(int *)(param_2 * 4 + local_28) = param_3;" (assignment_expression "*(int *)(param_2 * 4 + local_28) = param_3" (pointer_expression "*(int *)(param_2 * 4 + local_28)" (* "*") (cast_expression "(int *)(param_2 * 4 + local_28)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 * 4 + local_28)" (( "(") (binary_expression "param_2 * 4 + local_28" (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4")) (+ "+") (identifier "local_28")) () ")")))) (= "=") (identifier "param_3")) (; ";"))) (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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" (else "else") (compound_statement "{\n      for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }\n      iVar3 = FUN_000383f0();\n    }" ({ "{") (for_statement "for (; iVar2 != 0; iVar2 = iVar2 + -1) {\n        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\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        uVar4 = uVar4 + 1 & 0x1fff;\n        psVar5 = (short *)(local_2c + uVar4 * 2);\n        if (*psVar5 == 0) goto LAB_0003a589;\n      }" ({ "{") (expression_statement "uVar4 = uVar4 + 1 & 0x1fff;" (assignment_expression "uVar4 = uVar4 + 1 & 0x1fff" (identifier "uVar4") (= "=") (binary_expression "uVar4 + 1 & 0x1fff" (binary_expression "uVar4 + 1" (identifier "uVar4") (+ "+") (number_literal "1")) (& "&") (number_literal "0x1fff"))) (; ";")) (expression_statement "psVar5 = (short *)(local_2c + uVar4 * 2);" (assignment_expression "psVar5 = (short *)(local_2c + uVar4 * 2)" (identifier "psVar5") (= "=") (cast_expression "(short *)(local_2c + uVar4 * 2)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_2c + uVar4 * 2)" (( "(") (binary_expression "local_2c + uVar4 * 2" (identifier "local_2c") (+ "+") (binary_expression "uVar4 * 2" (identifier "uVar4") (* "*") (number_literal "2"))) () ")")))) (; ";")) (if_statement "if (*psVar5 == 0) goto LAB_0003a589;" (if "if") (parenthesized_expression "(*psVar5 == 0)" (( "(") (binary_expression "*psVar5 == 0" (pointer_expression "*psVar5" (* "*") (identifier "psVar5")) (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0003a589;" (goto "goto") (statement_identifier "LAB_0003a589") (; ";"))) (} "}"))) (expression_statement "iVar3 = FUN_000383f0();" (assignment_expression "iVar3 = FUN_000383f0()" (identifier "iVar3") (= "=") (call_expression "FUN_000383f0()" (identifier "FUN_000383f0") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a9ea0();\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                    \n    FUN_000a9ea0();\n  }" ({ "{") (expression_statement "FUN_000a9ea0();" (call_expression "FUN_000a9ea0()" (identifier "FUN_000a9ea0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

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

int __regparm3 function_1(type_1 *pWal,type_2 var_3,type_2 var_8)

{
  int var_12;
  int var_10;
  int var_4;
  type_3 var_9;
  type_4 *phVar5;
  int var_5;
  int var_1;
  type_5 sLoc;
  
  var_12 = *(int *)(var_1 + 0x14);
  var_4 = var_2(pWal,var_3 + 0x21 >> 0xc,&sLoc);
  if (var_4 == 0) {
    var_5 = var_3 - sLoc.iZero;
    if (var_5 == 1) {
      var_6(sLoc.aPgno + 1,0,(int)sLoc.aHash + (0x4000 - (int)(sLoc.aPgno + 1)));
    }
    if (sLoc.aPgno[var_5] != 0) {
      var_7(pWal);
    }
    var_9 = var_8 * 0x17f & 0x1fff;
    phVar5 = sLoc.aHash + var_9;
    var_10 = var_5;
    if (*phVar5 == 0) {
LAB_0003a589:
      sLoc.aPgno[var_5] = var_8;
      *phVar5 = (type_4)var_5;
    }
    else {
      for (; var_10 != 0; var_10 = var_10 + -1) {
        var_9 = var_9 + 1 & 0x1fff;
        phVar5 = sLoc.aHash + var_9;
        if (*phVar5 == 0) goto LAB_0003a589;
      }
      var_4 = var_11(0xec56);
    }
  }
  if (var_12 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_13();
  }
  return var_4;
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) 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: (type_identifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (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: (identifier) right: (number_literal))))))) (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: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_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 (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (number_literal) (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) 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: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))) right: (identifier)))) (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))))))))) (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 (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (return_statement (identifier)))))

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

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

{
  int iVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  short *psVar5;
  int in_GS_OFFSET;
  int local_2c;
  int local_28;
  int local_24;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = FUN_0002daa0();
  if (iVar3 == 0) {
    param_2 = param_2 - local_24;
    if (param_2 == 1) {
      memset((void *)(local_28 + 4),0,(local_2c + 0x4000) - (local_28 + 4));
    }
    if (*(int *)(local_28 + param_2 * 4) != 0) {
      FUN_0002daf0();
    }
    uVar4 = param_3 * 0x17f & 0x1fff;
    psVar5 = (short *)(local_2c + uVar4 * 2);
    iVar2 = param_2;
    if (*psVar5 == 0) {
LAB_0003a589:
      *(int *)(param_2 * 4 + local_28) = param_3;
      *psVar5 = (short)param_2;
    }
    else {
      for (; iVar2 != 0; iVar2 = iVar2 + -1) {
        uVar4 = uVar4 + 1 & 0x1fff;
        psVar5 = (short *)(local_2c + uVar4 * 2);
        if (*psVar5 == 0) goto LAB_0003a589;
      }
      iVar3 = FUN_000383f0();
    }
  }
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a9ea0();
  }
  return iVar3;
}

