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

int unixTruncate(sqlite3_file *id,i64 nByte)

{
  sqlite3_io_methods *psVar1;
  uint uVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  longlong lVar6;
  sqlite3_io_methods *in_stack_ffffffd4;
  int in_stack_ffffffd8;
  
  psVar1 = id[10].pMethods;
  if (0 < (int)psVar1) {
    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;
    in_stack_ffffffd4 = psVar1;
    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);
    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);
  }
  iVar5 = (int)((ulonglong)nByte >> 0x20);
  iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4));
  if (iVar3 == 0) {
    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);
    iVar3 = iVar5 - (int)id[0xd].pMethods;
    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0
       ) {
      *(i64 *)(id + 0xc) = nByte;
    }
    return 0;
  }
  piVar4 = __errno_location();
  id[5].pMethods = (sqlite3_io_methods *)*piVar4;
  iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40);
  return iVar3;
}



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

undefined4 FUN_000549e0(int param_1,uint param_2,int param_3)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  undefined4 uVar4;
  int iVar5;
  longlong lVar6;
  
  lVar6 = CONCAT44(param_3,param_2);
  uVar1 = *(uint *)(param_1 + 0x28);
  if (0 < (int)uVar1) {
    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,
                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +
                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);
    lVar6 = lVar6 * (int)uVar1;
  }
  iVar5 = (int)((ulonglong)lVar6 >> 0x20);
  iVar2 = FUN_00022610();
  if (iVar2 == 0) {
    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));
    iVar2 = iVar5 - *(int *)(param_1 + 0x34);
    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=
        (int)(iVar2 - uVar1) < 0) {
      *(longlong *)(param_1 + 0x30) = lVar6;
    }
    return 0;
  }
  piVar3 = __errno_location();
  *(int *)(param_1 + 0x14) = *piVar3;
  uVar4 = FUN_00053ed0();
  return uVar4;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00014cf0
