
int sqlite3BtreeSetPageSize(Btree *p,int pageSize,int nReserve,int iFix)

{
  BtShared *pBt;
  int iVar1;
  uint uVar2;
  
  pBt = p->pBt;
  sqlite3BtreeEnter(p);
  pBt->nReserveWanted = (u8)nReserve;
  uVar2 = pBt->pageSize - pBt->usableSize;
  if (nReserve <= (int)uVar2) {
    nReserve = uVar2;
  }
  if ((pBt->btsFlags & 2) == 0) {
    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {
      pBt->pageSize = pageSize;
      freeTempSpace(pBt);
    }
    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);
    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);
    if (iFix != 0) {
      pBt->btsFlags = pBt->btsFlags | 2;
    }
    sqlite3BtreeLeave(p);
  }
  else {
    sqlite3BtreeLeave(p);
    iVar1 = 8;
  }
  return iVar1;
}



undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  uint uVar3;
  
  puVar1 = *(undefined8 **)(param_1 + 8);
  FUN_00117be4();
  *(char *)((long)puVar1 + 0x26) = (char)param_3;
  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);
  if ((int)param_3 <= (int)uVar3) {
    param_3 = uVar3;
  }
  if ((*(byte *)(puVar1 + 5) & 2) == 0) {
    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {
      *(uint *)((long)puVar1 + 0x34) = param_2;
      FUN_0011affc(puVar1);
    }
    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);
    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);
    if (param_4 != 0) {
      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;
    }
    FUN_0010ec55(param_1);
  }
  else {
    FUN_0010ec55(param_1);
    uVar2 = 8;
  }
  return uVar2;
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
MOV R12,RDI
MOV R13D,ESI
MOV EBP,EDX
MOV R14D,ECX
MOV RBX,qword ptr [RDI + 0x8]
CALL 0x00117be4
MOV byte ptr [RBX + 0x26],BPL
MOV EDX,dword ptr [RBX + 0x34]
SUB EDX,dword ptr [RBX + 0x38]
CMP EDX,EBP
CMOVGE EBP,EDX
TEST byte ptr [RBX + 0x28],0x2
JNZ 0x0011e32e
LEA EAX,[R13 + -0x200]
CMP EAX,0xfe00
JA 0x0011e2f4
LEA EAX,[R13 + -0x1]
TEST EAX,R13D
JZ 0x0011e33e
LEA RSI,[RBX + 0x34]
MOV EDX,EBP
MOV RDI,qword ptr [RBX]
CALL 0x0011e133
MOV R13D,EAX
MOVZX EDX,BP
MOV EAX,dword ptr [RBX + 0x34]
SUB EAX,EDX
MOV dword ptr [RBX + 0x38],EAX
TEST R14D,R14D
JZ 0x0011e31a
OR word ptr [RBX + 0x28],0x2
MOV RDI,R12
CALL 0x0010ec55
MOV EAX,R13D
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
MOV RDI,R12
CALL 0x0010ec55
MOV R13D,0x8
JMP 0x0011e322
MOV dword ptr [RBX + 0x34],R13D
MOV RDI,RBX
CALL 0x0011affc
JMP 0x0011e2f4
(translation_unit "undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)\n\n{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)\n\n{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)" identifier (parameter_list "(long param_1,uint param_2,uint param_3,int param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" { (declaration "undefined8 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "puVar1 = *(undefined8 **)(param_1 + 8);" (assignment_expression "puVar1 = *(undefined8 **)(param_1 + 8)" identifier = (pointer_expression "*(undefined8 **)(param_1 + 8)" * (cast_expression "(undefined8 **)(param_1 + 8)" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "FUN_00117be4();" (call_expression "FUN_00117be4()" identifier (argument_list "()" ( ))) ;) (expression_statement "*(char *)((long)puVar1 + 0x26) = (char)param_3;" (assignment_expression "*(char *)((long)puVar1 + 0x26) = (char)param_3" (pointer_expression "*(char *)((long)puVar1 + 0x26)" * (cast_expression "(char *)((long)puVar1 + 0x26)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x26)" ( (binary_expression "(long)puVar1 + 0x26" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = (cast_expression "(char)param_3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);" (assignment_expression "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" identifier = (binary_expression "*(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" * (cast_expression "(int *)((long)puVar1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) - (pointer_expression "*(int *)(puVar1 + 7)" * (cast_expression "(int *)(puVar1 + 7)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 7)" ( (binary_expression "puVar1 + 7" identifier + number_literal) )))))) ;) (if_statement "if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }" if (parenthesized_expression "((int)param_3 <= (int)uVar3)" ( (binary_expression "(int)param_3 <= (int)uVar3" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) <= (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    param_3 = uVar3;\n  }" { (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" identifier = identifier) ;) })) (if_statement "if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" if (parenthesized_expression "((*(byte *)(puVar1 + 5) & 2) == 0)" ( (binary_expression "(*(byte *)(puVar1 + 5) & 2) == 0" (parenthesized_expression "(*(byte *)(puVar1 + 5) & 2)" ( (binary_expression "*(byte *)(puVar1 + 5) & 2" (pointer_expression "*(byte *)(puVar1 + 5)" * (cast_expression "(byte *)(puVar1 + 5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }" { (if_statement "if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" if (parenthesized_expression "((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0))" ( (binary_expression "(param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)" (parenthesized_expression "(param_2 - 0x200 < 0xfe01)" ( (binary_expression "param_2 - 0x200 < 0xfe01" (binary_expression "param_2 - 0x200" identifier - number_literal) < number_literal) )) && (parenthesized_expression "((param_2 - 1 & param_2) == 0)" ( (binary_expression "(param_2 - 1 & param_2) == 0" (parenthesized_expression "(param_2 - 1 & param_2)" ( (binary_expression "param_2 - 1 & param_2" (binary_expression "param_2 - 1" identifier - number_literal) & identifier) )) == number_literal) ))) )) (compound_statement "{\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" { (expression_statement "*(uint *)((long)puVar1 + 0x34) = param_2;" (assignment_expression "*(uint *)((long)puVar1 + 0x34) = param_2" (pointer_expression "*(uint *)((long)puVar1 + 0x34)" * (cast_expression "(uint *)((long)puVar1 + 0x34)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = identifier) ;) (expression_statement "FUN_0011affc(puVar1);" (call_expression "FUN_0011affc(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) })) (expression_statement "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);" (assignment_expression "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" identifier = (call_expression "FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" identifier (argument_list "(*puVar1,(long)puVar1 + 0x34,param_3)" ( (pointer_expression "*puVar1" * identifier) , (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) , identifier )))) ;) (expression_statement "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);" (assignment_expression "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(uint *)(puVar1 + 7)" * (cast_expression "(uint *)(puVar1 + 7)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 7)" ( (binary_expression "puVar1 + 7" identifier + number_literal) )))) = (binary_expression "*(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" * (cast_expression "(int *)((long)puVar1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) - (parenthesized_expression "(param_3 & 0xffff)" ( (binary_expression "param_3 & 0xffff" identifier & number_literal) )))) ;) (if_statement "if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" { (expression_statement "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;" (assignment_expression "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" * (cast_expression "(ushort *)(puVar1 + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) = (binary_expression "*(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" * (cast_expression "(ushort *)(puVar1 + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) | number_literal)) ;) })) (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) }) (else_clause "else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" else (compound_statement "{\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" { (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "uVar2 = 8;" (assignment_expression "uVar2 = 8" identifier = number_literal) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "int sqlite3BtreeSetPageSize(Btree *p,int pageSize,int nReserve,int iFix)\n\n{\n  BtShared *pBt;\n  int iVar1;\n  uint uVar2;\n  \n  pBt = p->pBt;\n  sqlite3BtreeEnter(p);\n  pBt->nReserveWanted = (u8)nReserve;\n  uVar2 = pBt->pageSize - pBt->usableSize;\n  if (nReserve <= (int)uVar2) {\n    nReserve = uVar2;\n  }\n  if ((pBt->btsFlags & 2) == 0) {\n    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }\n    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);\n    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);\n    if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }\n    sqlite3BtreeLeave(p);\n  }\n  else {\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }\n  return iVar1;\n}\n\n" (function_definition "int sqlite3BtreeSetPageSize(Btree *p,int pageSize,int nReserve,int iFix)\n\n{\n  BtShared *pBt;\n  int iVar1;\n  uint uVar2;\n  \n  pBt = p->pBt;\n  sqlite3BtreeEnter(p);\n  pBt->nReserveWanted = (u8)nReserve;\n  uVar2 = pBt->pageSize - pBt->usableSize;\n  if (nReserve <= (int)uVar2) {\n    nReserve = uVar2;\n  }\n  if ((pBt->btsFlags & 2) == 0) {\n    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }\n    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);\n    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);\n    if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }\n    sqlite3BtreeLeave(p);\n  }\n  else {\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "sqlite3BtreeSetPageSize(Btree *p,int pageSize,int nReserve,int iFix)" identifier (parameter_list "(Btree *p,int pageSize,int nReserve,int iFix)" ( (parameter_declaration "Btree *p" type_identifier (pointer_declarator "*p" * identifier)) , (parameter_declaration "int pageSize" primitive_type identifier) , (parameter_declaration "int nReserve" primitive_type identifier) , (parameter_declaration "int iFix" primitive_type identifier) ))) (compound_statement "{\n  BtShared *pBt;\n  int iVar1;\n  uint uVar2;\n  \n  pBt = p->pBt;\n  sqlite3BtreeEnter(p);\n  pBt->nReserveWanted = (u8)nReserve;\n  uVar2 = pBt->pageSize - pBt->usableSize;\n  if (nReserve <= (int)uVar2) {\n    nReserve = uVar2;\n  }\n  if ((pBt->btsFlags & 2) == 0) {\n    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }\n    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);\n    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);\n    if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }\n    sqlite3BtreeLeave(p);\n  }\n  else {\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }\n  return iVar1;\n}" { (declaration "BtShared *pBt;" type_identifier (pointer_declarator "*pBt" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "pBt = p->pBt;" (assignment_expression "pBt = p->pBt" identifier = (field_expression "p->pBt" identifier -> field_identifier)) ;) (expression_statement "sqlite3BtreeEnter(p);" (call_expression "sqlite3BtreeEnter(p)" identifier (argument_list "(p)" ( identifier ))) ;) (expression_statement "pBt->nReserveWanted = (u8)nReserve;" (assignment_expression "pBt->nReserveWanted = (u8)nReserve" (field_expression "pBt->nReserveWanted" identifier -> field_identifier) = (cast_expression "(u8)nReserve" ( (type_descriptor "u8" type_identifier) ) identifier)) ;) (expression_statement "uVar2 = pBt->pageSize - pBt->usableSize;" (assignment_expression "uVar2 = pBt->pageSize - pBt->usableSize" identifier = (binary_expression "pBt->pageSize - pBt->usableSize" (field_expression "pBt->pageSize" identifier -> field_identifier) - (field_expression "pBt->usableSize" identifier -> field_identifier))) ;) (if_statement "if (nReserve <= (int)uVar2) {\n    nReserve = uVar2;\n  }" if (parenthesized_expression "(nReserve <= (int)uVar2)" ( (binary_expression "nReserve <= (int)uVar2" identifier <= (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    nReserve = uVar2;\n  }" { (expression_statement "nReserve = uVar2;" (assignment_expression "nReserve = uVar2" identifier = identifier) ;) })) (if_statement "if ((pBt->btsFlags & 2) == 0) {\n    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }\n    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);\n    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);\n    if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }\n    sqlite3BtreeLeave(p);\n  }\n  else {\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }" if (parenthesized_expression "((pBt->btsFlags & 2) == 0)" ( (binary_expression "(pBt->btsFlags & 2) == 0" (parenthesized_expression "(pBt->btsFlags & 2)" ( (binary_expression "pBt->btsFlags & 2" (field_expression "pBt->btsFlags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n    if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }\n    iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);\n    pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);\n    if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }\n    sqlite3BtreeLeave(p);\n  }" { (if_statement "if ((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)) {\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }" if (parenthesized_expression "((pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0))" ( (binary_expression "(pageSize - 0x200U < 0xfe01) && ((pageSize - 1U & pageSize) == 0)" (parenthesized_expression "(pageSize - 0x200U < 0xfe01)" ( (binary_expression "pageSize - 0x200U < 0xfe01" (binary_expression "pageSize - 0x200U" identifier - number_literal) < number_literal) )) && (parenthesized_expression "((pageSize - 1U & pageSize) == 0)" ( (binary_expression "(pageSize - 1U & pageSize) == 0" (parenthesized_expression "(pageSize - 1U & pageSize)" ( (binary_expression "pageSize - 1U & pageSize" (binary_expression "pageSize - 1U" identifier - number_literal) & identifier) )) == number_literal) ))) )) (compound_statement "{\n      pBt->pageSize = pageSize;\n      freeTempSpace(pBt);\n    }" { (expression_statement "pBt->pageSize = pageSize;" (assignment_expression "pBt->pageSize = pageSize" (field_expression "pBt->pageSize" identifier -> field_identifier) = identifier) ;) (expression_statement "freeTempSpace(pBt);" (call_expression "freeTempSpace(pBt)" identifier (argument_list "(pBt)" ( identifier ))) ;) })) (expression_statement "iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve);" (assignment_expression "iVar1 = sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve)" identifier = (call_expression "sqlite3PagerSetPagesize(pBt->pPager,&pBt->pageSize,nReserve)" identifier (argument_list "(pBt->pPager,&pBt->pageSize,nReserve)" ( (field_expression "pBt->pPager" identifier -> field_identifier) , (pointer_expression "&pBt->pageSize" & (field_expression "pBt->pageSize" identifier -> field_identifier)) , identifier )))) ;) (expression_statement "pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU);" (assignment_expression "pBt->usableSize = pBt->pageSize - (nReserve & 0xffffU)" (field_expression "pBt->usableSize" identifier -> field_identifier) = (binary_expression "pBt->pageSize - (nReserve & 0xffffU)" (field_expression "pBt->pageSize" identifier -> field_identifier) - (parenthesized_expression "(nReserve & 0xffffU)" ( (binary_expression "nReserve & 0xffffU" identifier & number_literal) )))) ;) (if_statement "if (iFix != 0) {\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }" if (parenthesized_expression "(iFix != 0)" ( (binary_expression "iFix != 0" identifier != number_literal) )) (compound_statement "{\n      pBt->btsFlags = pBt->btsFlags | 2;\n    }" { (expression_statement "pBt->btsFlags = pBt->btsFlags | 2;" (assignment_expression "pBt->btsFlags = pBt->btsFlags | 2" (field_expression "pBt->btsFlags" identifier -> field_identifier) = (binary_expression "pBt->btsFlags | 2" (field_expression "pBt->btsFlags" identifier -> field_identifier) | number_literal)) ;) })) (expression_statement "sqlite3BtreeLeave(p);" (call_expression "sqlite3BtreeLeave(p)" identifier (argument_list "(p)" ( identifier ))) ;) }) (else_clause "else {\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }" else (compound_statement "{\n    sqlite3BtreeLeave(p);\n    iVar1 = 8;\n  }" { (expression_statement "sqlite3BtreeLeave(p);" (call_expression "sqlite3BtreeLeave(p)" identifier (argument_list "(p)" ( identifier ))) ;) (expression_statement "iVar1 = 8;" (assignment_expression "iVar1 = 8" identifier = number_literal) ;) }))) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)\n\n{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)\n\n{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)" identifier (parameter_list "(long param_1,uint param_2,uint param_3,int param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" { (declaration "undefined8 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "puVar1 = *(undefined8 **)(param_1 + 8);" (assignment_expression "puVar1 = *(undefined8 **)(param_1 + 8)" identifier = (pointer_expression "*(undefined8 **)(param_1 + 8)" * (cast_expression "(undefined8 **)(param_1 + 8)" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "FUN_00117be4();" (call_expression "FUN_00117be4()" identifier (argument_list "()" ( ))) ;) (expression_statement "*(char *)((long)puVar1 + 0x26) = (char)param_3;" (assignment_expression "*(char *)((long)puVar1 + 0x26) = (char)param_3" (pointer_expression "*(char *)((long)puVar1 + 0x26)" * (cast_expression "(char *)((long)puVar1 + 0x26)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x26)" ( (binary_expression "(long)puVar1 + 0x26" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = (cast_expression "(char)param_3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);" (assignment_expression "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" identifier = (binary_expression "*(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" * (cast_expression "(int *)((long)puVar1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) - (pointer_expression "*(int *)(puVar1 + 7)" * (cast_expression "(int *)(puVar1 + 7)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 7)" ( (binary_expression "puVar1 + 7" identifier + number_literal) )))))) ;) (if_statement "if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }" if (parenthesized_expression "((int)param_3 <= (int)uVar3)" ( (binary_expression "(int)param_3 <= (int)uVar3" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) <= (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    param_3 = uVar3;\n  }" { (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" identifier = identifier) ;) })) (if_statement "if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" if (parenthesized_expression "((*(byte *)(puVar1 + 5) & 2) == 0)" ( (binary_expression "(*(byte *)(puVar1 + 5) & 2) == 0" (parenthesized_expression "(*(byte *)(puVar1 + 5) & 2)" ( (binary_expression "*(byte *)(puVar1 + 5) & 2" (pointer_expression "*(byte *)(puVar1 + 5)" * (cast_expression "(byte *)(puVar1 + 5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }" { (if_statement "if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" if (parenthesized_expression "((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0))" ( (binary_expression "(param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)" (parenthesized_expression "(param_2 - 0x200 < 0xfe01)" ( (binary_expression "param_2 - 0x200 < 0xfe01" (binary_expression "param_2 - 0x200" identifier - number_literal) < number_literal) )) && (parenthesized_expression "((param_2 - 1 & param_2) == 0)" ( (binary_expression "(param_2 - 1 & param_2) == 0" (parenthesized_expression "(param_2 - 1 & param_2)" ( (binary_expression "param_2 - 1 & param_2" (binary_expression "param_2 - 1" identifier - number_literal) & identifier) )) == number_literal) ))) )) (compound_statement "{\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" { (expression_statement "*(uint *)((long)puVar1 + 0x34) = param_2;" (assignment_expression "*(uint *)((long)puVar1 + 0x34) = param_2" (pointer_expression "*(uint *)((long)puVar1 + 0x34)" * (cast_expression "(uint *)((long)puVar1 + 0x34)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = identifier) ;) (expression_statement "FUN_0011affc(puVar1);" (call_expression "FUN_0011affc(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) })) (expression_statement "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);" (assignment_expression "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" identifier = (call_expression "FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" identifier (argument_list "(*puVar1,(long)puVar1 + 0x34,param_3)" ( (pointer_expression "*puVar1" * identifier) , (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) , identifier )))) ;) (expression_statement "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);" (assignment_expression "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(uint *)(puVar1 + 7)" * (cast_expression "(uint *)(puVar1 + 7)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 7)" ( (binary_expression "puVar1 + 7" identifier + number_literal) )))) = (binary_expression "*(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" * (cast_expression "(int *)((long)puVar1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar1 + 0x34)" ( (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) - (parenthesized_expression "(param_3 & 0xffff)" ( (binary_expression "param_3 & 0xffff" identifier & number_literal) )))) ;) (if_statement "if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" { (expression_statement "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;" (assignment_expression "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" * (cast_expression "(ushort *)(puVar1 + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) = (binary_expression "*(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" * (cast_expression "(ushort *)(puVar1 + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar1 + 5)" ( (binary_expression "puVar1 + 5" identifier + number_literal) )))) | number_literal)) ;) })) (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) }) (else_clause "else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" else (compound_statement "{\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" { (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "uVar2 = 8;" (assignment_expression "uVar2 = 8" identifier = number_literal) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) <= (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = 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) )) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) < LIT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) & IDENT) )) == LIT) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) - (parenthesized_expression ( (binary_expression IDENT & LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) | LIT)) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)\n\n{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" (type_identifier "undefined4") (function_declarator "FUN_0011e2ac(long param_1,uint param_2,uint param_3,int param_4)" (identifier "FUN_0011e2ac") (parameter_list "(long param_1,uint param_2,uint param_3,int param_4)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) () ")"))) (compound_statement "{\n  undefined8 *puVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  \n  puVar1 = *(undefined8 **)(param_1 + 8);\n  FUN_00117be4();\n  *(char *)((long)puVar1 + 0x26) = (char)param_3;\n  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);\n  if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }\n  if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }\n  return uVar2;\n}" ({ "{") (declaration "undefined8 *puVar1;" (type_identifier "undefined8") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (expression_statement "puVar1 = *(undefined8 **)(param_1 + 8);" (assignment_expression "puVar1 = *(undefined8 **)(param_1 + 8)" (identifier "puVar1") (= "=") (pointer_expression "*(undefined8 **)(param_1 + 8)" (* "*") (cast_expression "(undefined8 **)(param_1 + 8)" (( "(") (type_descriptor "undefined8 **" (type_identifier "undefined8") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "FUN_00117be4();" (call_expression "FUN_00117be4()" (identifier "FUN_00117be4") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "*(char *)((long)puVar1 + 0x26) = (char)param_3;" (assignment_expression "*(char *)((long)puVar1 + 0x26) = (char)param_3" (pointer_expression "*(char *)((long)puVar1 + 0x26)" (* "*") (cast_expression "(char *)((long)puVar1 + 0x26)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar1 + 0x26)" (( "(") (binary_expression "(long)puVar1 + 0x26" (cast_expression "(long)puVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar1")) (+ "+") (number_literal "0x26")) () ")")))) (= "=") (cast_expression "(char)param_3" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "param_3"))) (; ";")) (expression_statement "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);" (assignment_expression "uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" (identifier "uVar3") (= "=") (binary_expression "*(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" (* "*") (cast_expression "(int *)((long)puVar1 + 0x34)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar1 + 0x34)" (( "(") (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar1")) (+ "+") (number_literal "0x34")) () ")")))) (- "-") (pointer_expression "*(int *)(puVar1 + 7)" (* "*") (cast_expression "(int *)(puVar1 + 7)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar1 + 7)" (( "(") (binary_expression "puVar1 + 7" (identifier "puVar1") (+ "+") (number_literal "7")) () ")")))))) (; ";")) (if_statement "if ((int)param_3 <= (int)uVar3) {\n    param_3 = uVar3;\n  }" (if "if") (parenthesized_expression "((int)param_3 <= (int)uVar3)" (( "(") (binary_expression "(int)param_3 <= (int)uVar3" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (<= "<=") (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3"))) () ")")) (compound_statement "{\n    param_3 = uVar3;\n  }" ({ "{") (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" (identifier "param_3") (= "=") (identifier "uVar3")) (; ";")) (} "}"))) (if_statement "if ((*(byte *)(puVar1 + 5) & 2) == 0) {\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }\n  else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" (if "if") (parenthesized_expression "((*(byte *)(puVar1 + 5) & 2) == 0)" (( "(") (binary_expression "(*(byte *)(puVar1 + 5) & 2) == 0" (parenthesized_expression "(*(byte *)(puVar1 + 5) & 2)" (( "(") (binary_expression "*(byte *)(puVar1 + 5) & 2" (pointer_expression "*(byte *)(puVar1 + 5)" (* "*") (cast_expression "(byte *)(puVar1 + 5)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar1 + 5)" (( "(") (binary_expression "puVar1 + 5" (identifier "puVar1") (+ "+") (number_literal "5")) () ")")))) (& "&") (number_literal "2")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }\n    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);\n    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);\n    if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }\n    FUN_0010ec55(param_1);\n  }" ({ "{") (if_statement "if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" (if "if") (parenthesized_expression "((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0))" (( "(") (binary_expression "(param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)" (parenthesized_expression "(param_2 - 0x200 < 0xfe01)" (( "(") (binary_expression "param_2 - 0x200 < 0xfe01" (binary_expression "param_2 - 0x200" (identifier "param_2") (- "-") (number_literal "0x200")) (< "<") (number_literal "0xfe01")) () ")")) (&& "&&") (parenthesized_expression "((param_2 - 1 & param_2) == 0)" (( "(") (binary_expression "(param_2 - 1 & param_2) == 0" (parenthesized_expression "(param_2 - 1 & param_2)" (( "(") (binary_expression "param_2 - 1 & param_2" (binary_expression "param_2 - 1" (identifier "param_2") (- "-") (number_literal "1")) (& "&") (identifier "param_2")) () ")")) (== "==") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n      *(uint *)((long)puVar1 + 0x34) = param_2;\n      FUN_0011affc(puVar1);\n    }" ({ "{") (expression_statement "*(uint *)((long)puVar1 + 0x34) = param_2;" (assignment_expression "*(uint *)((long)puVar1 + 0x34) = param_2" (pointer_expression "*(uint *)((long)puVar1 + 0x34)" (* "*") (cast_expression "(uint *)((long)puVar1 + 0x34)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar1 + 0x34)" (( "(") (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar1")) (+ "+") (number_literal "0x34")) () ")")))) (= "=") (identifier "param_2")) (; ";")) (expression_statement "FUN_0011affc(puVar1);" (call_expression "FUN_0011affc(puVar1)" (identifier "FUN_0011affc") (argument_list "(puVar1)" (( "(") (identifier "puVar1") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);" (assignment_expression "uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" (identifier "uVar2") (= "=") (call_expression "FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3)" (identifier "FUN_0011e133") (argument_list "(*puVar1,(long)puVar1 + 0x34,param_3)" (( "(") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (, ",") (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar1")) (+ "+") (number_literal "0x34")) (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);" (assignment_expression "*(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(uint *)(puVar1 + 7)" (* "*") (cast_expression "(uint *)(puVar1 + 7)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar1 + 7)" (( "(") (binary_expression "puVar1 + 7" (identifier "puVar1") (+ "+") (number_literal "7")) () ")")))) (= "=") (binary_expression "*(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff)" (pointer_expression "*(int *)((long)puVar1 + 0x34)" (* "*") (cast_expression "(int *)((long)puVar1 + 0x34)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar1 + 0x34)" (( "(") (binary_expression "(long)puVar1 + 0x34" (cast_expression "(long)puVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar1")) (+ "+") (number_literal "0x34")) () ")")))) (- "-") (parenthesized_expression "(param_3 & 0xffff)" (( "(") (binary_expression "param_3 & 0xffff" (identifier "param_3") (& "&") (number_literal "0xffff")) () ")")))) (; ";")) (if_statement "if (param_4 != 0) {\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;\n    }" ({ "{") (expression_statement "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;" (assignment_expression "*(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" (* "*") (cast_expression "(ushort *)(puVar1 + 5)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar1 + 5)" (( "(") (binary_expression "puVar1 + 5" (identifier "puVar1") (+ "+") (number_literal "5")) () ")")))) (= "=") (binary_expression "*(ushort *)(puVar1 + 5) | 2" (pointer_expression "*(ushort *)(puVar1 + 5)" (* "*") (cast_expression "(ushort *)(puVar1 + 5)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar1 + 5)" (( "(") (binary_expression "puVar1 + 5" (identifier "puVar1") (+ "+") (number_literal "5")) () ")")))) (| "|") (number_literal "2"))) (; ";")) (} "}"))) (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" (identifier "FUN_0010ec55") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" (else "else") (compound_statement "{\n    FUN_0010ec55(param_1);\n    uVar2 = 8;\n  }" ({ "{") (expression_statement "FUN_0010ec55(param_1);" (call_expression "FUN_0010ec55(param_1)" (identifier "FUN_0010ec55") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "uVar2 = 8;" (assignment_expression "uVar2 = 8" (identifier "uVar2") (= "=") (number_literal "8")) (; ";")) (} "}")))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

int function_1(type_1 *p,int var_3,int var_2,int var_6)

{
  type_2 *pBt;
  int iVar1;
  type_3 uVar2;
  
  pBt = p->pBt;
  var_1(p);
  pBt->nReserveWanted = (type_4)var_2;
  uVar2 = pBt->var_3 - pBt->usableSize;
  if (var_2 <= (int)uVar2) {
    var_2 = uVar2;
  }
  if ((pBt->btsFlags & 2) == 0) {
    if ((var_3 - 0x200U < 0xfe01) && ((var_3 - 1U & var_3) == 0)) {
      pBt->var_3 = var_3;
      var_4(pBt);
    }
    iVar1 = var_5(pBt->pPager,&pBt->var_3,var_2);
    pBt->usableSize = pBt->var_3 - (var_2 & 0xffffU);
    if (var_6 != 0) {
      pBt->btsFlags = pBt->btsFlags | 2;
    }
    var_7(p);
  }
  else {
    var_7(p);
    iVar1 = 8;
  }
  return iVar1;
}


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

undefined4 MASKED(long param_1,uint param_2,uint param_3,int param_4)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  uint uVar3;
  
  puVar1 = *(undefined8 **)(param_1 + 8);
  FUN_00117be4();
  *(char *)((long)puVar1 + 0x26) = (char)param_3;
  uVar3 = *(int *)((long)puVar1 + 0x34) - *(int *)(puVar1 + 7);
  if ((int)param_3 <= (int)uVar3) {
    param_3 = uVar3;
  }
  if ((*(byte *)(puVar1 + 5) & 2) == 0) {
    if ((param_2 - 0x200 < 0xfe01) && ((param_2 - 1 & param_2) == 0)) {
      *(uint *)((long)puVar1 + 0x34) = param_2;
      FUN_0011affc(puVar1);
    }
    uVar2 = FUN_0011e133(*puVar1,(long)puVar1 + 0x34,param_3);
    *(uint *)(puVar1 + 7) = *(int *)((long)puVar1 + 0x34) - (param_3 & 0xffff);
    if (param_4 != 0) {
      *(ushort *)(puVar1 + 5) = *(ushort *)(puVar1 + 5) | 2;
    }
    FUN_0010ec55(param_1);
  }
  else {
    FUN_0010ec55(param_1);
    uVar2 = 8;
  }
  return uVar2;
}

