
int readDbPage(PgHdr *pPg)

{
  longlong lVar1;
  undefined *puVar2;
  void *pvVar3;
  int iVar4;
  uint uVar5;
  u32 *puVar6;
  undefined4 uVar7;
  sqlite3_file *psVar8;
  void *pvVar9;
  u32 *piRead;
  Pager *pPVar10;
  u32 iFrame;
  int local_1c;
  
  puVar2 = PTR___stack_chk_guard_000f5568;
  pvVar3 = (void *)pPg->pgno;
  pPVar10 = pPg->pPager;
  iFrame = 0;
  local_1c = *(int *)PTR___stack_chk_guard_000f5568;
  if (pPVar10->pWal == (Wal *)0x0) {
    piRead = (u32 *)pPVar10->pageSize;
    pvVar9 = pPg->pData;
    goto LAB_0004734c;
  }
  piRead = &iFrame;
  iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead);
  pvVar9 = pvVar3;
  if (iVar4 != 0) goto LAB_00047318;
  piRead = (u32 *)pPVar10->pageSize;
  pvVar9 = pPg->pData;
  if (iFrame == 0) goto LAB_00047408;
  uVar5 = (uint)(pPVar10->pWal->hdr).szPage;
  psVar8 = pPVar10->pWal->pWalFd;
  puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10);
  if ((int)puVar6 <= (int)piRead) {
    piRead = puVar6;
  }
  iVar4 = (*psVar8->pMethods->xRead)
                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38);
  do {
    if (pPg->pgno == 1) {
      if (iVar4 == 0) goto LAB_000473ac;
      piRead = (u32 *)0x10;
      pvVar9 = (void *)0xff;
      (*(code *)PTR_memset_000f5450)();
    }
LAB_00047318:
    while( true ) {
      if (local_1c == *(int *)puVar2) {
        return iVar4;
      }
      (*(code *)PTR___stack_chk_fail_000f5540)();
LAB_00047408:
      pvVar3 = (void *)pPg->pgno;
LAB_0004734c:
      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);
      iVar4 = (*pPVar10->fd->pMethods->xRead)
                        (pPVar10->fd,pvVar9,(int)piRead,
                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +
                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));
      if (iVar4 != 0x20a) break;
      if (pPg->pgno == 1) {
LAB_000473ac:
        pvVar3 = pPg->pData;
        iVar4 = 0;
        piRead = *(u32 **)((int)pvVar3 + 0x1c);
        pvVar9 = *(void **)((int)pvVar3 + 0x20);
        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);
        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);
        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;
        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;
        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;
      }
      else {
        iVar4 = 0;
      }
    }
  } while( true );
}



/* WARNING: Removing unreachable block (ram,0x00047284) */
/* WARNING: Removing unreachable block (ram,0x000472b8) */
/* WARNING: Removing unreachable block (ram,0x000472bc) */

int FUN_00047208(int param_1)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  int iVar8;
  
  puVar1 = PTR___stack_chk_guard_000f5568;
  iVar8 = *(int *)(param_1 + 0x14);
  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;
  if ((*(int *)(iVar8 + 0xd8) != 0) &&
     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))
  goto LAB_00047318;
  do {
    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();
    if (iVar2 == 0x20a) {
      if (*(int *)(param_1 + 0x18) == 1) {
LAB_000473ac:
        iVar3 = *(int *)(param_1 + 4);
        iVar2 = 0;
        uVar7 = *(undefined4 *)(iVar3 + 0x1c);
        uVar6 = *(undefined4 *)(iVar3 + 0x20);
        uVar5 = *(undefined4 *)(iVar3 + 0x24);
        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);
        *(undefined4 *)(iVar8 + 0x6c) = uVar7;
        *(undefined4 *)(iVar8 + 0x70) = uVar6;
        *(undefined4 *)(iVar8 + 0x74) = uVar5;
      }
      else {
        iVar2 = 0;
      }
    }
    else if (*(int *)(param_1 + 0x18) == 1) {
      if (iVar2 == 0) goto LAB_000473ac;
      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);
    }
LAB_00047318:
    if (iVar4 == *(int *)puVar1) {
      return iVar2;
    }
    (*(code *)PTR___stack_chk_fail_000f5540)();
  } while( true );
}