ADD EBX,0xf44eb
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x30]
MOV ESI,dword ptr [ESP + 0x34]
MOV EDI,dword ptr [ESP + 0x38]
MOV ECX,dword ptr [EAX + 0x28]
MOV dword ptr [ESP + 0x8],EAX
TEST ECX,ECX
JLE 0x00054a4b
MOV EAX,ECX
MOV dword ptr [ESP + 0xc],ECX
CDQ
ADD ESI,ECX
MOV dword ptr [ESP],ECX
ADC EDI,EDX
ADD ESI,-0x1
MOV dword ptr [ESP + 0x4],EDX
ADC EDI,-0x1
PUSH EDX
PUSH ECX
PUSH EDI
PUSH ESI
CALL 0x000f41f0
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0xc]
MOV ESI,EAX
MOV EAX,dword ptr [ESP + 0x4]
IMUL EDX,ECX
IMUL EAX,ESI
ADD EAX,EDX
MOV EBP,EAX
MOV EAX,ECX
MUL ESI
MOV EDI,EDX
MOV ESI,EAX
ADD EDI,EBP
MOV EAX,dword ptr [ESP + 0x8]
MOV EDX,ESI
MOV ECX,EDI
MOV EAX,dword ptr [EAX + 0xc]
CALL 0x00022610
TEST EAX,EAX
JNZ 0x00054a80
MOV EBX,dword ptr [ESP + 0x8]
MOV EAX,EDI
CMP ESI,dword ptr [EBX + 0x30]
SBB EAX,dword ptr [EBX + 0x34]
JGE 0x00054a73
MOV dword ptr [EBX + 0x30],ESI
MOV dword ptr [EBX + 0x34],EDI
ADD ESP,0x1c
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
CALL 0x000142b0
MOV EDI,dword ptr [ESP + 0x8]
LEA EDX,[EBX + 0xfffadb45]
MOV EAX,dword ptr [EAX]
MOV ECX,dword ptr [EDI + 0x20]
MOV dword ptr [EDI + 0x14],EAX
MOV EAX,0x60a
MOV dword ptr [ESP + 0x30],0x8d40
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
JMP 0x00053ed0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_000549e0(int param_1,uint param_2,int param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}\n\n" comment (function_definition "undefined4 FUN_000549e0(int param_1,uint param_2,int param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" type_identifier (function_declarator "FUN_000549e0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "longlong lVar6;" type_identifier identifier ;) (expression_statement "lVar6 = CONCAT44(param_3,param_2);" (assignment_expression "lVar6 = CONCAT44(param_3,param_2)" identifier = (call_expression "CONCAT44(param_3,param_2)" identifier (argument_list "(param_3,param_2)" ( identifier , identifier )))) ;) (expression_statement "uVar1 = *(uint *)(param_1 + 0x28);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x28)" identifier = (pointer_expression "*(uint *)(param_1 + 0x28)" * (cast_expression "(uint *)(param_1 + 0x28)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x28)" ( (binary_expression "param_1 + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" if (parenthesized_expression "(0 < (int)uVar1)" ( (binary_expression "0 < (int)uVar1" number_literal < (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" { (expression_statement "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);" (assignment_expression "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" identifier = (call_expression "FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" identifier (argument_list "(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" ( (binary_expression "param_2 + uVar1 + -1" (binary_expression "param_2 + uVar1" identifier + identifier) + number_literal) , (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f)" identifier + (parenthesized_expression "((int)uVar1 >> 0x1f)" ( (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) ))) + (cast_expression "(uint)CARRY4(param_2,uVar1)" ( (type_descriptor "uint" type_identifier) ) (call_expression "CARRY4(param_2,uVar1)" identifier (argument_list "(param_2,uVar1)" ( identifier , identifier ))))) + number_literal) + (call_expression "(uint)(param_2 + uVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_2 + uVar1 != 0)" ( (binary_expression "param_2 + uVar1 != 0" (binary_expression "param_2 + uVar1" identifier + identifier) != number_literal) )))) , identifier , (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) , identifier )))) ;) (expression_statement "lVar6 = lVar6 * (int)uVar1;" (assignment_expression "lVar6 = lVar6 * (int)uVar1" identifier = (binary_expression "lVar6 * (int)uVar1" identifier * (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) })) (expression_statement "iVar5 = (int)((ulonglong)lVar6 >> 0x20);" (assignment_expression "iVar5 = (int)((ulonglong)lVar6 >> 0x20)" identifier = (cast_expression "(int)((ulonglong)lVar6 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)lVar6 >> 0x20)" ( (binary_expression "(ulonglong)lVar6 >> 0x20" (cast_expression "(ulonglong)lVar6" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "iVar2 = FUN_00022610();" (assignment_expression "iVar2 = FUN_00022610()" identifier = (call_expression "FUN_00022610()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" { (expression_statement "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));" (assignment_expression "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" identifier = (call_expression "(uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((uint)lVar6 < *(uint *)(param_1 + 0x30))" ( (binary_expression "(uint)lVar6 < *(uint *)(param_1 + 0x30)" (cast_expression "(uint)lVar6" ( (type_descriptor "uint" type_identifier) ) identifier) < (pointer_expression "*(uint *)(param_1 + 0x30)" * (cast_expression "(uint *)(param_1 + 0x30)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) ))))) )))) ;) (expression_statement "iVar2 = iVar5 - *(int *)(param_1 + 0x34);" (assignment_expression "iVar2 = iVar5 - *(int *)(param_1 + 0x34)" identifier = (binary_expression "iVar5 - *(int *)(param_1 + 0x34)" identifier - (pointer_expression "*(int *)(param_1 + 0x34)" * (cast_expression "(int *)(param_1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x34)" ( (binary_expression "param_1 + 0x34" identifier + number_literal) )))))) ;) (if_statement "if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" if (parenthesized_expression "((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0)" ( (binary_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0" (parenthesized_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1))" ( (binary_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)" (call_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34))" identifier (argument_list "(iVar5,*(int *)(param_1 + 0x34))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x34)" * (cast_expression "(int *)(param_1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x34)" ( (binary_expression "param_1 + 0x34" identifier + number_literal) )))) ))) != (call_expression "SBORROW4(iVar2,uVar1)" identifier (argument_list "(iVar2,uVar1)" ( identifier , identifier )))) )) != (binary_expression "(int)(iVar2 - uVar1) < 0" (cast_expression "(int)(iVar2 - uVar1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(iVar2 - uVar1)" ( (binary_expression "iVar2 - uVar1" identifier - identifier) ))) < number_literal)) )) (compound_statement "{\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" { (expression_statement "*(longlong *)(param_1 + 0x30) = lVar6;" (assignment_expression "*(longlong *)(param_1 + 0x30) = lVar6" (pointer_expression "*(longlong *)(param_1 + 0x30)" * (cast_expression "(longlong *)(param_1 + 0x30)" ( (type_descriptor "longlong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) = identifier) ;) })) (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*(int *)(param_1 + 0x14) = *piVar3;" (assignment_expression "*(int *)(param_1 + 0x14) = *piVar3" (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) )))) = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "uVar4 = FUN_00053ed0();" (assignment_expression "uVar4 = FUN_00053ed0()" identifier = (call_expression "FUN_00053ed0()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint unixTruncate(sqlite3_file *id,i64 nByte)\n\n{\n  sqlite3_io_methods *psVar1;\n  uint uVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  longlong lVar6;\n  sqlite3_io_methods *in_stack_ffffffd4;\n  int in_stack_ffffffd8;\n  \n  psVar1 = id[10].pMethods;\n  if (0 < (int)psVar1) {\n    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;\n    in_stack_ffffffd4 = psVar1;\n    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);\n    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);\n  }\n  iVar5 = (int)((ulonglong)nByte >> 0x20);\n  iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4));\n  if (iVar3 == 0) {\n    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);\n    iVar3 = iVar5 - (int)id[0xd].pMethods;\n    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }\n    return 0;\n  }\n  piVar4 = __errno_location();\n  id[5].pMethods = (sqlite3_io_methods *)*piVar4;\n  iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40);\n  return iVar3;\n}\n\n" comment (function_definition "int unixTruncate(sqlite3_file *id,i64 nByte)\n\n{\n  sqlite3_io_methods *psVar1;\n  uint uVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  longlong lVar6;\n  sqlite3_io_methods *in_stack_ffffffd4;\n  int in_stack_ffffffd8;\n  \n  psVar1 = id[10].pMethods;\n  if (0 < (int)psVar1) {\n    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;\n    in_stack_ffffffd4 = psVar1;\n    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);\n    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);\n  }\n  iVar5 = (int)((ulonglong)nByte >> 0x20);\n  iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4));\n  if (iVar3 == 0) {\n    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);\n    iVar3 = iVar5 - (int)id[0xd].pMethods;\n    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }\n    return 0;\n  }\n  piVar4 = __errno_location();\n  id[5].pMethods = (sqlite3_io_methods *)*piVar4;\n  iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40);\n  return iVar3;\n}" primitive_type (function_declarator "unixTruncate(sqlite3_file *id,i64 nByte)" identifier (parameter_list "(sqlite3_file *id,i64 nByte)" ( (parameter_declaration "sqlite3_file *id" type_identifier (pointer_declarator "*id" * identifier)) , (parameter_declaration "i64 nByte" type_identifier identifier) ))) (compound_statement "{\n  sqlite3_io_methods *psVar1;\n  uint uVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  longlong lVar6;\n  sqlite3_io_methods *in_stack_ffffffd4;\n  int in_stack_ffffffd8;\n  \n  psVar1 = id[10].pMethods;\n  if (0 < (int)psVar1) {\n    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;\n    in_stack_ffffffd4 = psVar1;\n    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);\n    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);\n  }\n  iVar5 = (int)((ulonglong)nByte >> 0x20);\n  iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4));\n  if (iVar3 == 0) {\n    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);\n    iVar3 = iVar5 - (int)id[0xd].pMethods;\n    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }\n    return 0;\n  }\n  piVar4 = __errno_location();\n  id[5].pMethods = (sqlite3_io_methods *)*piVar4;\n  iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40);\n  return iVar3;\n}" { (declaration "sqlite3_io_methods *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "longlong lVar6;" type_identifier identifier ;) (declaration "sqlite3_io_methods *in_stack_ffffffd4;" type_identifier (pointer_declarator "*in_stack_ffffffd4" * identifier) ;) (declaration "int in_stack_ffffffd8;" primitive_type identifier ;) (expression_statement "psVar1 = id[10].pMethods;" (assignment_expression "psVar1 = id[10].pMethods" identifier = (field_expression "id[10].pMethods" (subscript_expression "id[10]" identifier [ number_literal ]) . field_identifier)) ;) (if_statement "if (0 < (int)psVar1) {\n    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;\n    in_stack_ffffffd4 = psVar1;\n    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);\n    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);\n  }" if (parenthesized_expression "(0 < (int)psVar1)" ( (binary_expression "0 < (int)psVar1" number_literal < (cast_expression "(int)psVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;\n    in_stack_ffffffd4 = psVar1;\n    lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);\n    nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);\n  }" { (expression_statement "in_stack_ffffffd8 = (int)psVar1 >> 0x1f;" (assignment_expression "in_stack_ffffffd8 = (int)psVar1 >> 0x1f" identifier = (binary_expression "(int)psVar1 >> 0x1f" (cast_expression "(int)psVar1" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal)) ;) (expression_statement "in_stack_ffffffd4 = psVar1;" (assignment_expression "in_stack_ffffffd4 = psVar1" identifier = identifier) ;) (expression_statement "lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);" (assignment_expression "lVar6 = __divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8)" identifier = (call_expression "__divdi3(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8)" identifier (argument_list "(nByte + (int)psVar1 + -1,psVar1,in_stack_ffffffd8)" ( (binary_expression "nByte + (int)psVar1 + -1" (binary_expression "nByte + (int)psVar1" identifier + (cast_expression "(int)psVar1" ( (type_descriptor "int" primitive_type) ) identifier)) + number_literal) , identifier , identifier )))) ;) (expression_statement "nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1);" (assignment_expression "nByte = lVar6 * CONCAT44(in_stack_ffffffd8,psVar1)" identifier = (binary_expression "lVar6 * CONCAT44(in_stack_ffffffd8,psVar1)" identifier * (call_expression "CONCAT44(in_stack_ffffffd8,psVar1)" identifier (argument_list "(in_stack_ffffffd8,psVar1)" ( identifier , identifier ))))) ;) })) (expression_statement "iVar5 = (int)((ulonglong)nByte >> 0x20);" (assignment_expression "iVar5 = (int)((ulonglong)nByte >> 0x20)" identifier = (cast_expression "(int)((ulonglong)nByte >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)nByte >> 0x20)" ( (binary_expression "(ulonglong)nByte >> 0x20" (cast_expression "(ulonglong)nByte" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4));" (assignment_expression "iVar3 = robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4))" identifier = (call_expression "robust_ftruncate((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4))" identifier (argument_list "((int)id[3].pMethods,CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4))" ( (cast_expression "(int)id[3].pMethods" ( (type_descriptor "int" primitive_type) ) (field_expression "id[3].pMethods" (subscript_expression "id[3]" identifier [ number_literal ]) . field_identifier)) , (call_expression "CONCAT44(in_stack_ffffffd8,in_stack_ffffffd4)" identifier (argument_list "(in_stack_ffffffd8,in_stack_ffffffd4)" ( identifier , identifier ))) )))) ;) (if_statement "if (iVar3 == 0) {\n    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);\n    iVar3 = iVar5 - (int)id[0xd].pMethods;\n    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }\n    return 0;\n  }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);\n    iVar3 = iVar5 - (int)id[0xd].pMethods;\n    if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }\n    return 0;\n  }" { (expression_statement "uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods);" (assignment_expression "uVar2 = (uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods)" identifier = (call_expression "(uint)((sqlite3_io_methods *)nByte < id[0xc].pMethods)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((sqlite3_io_methods *)nByte < id[0xc].pMethods)" ( (binary_expression "(sqlite3_io_methods *)nByte < id[0xc].pMethods" (cast_expression "(sqlite3_io_methods *)nByte" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) < (field_expression "id[0xc].pMethods" (subscript_expression "id[0xc]" identifier [ number_literal ]) . field_identifier)) )))) ;) (expression_statement "iVar3 = iVar5 - (int)id[0xd].pMethods;" (assignment_expression "iVar3 = iVar5 - (int)id[0xd].pMethods" identifier = (binary_expression "iVar5 - (int)id[0xd].pMethods" identifier - (cast_expression "(int)id[0xd].pMethods" ( (type_descriptor "int" primitive_type) ) (field_expression "id[0xd].pMethods" (subscript_expression "id[0xd]" identifier [ number_literal ]) . field_identifier)))) ;) (if_statement "if ((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       ) {\n      *(i64 *)(id + 0xc) = nByte;\n    }" if (parenthesized_expression "((SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0\n       )" ( (binary_expression "(SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)) != (int)(iVar3 - uVar2) < 0" (parenthesized_expression "(SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2))" ( (binary_expression "SBORROW4(iVar5,(int)id[0xd].pMethods) != SBORROW4(iVar3,uVar2)" (call_expression "SBORROW4(iVar5,(int)id[0xd].pMethods)" identifier (argument_list "(iVar5,(int)id[0xd].pMethods)" ( identifier , (cast_expression "(int)id[0xd].pMethods" ( (type_descriptor "int" primitive_type) ) (field_expression "id[0xd].pMethods" (subscript_expression "id[0xd]" identifier [ number_literal ]) . field_identifier)) ))) != (call_expression "SBORROW4(iVar3,uVar2)" identifier (argument_list "(iVar3,uVar2)" ( identifier , identifier )))) )) != (binary_expression "(int)(iVar3 - uVar2) < 0" (cast_expression "(int)(iVar3 - uVar2)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(iVar3 - uVar2)" ( (binary_expression "iVar3 - uVar2" identifier - identifier) ))) < number_literal)) )) (compound_statement "{\n      *(i64 *)(id + 0xc) = nByte;\n    }" { (expression_statement "*(i64 *)(id + 0xc) = nByte;" (assignment_expression "*(i64 *)(id + 0xc) = nByte" (pointer_expression "*(i64 *)(id + 0xc)" * (cast_expression "(i64 *)(id + 0xc)" ( (type_descriptor "i64 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(id + 0xc)" ( (binary_expression "id + 0xc" identifier + number_literal) )))) = identifier) ;) })) (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "id[5].pMethods = (sqlite3_io_methods *)*piVar4;" (assignment_expression "id[5].pMethods = (sqlite3_io_methods *)*piVar4" (field_expression "id[5].pMethods" (subscript_expression "id[5]" identifier [ number_literal ]) . field_identifier) = (cast_expression "(sqlite3_io_methods *)*piVar4" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar4" * identifier))) ;) (expression_statement "iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40);" (assignment_expression "iVar3 = unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40)" identifier = (call_expression "unixLogErrorAtLine(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40)" identifier (argument_list "(0x60a,"ftruncate",(char *)id[8].pMethods,0x8d40)" ( number_literal , (string_literal ""ftruncate"" " string_content ") , (cast_expression "(char *)id[8].pMethods" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "id[8].pMethods" (subscript_expression "id[8]" identifier [ number_literal ]) . field_identifier)) , number_literal )))) ;) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "undefined4 FUN_000549e0(int param_1,uint param_2,int param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}\n\n" (function_definition "undefined4 FUN_000549e0(int param_1,uint param_2,int param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" type_identifier (function_declarator "FUN_000549e0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "longlong lVar6;" type_identifier identifier ;) (expression_statement "lVar6 = CONCAT44(param_3,param_2);" (assignment_expression "lVar6 = CONCAT44(param_3,param_2)" identifier = (call_expression "CONCAT44(param_3,param_2)" identifier (argument_list "(param_3,param_2)" ( identifier , identifier )))) ;) (expression_statement "uVar1 = *(uint *)(param_1 + 0x28);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x28)" identifier = (pointer_expression "*(uint *)(param_1 + 0x28)" * (cast_expression "(uint *)(param_1 + 0x28)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x28)" ( (binary_expression "param_1 + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" if (parenthesized_expression "(0 < (int)uVar1)" ( (binary_expression "0 < (int)uVar1" number_literal < (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" { (expression_statement "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);" (assignment_expression "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" identifier = (call_expression "FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" identifier (argument_list "(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" ( (binary_expression "param_2 + uVar1 + -1" (binary_expression "param_2 + uVar1" identifier + identifier) + number_literal) , (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f)" identifier + (parenthesized_expression "((int)uVar1 >> 0x1f)" ( (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) ))) + (cast_expression "(uint)CARRY4(param_2,uVar1)" ( (type_descriptor "uint" type_identifier) ) (call_expression "CARRY4(param_2,uVar1)" identifier (argument_list "(param_2,uVar1)" ( identifier , identifier ))))) + number_literal) + (call_expression "(uint)(param_2 + uVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_2 + uVar1 != 0)" ( (binary_expression "param_2 + uVar1 != 0" (binary_expression "param_2 + uVar1" identifier + identifier) != number_literal) )))) , identifier , (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) , identifier )))) ;) (expression_statement "lVar6 = lVar6 * (int)uVar1;" (assignment_expression "lVar6 = lVar6 * (int)uVar1" identifier = (binary_expression "lVar6 * (int)uVar1" identifier * (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) })) (expression_statement "iVar5 = (int)((ulonglong)lVar6 >> 0x20);" (assignment_expression "iVar5 = (int)((ulonglong)lVar6 >> 0x20)" identifier = (cast_expression "(int)((ulonglong)lVar6 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)lVar6 >> 0x20)" ( (binary_expression "(ulonglong)lVar6 >> 0x20" (cast_expression "(ulonglong)lVar6" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "iVar2 = FUN_00022610();" (assignment_expression "iVar2 = FUN_00022610()" identifier = (call_expression "FUN_00022610()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" { (expression_statement "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));" (assignment_expression "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" identifier = (call_expression "(uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((uint)lVar6 < *(uint *)(param_1 + 0x30))" ( (binary_expression "(uint)lVar6 < *(uint *)(param_1 + 0x30)" (cast_expression "(uint)lVar6" ( (type_descriptor "uint" type_identifier) ) identifier) < (pointer_expression "*(uint *)(param_1 + 0x30)" * (cast_expression "(uint *)(param_1 + 0x30)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) ))))) )))) ;) (expression_statement "iVar2 = iVar5 - *(int *)(param_1 + 0x34);" (assignment_expression "iVar2 = iVar5 - *(int *)(param_1 + 0x34)" identifier = (binary_expression "iVar5 - *(int *)(param_1 + 0x34)" identifier - (pointer_expression "*(int *)(param_1 + 0x34)" * (cast_expression "(int *)(param_1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x34)" ( (binary_expression "param_1 + 0x34" identifier + number_literal) )))))) ;) (if_statement "if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" if (parenthesized_expression "((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0)" ( (binary_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0" (parenthesized_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1))" ( (binary_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)" (call_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34))" identifier (argument_list "(iVar5,*(int *)(param_1 + 0x34))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x34)" * (cast_expression "(int *)(param_1 + 0x34)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x34)" ( (binary_expression "param_1 + 0x34" identifier + number_literal) )))) ))) != (call_expression "SBORROW4(iVar2,uVar1)" identifier (argument_list "(iVar2,uVar1)" ( identifier , identifier )))) )) != (binary_expression "(int)(iVar2 - uVar1) < 0" (cast_expression "(int)(iVar2 - uVar1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(iVar2 - uVar1)" ( (binary_expression "iVar2 - uVar1" identifier - identifier) ))) < number_literal)) )) (compound_statement "{\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" { (expression_statement "*(longlong *)(param_1 + 0x30) = lVar6;" (assignment_expression "*(longlong *)(param_1 + 0x30) = lVar6" (pointer_expression "*(longlong *)(param_1 + 0x30)" * (cast_expression "(longlong *)(param_1 + 0x30)" ( (type_descriptor "longlong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) = identifier) ;) })) (return_statement "return 0;" return number_literal ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*(int *)(param_1 + 0x14) = *piVar3;" (assignment_expression "*(int *)(param_1 + 0x14) = *piVar3" (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) )))) = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "uVar4 = FUN_00053ed0();" (assignment_expression "uVar4 = FUN_00053ed0()" identifier = (call_expression "FUN_00053ed0()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (binary_expression IDENT + IDENT) + LIT) , (binary_expression (binary_expression (binary_expression (binary_expression IDENT + (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT) ))) + (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( IDENT , IDENT ))))) + LIT) + (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (binary_expression IDENT + IDENT) != LIT) )))) , IDENT , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT) , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT * (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) != (call_expression IDENT (argument_list ( IDENT , IDENT )))) )) != (binary_expression (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) < LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) })) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_000549e0(int param_1,uint param_2,int param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" (type_identifier "undefined4") (function_declarator "FUN_000549e0(int param_1,uint param_2,int param_3)" (identifier "FUN_000549e0") (parameter_list "(int param_1,uint param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  undefined4 uVar4;\n  int iVar5;\n  longlong lVar6;\n  \n  lVar6 = CONCAT44(param_3,param_2);\n  uVar1 = *(uint *)(param_1 + 0x28);\n  if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }\n  iVar5 = (int)((ulonglong)lVar6 >> 0x20);\n  iVar2 = FUN_00022610();\n  if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }\n  piVar3 = __errno_location();\n  *(int *)(param_1 + 0x14) = *piVar3;\n  uVar4 = FUN_00053ed0();\n  return uVar4;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "longlong lVar6;" (type_identifier "longlong") (identifier "lVar6") (; ";")) (expression_statement "lVar6 = CONCAT44(param_3,param_2);" (assignment_expression "lVar6 = CONCAT44(param_3,param_2)" (identifier "lVar6") (= "=") (call_expression "CONCAT44(param_3,param_2)" (identifier "CONCAT44") (argument_list "(param_3,param_2)" (( "(") (identifier "param_3") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "uVar1 = *(uint *)(param_1 + 0x28);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x28)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(param_1 + 0x28)" (* "*") (cast_expression "(uint *)(param_1 + 0x28)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x28)" (( "(") (binary_expression "param_1 + 0x28" (identifier "param_1") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (0 < (int)uVar1) {\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" (if "if") (parenthesized_expression "(0 < (int)uVar1)" (( "(") (binary_expression "0 < (int)uVar1" (number_literal "0") (< "<") (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1"))) () ")")) (compound_statement "{\n    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);\n    lVar6 = lVar6 * (int)uVar1;\n  }" ({ "{") (expression_statement "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);" (assignment_expression "lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" (identifier "lVar6") (= "=") (call_expression "FUN_000f41f0(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" (identifier "FUN_000f41f0") (argument_list "(param_2 + uVar1 + -1,\n                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1)" (( "(") (binary_expression "param_2 + uVar1 + -1" (binary_expression "param_2 + uVar1" (identifier "param_2") (+ "+") (identifier "uVar1")) (+ "+") (number_literal "-1")) (, ",") (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +\n                         (uint)(param_2 + uVar1 != 0)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1" (binary_expression "param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1)" (binary_expression "param_3 + ((int)uVar1 >> 0x1f)" (identifier "param_3") (+ "+") (parenthesized_expression "((int)uVar1 >> 0x1f)" (( "(") (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (>> ">>") (number_literal "0x1f")) () ")"))) (+ "+") (cast_expression "(uint)CARRY4(param_2,uVar1)" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (call_expression "CARRY4(param_2,uVar1)" (identifier "CARRY4") (argument_list "(param_2,uVar1)" (( "(") (identifier "param_2") (, ",") (identifier "uVar1") () ")"))))) (+ "+") (number_literal "-1")) (+ "+") (call_expression "(uint)(param_2 + uVar1 != 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_2 + uVar1 != 0)" (( "(") (binary_expression "param_2 + uVar1 != 0" (binary_expression "param_2 + uVar1" (identifier "param_2") (+ "+") (identifier "uVar1")) (!= "!=") (number_literal "0")) () ")")))) (, ",") (identifier "uVar1") (, ",") (binary_expression "(int)uVar1 >> 0x1f" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (>> ">>") (number_literal "0x1f")) (, ",") (identifier "uVar1") () ")")))) (; ";")) (expression_statement "lVar6 = lVar6 * (int)uVar1;" (assignment_expression "lVar6 = lVar6 * (int)uVar1" (identifier "lVar6") (= "=") (binary_expression "lVar6 * (int)uVar1" (identifier "lVar6") (* "*") (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")))) (; ";")) (} "}"))) (expression_statement "iVar5 = (int)((ulonglong)lVar6 >> 0x20);" (assignment_expression "iVar5 = (int)((ulonglong)lVar6 >> 0x20)" (identifier "iVar5") (= "=") (cast_expression "(int)((ulonglong)lVar6 >> 0x20)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((ulonglong)lVar6 >> 0x20)" (( "(") (binary_expression "(ulonglong)lVar6 >> 0x20" (cast_expression "(ulonglong)lVar6" (( "(") (type_descriptor "ulonglong" (type_identifier "ulonglong")) () ")") (identifier "lVar6")) (>> ">>") (number_literal "0x20")) () ")")))) (; ";")) (expression_statement "iVar2 = FUN_00022610();" (assignment_expression "iVar2 = FUN_00022610()" (identifier "iVar2") (= "=") (call_expression "FUN_00022610()" (identifier "FUN_00022610") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));\n    iVar2 = iVar5 - *(int *)(param_1 + 0x34);\n    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }\n    return 0;\n  }" ({ "{") (expression_statement "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));" (assignment_expression "uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" (identifier "uVar1") (= "=") (call_expression "(uint)((uint)lVar6 < *(uint *)(param_1 + 0x30))" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((uint)lVar6 < *(uint *)(param_1 + 0x30))" (( "(") (binary_expression "(uint)lVar6 < *(uint *)(param_1 + 0x30)" (cast_expression "(uint)lVar6" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "lVar6")) (< "<") (pointer_expression "*(uint *)(param_1 + 0x30)" (* "*") (cast_expression "(uint *)(param_1 + 0x30)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x30)" (( "(") (binary_expression "param_1 + 0x30" (identifier "param_1") (+ "+") (number_literal "0x30")) () ")"))))) () ")")))) (; ";")) (expression_statement "iVar2 = iVar5 - *(int *)(param_1 + 0x34);" (assignment_expression "iVar2 = iVar5 - *(int *)(param_1 + 0x34)" (identifier "iVar2") (= "=") (binary_expression "iVar5 - *(int *)(param_1 + 0x34)" (identifier "iVar5") (- "-") (pointer_expression "*(int *)(param_1 + 0x34)" (* "*") (cast_expression "(int *)(param_1 + 0x34)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x34)" (( "(") (binary_expression "param_1 + 0x34" (identifier "param_1") (+ "+") (number_literal "0x34")) () ")")))))) (; ";")) (if_statement "if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0) {\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" (if "if") (parenthesized_expression "((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0)" (( "(") (binary_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=\n        (int)(iVar2 - uVar1) < 0" (parenthesized_expression "(SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1))" (( "(") (binary_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)" (call_expression "SBORROW4(iVar5,*(int *)(param_1 + 0x34))" (identifier "SBORROW4") (argument_list "(iVar5,*(int *)(param_1 + 0x34))" (( "(") (identifier "iVar5") (, ",") (pointer_expression "*(int *)(param_1 + 0x34)" (* "*") (cast_expression "(int *)(param_1 + 0x34)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x34)" (( "(") (binary_expression "param_1 + 0x34" (identifier "param_1") (+ "+") (number_literal "0x34")) () ")")))) () ")"))) (!= "!=") (call_expression "SBORROW4(iVar2,uVar1)" (identifier "SBORROW4") (argument_list "(iVar2,uVar1)" (( "(") (identifier "iVar2") (, ",") (identifier "uVar1") () ")")))) () ")")) (!= "!=") (binary_expression "(int)(iVar2 - uVar1) < 0" (cast_expression "(int)(iVar2 - uVar1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(iVar2 - uVar1)" (( "(") (binary_expression "iVar2 - uVar1" (identifier "iVar2") (- "-") (identifier "uVar1")) () ")"))) (< "<") (number_literal "0"))) () ")")) (compound_statement "{\n      *(longlong *)(param_1 + 0x30) = lVar6;\n    }" ({ "{") (expression_statement "*(longlong *)(param_1 + 0x30) = lVar6;" (assignment_expression "*(longlong *)(param_1 + 0x30) = lVar6" (pointer_expression "*(longlong *)(param_1 + 0x30)" (* "*") (cast_expression "(longlong *)(param_1 + 0x30)" (( "(") (type_descriptor "longlong *" (type_identifier "longlong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x30)" (( "(") (binary_expression "param_1 + 0x30" (identifier "param_1") (+ "+") (number_literal "0x30")) () ")")))) (= "=") (identifier "lVar6")) (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*(int *)(param_1 + 0x14) = *piVar3;" (assignment_expression "*(int *)(param_1 + 0x14) = *piVar3" (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")) () ")")))) (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "uVar4 = FUN_00053ed0();" (assignment_expression "uVar4 = FUN_00053ed0()" (identifier "uVar4") (= "=") (call_expression "FUN_00053ed0()" (identifier "FUN_00053ed0") (argument_list "()" (( "(") () ")")))) (; ";")) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}")))

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

int function_1(type_1 *var_10,type_2 var_2)

{
  type_3 *psVar1;
  type_4 var_9;
  int var_6;
  int *piVar4;
  int var_7;
  type_5 var_3;
  type_3 *in_stack_ffffffd4;
  int in_stack_ffffffd8;
  
  psVar1 = var_10[10].pMethods;
  if (0 < (int)psVar1) {
    in_stack_ffffffd8 = (int)psVar1 >> 0x1f;
    in_stack_ffffffd4 = psVar1;
    var_3 = var_1(var_2 + (int)psVar1 + -1,psVar1,in_stack_ffffffd8);
    var_2 = var_3 * var_4(in_stack_ffffffd8,psVar1);
  }
  var_7 = (int)((type_6)var_2 >> 0x20);
  var_6 = var_5((int)var_10[3].pMethods,var_4(in_stack_ffffffd8,in_stack_ffffffd4));
  if (var_6 == 0) {
    var_9 = (type_4)((type_3 *)var_2 < var_10[0xc].pMethods);
    var_6 = var_7 - (int)var_10[0xd].pMethods;
    if ((var_8(var_7,(int)var_10[0xd].pMethods) != var_8(var_6,var_9)) != (int)(var_6 - var_9) < 0
       ) {
      *(type_2 *)(var_10 + 0xc) = var_2;
    }
    return 0;
  }
  piVar4 = var_11();
  var_10[5].pMethods = (type_3 *)*piVar4;
  var_6 = var_12(0x60a,"ftruncate",(char *)var_10[8].pMethods,0x8d40);
  return var_6;
}


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

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

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

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  undefined4 uVar4;
  int iVar5;
  longlong lVar6;
  
  lVar6 = CONCAT44(param_3,param_2);
  uVar1 = *(uint *)(param_1 + 0x28);
  if (0 < (int)uVar1) {
    lVar6 = FUN_000f41f0(param_2 + uVar1 + -1,
                         param_3 + ((int)uVar1 >> 0x1f) + (uint)CARRY4(param_2,uVar1) + -1 +
                         (uint)(param_2 + uVar1 != 0),uVar1,(int)uVar1 >> 0x1f,uVar1);
    lVar6 = lVar6 * (int)uVar1;
  }
  iVar5 = (int)((ulonglong)lVar6 >> 0x20);
  iVar2 = FUN_00022610();
  if (iVar2 == 0) {
    uVar1 = (uint)((uint)lVar6 < *(uint *)(param_1 + 0x30));
    iVar2 = iVar5 - *(int *)(param_1 + 0x34);
    if ((SBORROW4(iVar5,*(int *)(param_1 + 0x34)) != SBORROW4(iVar2,uVar1)) !=
        (int)(iVar2 - uVar1) < 0) {
      *(longlong *)(param_1 + 0x30) = lVar6;
    }
    return 0;
  }
  piVar3 = __errno_location();
  *(int *)(param_1 + 0x14) = *piVar3;
  uVar4 = FUN_00053ed0();
  return uVar4;
}