lui gp,0xb
addiu gp,gp,0x6098
addu gp,gp,t9
addiu sp,sp,-0x40
lw v0,0x18(a0)
sw s3,0x38(sp)
sw s0,0x2c(sp)
sw s1,0x30(sp)
or s1,a0,zero
lw s3,-0x7d38(gp)
lw s0,0x14(a0)
sw gp,0x18(sp)
sw ra,0x3c(sp)
sw s2,0x34(sp)
sw zero,0x20(sp)
lw v1,0x0(s3)
lw a0,0xd8(s0)
sw v1,0x24(sp)
beq a0,zero,0x00047344
_lw t9,-0x7fb8(gp)
addiu a2,sp,0x20
addiu t9,t9,0x7038
bal 0x00047038
_or a1,v0,zero
lw gp,0x18(sp)
bne v0,zero,0x00047318
_or s2,v0,zero
lw t0,0x20(sp)
lw a2,0x98(s0)
beq t0,zero,0x00047408
_lw a1,0x4(s1)
lw v1,0xd8(s0)
lui a3,0x1
addiu t0,t0,-0x1
lhu v0,0x42(v1)
lw a0,0x8(v1)
sll v1,v0,0x10
andi v0,v0,0xfe00
and v1,v1,a3
lw a3,0x0(a0)
or v0,v0,v1
addiu t1,v0,0x18
slt v1,a2,v0
multu t0,t1
movz a2,v0,v1
mflo t3
mfhi t2
addiu v1,t3,0x38
sltu v0,v1,t3
sw v1,0x14(sp)
addu v0,v0,t2
sw v0,0x10(sp)
lw t9,0x8(a3)
jalr t9
_nop
lw gp,0x18(sp)
or s2,v0,zero
lw v1,0x18(s1)
li v0,0x1
bne v1,v0,0x00047318
_nop
beq s2,zero,0x000473ac
_addiu a0,s0,0x68
lw t9,-0x7e50(gp)
li a2,0x10
jalr t9
_li a1,0xff
lw gp,0x18(sp)
lw a0,0x24(sp)
or v0,s2,zero
lw v1,0x0(s3)
bne a0,v1,0x000473fc
_lw ra,0x3c(sp)
lw s3,0x38(sp)
lw s2,0x34(sp)
lw s1,0x30(sp)
lw s0,0x2c(sp)
jr ra
_addiu sp,sp,0x40
lw a2,0x98(s0)
lw a1,0x4(s1)
addiu v0,v0,-0x1
lw a0,0x3c(s0)
sra v1,a2,0x1f
multu v0,a2
mflo t1
mfhi t0
mul a3,v1,v0
lw v0,0x0(a0)
sw t1,0x14(sp)
addu t0,a3,t0
sw t0,0x10(sp)
lw t9,0x8(v0)
jalr t9
_nop
li v1,0x20a
lw gp,0x18(sp)
bne v0,v1,0x000472ec
_or s2,v0,zero
lw v1,0x18(s1)
li v0,0x1
beq v1,v0,0x000473ac
_addiu a0,s0,0x68
b 0x00047318
_or s2,zero,zero
lw v0,0x4(s1)
or s2,zero,zero
addiu v0,v0,0x18
lwl a3,0x0(v0)
lwl a2,0x4(v0)
lwl a1,0x8(v0)
lwl v1,0xc(v0)
lwr a3,0x3(v0)
lwr a2,0x7(v0)
lwr a1,0xb(v0)
lwr v1,0xf(v0)
swl a3,0x0(a0)
swr a3,0x3(a0)
swl a2,0x4(a0)
swr a2,0x7(a0)
swl a1,0x8(a0)
swr a1,0xb(a0)
swl v1,0xc(a0)
b 0x00047318
_swr v1,0xf(a0)
lw t9,-0x7d60(gp)
jalr t9
_nop
b 0x0004734c
_lw v0,0x18(s1)
(translation_unit "/* WARNING: Removing unreachable block (ram,0x00047284) */\n/* WARNING: Removing unreachable block (ram,0x000472b8) */\n/* WARNING: Removing unreachable block (ram,0x000472bc) */\n\nint FUN_00047208(int param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}\n\n" comment comment comment (function_definition "int FUN_00047208(int param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" primitive_type (function_declarator "FUN_00047208(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "undefined4 uVar7;" type_identifier identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_000f5568;" (assignment_expression "puVar1 = PTR___stack_chk_guard_000f5568" identifier = identifier) ;) (expression_statement "iVar8 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar8 = *(int *)(param_1 + 0x14)" identifier = (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar4 = *(int *)PTR___stack_chk_guard_000f5568;" (assignment_expression "iVar4 = *(int *)PTR___stack_chk_guard_000f5568" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000f5568" * (cast_expression "(int *)PTR___stack_chk_guard_000f5568" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;" if (parenthesized_expression "((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))" ( (binary_expression "(*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" (parenthesized_expression "(*(int *)(iVar8 + 0xd8) != 0)" ( (binary_expression "*(int *)(iVar8 + 0xd8) != 0" (pointer_expression "*(int *)(iVar8 + 0xd8)" * (cast_expression "(int *)(iVar8 + 0xd8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0xd8)" ( (binary_expression "iVar8 + 0xd8" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" ( (comma_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0" (assignment_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" identifier = (call_expression "FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" identifier (argument_list "(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" ( (pointer_expression "*(int *)(iVar8 + 0xd8)" * (cast_expression "(int *)(iVar8 + 0xd8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0xd8)" ( (binary_expression "iVar8 + 0xd8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0x18)" * (cast_expression "(undefined4 *)(param_1 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) (goto_statement "goto LAB_00047318;" goto statement_identifier ;)) (do_statement "do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );" do (compound_statement "{\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  }" { (expression_statement "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();" (assignment_expression "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" identifier = (call_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" (parenthesized_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))" ( (pointer_expression "**(code **)(**(int **)(iVar8 + 0x3c) + 8)" * (pointer_expression "*(code **)(**(int **)(iVar8 + 0x3c) + 8)" * (cast_expression "(code **)(**(int **)(iVar8 + 0x3c) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(iVar8 + 0x3c) + 8)" ( (binary_expression "**(int **)(iVar8 + 0x3c) + 8" (pointer_expression "**(int **)(iVar8 + 0x3c)" * (pointer_expression "*(int **)(iVar8 + 0x3c)" * (cast_expression "(int **)(iVar8 + 0x3c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar8 + 0x3c)" ( (binary_expression "iVar8 + 0x3c" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" if (parenthesized_expression "(iVar2 == 0x20a)" ( (binary_expression "iVar2 == 0x20a" identifier == number_literal) )) (compound_statement "{\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }" { (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" ( (binary_expression "*(int *)(param_1 + 0x18) == 1" (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) )))) == number_literal) )) (compound_statement "{\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }" { (labeled_statement "LAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);" statement_identifier : (expression_statement "iVar3 = *(int *)(param_1 + 4);" (assignment_expression "iVar3 = *(int *)(param_1 + 4)" identifier = (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;)) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "uVar7 = *(undefined4 *)(iVar3 + 0x1c);" (assignment_expression "uVar7 = *(undefined4 *)(iVar3 + 0x1c)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x1c)" * (cast_expression "(undefined4 *)(iVar3 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x1c)" ( (binary_expression "iVar3 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "uVar6 = *(undefined4 *)(iVar3 + 0x20);" (assignment_expression "uVar6 = *(undefined4 *)(iVar3 + 0x20)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x20)" * (cast_expression "(undefined4 *)(iVar3 + 0x20)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x20)" ( (binary_expression "iVar3 + 0x20" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = *(undefined4 *)(iVar3 + 0x24);" (assignment_expression "uVar5 = *(undefined4 *)(iVar3 + 0x24)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x24)" * (cast_expression "(undefined4 *)(iVar3 + 0x24)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x24)" ( (binary_expression "iVar3 + 0x24" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);" (assignment_expression "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18)" (pointer_expression "*(undefined4 *)(iVar8 + 0x68)" * (cast_expression "(undefined4 *)(iVar8 + 0x68)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x68)" ( (binary_expression "iVar8 + 0x68" identifier + number_literal) )))) = (pointer_expression "*(undefined4 *)(iVar3 + 0x18)" * (cast_expression "(undefined4 *)(iVar3 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x18)" ( (binary_expression "iVar3 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x6c) = uVar7;" (assignment_expression "*(undefined4 *)(iVar8 + 0x6c) = uVar7" (pointer_expression "*(undefined4 *)(iVar8 + 0x6c)" * (cast_expression "(undefined4 *)(iVar8 + 0x6c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x6c)" ( (binary_expression "iVar8 + 0x6c" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x70) = uVar6;" (assignment_expression "*(undefined4 *)(iVar8 + 0x70) = uVar6" (pointer_expression "*(undefined4 *)(iVar8 + 0x70)" * (cast_expression "(undefined4 *)(iVar8 + 0x70)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x70)" ( (binary_expression "iVar8 + 0x70" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x74) = uVar5;" (assignment_expression "*(undefined4 *)(iVar8 + 0x74) = uVar5" (pointer_expression "*(undefined4 *)(iVar8 + 0x74)" * (cast_expression "(undefined4 *)(iVar8 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x74)" ( (binary_expression "iVar8 + 0x74" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n        iVar2 = 0;\n      }" else (compound_statement "{\n        iVar2 = 0;\n      }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }))) }) (else_clause "else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" else (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" ( (binary_expression "*(int *)(param_1 + 0x18) == 1" (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) )))) == number_literal) )) (compound_statement "{\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" { (if_statement "if (iVar2 == 0) goto LAB_000473ac;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000473ac;" goto statement_identifier ;)) (expression_statement "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);" (call_expression "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff)" (parenthesized_expression "(*(code *)PTR_memset_000f5450)" ( (pointer_expression "*(code *)PTR_memset_000f5450" * (cast_expression "(code *)PTR_memset_000f5450" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8 + 0x68,0xff)" ( (binary_expression "iVar8 + 0x68" identifier + number_literal) , number_literal ))) ;) })))) (labeled_statement "LAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" statement_identifier : (if_statement "if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar4 == *(int *)puVar1)" ( (binary_expression "iVar4 == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "(*(code *)PTR___stack_chk_fail_000f5540)();" (call_expression "(*(code *)PTR___stack_chk_fail_000f5540)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000f5540)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000f5540" * (cast_expression "(code *)PTR___stack_chk_fail_000f5540" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int readDbPage(PgHdr *pPg)\n\n{\n  longlong lVar1;\n  undefined *puVar2;\n  void *pvVar3;\n  int iVar4;\n  uint uVar5;\n  u32 *puVar6;\n  undefined4 uVar7;\n  sqlite3_file *psVar8;\n  void *pvVar9;\n  u32 *piRead;\n  Pager *pPVar10;\n  u32 iFrame;\n  int local_1c;\n  \n  puVar2 = PTR___stack_chk_guard_000f5568;\n  pvVar3 = (void *)pPg->pgno;\n  pPVar10 = pPg->pPager;\n  iFrame = 0;\n  local_1c = *(int *)PTR___stack_chk_guard_000f5568;\n  if (pPVar10->pWal == (Wal *)0x0) {\n    piRead = (u32 *)pPVar10->pageSize;\n    pvVar9 = pPg->pData;\n    goto LAB_0004734c;\n  }\n  piRead = &iFrame;\n  iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead);\n  pvVar9 = pvVar3;\n  if (iVar4 != 0) goto LAB_00047318;\n  piRead = (u32 *)pPVar10->pageSize;\n  pvVar9 = pPg->pData;\n  if (iFrame == 0) goto LAB_00047408;\n  uVar5 = (uint)(pPVar10->pWal->hdr).szPage;\n  psVar8 = pPVar10->pWal->pWalFd;\n  puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10);\n  if ((int)puVar6 <= (int)piRead) {\n    piRead = puVar6;\n  }\n  iVar4 = (*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38);\n  do {\n    if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }\nLAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }\n  } while( true );\n}\n\n" (function_definition "int readDbPage(PgHdr *pPg)\n\n{\n  longlong lVar1;\n  undefined *puVar2;\n  void *pvVar3;\n  int iVar4;\n  uint uVar5;\n  u32 *puVar6;\n  undefined4 uVar7;\n  sqlite3_file *psVar8;\n  void *pvVar9;\n  u32 *piRead;\n  Pager *pPVar10;\n  u32 iFrame;\n  int local_1c;\n  \n  puVar2 = PTR___stack_chk_guard_000f5568;\n  pvVar3 = (void *)pPg->pgno;\n  pPVar10 = pPg->pPager;\n  iFrame = 0;\n  local_1c = *(int *)PTR___stack_chk_guard_000f5568;\n  if (pPVar10->pWal == (Wal *)0x0) {\n    piRead = (u32 *)pPVar10->pageSize;\n    pvVar9 = pPg->pData;\n    goto LAB_0004734c;\n  }\n  piRead = &iFrame;\n  iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead);\n  pvVar9 = pvVar3;\n  if (iVar4 != 0) goto LAB_00047318;\n  piRead = (u32 *)pPVar10->pageSize;\n  pvVar9 = pPg->pData;\n  if (iFrame == 0) goto LAB_00047408;\n  uVar5 = (uint)(pPVar10->pWal->hdr).szPage;\n  psVar8 = pPVar10->pWal->pWalFd;\n  puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10);\n  if ((int)puVar6 <= (int)piRead) {\n    piRead = puVar6;\n  }\n  iVar4 = (*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38);\n  do {\n    if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }\nLAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }\n  } while( true );\n}" primitive_type (function_declarator "readDbPage(PgHdr *pPg)" identifier (parameter_list "(PgHdr *pPg)" ( (parameter_declaration "PgHdr *pPg" type_identifier (pointer_declarator "*pPg" * identifier)) ))) (compound_statement "{\n  longlong lVar1;\n  undefined *puVar2;\n  void *pvVar3;\n  int iVar4;\n  uint uVar5;\n  u32 *puVar6;\n  undefined4 uVar7;\n  sqlite3_file *psVar8;\n  void *pvVar9;\n  u32 *piRead;\n  Pager *pPVar10;\n  u32 iFrame;\n  int local_1c;\n  \n  puVar2 = PTR___stack_chk_guard_000f5568;\n  pvVar3 = (void *)pPg->pgno;\n  pPVar10 = pPg->pPager;\n  iFrame = 0;\n  local_1c = *(int *)PTR___stack_chk_guard_000f5568;\n  if (pPVar10->pWal == (Wal *)0x0) {\n    piRead = (u32 *)pPVar10->pageSize;\n    pvVar9 = pPg->pData;\n    goto LAB_0004734c;\n  }\n  piRead = &iFrame;\n  iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead);\n  pvVar9 = pvVar3;\n  if (iVar4 != 0) goto LAB_00047318;\n  piRead = (u32 *)pPVar10->pageSize;\n  pvVar9 = pPg->pData;\n  if (iFrame == 0) goto LAB_00047408;\n  uVar5 = (uint)(pPVar10->pWal->hdr).szPage;\n  psVar8 = pPVar10->pWal->pWalFd;\n  puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10);\n  if ((int)puVar6 <= (int)piRead) {\n    piRead = puVar6;\n  }\n  iVar4 = (*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38);\n  do {\n    if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }\nLAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }\n  } while( true );\n}" { (declaration "longlong lVar1;" type_identifier identifier ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "void *pvVar3;" primitive_type (pointer_declarator "*pvVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "u32 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "undefined4 uVar7;" type_identifier identifier ;) (declaration "sqlite3_file *psVar8;" type_identifier (pointer_declarator "*psVar8" * identifier) ;) (declaration "void *pvVar9;" primitive_type (pointer_declarator "*pvVar9" * identifier) ;) (declaration "u32 *piRead;" type_identifier (pointer_declarator "*piRead" * identifier) ;) (declaration "Pager *pPVar10;" type_identifier (pointer_declarator "*pPVar10" * identifier) ;) (declaration "u32 iFrame;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar2 = PTR___stack_chk_guard_000f5568;" (assignment_expression "puVar2 = PTR___stack_chk_guard_000f5568" identifier = identifier) ;) (expression_statement "pvVar3 = (void *)pPg->pgno;" (assignment_expression "pvVar3 = (void *)pPg->pgno" identifier = (cast_expression "(void *)pPg->pgno" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "pPg->pgno" identifier -> field_identifier))) ;) (expression_statement "pPVar10 = pPg->pPager;" (assignment_expression "pPVar10 = pPg->pPager" identifier = (field_expression "pPg->pPager" identifier -> field_identifier)) ;) (expression_statement "iFrame = 0;" (assignment_expression "iFrame = 0" identifier = number_literal) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_000f5568;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_000f5568" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000f5568" * (cast_expression "(int *)PTR___stack_chk_guard_000f5568" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (pPVar10->pWal == (Wal *)0x0) {\n    piRead = (u32 *)pPVar10->pageSize;\n    pvVar9 = pPg->pData;\n    goto LAB_0004734c;\n  }" if (parenthesized_expression "(pPVar10->pWal == (Wal *)0x0)" ( (binary_expression "pPVar10->pWal == (Wal *)0x0" (field_expression "pPVar10->pWal" identifier -> field_identifier) == (cast_expression "(Wal *)0x0" ( (type_descriptor "Wal *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    piRead = (u32 *)pPVar10->pageSize;\n    pvVar9 = pPg->pData;\n    goto LAB_0004734c;\n  }" { (expression_statement "piRead = (u32 *)pPVar10->pageSize;" (assignment_expression "piRead = (u32 *)pPVar10->pageSize" identifier = (cast_expression "(u32 *)pPVar10->pageSize" ( (type_descriptor "u32 *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pPVar10->pageSize" identifier -> field_identifier))) ;) (expression_statement "pvVar9 = pPg->pData;" (assignment_expression "pvVar9 = pPg->pData" identifier = (field_expression "pPg->pData" identifier -> field_identifier)) ;) (goto_statement "goto LAB_0004734c;" goto statement_identifier ;) })) (expression_statement "piRead = &iFrame;" (assignment_expression "piRead = &iFrame" identifier = (pointer_expression "&iFrame" & identifier)) ;) (expression_statement "iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead);" (assignment_expression "iVar4 = sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead)" identifier = (call_expression "sqlite3WalFindFrame(pPVar10->pWal,(Pgno)pvVar3,piRead)" identifier (argument_list "(pPVar10->pWal,(Pgno)pvVar3,piRead)" ( (field_expression "pPVar10->pWal" identifier -> field_identifier) , (cast_expression "(Pgno)pvVar3" ( (type_descriptor "Pgno" type_identifier) ) identifier) , identifier )))) ;) (expression_statement "pvVar9 = pvVar3;" (assignment_expression "pvVar9 = pvVar3" identifier = identifier) ;) (if_statement "if (iVar4 != 0) goto LAB_00047318;" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (goto_statement "goto LAB_00047318;" goto statement_identifier ;)) (expression_statement "piRead = (u32 *)pPVar10->pageSize;" (assignment_expression "piRead = (u32 *)pPVar10->pageSize" identifier = (cast_expression "(u32 *)pPVar10->pageSize" ( (type_descriptor "u32 *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pPVar10->pageSize" identifier -> field_identifier))) ;) (expression_statement "pvVar9 = pPg->pData;" (assignment_expression "pvVar9 = pPg->pData" identifier = (field_expression "pPg->pData" identifier -> field_identifier)) ;) (if_statement "if (iFrame == 0) goto LAB_00047408;" if (parenthesized_expression "(iFrame == 0)" ( (binary_expression "iFrame == 0" identifier == number_literal) )) (goto_statement "goto LAB_00047408;" goto statement_identifier ;)) (expression_statement "uVar5 = (uint)(pPVar10->pWal->hdr).szPage;" (assignment_expression "uVar5 = (uint)(pPVar10->pWal->hdr).szPage" identifier = (field_expression "(uint)(pPVar10->pWal->hdr).szPage" (call_expression "(uint)(pPVar10->pWal->hdr)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(pPVar10->pWal->hdr)" ( (field_expression "pPVar10->pWal->hdr" (field_expression "pPVar10->pWal" identifier -> field_identifier) -> field_identifier) ))) . field_identifier)) ;) (expression_statement "psVar8 = pPVar10->pWal->pWalFd;" (assignment_expression "psVar8 = pPVar10->pWal->pWalFd" identifier = (field_expression "pPVar10->pWal->pWalFd" (field_expression "pPVar10->pWal" identifier -> field_identifier) -> field_identifier)) ;) (expression_statement "puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10);" (assignment_expression "puVar6 = (u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10)" identifier = (cast_expression "(u32 *)(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10)" ( (type_descriptor "u32 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar5 & 0xfe00 | (uVar5 & 1) << 0x10)" ( (binary_expression "uVar5 & 0xfe00 | (uVar5 & 1) << 0x10" (binary_expression "uVar5 & 0xfe00" identifier & number_literal) | (binary_expression "(uVar5 & 1) << 0x10" (parenthesized_expression "(uVar5 & 1)" ( (binary_expression "uVar5 & 1" identifier & number_literal) )) << number_literal)) )))) ;) (if_statement "if ((int)puVar6 <= (int)piRead) {\n    piRead = puVar6;\n  }" if (parenthesized_expression "((int)puVar6 <= (int)piRead)" ( (binary_expression "(int)puVar6 <= (int)piRead" (cast_expression "(int)puVar6" ( (type_descriptor "int" primitive_type) ) identifier) <= (cast_expression "(int)piRead" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    piRead = puVar6;\n  }" { (expression_statement "piRead = puVar6;" (assignment_expression "piRead = puVar6" identifier = identifier) ;) })) (expression_statement "iVar4 = (*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38);" (assignment_expression "iVar4 = (*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38)" identifier = (call_expression "(*psVar8->pMethods->xRead)\n                    (psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38)" (parenthesized_expression "(*psVar8->pMethods->xRead)" ( (pointer_expression "*psVar8->pMethods->xRead" * (field_expression "psVar8->pMethods->xRead" (field_expression "psVar8->pMethods" identifier -> field_identifier) -> field_identifier)) )) (argument_list "(psVar8,pvVar9,(int)piRead,(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38)" ( identifier , identifier , (cast_expression "(int)piRead" ( (type_descriptor "int" primitive_type) ) identifier) , (binary_expression "(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6) + 0x38" (binary_expression "(ulonglong)(iFrame - 1) * ZEXT48(puVar6 + 6)" (call_expression "(ulonglong)(iFrame - 1)" (parenthesized_expression "(ulonglong)" ( identifier )) (argument_list "(iFrame - 1)" ( (binary_expression "iFrame - 1" identifier - number_literal) ))) * (call_expression "ZEXT48(puVar6 + 6)" identifier (argument_list "(puVar6 + 6)" ( (binary_expression "puVar6 + 6" identifier + number_literal) )))) + number_literal) )))) ;) (do_statement "do {\n    if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }\nLAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }\n  } while( true );" do (compound_statement "{\n    if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }\nLAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }\n  }" { (if_statement "if (pPg->pgno == 1) {\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }" if (parenthesized_expression "(pPg->pgno == 1)" ( (binary_expression "pPg->pgno == 1" (field_expression "pPg->pgno" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n      if (iVar4 == 0) goto LAB_000473ac;\n      piRead = (u32 *)0x10;\n      pvVar9 = (void *)0xff;\n      (*(code *)PTR_memset_000f5450)();\n    }" { (if_statement "if (iVar4 == 0) goto LAB_000473ac;" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000473ac;" goto statement_identifier ;)) (expression_statement "piRead = (u32 *)0x10;" (assignment_expression "piRead = (u32 *)0x10" identifier = (cast_expression "(u32 *)0x10" ( (type_descriptor "u32 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pvVar9 = (void *)0xff;" (assignment_expression "pvVar9 = (void *)0xff" identifier = (cast_expression "(void *)0xff" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "(*(code *)PTR_memset_000f5450)();" (call_expression "(*(code *)PTR_memset_000f5450)()" (parenthesized_expression "(*(code *)PTR_memset_000f5450)" ( (pointer_expression "*(code *)PTR_memset_000f5450" * (cast_expression "(code *)PTR_memset_000f5450" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) })) (labeled_statement "LAB_00047318:\n    while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }" statement_identifier : (while_statement "while( true ) {\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }\n      (*(code *)PTR___stack_chk_fail_000f5540)();\nLAB_00047408:\n      pvVar3 = (void *)pPg->pgno;\nLAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);\n      iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));\n      if (iVar4 != 0x20a) break;\n      if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }\n    }" { (if_statement "if (local_1c == *(int *)puVar2) {\n        return iVar4;\n      }" if (parenthesized_expression "(local_1c == *(int *)puVar2)" ( (binary_expression "local_1c == *(int *)puVar2" identifier == (pointer_expression "*(int *)puVar2" * (cast_expression "(int *)puVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n        return iVar4;\n      }" { (return_statement "return iVar4;" return identifier ;) })) (expression_statement "(*(code *)PTR___stack_chk_fail_000f5540)();" (call_expression "(*(code *)PTR___stack_chk_fail_000f5540)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000f5540)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000f5540" * (cast_expression "(code *)PTR___stack_chk_fail_000f5540" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (labeled_statement "LAB_00047408:\n      pvVar3 = (void *)pPg->pgno;" statement_identifier : (expression_statement "pvVar3 = (void *)pPg->pgno;" (assignment_expression "pvVar3 = (void *)pPg->pgno" identifier = (cast_expression "(void *)pPg->pgno" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "pPg->pgno" identifier -> field_identifier))) ;)) (labeled_statement "LAB_0004734c:\n      lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);" statement_identifier : (expression_statement "lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead);" (assignment_expression "lVar1 = (ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead)" identifier = (binary_expression "(ulonglong)((int)pvVar3 - 1U) * ZEXT48(piRead)" (call_expression "(ulonglong)((int)pvVar3 - 1U)" (parenthesized_expression "(ulonglong)" ( identifier )) (argument_list "((int)pvVar3 - 1U)" ( (binary_expression "(int)pvVar3 - 1U" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) - number_literal) ))) * (call_expression "ZEXT48(piRead)" identifier (argument_list "(piRead)" ( identifier ))))) ;)) (expression_statement "iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1));" (assignment_expression "iVar4 = (*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1))" identifier = (call_expression "(*pPVar10->fd->pMethods->xRead)\n                        (pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1))" (parenthesized_expression "(*pPVar10->fd->pMethods->xRead)" ( (pointer_expression "*pPVar10->fd->pMethods->xRead" * (field_expression "pPVar10->fd->pMethods->xRead" (field_expression "pPVar10->fd->pMethods" (field_expression "pPVar10->fd" identifier -> field_identifier) -> field_identifier) -> field_identifier)) )) (argument_list "(pPVar10->fd,pvVar9,(int)piRead,\n                         CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1))" ( (field_expression "pPVar10->fd" identifier -> field_identifier) , identifier , (cast_expression "(int)piRead" ( (type_descriptor "int" primitive_type) ) identifier) , (call_expression "CONCAT44(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1)" identifier (argument_list "(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20),(int)lVar1)" ( (binary_expression "((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +\n                                  (int)((ulonglong)lVar1 >> 0x20)" (binary_expression "((int)piRead >> 0x1f) * ((int)pvVar3 - 1U)" (parenthesized_expression "((int)piRead >> 0x1f)" ( (binary_expression "(int)piRead >> 0x1f" (cast_expression "(int)piRead" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) )) * (parenthesized_expression "((int)pvVar3 - 1U)" ( (binary_expression "(int)pvVar3 - 1U" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) - number_literal) ))) + (cast_expression "(int)((ulonglong)lVar1 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)lVar1 >> 0x20)" ( (binary_expression "(ulonglong)lVar1 >> 0x20" (cast_expression "(ulonglong)lVar1" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) , (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier) ))) )))) ;) (if_statement "if (iVar4 != 0x20a) break;" if (parenthesized_expression "(iVar4 != 0x20a)" ( (binary_expression "iVar4 != 0x20a" identifier != number_literal) )) (break_statement "break;" break ;)) (if_statement "if (pPg->pgno == 1) {\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }\n      else {\n        iVar4 = 0;\n      }" if (parenthesized_expression "(pPg->pgno == 1)" ( (binary_expression "pPg->pgno == 1" (field_expression "pPg->pgno" identifier -> field_identifier) == number_literal) )) (compound_statement "{\nLAB_000473ac:\n        pvVar3 = pPg->pData;\n        iVar4 = 0;\n        piRead = *(u32 **)((int)pvVar3 + 0x1c);\n        pvVar9 = *(void **)((int)pvVar3 + 0x20);\n        uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);\n        *(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);\n        *(u32 **)(pPVar10->dbFileVers + 4) = piRead;\n        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;\n        *(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;\n      }" { (labeled_statement "LAB_000473ac:\n        pvVar3 = pPg->pData;" statement_identifier : (expression_statement "pvVar3 = pPg->pData;" (assignment_expression "pvVar3 = pPg->pData" identifier = (field_expression "pPg->pData" identifier -> field_identifier)) ;)) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (expression_statement "piRead = *(u32 **)((int)pvVar3 + 0x1c);" (assignment_expression "piRead = *(u32 **)((int)pvVar3 + 0x1c)" identifier = (pointer_expression "*(u32 **)((int)pvVar3 + 0x1c)" * (cast_expression "(u32 **)((int)pvVar3 + 0x1c)" ( (type_descriptor "u32 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar3 + 0x1c)" ( (binary_expression "(int)pvVar3 + 0x1c" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "pvVar9 = *(void **)((int)pvVar3 + 0x20);" (assignment_expression "pvVar9 = *(void **)((int)pvVar3 + 0x20)" identifier = (pointer_expression "*(void **)((int)pvVar3 + 0x20)" * (cast_expression "(void **)((int)pvVar3 + 0x20)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)pvVar3 + 0x20)" ( (binary_expression "(int)pvVar3 + 0x20" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "uVar7 = *(undefined4 *)((int)pvVar3 + 0x24);" (assignment_expression "uVar7 = *(undefined4 *)((int)pvVar3 + 0x24)" identifier = (pointer_expression "*(undefined4 *)((int)pvVar3 + 0x24)" * (cast_expression "(undefined4 *)((int)pvVar3 + 0x24)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar3 + 0x24)" ( (binary_expression "(int)pvVar3 + 0x24" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "*(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18);" (assignment_expression "*(undefined4 *)pPVar10->dbFileVers = *(undefined4 *)((int)pvVar3 + 0x18)" (pointer_expression "*(undefined4 *)pPVar10->dbFileVers" * (cast_expression "(undefined4 *)pPVar10->dbFileVers" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pPVar10->dbFileVers" identifier -> field_identifier))) = (pointer_expression "*(undefined4 *)((int)pvVar3 + 0x18)" * (cast_expression "(undefined4 *)((int)pvVar3 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar3 + 0x18)" ( (binary_expression "(int)pvVar3 + 0x18" (cast_expression "(int)pvVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "*(u32 **)(pPVar10->dbFileVers + 4) = piRead;" (assignment_expression "*(u32 **)(pPVar10->dbFileVers + 4) = piRead" (pointer_expression "*(u32 **)(pPVar10->dbFileVers + 4)" * (cast_expression "(u32 **)(pPVar10->dbFileVers + 4)" ( (type_descriptor "u32 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(pPVar10->dbFileVers + 4)" ( (binary_expression "pPVar10->dbFileVers + 4" (field_expression "pPVar10->dbFileVers" identifier -> field_identifier) + number_literal) )))) = identifier) ;) (expression_statement "*(void **)(pPVar10->dbFileVers + 8) = pvVar9;" (assignment_expression "*(void **)(pPVar10->dbFileVers + 8) = pvVar9" (pointer_expression "*(void **)(pPVar10->dbFileVers + 8)" * (cast_expression "(void **)(pPVar10->dbFileVers + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(pPVar10->dbFileVers + 8)" ( (binary_expression "pPVar10->dbFileVers + 8" (field_expression "pPVar10->dbFileVers" identifier -> field_identifier) + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7;" (assignment_expression "*(undefined4 *)(pPVar10->dbFileVers + 0xc) = uVar7" (pointer_expression "*(undefined4 *)(pPVar10->dbFileVers + 0xc)" * (cast_expression "(undefined4 *)(pPVar10->dbFileVers + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pPVar10->dbFileVers + 0xc)" ( (binary_expression "pPVar10->dbFileVers + 0xc" (field_expression "pPVar10->dbFileVers" identifier -> field_identifier) + number_literal) )))) = identifier) ;) }) (else_clause "else {\n        iVar4 = 0;\n      }" else (compound_statement "{\n        iVar4 = 0;\n      }" { (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) }))) }))) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int FUN_00047208(int param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}\n\n" (function_definition "int FUN_00047208(int param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" primitive_type (function_declarator "FUN_00047208(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "undefined4 uVar7;" type_identifier identifier ;) (declaration "int iVar8;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_000f5568;" (assignment_expression "puVar1 = PTR___stack_chk_guard_000f5568" identifier = identifier) ;) (expression_statement "iVar8 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar8 = *(int *)(param_1 + 0x14)" identifier = (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar4 = *(int *)PTR___stack_chk_guard_000f5568;" (assignment_expression "iVar4 = *(int *)PTR___stack_chk_guard_000f5568" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000f5568" * (cast_expression "(int *)PTR___stack_chk_guard_000f5568" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;" if (parenthesized_expression "((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))" ( (binary_expression "(*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" (parenthesized_expression "(*(int *)(iVar8 + 0xd8) != 0)" ( (binary_expression "*(int *)(iVar8 + 0xd8) != 0" (pointer_expression "*(int *)(iVar8 + 0xd8)" * (cast_expression "(int *)(iVar8 + 0xd8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0xd8)" ( (binary_expression "iVar8 + 0xd8" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" ( (comma_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0" (assignment_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" identifier = (call_expression "FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" identifier (argument_list "(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" ( (pointer_expression "*(int *)(iVar8 + 0xd8)" * (cast_expression "(int *)(iVar8 + 0xd8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0xd8)" ( (binary_expression "iVar8 + 0xd8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0x18)" * (cast_expression "(undefined4 *)(param_1 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) (goto_statement "goto LAB_00047318;" goto statement_identifier ;)) (do_statement "do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );" do (compound_statement "{\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  }" { (expression_statement "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();" (assignment_expression "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" identifier = (call_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" (parenthesized_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))" ( (pointer_expression "**(code **)(**(int **)(iVar8 + 0x3c) + 8)" * (pointer_expression "*(code **)(**(int **)(iVar8 + 0x3c) + 8)" * (cast_expression "(code **)(**(int **)(iVar8 + 0x3c) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(iVar8 + 0x3c) + 8)" ( (binary_expression "**(int **)(iVar8 + 0x3c) + 8" (pointer_expression "**(int **)(iVar8 + 0x3c)" * (pointer_expression "*(int **)(iVar8 + 0x3c)" * (cast_expression "(int **)(iVar8 + 0x3c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar8 + 0x3c)" ( (binary_expression "iVar8 + 0x3c" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" if (parenthesized_expression "(iVar2 == 0x20a)" ( (binary_expression "iVar2 == 0x20a" identifier == number_literal) )) (compound_statement "{\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }" { (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" ( (binary_expression "*(int *)(param_1 + 0x18) == 1" (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) )))) == number_literal) )) (compound_statement "{\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }" { (labeled_statement "LAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);" statement_identifier : (expression_statement "iVar3 = *(int *)(param_1 + 4);" (assignment_expression "iVar3 = *(int *)(param_1 + 4)" identifier = (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;)) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "uVar7 = *(undefined4 *)(iVar3 + 0x1c);" (assignment_expression "uVar7 = *(undefined4 *)(iVar3 + 0x1c)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x1c)" * (cast_expression "(undefined4 *)(iVar3 + 0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x1c)" ( (binary_expression "iVar3 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "uVar6 = *(undefined4 *)(iVar3 + 0x20);" (assignment_expression "uVar6 = *(undefined4 *)(iVar3 + 0x20)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x20)" * (cast_expression "(undefined4 *)(iVar3 + 0x20)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x20)" ( (binary_expression "iVar3 + 0x20" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = *(undefined4 *)(iVar3 + 0x24);" (assignment_expression "uVar5 = *(undefined4 *)(iVar3 + 0x24)" identifier = (pointer_expression "*(undefined4 *)(iVar3 + 0x24)" * (cast_expression "(undefined4 *)(iVar3 + 0x24)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x24)" ( (binary_expression "iVar3 + 0x24" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);" (assignment_expression "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18)" (pointer_expression "*(undefined4 *)(iVar8 + 0x68)" * (cast_expression "(undefined4 *)(iVar8 + 0x68)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x68)" ( (binary_expression "iVar8 + 0x68" identifier + number_literal) )))) = (pointer_expression "*(undefined4 *)(iVar3 + 0x18)" * (cast_expression "(undefined4 *)(iVar3 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 0x18)" ( (binary_expression "iVar3 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x6c) = uVar7;" (assignment_expression "*(undefined4 *)(iVar8 + 0x6c) = uVar7" (pointer_expression "*(undefined4 *)(iVar8 + 0x6c)" * (cast_expression "(undefined4 *)(iVar8 + 0x6c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x6c)" ( (binary_expression "iVar8 + 0x6c" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x70) = uVar6;" (assignment_expression "*(undefined4 *)(iVar8 + 0x70) = uVar6" (pointer_expression "*(undefined4 *)(iVar8 + 0x70)" * (cast_expression "(undefined4 *)(iVar8 + 0x70)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x70)" ( (binary_expression "iVar8 + 0x70" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar8 + 0x74) = uVar5;" (assignment_expression "*(undefined4 *)(iVar8 + 0x74) = uVar5" (pointer_expression "*(undefined4 *)(iVar8 + 0x74)" * (cast_expression "(undefined4 *)(iVar8 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar8 + 0x74)" ( (binary_expression "iVar8 + 0x74" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n        iVar2 = 0;\n      }" else (compound_statement "{\n        iVar2 = 0;\n      }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }))) }) (else_clause "else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" else (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" ( (binary_expression "*(int *)(param_1 + 0x18) == 1" (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) )))) == number_literal) )) (compound_statement "{\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" { (if_statement "if (iVar2 == 0) goto LAB_000473ac;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000473ac;" goto statement_identifier ;)) (expression_statement "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);" (call_expression "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff)" (parenthesized_expression "(*(code *)PTR_memset_000f5450)" ( (pointer_expression "*(code *)PTR_memset_000f5450" * (cast_expression "(code *)PTR_memset_000f5450" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar8 + 0x68,0xff)" ( (binary_expression "iVar8 + 0x68" identifier + number_literal) , number_literal ))) ;) })))) (labeled_statement "LAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" statement_identifier : (if_statement "if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" if (parenthesized_expression "(iVar4 == *(int *)puVar1)" ( (binary_expression "iVar4 == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "(*(code *)PTR___stack_chk_fail_000f5540)();" (call_expression "(*(code *)PTR___stack_chk_fail_000f5540)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000f5540)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_000f5540" * (cast_expression "(code *)PTR___stack_chk_fail_000f5540" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = 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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) , (binary_expression IDENT != LIT)) ))) )) (goto_statement goto statement_identifier ;)) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT) ))))) )) (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (labeled_statement statement_identifier : (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 = LIT) ;) (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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) , LIT ))) ;) })))) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "int FUN_00047208(int param_1)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" (primitive_type "int") (function_declarator "FUN_00047208(int param_1)" (identifier "FUN_00047208") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  undefined4 uVar7;\n  int iVar8;\n  \n  puVar1 = PTR___stack_chk_guard_000f5568;\n  iVar8 = *(int *)(param_1 + 0x14);\n  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;\n  if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;\n  do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "undefined4 uVar6;" (type_identifier "undefined4") (identifier "uVar6") (; ";")) (declaration "undefined4 uVar7;" (type_identifier "undefined4") (identifier "uVar7") (; ";")) (declaration "int iVar8;" (primitive_type "int") (identifier "iVar8") (; ";")) (expression_statement "puVar1 = PTR___stack_chk_guard_000f5568;" (assignment_expression "puVar1 = PTR___stack_chk_guard_000f5568" (identifier "puVar1") (= "=") (identifier "PTR___stack_chk_guard_000f5568")) (; ";")) (expression_statement "iVar8 = *(int *)(param_1 + 0x14);" (assignment_expression "iVar8 = *(int *)(param_1 + 0x14)" (identifier "iVar8") (= "=") (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar4 = *(int *)PTR___stack_chk_guard_000f5568;" (assignment_expression "iVar4 = *(int *)PTR___stack_chk_guard_000f5568" (identifier "iVar4") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_000f5568" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_000f5568" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_000f5568")))) (; ";")) (if_statement "if ((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))\n  goto LAB_00047318;" (if "if") (parenthesized_expression "((*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))" (( "(") (binary_expression "(*(int *)(iVar8 + 0xd8) != 0) &&\n     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" (parenthesized_expression "(*(int *)(iVar8 + 0xd8) != 0)" (( "(") (binary_expression "*(int *)(iVar8 + 0xd8) != 0" (pointer_expression "*(int *)(iVar8 + 0xd8)" (* "*") (cast_expression "(int *)(iVar8 + 0xd8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0xd8)" (( "(") (binary_expression "iVar8 + 0xd8" (identifier "iVar8") (+ "+") (number_literal "0xd8")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0)" (( "(") (comma_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0" (assignment_expression "iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" (identifier "iVar2") (= "=") (call_expression "FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" (identifier "FUN_00047038") (argument_list "(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18))" (( "(") (pointer_expression "*(int *)(iVar8 + 0xd8)" (* "*") (cast_expression "(int *)(iVar8 + 0xd8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0xd8)" (( "(") (binary_expression "iVar8 + 0xd8" (identifier "iVar8") (+ "+") (number_literal "0xd8")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0x18)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x18)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) () ")")))) (, ",") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (goto_statement "goto LAB_00047318;" (goto "goto") (statement_identifier "LAB_00047318") (; ";"))) (do_statement "do {\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  } while( true );" (do "do") (compound_statement "{\n    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();\n    if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }\nLAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }\n    (*(code *)PTR___stack_chk_fail_000f5540)();\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();" (assignment_expression "iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" (identifier "iVar2") (= "=") (call_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))()" (parenthesized_expression "(**(code **)(**(int **)(iVar8 + 0x3c) + 8))" (( "(") (pointer_expression "**(code **)(**(int **)(iVar8 + 0x3c) + 8)" (* "*") (pointer_expression "*(code **)(**(int **)(iVar8 + 0x3c) + 8)" (* "*") (cast_expression "(code **)(**(int **)(iVar8 + 0x3c) + 8)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(**(int **)(iVar8 + 0x3c) + 8)" (( "(") (binary_expression "**(int **)(iVar8 + 0x3c) + 8" (pointer_expression "**(int **)(iVar8 + 0x3c)" (* "*") (pointer_expression "*(int **)(iVar8 + 0x3c)" (* "*") (cast_expression "(int **)(iVar8 + 0x3c)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar8 + 0x3c)" (( "(") (binary_expression "iVar8 + 0x3c" (identifier "iVar8") (+ "+") (number_literal "0x3c")) () ")"))))) (+ "+") (number_literal "8")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 == 0x20a) {\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }\n    else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" (if "if") (parenthesized_expression "(iVar2 == 0x20a)" (( "(") (binary_expression "iVar2 == 0x20a" (identifier "iVar2") (== "==") (number_literal "0x20a")) () ")")) (compound_statement "{\n      if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }\n    }" ({ "{") (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }\n      else {\n        iVar2 = 0;\n      }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" (( "(") (binary_expression "*(int *)(param_1 + 0x18) == 1" (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")) () ")")))) (== "==") (number_literal "1")) () ")")) (compound_statement "{\nLAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);\n        iVar2 = 0;\n        uVar7 = *(undefined4 *)(iVar3 + 0x1c);\n        uVar6 = *(undefined4 *)(iVar3 + 0x20);\n        uVar5 = *(undefined4 *)(iVar3 + 0x24);\n        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);\n        *(undefined4 *)(iVar8 + 0x6c) = uVar7;\n        *(undefined4 *)(iVar8 + 0x70) = uVar6;\n        *(undefined4 *)(iVar8 + 0x74) = uVar5;\n      }" ({ "{") (labeled_statement "LAB_000473ac:\n        iVar3 = *(int *)(param_1 + 4);" (statement_identifier "LAB_000473ac") (: ":") (expression_statement "iVar3 = *(int *)(param_1 + 4);" (assignment_expression "iVar3 = *(int *)(param_1 + 4)" (identifier "iVar3") (= "=") (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))))) (; ";"))) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar7 = *(undefined4 *)(iVar3 + 0x1c);" (assignment_expression "uVar7 = *(undefined4 *)(iVar3 + 0x1c)" (identifier "uVar7") (= "=") (pointer_expression "*(undefined4 *)(iVar3 + 0x1c)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 0x1c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x1c)" (( "(") (binary_expression "iVar3 + 0x1c" (identifier "iVar3") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (expression_statement "uVar6 = *(undefined4 *)(iVar3 + 0x20);" (assignment_expression "uVar6 = *(undefined4 *)(iVar3 + 0x20)" (identifier "uVar6") (= "=") (pointer_expression "*(undefined4 *)(iVar3 + 0x20)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 0x20)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x20)" (( "(") (binary_expression "iVar3 + 0x20" (identifier "iVar3") (+ "+") (number_literal "0x20")) () ")"))))) (; ";")) (expression_statement "uVar5 = *(undefined4 *)(iVar3 + 0x24);" (assignment_expression "uVar5 = *(undefined4 *)(iVar3 + 0x24)" (identifier "uVar5") (= "=") (pointer_expression "*(undefined4 *)(iVar3 + 0x24)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 0x24)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x24)" (( "(") (binary_expression "iVar3 + 0x24" (identifier "iVar3") (+ "+") (number_literal "0x24")) () ")"))))) (; ";")) (expression_statement "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);" (assignment_expression "*(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18)" (pointer_expression "*(undefined4 *)(iVar8 + 0x68)" (* "*") (cast_expression "(undefined4 *)(iVar8 + 0x68)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0x68)" (( "(") (binary_expression "iVar8 + 0x68" (identifier "iVar8") (+ "+") (number_literal "0x68")) () ")")))) (= "=") (pointer_expression "*(undefined4 *)(iVar3 + 0x18)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 0x18)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 0x18)" (( "(") (binary_expression "iVar3 + 0x18" (identifier "iVar3") (+ "+") (number_literal "0x18")) () ")"))))) (; ";")) (expression_statement "*(undefined4 *)(iVar8 + 0x6c) = uVar7;" (assignment_expression "*(undefined4 *)(iVar8 + 0x6c) = uVar7" (pointer_expression "*(undefined4 *)(iVar8 + 0x6c)" (* "*") (cast_expression "(undefined4 *)(iVar8 + 0x6c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0x6c)" (( "(") (binary_expression "iVar8 + 0x6c" (identifier "iVar8") (+ "+") (number_literal "0x6c")) () ")")))) (= "=") (identifier "uVar7")) (; ";")) (expression_statement "*(undefined4 *)(iVar8 + 0x70) = uVar6;" (assignment_expression "*(undefined4 *)(iVar8 + 0x70) = uVar6" (pointer_expression "*(undefined4 *)(iVar8 + 0x70)" (* "*") (cast_expression "(undefined4 *)(iVar8 + 0x70)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0x70)" (( "(") (binary_expression "iVar8 + 0x70" (identifier "iVar8") (+ "+") (number_literal "0x70")) () ")")))) (= "=") (identifier "uVar6")) (; ";")) (expression_statement "*(undefined4 *)(iVar8 + 0x74) = uVar5;" (assignment_expression "*(undefined4 *)(iVar8 + 0x74) = uVar5" (pointer_expression "*(undefined4 *)(iVar8 + 0x74)" (* "*") (cast_expression "(undefined4 *)(iVar8 + 0x74)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar8 + 0x74)" (( "(") (binary_expression "iVar8 + 0x74" (identifier "iVar8") (+ "+") (number_literal "0x74")) () ")")))) (= "=") (identifier "uVar5")) (; ";")) (} "}")) (else_clause "else {\n        iVar2 = 0;\n      }" (else "else") (compound_statement "{\n        iVar2 = 0;\n      }" ({ "{") (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (} "}")))) (} "}")) (else_clause "else if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" (else "else") (if_statement "if (*(int *)(param_1 + 0x18) == 1) {\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x18) == 1)" (( "(") (binary_expression "*(int *)(param_1 + 0x18) == 1" (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")) () ")")))) (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      if (iVar2 == 0) goto LAB_000473ac;\n      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);\n    }" ({ "{") (if_statement "if (iVar2 == 0) goto LAB_000473ac;" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_000473ac;" (goto "goto") (statement_identifier "LAB_000473ac") (; ";"))) (expression_statement "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);" (call_expression "(*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff)" (parenthesized_expression "(*(code *)PTR_memset_000f5450)" (( "(") (pointer_expression "*(code *)PTR_memset_000f5450" (* "*") (cast_expression "(code *)PTR_memset_000f5450" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memset_000f5450"))) () ")")) (argument_list "(iVar8 + 0x68,0xff)" (( "(") (binary_expression "iVar8 + 0x68" (identifier "iVar8") (+ "+") (number_literal "0x68")) (, ",") (number_literal "0xff") () ")"))) (; ";")) (} "}"))))) (labeled_statement "LAB_00047318:\n    if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" (statement_identifier "LAB_00047318") (: ":") (if_statement "if (iVar4 == *(int *)puVar1) {\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(iVar4 == *(int *)puVar1)" (( "(") (binary_expression "iVar4 == *(int *)puVar1" (identifier "iVar4") (== "==") (pointer_expression "*(int *)puVar1" (* "*") (cast_expression "(int *)puVar1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1")))) () ")")) (compound_statement "{\n      return iVar2;\n    }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))) (expression_statement "(*(code *)PTR___stack_chk_fail_000f5540)();" (call_expression "(*(code *)PTR___stack_chk_fail_000f5540)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_000f5540)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_000f5540" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_000f5540" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_000f5540"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

int function_1(type_1 *pPg)

{
  type_2 lVar1;
  type_3 *puVar2;
  void *pvVar3;
  int var_2;
  type_4 var_4;
  type_5 *var_6;
  type_6 uVar7;
  type_7 *psVar8;
  void *pvVar9;
  type_5 *piRead;
  type_8 *pPVar10;
  type_5 var_3;
  int var_7;
  
  puVar2 = PTR___stack_chk_guard_000f5568;
  pvVar3 = (void *)pPg->pgno;
  pPVar10 = pPg->pPager;
  var_3 = 0;
  var_7 = *(int *)PTR___stack_chk_guard_000f5568;
  if (pPVar10->pWal == (type_9 *)0x0) {
    piRead = (type_5 *)pPVar10->pageSize;
    pvVar9 = pPg->pData;
    goto LAB_0004734c;
  }
  piRead = &var_3;
  var_2 = var_1(pPVar10->pWal,(type_10)pvVar3,piRead);
  pvVar9 = pvVar3;
  if (var_2 != 0) goto LAB_00047318;
  piRead = (type_5 *)pPVar10->pageSize;
  pvVar9 = pPg->pData;
  if (var_3 == 0) goto LAB_00047408;
  var_4 = (type_4)(pPVar10->pWal->hdr).szPage;
  psVar8 = pPVar10->pWal->pWalFd;
  var_6 = (type_5 *)(var_4 & 0xfe00 | (var_4 & 1) << 0x10);
  if ((int)var_6 <= (int)piRead) {
    piRead = var_6;
  }
  var_2 = (*psVar8->pMethods->xRead)
                    (psVar8,pvVar9,(int)piRead,(type_12)(var_3 - 1) * var_5(var_6 + 6) + 0x38);
  do {
    if (pPg->pgno == 1) {
      if (var_2 == 0) goto LAB_000473ac;
      piRead = (type_5 *)0x10;
      pvVar9 = (void *)0xff;
      (*(type_11 *)PTR_memset_000f5450)();
    }
LAB_00047318:
    while( true ) {
      if (var_7 == *(int *)puVar2) {
        return var_2;
      }
      (*(type_11 *)PTR___stack_chk_fail_000f5540)();
LAB_00047408:
      pvVar3 = (void *)pPg->pgno;
LAB_0004734c:
      lVar1 = (type_12)((int)pvVar3 - 1U) * var_5(piRead);
      var_2 = (*pPVar10->fd->pMethods->xRead)
                        (pPVar10->fd,pvVar9,(int)piRead,
                         var_8(((int)piRead >> 0x1f) * ((int)pvVar3 - 1U) +
                                  (int)((type_12)lVar1 >> 0x20),(int)lVar1));
      if (var_2 != 0x20a) break;
      if (pPg->pgno == 1) {
LAB_000473ac:
        pvVar3 = pPg->pData;
        var_2 = 0;
        piRead = *(type_5 **)((int)pvVar3 + 0x1c);
        pvVar9 = *(void **)((int)pvVar3 + 0x20);
        uVar7 = *(type_6 *)((int)pvVar3 + 0x24);
        *(type_6 *)pPVar10->dbFileVers = *(type_6 *)((int)pvVar3 + 0x18);
        *(type_5 **)(pPVar10->dbFileVers + 4) = piRead;
        *(void **)(pPVar10->dbFileVers + 8) = pvVar9;
        *(type_6 *)(pPVar10->dbFileVers + 0xc) = uVar7;
      }
      else {
        var_2 = 0;
      }
    }
  } while( true );
}


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

/* WARNING: Removing unreachable block (ram,0x00047284) */
/* WARNING: Removing unreachable block (ram,0x000472b8) */
/* WARNING: Removing unreachable block (ram,0x000472bc) */

int MASKED(int param_1)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  int iVar8;
  
  puVar1 = PTR___stack_chk_guard_000f5568;
  iVar8 = *(int *)(param_1 + 0x14);
  iVar4 = *(int *)PTR___stack_chk_guard_000f5568;
  if ((*(int *)(iVar8 + 0xd8) != 0) &&
     (iVar2 = FUN_00047038(*(int *)(iVar8 + 0xd8),*(undefined4 *)(param_1 + 0x18)), iVar2 != 0))
  goto LAB_00047318;
  do {
    iVar2 = (**(code **)(**(int **)(iVar8 + 0x3c) + 8))();
    if (iVar2 == 0x20a) {
      if (*(int *)(param_1 + 0x18) == 1) {
LAB_000473ac:
        iVar3 = *(int *)(param_1 + 4);
        iVar2 = 0;
        uVar7 = *(undefined4 *)(iVar3 + 0x1c);
        uVar6 = *(undefined4 *)(iVar3 + 0x20);
        uVar5 = *(undefined4 *)(iVar3 + 0x24);
        *(undefined4 *)(iVar8 + 0x68) = *(undefined4 *)(iVar3 + 0x18);
        *(undefined4 *)(iVar8 + 0x6c) = uVar7;
        *(undefined4 *)(iVar8 + 0x70) = uVar6;
        *(undefined4 *)(iVar8 + 0x74) = uVar5;
      }
      else {
        iVar2 = 0;
      }
    }
    else if (*(int *)(param_1 + 0x18) == 1) {
      if (iVar2 == 0) goto LAB_000473ac;
      (*(code *)PTR_memset_000f5450)(iVar8 + 0x68,0xff);
    }
LAB_00047318:
    if (iVar4 == *(int *)puVar1) {
      return iVar2;
    }
    (*(code *)PTR___stack_chk_fail_000f5540)();
  } while( true );
}

