
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Removing unreachable block (ram,0x00056500) */
/* WARNING: Removing unreachable block (ram,0x00056530) */

sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n)

{
  sqlite3_int64 sVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  sqlite3_int64 sVar7;
  undefined4 local_14;
  undefined4 local_10;
  
  iVar4 = sqlite3_initialize();
  sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold);
  if (iVar4 == 0) {
    sqlite3_mutex_enter(mem0.mutex);
    uVar3 = mem0.alarmThreshold._4_4_;
    uVar2 = (undefined4)mem0.alarmThreshold;
    local_14 = (undefined4)mem0.alarmThreshold;
    local_10 = mem0.alarmThreshold._4_4_;
    if (n < 0) {
      sqlite3_mutex_leave(mem0.mutex);
      return CONCAT44(uVar3,uVar2);
    }
    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))
       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {
      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);
    }
    iVar4 = (int)((ulonglong)n >> 0x20);
    uVar5 = 1;
    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {
      uVar5 = 0;
    }
    uVar6 = iVar4 >> 0x1f;
    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;
    mem0.alarmThreshold = n;
    sqlite3_mutex_leave(mem0.mutex);
    sVar7 = sqlite3_memory_used();
    sVar1 = mem0.alarmThreshold;
    if (0 < sVar7 - n) {
      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);
      sVar1 = mem0.alarmThreshold;
    }
  }
  else {
    local_14 = 0xffffffff;
    local_10 = 0xffffffff;
  }
  mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20);
  mem0.alarmThreshold._0_4_ = (undefined4)sVar1;
  return CONCAT44(local_10,local_14);
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Removing unreachable block (ram,0x00056530) */

undefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  longlong lVar3;
  uint local_14;
  int local_10;
  
  iVar1 = sqlite3_initialize();
  if (iVar1 == 0) {
    sqlite3_mutex_enter(DAT_000df9e4);
    iVar1 = DAT_000df9ec;
    uVar2 = DAT_000df9e8;
    local_14 = DAT_000df9e8;
    local_10 = DAT_000df9ec;
    if (param_2 < 0) {
      sqlite3_mutex_leave(DAT_000df9e4);
      return CONCAT44(iVar1,uVar2);
    }
    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&
       ((DAT_000df9f4 < param_2 ||
        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))
       )) {
      param_1 = DAT_000df9f0;
      param_2 = DAT_000df9f4;
    }
    uVar2 = 1;
    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {
      uVar2 = 0;
    }
    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)
                           >> 0x1f;
    DAT_000df9e8 = param_1;
    DAT_000df9ec = param_2;
    sqlite3_mutex_leave(DAT_000df9e4);
    lVar3 = sqlite3_memory_used();
    lVar3 = lVar3 - CONCAT44(param_2,param_1);
    if (0 < lVar3) {
      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);
    }
  }
  else {
    local_14 = 0xffffffff;
    local_10 = -1;
  }
  return CONCAT44(local_10,local_14);
}


PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001d810
ADD EBX,0x87c08
SUB ESP,0x10
MOV ESI,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x24]
CALL 0x00016350
TEST EAX,EAX
JNZ 0x00056550
SUB ESP,0xc
PUSH dword ptr [EBX + 0x19e4]
CALL 0x000168d0
MOV EAX,dword ptr [EBX + 0x19e8]
MOV EDX,dword ptr [EBX + 0x19ec]
MOV dword ptr [ESP + 0x18],EAX
MOV dword ptr [ESP + 0x1c],EDX
ADD ESP,0x10
TEST EDI,EDI
JS 0x00056510
MOV EAX,dword ptr [EBX + 0x19f4]
MOV EDX,dword ptr [EBX + 0x19f0]
CMP EAX,0x0
JL 0x0005646e
JLE 0x00056540
CMP EAX,EDI
JL 0x0005646a
JLE 0x00056500
MOV ECX,ESI
OR ECX,EDI
JNZ 0x0005646e
MOV ESI,EDX
MOV EDI,EAX
CMP EDI,0x0
MOV dword ptr [EBX + 0x19e8],ESI
MOV dword ptr [EBX + 0x19ec],EDI
MOV EAX,dword ptr [EBX + 0x1a20]
MOV ECX,0x1
JGE 0x000564e8
MOV EDX,EDI
SAR EDX,0x1f
MOV EAX,EDX
SUB EAX,ESI
SBB EDX,EDI
SUB ESP,0xc
MOV EAX,EDX
SHR EAX,0x1f
AND ECX,EAX
MOV dword ptr [EBX + 0x19f8],ECX
PUSH dword ptr [EBX + 0x19e4]
CALL 0x00016830
CALL 0x000168f0
SUB EAX,ESI
SBB EDX,EDI
ADD ESP,0x10
CMP EDX,0x0
JL 0x000564d4
JLE 0x00056530
SUB ESP,0xc
AND EAX,0x7fffffff
PUSH EAX
CALL 0x000167b0
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x8]
MOV EDX,dword ptr [ESP + 0xc]
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
JLE 0x000564f0
XOR ECX,ECX
JMP 0x0005648a
CMP ESI,EAX
JBE 0x0005648a
JMP 0x000564ea
CMP EDX,ESI
JC 0x0005646a
JMP 0x00056464
SUB ESP,0xc
PUSH dword ptr [EBX + 0x19e4]
CALL 0x00016830
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x8]
MOV EDX,dword ptr [ESP + 0xc]
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
CMP EAX,0x0
JBE 0x000564d4
JMP 0x000564c3
CMP EDX,0x0
JBE 0x0005646e
JMP 0x0005645a
MOV dword ptr [ESP + 0x8],0xffffffff
MOV dword ptr [ESP + 0xc],0xffffffff
JMP 0x000564d4
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Removing unreachable block (ram,0x00056530) */\n\nundefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}\n\n" comment comment (function_definition "undefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" type_identifier (function_declarator "sqlite3_soft_heap_limit64(uint param_1,int param_2)" identifier (parameter_list "(uint param_1,int param_2)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "longlong lVar3;" type_identifier identifier ;) (declaration "uint local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "iVar1 = sqlite3_initialize();" (assignment_expression "iVar1 = sqlite3_initialize()" identifier = (call_expression "sqlite3_initialize()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }" { (expression_statement "sqlite3_mutex_enter(DAT_000df9e4);" (call_expression "sqlite3_mutex_enter(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (expression_statement "iVar1 = DAT_000df9ec;" (assignment_expression "iVar1 = DAT_000df9ec" identifier = identifier) ;) (expression_statement "uVar2 = DAT_000df9e8;" (assignment_expression "uVar2 = DAT_000df9e8" identifier = identifier) ;) (expression_statement "local_14 = DAT_000df9e8;" (assignment_expression "local_14 = DAT_000df9e8" identifier = identifier) ;) (expression_statement "local_10 = DAT_000df9ec;" (assignment_expression "local_10 = DAT_000df9ec" identifier = identifier) ;) (if_statement "if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" { (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (return_statement "return CONCAT44(iVar1,uVar2);" return (call_expression "CONCAT44(iVar1,uVar2)" identifier (argument_list "(iVar1,uVar2)" ( identifier , identifier ))) ;) })) (if_statement "if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" if (parenthesized_expression "(((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       ))" ( (binary_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" (parenthesized_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0))))" ( (binary_expression "(-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" (parenthesized_expression "(-1 < DAT_000df9f4)" ( (binary_expression "-1 < DAT_000df9f4" number_literal < identifier) )) && (parenthesized_expression "((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" ( (parenthesized_expression "(0 < DAT_000df9f4 || (DAT_000df9f0 != 0))" ( (binary_expression "0 < DAT_000df9f4 || (DAT_000df9f0 != 0)" (binary_expression "0 < DAT_000df9f4" number_literal < identifier) || (parenthesized_expression "(DAT_000df9f0 != 0)" ( (binary_expression "DAT_000df9f0 != 0" identifier != number_literal) ))) )) ))) )) && (parenthesized_expression "((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" ( (parenthesized_expression "(DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))" ( (binary_expression "DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" (binary_expression "DAT_000df9f4 < param_2" identifier < identifier) || (parenthesized_expression "(((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" ( (parenthesized_expression "((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))" ( (binary_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)" (parenthesized_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1))" ( (binary_expression "DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)" (binary_expression "DAT_000df9f4 <= param_2" identifier <= identifier) && (parenthesized_expression "(DAT_000df9f0 < param_1)" ( (binary_expression "DAT_000df9f0 < param_1" identifier < identifier) ))) )) || (parenthesized_expression "(param_1 == 0 && param_2 == 0)" ( (binary_expression "param_1 == 0 && param_2 == 0" (binary_expression "param_1 == 0" identifier == number_literal) && (binary_expression "param_2 == 0" identifier == number_literal)) ))) )) ))) )) ))) )) (compound_statement "{\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" { (expression_statement "param_1 = DAT_000df9f0;" (assignment_expression "param_1 = DAT_000df9f0" identifier = identifier) ;) (expression_statement "param_2 = DAT_000df9f4;" (assignment_expression "param_2 = DAT_000df9f4" identifier = identifier) ;) })) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) (if_statement "if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }" if (parenthesized_expression "((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1))))" ( (binary_expression "(-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))" (parenthesized_expression "(-1 < param_2)" ( (binary_expression "-1 < param_2" number_literal < identifier) )) && (parenthesized_expression "((0 < param_2 || (DAT_000dfa20 < param_1)))" ( (parenthesized_expression "(0 < param_2 || (DAT_000dfa20 < param_1))" ( (binary_expression "0 < param_2 || (DAT_000dfa20 < param_1)" (binary_expression "0 < param_2" number_literal < identifier) || (parenthesized_expression "(DAT_000dfa20 < param_1)" ( (binary_expression "DAT_000dfa20 < param_1" identifier < identifier) ))) )) ))) )) (compound_statement "{\n      uVar2 = 0;\n    }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) })) (expression_statement "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;" (assignment_expression "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" identifier = (binary_expression "uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" identifier & (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "((param_2 >> 0x1f) - param_2)" ( (binary_expression "(param_2 >> 0x1f) - param_2" (parenthesized_expression "(param_2 >> 0x1f)" ( (binary_expression "param_2 >> 0x1f" identifier >> number_literal) )) - identifier) )) - (call_expression "(uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((uint)(param_2 >> 0x1f) < param_1)" ( (binary_expression "(uint)(param_2 >> 0x1f) < param_1" (call_expression "(uint)(param_2 >> 0x1f)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_2 >> 0x1f)" ( (binary_expression "param_2 >> 0x1f" identifier >> number_literal) ))) < identifier) )))) >> number_literal))) ;) (expression_statement "DAT_000df9e8 = param_1;" (assignment_expression "DAT_000df9e8 = param_1" identifier = identifier) ;) (expression_statement "DAT_000df9ec = param_2;" (assignment_expression "DAT_000df9ec = param_2" identifier = identifier) ;) (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (expression_statement "lVar3 = sqlite3_memory_used();" (assignment_expression "lVar3 = sqlite3_memory_used()" identifier = (call_expression "sqlite3_memory_used()" identifier (argument_list "()" ( )))) ;) (expression_statement "lVar3 = lVar3 - CONCAT44(param_2,param_1);" (assignment_expression "lVar3 = lVar3 - CONCAT44(param_2,param_1)" identifier = (binary_expression "lVar3 - CONCAT44(param_2,param_1)" identifier - (call_expression "CONCAT44(param_2,param_1)" identifier (argument_list "(param_2,param_1)" ( identifier , identifier ))))) ;) (if_statement "if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" if (parenthesized_expression "(0 < lVar3)" ( (binary_expression "0 < lVar3" number_literal < identifier) )) (compound_statement "{\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" { (expression_statement "sqlite3_release_memory((uint)lVar3 & 0x7fffffff);" (call_expression "sqlite3_release_memory((uint)lVar3 & 0x7fffffff)" identifier (argument_list "((uint)lVar3 & 0x7fffffff)" ( (binary_expression "(uint)lVar3 & 0x7fffffff" (cast_expression "(uint)lVar3" ( (type_descriptor "uint" type_identifier) ) identifier) & number_literal) ))) ;) })) }) (else_clause "else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" else (compound_statement "{\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" { (expression_statement "local_14 = 0xffffffff;" (assignment_expression "local_14 = 0xffffffff" identifier = number_literal) ;) (expression_statement "local_10 = -1;" (assignment_expression "local_10 = -1" identifier = number_literal) ;) }))) (return_statement "return CONCAT44(local_10,local_14);" return (call_expression "CONCAT44(local_10,local_14)" identifier (argument_list "(local_10,local_14)" ( identifier , identifier ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Removing unreachable block (ram,0x00056500) */\n/* WARNING: Removing unreachable block (ram,0x00056530) */\n\nsqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n)\n\n{\n  sqlite3_int64 sVar1;\n  undefined4 uVar2;\n  undefined4 uVar3;\n  int iVar4;\n  uint uVar5;\n  uint uVar6;\n  sqlite3_int64 sVar7;\n  undefined4 local_14;\n  undefined4 local_10;\n  \n  iVar4 = sqlite3_initialize();\n  sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold);\n  if (iVar4 == 0) {\n    sqlite3_mutex_enter(mem0.mutex);\n    uVar3 = mem0.alarmThreshold._4_4_;\n    uVar2 = (undefined4)mem0.alarmThreshold;\n    local_14 = (undefined4)mem0.alarmThreshold;\n    local_10 = mem0.alarmThreshold._4_4_;\n    if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }\n    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }\n    iVar4 = (int)((ulonglong)n >> 0x20);\n    uVar5 = 1;\n    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }\n    uVar6 = iVar4 >> 0x1f;\n    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;\n    mem0.alarmThreshold = n;\n    sqlite3_mutex_leave(mem0.mutex);\n    sVar7 = sqlite3_memory_used();\n    sVar1 = mem0.alarmThreshold;\n    if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }\n  mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20);\n  mem0.alarmThreshold._0_4_ = (undefined4)sVar1;\n  return CONCAT44(local_10,local_14);\n}\n\n" comment comment comment (function_definition "sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n)\n\n{\n  sqlite3_int64 sVar1;\n  undefined4 uVar2;\n  undefined4 uVar3;\n  int iVar4;\n  uint uVar5;\n  uint uVar6;\n  sqlite3_int64 sVar7;\n  undefined4 local_14;\n  undefined4 local_10;\n  \n  iVar4 = sqlite3_initialize();\n  sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold);\n  if (iVar4 == 0) {\n    sqlite3_mutex_enter(mem0.mutex);\n    uVar3 = mem0.alarmThreshold._4_4_;\n    uVar2 = (undefined4)mem0.alarmThreshold;\n    local_14 = (undefined4)mem0.alarmThreshold;\n    local_10 = mem0.alarmThreshold._4_4_;\n    if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }\n    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }\n    iVar4 = (int)((ulonglong)n >> 0x20);\n    uVar5 = 1;\n    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }\n    uVar6 = iVar4 >> 0x1f;\n    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;\n    mem0.alarmThreshold = n;\n    sqlite3_mutex_leave(mem0.mutex);\n    sVar7 = sqlite3_memory_used();\n    sVar1 = mem0.alarmThreshold;\n    if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }\n  mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20);\n  mem0.alarmThreshold._0_4_ = (undefined4)sVar1;\n  return CONCAT44(local_10,local_14);\n}" type_identifier (function_declarator "sqlite3_soft_heap_limit64(sqlite3_int64 n)" identifier (parameter_list "(sqlite3_int64 n)" ( (parameter_declaration "sqlite3_int64 n" type_identifier identifier) ))) (compound_statement "{\n  sqlite3_int64 sVar1;\n  undefined4 uVar2;\n  undefined4 uVar3;\n  int iVar4;\n  uint uVar5;\n  uint uVar6;\n  sqlite3_int64 sVar7;\n  undefined4 local_14;\n  undefined4 local_10;\n  \n  iVar4 = sqlite3_initialize();\n  sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold);\n  if (iVar4 == 0) {\n    sqlite3_mutex_enter(mem0.mutex);\n    uVar3 = mem0.alarmThreshold._4_4_;\n    uVar2 = (undefined4)mem0.alarmThreshold;\n    local_14 = (undefined4)mem0.alarmThreshold;\n    local_10 = mem0.alarmThreshold._4_4_;\n    if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }\n    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }\n    iVar4 = (int)((ulonglong)n >> 0x20);\n    uVar5 = 1;\n    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }\n    uVar6 = iVar4 >> 0x1f;\n    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;\n    mem0.alarmThreshold = n;\n    sqlite3_mutex_leave(mem0.mutex);\n    sVar7 = sqlite3_memory_used();\n    sVar1 = mem0.alarmThreshold;\n    if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }\n  mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20);\n  mem0.alarmThreshold._0_4_ = (undefined4)sVar1;\n  return CONCAT44(local_10,local_14);\n}" { (declaration "sqlite3_int64 sVar1;" type_identifier identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "sqlite3_int64 sVar7;" type_identifier identifier ;) (declaration "undefined4 local_14;" type_identifier identifier ;) (declaration "undefined4 local_10;" type_identifier identifier ;) (expression_statement "iVar4 = sqlite3_initialize();" (assignment_expression "iVar4 = sqlite3_initialize()" identifier = (call_expression "sqlite3_initialize()" identifier (argument_list "()" ( )))) ;) (expression_statement "sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold);" (assignment_expression "sVar1 = CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold)" identifier = (call_expression "CONCAT44(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold)" identifier (argument_list "(mem0.alarmThreshold._4_4_,(undefined4)mem0.alarmThreshold)" ( (field_expression "mem0.alarmThreshold._4_4_" (field_expression "mem0.alarmThreshold" identifier . field_identifier) . field_identifier) , (cast_expression "(undefined4)mem0.alarmThreshold" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "mem0.alarmThreshold" identifier . field_identifier)) )))) ;) (if_statement "if (iVar4 == 0) {\n    sqlite3_mutex_enter(mem0.mutex);\n    uVar3 = mem0.alarmThreshold._4_4_;\n    uVar2 = (undefined4)mem0.alarmThreshold;\n    local_14 = (undefined4)mem0.alarmThreshold;\n    local_10 = mem0.alarmThreshold._4_4_;\n    if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }\n    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }\n    iVar4 = (int)((ulonglong)n >> 0x20);\n    uVar5 = 1;\n    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }\n    uVar6 = iVar4 >> 0x1f;\n    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;\n    mem0.alarmThreshold = n;\n    sqlite3_mutex_leave(mem0.mutex);\n    sVar7 = sqlite3_memory_used();\n    sVar1 = mem0.alarmThreshold;\n    if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n    sqlite3_mutex_enter(mem0.mutex);\n    uVar3 = mem0.alarmThreshold._4_4_;\n    uVar2 = (undefined4)mem0.alarmThreshold;\n    local_14 = (undefined4)mem0.alarmThreshold;\n    local_10 = mem0.alarmThreshold._4_4_;\n    if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }\n    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }\n    iVar4 = (int)((ulonglong)n >> 0x20);\n    uVar5 = 1;\n    if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }\n    uVar6 = iVar4 >> 0x1f;\n    mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;\n    mem0.alarmThreshold = n;\n    sqlite3_mutex_leave(mem0.mutex);\n    sVar7 = sqlite3_memory_used();\n    sVar1 = mem0.alarmThreshold;\n    if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }\n  }" { (expression_statement "sqlite3_mutex_enter(mem0.mutex);" (call_expression "sqlite3_mutex_enter(mem0.mutex)" identifier (argument_list "(mem0.mutex)" ( (field_expression "mem0.mutex" identifier . field_identifier) ))) ;) (expression_statement "uVar3 = mem0.alarmThreshold._4_4_;" (assignment_expression "uVar3 = mem0.alarmThreshold._4_4_" identifier = (field_expression "mem0.alarmThreshold._4_4_" (field_expression "mem0.alarmThreshold" identifier . field_identifier) . field_identifier)) ;) (expression_statement "uVar2 = (undefined4)mem0.alarmThreshold;" (assignment_expression "uVar2 = (undefined4)mem0.alarmThreshold" identifier = (cast_expression "(undefined4)mem0.alarmThreshold" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "mem0.alarmThreshold" identifier . field_identifier))) ;) (expression_statement "local_14 = (undefined4)mem0.alarmThreshold;" (assignment_expression "local_14 = (undefined4)mem0.alarmThreshold" identifier = (cast_expression "(undefined4)mem0.alarmThreshold" ( (type_descriptor "undefined4" type_identifier) ) (field_expression "mem0.alarmThreshold" identifier . field_identifier))) ;) (expression_statement "local_10 = mem0.alarmThreshold._4_4_;" (assignment_expression "local_10 = mem0.alarmThreshold._4_4_" identifier = (field_expression "mem0.alarmThreshold._4_4_" (field_expression "mem0.alarmThreshold" identifier . field_identifier) . field_identifier)) ;) (if_statement "if (n < 0) {\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }" if (parenthesized_expression "(n < 0)" ( (binary_expression "n < 0" identifier < number_literal) )) (compound_statement "{\n      sqlite3_mutex_leave(mem0.mutex);\n      return CONCAT44(uVar3,uVar2);\n    }" { (expression_statement "sqlite3_mutex_leave(mem0.mutex);" (call_expression "sqlite3_mutex_leave(mem0.mutex)" identifier (argument_list "(mem0.mutex)" ( (field_expression "mem0.mutex" identifier . field_identifier) ))) ;) (return_statement "return CONCAT44(uVar3,uVar2);" return (call_expression "CONCAT44(uVar3,uVar2)" identifier (argument_list "(uVar3,uVar2)" ( identifier , identifier ))) ;) })) (if_statement "if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))) {\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }" if (parenthesized_expression "(((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0))))" ( (binary_expression "((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))\n       && ((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))" (parenthesized_expression "((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))" ( (binary_expression "(-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0)))" (parenthesized_expression "(-1 < mem0.hardLimit._4_4_)" ( (binary_expression "-1 < mem0.hardLimit._4_4_" number_literal < (field_expression "mem0.hardLimit._4_4_" (field_expression "mem0.hardLimit" identifier . field_identifier) . field_identifier)) )) && (parenthesized_expression "((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0)))" ( (parenthesized_expression "(0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))" ( (binary_expression "0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0)" (binary_expression "0 < mem0.hardLimit._4_4_" number_literal < (field_expression "mem0.hardLimit._4_4_" (field_expression "mem0.hardLimit" identifier . field_identifier) . field_identifier)) || (parenthesized_expression "((int)mem0.hardLimit != 0)" ( (binary_expression "(int)mem0.hardLimit != 0" (cast_expression "(int)mem0.hardLimit" ( (type_descriptor "int" primitive_type) ) (field_expression "mem0.hardLimit" identifier . field_identifier)) != number_literal) ))) )) ))) )) && (parenthesized_expression "((CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)))" ( (parenthesized_expression "(CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0))" ( (binary_expression "CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n || (n == 0)" (binary_expression "CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < n" (call_expression "CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit)" identifier (argument_list "(mem0.hardLimit._4_4_,(int)mem0.hardLimit)" ( (field_expression "mem0.hardLimit._4_4_" (field_expression "mem0.hardLimit" identifier . field_identifier) . field_identifier) , (cast_expression "(int)mem0.hardLimit" ( (type_descriptor "int" primitive_type) ) (field_expression "mem0.hardLimit" identifier . field_identifier)) ))) < identifier) || (parenthesized_expression "(n == 0)" ( (binary_expression "n == 0" identifier == number_literal) ))) )) ))) )) (compound_statement "{\n      n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);\n    }" { (expression_statement "n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit);" (assignment_expression "n = CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit)" identifier = (call_expression "CONCAT44(mem0.hardLimit._4_4_,(int)mem0.hardLimit)" identifier (argument_list "(mem0.hardLimit._4_4_,(int)mem0.hardLimit)" ( (field_expression "mem0.hardLimit._4_4_" (field_expression "mem0.hardLimit" identifier . field_identifier) . field_identifier) , (cast_expression "(int)mem0.hardLimit" ( (type_descriptor "int" primitive_type) ) (field_expression "mem0.hardLimit" identifier . field_identifier)) )))) ;) })) (expression_statement "iVar4 = (int)((ulonglong)n >> 0x20);" (assignment_expression "iVar4 = (int)((ulonglong)n >> 0x20)" identifier = (cast_expression "(int)((ulonglong)n >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((ulonglong)n >> 0x20)" ( (binary_expression "(ulonglong)n >> 0x20" (cast_expression "(ulonglong)n" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "uVar5 = 1;" (assignment_expression "uVar5 = 1" identifier = number_literal) ;) (if_statement "if ((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))) {\n      uVar5 = 0;\n    }" if (parenthesized_expression "((-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n))))" ( (binary_expression "(-1 < n) && ((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))" (parenthesized_expression "(-1 < n)" ( (binary_expression "-1 < n" number_literal < identifier) )) && (parenthesized_expression "((0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)))" ( (parenthesized_expression "(0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n))" ( (binary_expression "0xffffffff < n || (sqlite3Stat.nowValue[0] < (uint)n)" (binary_expression "0xffffffff < n" number_literal < identifier) || (parenthesized_expression "(sqlite3Stat.nowValue[0] < (uint)n)" ( (binary_expression "sqlite3Stat.nowValue[0] < (uint)n" (subscript_expression "sqlite3Stat.nowValue[0]" (field_expression "sqlite3Stat.nowValue" identifier . field_identifier) [ number_literal ]) < (cast_expression "(uint)n" ( (type_descriptor "uint" type_identifier) ) identifier)) ))) )) ))) )) (compound_statement "{\n      uVar5 = 0;\n    }" { (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) })) (expression_statement "uVar6 = iVar4 >> 0x1f;" (assignment_expression "uVar6 = iVar4 >> 0x1f" identifier = (binary_expression "iVar4 >> 0x1f" identifier >> number_literal)) ;) (expression_statement "mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f;" (assignment_expression "mem0.nearlyFull = uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f" (field_expression "mem0.nearlyFull" identifier . field_identifier) = (binary_expression "uVar5 & (uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f" identifier & (binary_expression "(uVar6 - iVar4) - (uint)(uVar6 < (uint)n) >> 0x1f" (binary_expression "(uVar6 - iVar4) - (uint)(uVar6 < (uint)n)" (parenthesized_expression "(uVar6 - iVar4)" ( (binary_expression "uVar6 - iVar4" identifier - identifier) )) - (call_expression "(uint)(uVar6 < (uint)n)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar6 < (uint)n)" ( (binary_expression "uVar6 < (uint)n" identifier < (cast_expression "(uint)n" ( (type_descriptor "uint" type_identifier) ) identifier)) )))) >> number_literal))) ;) (expression_statement "mem0.alarmThreshold = n;" (assignment_expression "mem0.alarmThreshold = n" (field_expression "mem0.alarmThreshold" identifier . field_identifier) = identifier) ;) (expression_statement "sqlite3_mutex_leave(mem0.mutex);" (call_expression "sqlite3_mutex_leave(mem0.mutex)" identifier (argument_list "(mem0.mutex)" ( (field_expression "mem0.mutex" identifier . field_identifier) ))) ;) (expression_statement "sVar7 = sqlite3_memory_used();" (assignment_expression "sVar7 = sqlite3_memory_used()" identifier = (call_expression "sqlite3_memory_used()" identifier (argument_list "()" ( )))) ;) (expression_statement "sVar1 = mem0.alarmThreshold;" (assignment_expression "sVar1 = mem0.alarmThreshold" identifier = (field_expression "mem0.alarmThreshold" identifier . field_identifier)) ;) (if_statement "if (0 < sVar7 - n) {\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }" if (parenthesized_expression "(0 < sVar7 - n)" ( (binary_expression "0 < sVar7 - n" number_literal < (binary_expression "sVar7 - n" identifier - identifier)) )) (compound_statement "{\n      sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);\n      sVar1 = mem0.alarmThreshold;\n    }" { (expression_statement "sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff);" (call_expression "sqlite3_release_memory((uint)(sVar7 - n) & 0x7fffffff)" identifier (argument_list "((uint)(sVar7 - n) & 0x7fffffff)" ( (binary_expression "(uint)(sVar7 - n) & 0x7fffffff" (call_expression "(uint)(sVar7 - n)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(sVar7 - n)" ( (binary_expression "sVar7 - n" identifier - identifier) ))) & number_literal) ))) ;) (expression_statement "sVar1 = mem0.alarmThreshold;" (assignment_expression "sVar1 = mem0.alarmThreshold" identifier = (field_expression "mem0.alarmThreshold" identifier . field_identifier)) ;) })) }) (else_clause "else {\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }" else (compound_statement "{\n    local_14 = 0xffffffff;\n    local_10 = 0xffffffff;\n  }" { (expression_statement "local_14 = 0xffffffff;" (assignment_expression "local_14 = 0xffffffff" identifier = number_literal) ;) (expression_statement "local_10 = 0xffffffff;" (assignment_expression "local_10 = 0xffffffff" identifier = number_literal) ;) }))) (expression_statement "mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20);" (assignment_expression "mem0.alarmThreshold._4_4_ = (undefined4)((ulonglong)sVar1 >> 0x20)" (field_expression "mem0.alarmThreshold._4_4_" (field_expression "mem0.alarmThreshold" identifier . field_identifier) . field_identifier) = (call_expression "(undefined4)((ulonglong)sVar1 >> 0x20)" (parenthesized_expression "(undefined4)" ( identifier )) (argument_list "((ulonglong)sVar1 >> 0x20)" ( (binary_expression "(ulonglong)sVar1 >> 0x20" (cast_expression "(ulonglong)sVar1" ( (type_descriptor "ulonglong" type_identifier) ) identifier) >> number_literal) )))) ;) (expression_statement "mem0.alarmThreshold._0_4_ = (undefined4)sVar1;" (assignment_expression "mem0.alarmThreshold._0_4_ = (undefined4)sVar1" (field_expression "mem0.alarmThreshold._0_4_" (field_expression "mem0.alarmThreshold" identifier . field_identifier) . field_identifier) = (cast_expression "(undefined4)sVar1" ( (type_descriptor "undefined4" type_identifier) ) identifier)) ;) (return_statement "return CONCAT44(local_10,local_14);" return (call_expression "CONCAT44(local_10,local_14)" identifier (argument_list "(local_10,local_14)" ( identifier , identifier ))) ;) })))
(translation_unit "undefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}\n\n" (function_definition "undefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" type_identifier (function_declarator "sqlite3_soft_heap_limit64(uint param_1,int param_2)" identifier (parameter_list "(uint param_1,int param_2)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "longlong lVar3;" type_identifier identifier ;) (declaration "uint local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "iVar1 = sqlite3_initialize();" (assignment_expression "iVar1 = sqlite3_initialize()" identifier = (call_expression "sqlite3_initialize()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }" { (expression_statement "sqlite3_mutex_enter(DAT_000df9e4);" (call_expression "sqlite3_mutex_enter(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (expression_statement "iVar1 = DAT_000df9ec;" (assignment_expression "iVar1 = DAT_000df9ec" identifier = identifier) ;) (expression_statement "uVar2 = DAT_000df9e8;" (assignment_expression "uVar2 = DAT_000df9e8" identifier = identifier) ;) (expression_statement "local_14 = DAT_000df9e8;" (assignment_expression "local_14 = DAT_000df9e8" identifier = identifier) ;) (expression_statement "local_10 = DAT_000df9ec;" (assignment_expression "local_10 = DAT_000df9ec" identifier = identifier) ;) (if_statement "if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" { (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (return_statement "return CONCAT44(iVar1,uVar2);" return (call_expression "CONCAT44(iVar1,uVar2)" identifier (argument_list "(iVar1,uVar2)" ( identifier , identifier ))) ;) })) (if_statement "if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" if (parenthesized_expression "(((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       ))" ( (binary_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" (parenthesized_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0))))" ( (binary_expression "(-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" (parenthesized_expression "(-1 < DAT_000df9f4)" ( (binary_expression "-1 < DAT_000df9f4" number_literal < identifier) )) && (parenthesized_expression "((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" ( (parenthesized_expression "(0 < DAT_000df9f4 || (DAT_000df9f0 != 0))" ( (binary_expression "0 < DAT_000df9f4 || (DAT_000df9f0 != 0)" (binary_expression "0 < DAT_000df9f4" number_literal < identifier) || (parenthesized_expression "(DAT_000df9f0 != 0)" ( (binary_expression "DAT_000df9f0 != 0" identifier != number_literal) ))) )) ))) )) && (parenthesized_expression "((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" ( (parenthesized_expression "(DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))" ( (binary_expression "DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" (binary_expression "DAT_000df9f4 < param_2" identifier < identifier) || (parenthesized_expression "(((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" ( (parenthesized_expression "((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))" ( (binary_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)" (parenthesized_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1))" ( (binary_expression "DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)" (binary_expression "DAT_000df9f4 <= param_2" identifier <= identifier) && (parenthesized_expression "(DAT_000df9f0 < param_1)" ( (binary_expression "DAT_000df9f0 < param_1" identifier < identifier) ))) )) || (parenthesized_expression "(param_1 == 0 && param_2 == 0)" ( (binary_expression "param_1 == 0 && param_2 == 0" (binary_expression "param_1 == 0" identifier == number_literal) && (binary_expression "param_2 == 0" identifier == number_literal)) ))) )) ))) )) ))) )) (compound_statement "{\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" { (expression_statement "param_1 = DAT_000df9f0;" (assignment_expression "param_1 = DAT_000df9f0" identifier = identifier) ;) (expression_statement "param_2 = DAT_000df9f4;" (assignment_expression "param_2 = DAT_000df9f4" identifier = identifier) ;) })) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" identifier = number_literal) ;) (if_statement "if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }" if (parenthesized_expression "((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1))))" ( (binary_expression "(-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))" (parenthesized_expression "(-1 < param_2)" ( (binary_expression "-1 < param_2" number_literal < identifier) )) && (parenthesized_expression "((0 < param_2 || (DAT_000dfa20 < param_1)))" ( (parenthesized_expression "(0 < param_2 || (DAT_000dfa20 < param_1))" ( (binary_expression "0 < param_2 || (DAT_000dfa20 < param_1)" (binary_expression "0 < param_2" number_literal < identifier) || (parenthesized_expression "(DAT_000dfa20 < param_1)" ( (binary_expression "DAT_000dfa20 < param_1" identifier < identifier) ))) )) ))) )) (compound_statement "{\n      uVar2 = 0;\n    }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) })) (expression_statement "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;" (assignment_expression "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" identifier = (binary_expression "uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" identifier & (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "((param_2 >> 0x1f) - param_2)" ( (binary_expression "(param_2 >> 0x1f) - param_2" (parenthesized_expression "(param_2 >> 0x1f)" ( (binary_expression "param_2 >> 0x1f" identifier >> number_literal) )) - identifier) )) - (call_expression "(uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((uint)(param_2 >> 0x1f) < param_1)" ( (binary_expression "(uint)(param_2 >> 0x1f) < param_1" (call_expression "(uint)(param_2 >> 0x1f)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_2 >> 0x1f)" ( (binary_expression "param_2 >> 0x1f" identifier >> number_literal) ))) < identifier) )))) >> number_literal))) ;) (expression_statement "DAT_000df9e8 = param_1;" (assignment_expression "DAT_000df9e8 = param_1" identifier = identifier) ;) (expression_statement "DAT_000df9ec = param_2;" (assignment_expression "DAT_000df9ec = param_2" identifier = identifier) ;) (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" identifier (argument_list "(DAT_000df9e4)" ( identifier ))) ;) (expression_statement "lVar3 = sqlite3_memory_used();" (assignment_expression "lVar3 = sqlite3_memory_used()" identifier = (call_expression "sqlite3_memory_used()" identifier (argument_list "()" ( )))) ;) (expression_statement "lVar3 = lVar3 - CONCAT44(param_2,param_1);" (assignment_expression "lVar3 = lVar3 - CONCAT44(param_2,param_1)" identifier = (binary_expression "lVar3 - CONCAT44(param_2,param_1)" identifier - (call_expression "CONCAT44(param_2,param_1)" identifier (argument_list "(param_2,param_1)" ( identifier , identifier ))))) ;) (if_statement "if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" if (parenthesized_expression "(0 < lVar3)" ( (binary_expression "0 < lVar3" number_literal < identifier) )) (compound_statement "{\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" { (expression_statement "sqlite3_release_memory((uint)lVar3 & 0x7fffffff);" (call_expression "sqlite3_release_memory((uint)lVar3 & 0x7fffffff)" identifier (argument_list "((uint)lVar3 & 0x7fffffff)" ( (binary_expression "(uint)lVar3 & 0x7fffffff" (cast_expression "(uint)lVar3" ( (type_descriptor "uint" type_identifier) ) identifier) & number_literal) ))) ;) })) }) (else_clause "else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" else (compound_statement "{\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" { (expression_statement "local_14 = 0xffffffff;" (assignment_expression "local_14 = 0xffffffff" identifier = number_literal) ;) (expression_statement "local_10 = -1;" (assignment_expression "local_10 = -1" identifier = number_literal) ;) }))) (return_statement "return CONCAT44(local_10,local_14);" return (call_expression "CONCAT44(local_10,local_14)" identifier (argument_list "(local_10,local_14)" ( identifier , identifier ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression LIT < IDENT) || (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) ))) )) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT < IDENT) || (parenthesized_expression ( (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT <= IDENT) && (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT == LIT) && (binary_expression IDENT == LIT)) ))) )) ))) )) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression LIT < IDENT) || (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT & (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) - IDENT) )) - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT >> LIT) ))) < IDENT) )))) >> LIT))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (call_expression IDENT (argument_list ( IDENT , IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) ))) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })))
(function_definition "undefined8 sqlite3_soft_heap_limit64(uint param_1,int param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" (type_identifier "undefined8") (function_declarator "sqlite3_soft_heap_limit64(uint param_1,int param_2)" (identifier "sqlite3_soft_heap_limit64") (parameter_list "(uint param_1,int param_2)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  longlong lVar3;\n  uint local_14;\n  int local_10;\n  \n  iVar1 = sqlite3_initialize();\n  if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }\n  return CONCAT44(local_10,local_14);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "longlong lVar3;" (type_identifier "longlong") (identifier "lVar3") (; ";")) (declaration "uint local_14;" (type_identifier "uint") (identifier "local_14") (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (expression_statement "iVar1 = sqlite3_initialize();" (assignment_expression "iVar1 = sqlite3_initialize()" (identifier "iVar1") (= "=") (call_expression "sqlite3_initialize()" (identifier "sqlite3_initialize") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }\n  else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    sqlite3_mutex_enter(DAT_000df9e4);\n    iVar1 = DAT_000df9ec;\n    uVar2 = DAT_000df9e8;\n    local_14 = DAT_000df9e8;\n    local_10 = DAT_000df9ec;\n    if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }\n    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }\n    uVar2 = 1;\n    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }\n    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;\n    DAT_000df9e8 = param_1;\n    DAT_000df9ec = param_2;\n    sqlite3_mutex_leave(DAT_000df9e4);\n    lVar3 = sqlite3_memory_used();\n    lVar3 = lVar3 - CONCAT44(param_2,param_1);\n    if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }\n  }" ({ "{") (expression_statement "sqlite3_mutex_enter(DAT_000df9e4);" (call_expression "sqlite3_mutex_enter(DAT_000df9e4)" (identifier "sqlite3_mutex_enter") (argument_list "(DAT_000df9e4)" (( "(") (identifier "DAT_000df9e4") () ")"))) (; ";")) (expression_statement "iVar1 = DAT_000df9ec;" (assignment_expression "iVar1 = DAT_000df9ec" (identifier "iVar1") (= "=") (identifier "DAT_000df9ec")) (; ";")) (expression_statement "uVar2 = DAT_000df9e8;" (assignment_expression "uVar2 = DAT_000df9e8" (identifier "uVar2") (= "=") (identifier "DAT_000df9e8")) (; ";")) (expression_statement "local_14 = DAT_000df9e8;" (assignment_expression "local_14 = DAT_000df9e8" (identifier "local_14") (= "=") (identifier "DAT_000df9e8")) (; ";")) (expression_statement "local_10 = DAT_000df9ec;" (assignment_expression "local_10 = DAT_000df9ec" (identifier "local_10") (= "=") (identifier "DAT_000df9ec")) (; ";")) (if_statement "if (param_2 < 0) {\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" (if "if") (parenthesized_expression "(param_2 < 0)" (( "(") (binary_expression "param_2 < 0" (identifier "param_2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      sqlite3_mutex_leave(DAT_000df9e4);\n      return CONCAT44(iVar1,uVar2);\n    }" ({ "{") (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" (identifier "sqlite3_mutex_leave") (argument_list "(DAT_000df9e4)" (( "(") (identifier "DAT_000df9e4") () ")"))) (; ";")) (return_statement "return CONCAT44(iVar1,uVar2);" (return "return") (call_expression "CONCAT44(iVar1,uVar2)" (identifier "CONCAT44") (argument_list "(iVar1,uVar2)" (( "(") (identifier "iVar1") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}"))) (if_statement "if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )) {\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" (if "if") (parenthesized_expression "(((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       ))" (( "(") (binary_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&\n       ((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" (parenthesized_expression "((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0))))" (( "(") (binary_expression "(-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" (parenthesized_expression "(-1 < DAT_000df9f4)" (( "(") (binary_expression "-1 < DAT_000df9f4" (number_literal "-1") (< "<") (identifier "DAT_000df9f4")) () ")")) (&& "&&") (parenthesized_expression "((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))" (( "(") (parenthesized_expression "(0 < DAT_000df9f4 || (DAT_000df9f0 != 0))" (( "(") (binary_expression "0 < DAT_000df9f4 || (DAT_000df9f0 != 0)" (binary_expression "0 < DAT_000df9f4" (number_literal "0") (< "<") (identifier "DAT_000df9f4")) (|| "||") (parenthesized_expression "(DAT_000df9f0 != 0)" (( "(") (binary_expression "DAT_000df9f0 != 0" (identifier "DAT_000df9f0") (!= "!=") (number_literal "0")) () ")"))) () ")")) () ")"))) () ")")) (&& "&&") (parenthesized_expression "((DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))\n       )" (( "(") (parenthesized_expression "(DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))" (( "(") (binary_expression "DAT_000df9f4 < param_2 ||\n        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" (binary_expression "DAT_000df9f4 < param_2" (identifier "DAT_000df9f4") (< "<") (identifier "param_2")) (|| "||") (parenthesized_expression "(((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)))" (( "(") (parenthesized_expression "((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))" (( "(") (binary_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0)" (parenthesized_expression "(DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1))" (( "(") (binary_expression "DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)" (binary_expression "DAT_000df9f4 <= param_2" (identifier "DAT_000df9f4") (<= "<=") (identifier "param_2")) (&& "&&") (parenthesized_expression "(DAT_000df9f0 < param_1)" (( "(") (binary_expression "DAT_000df9f0 < param_1" (identifier "DAT_000df9f0") (< "<") (identifier "param_1")) () ")"))) () ")")) (|| "||") (parenthesized_expression "(param_1 == 0 && param_2 == 0)" (( "(") (binary_expression "param_1 == 0 && param_2 == 0" (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) (&& "&&") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0"))) () ")"))) () ")")) () ")"))) () ")")) () ")"))) () ")")) (compound_statement "{\n      param_1 = DAT_000df9f0;\n      param_2 = DAT_000df9f4;\n    }" ({ "{") (expression_statement "param_1 = DAT_000df9f0;" (assignment_expression "param_1 = DAT_000df9f0" (identifier "param_1") (= "=") (identifier "DAT_000df9f0")) (; ";")) (expression_statement "param_2 = DAT_000df9f4;" (assignment_expression "param_2 = DAT_000df9f4" (identifier "param_2") (= "=") (identifier "DAT_000df9f4")) (; ";")) (} "}"))) (expression_statement "uVar2 = 1;" (assignment_expression "uVar2 = 1" (identifier "uVar2") (= "=") (number_literal "1")) (; ";")) (if_statement "if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {\n      uVar2 = 0;\n    }" (if "if") (parenthesized_expression "((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1))))" (( "(") (binary_expression "(-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))" (parenthesized_expression "(-1 < param_2)" (( "(") (binary_expression "-1 < param_2" (number_literal "-1") (< "<") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "((0 < param_2 || (DAT_000dfa20 < param_1)))" (( "(") (parenthesized_expression "(0 < param_2 || (DAT_000dfa20 < param_1))" (( "(") (binary_expression "0 < param_2 || (DAT_000dfa20 < param_1)" (binary_expression "0 < param_2" (number_literal "0") (< "<") (identifier "param_2")) (|| "||") (parenthesized_expression "(DAT_000dfa20 < param_1)" (( "(") (binary_expression "DAT_000dfa20 < param_1" (identifier "DAT_000dfa20") (< "<") (identifier "param_1")) () ")"))) () ")")) () ")"))) () ")")) (compound_statement "{\n      uVar2 = 0;\n    }" ({ "{") (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f;" (assignment_expression "DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" (identifier "DAT_000df9f8") (= "=") (binary_expression "uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" (identifier "uVar2") (& "&") (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)\n                           >> 0x1f" (binary_expression "((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "((param_2 >> 0x1f) - param_2)" (( "(") (binary_expression "(param_2 >> 0x1f) - param_2" (parenthesized_expression "(param_2 >> 0x1f)" (( "(") (binary_expression "param_2 >> 0x1f" (identifier "param_2") (>> ">>") (number_literal "0x1f")) () ")")) (- "-") (identifier "param_2")) () ")")) (- "-") (call_expression "(uint)((uint)(param_2 >> 0x1f) < param_1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((uint)(param_2 >> 0x1f) < param_1)" (( "(") (binary_expression "(uint)(param_2 >> 0x1f) < param_1" (call_expression "(uint)(param_2 >> 0x1f)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_2 >> 0x1f)" (( "(") (binary_expression "param_2 >> 0x1f" (identifier "param_2") (>> ">>") (number_literal "0x1f")) () ")"))) (< "<") (identifier "param_1")) () ")")))) (>> ">>") (number_literal "0x1f")))) (; ";")) (expression_statement "DAT_000df9e8 = param_1;" (assignment_expression "DAT_000df9e8 = param_1" (identifier "DAT_000df9e8") (= "=") (identifier "param_1")) (; ";")) (expression_statement "DAT_000df9ec = param_2;" (assignment_expression "DAT_000df9ec = param_2" (identifier "DAT_000df9ec") (= "=") (identifier "param_2")) (; ";")) (expression_statement "sqlite3_mutex_leave(DAT_000df9e4);" (call_expression "sqlite3_mutex_leave(DAT_000df9e4)" (identifier "sqlite3_mutex_leave") (argument_list "(DAT_000df9e4)" (( "(") (identifier "DAT_000df9e4") () ")"))) (; ";")) (expression_statement "lVar3 = sqlite3_memory_used();" (assignment_expression "lVar3 = sqlite3_memory_used()" (identifier "lVar3") (= "=") (call_expression "sqlite3_memory_used()" (identifier "sqlite3_memory_used") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "lVar3 = lVar3 - CONCAT44(param_2,param_1);" (assignment_expression "lVar3 = lVar3 - CONCAT44(param_2,param_1)" (identifier "lVar3") (= "=") (binary_expression "lVar3 - CONCAT44(param_2,param_1)" (identifier "lVar3") (- "-") (call_expression "CONCAT44(param_2,param_1)" (identifier "CONCAT44") (argument_list "(param_2,param_1)" (( "(") (identifier "param_2") (, ",") (identifier "param_1") () ")"))))) (; ";")) (if_statement "if (0 < lVar3) {\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" (if "if") (parenthesized_expression "(0 < lVar3)" (( "(") (binary_expression "0 < lVar3" (number_literal "0") (< "<") (identifier "lVar3")) () ")")) (compound_statement "{\n      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);\n    }" ({ "{") (expression_statement "sqlite3_release_memory((uint)lVar3 & 0x7fffffff);" (call_expression "sqlite3_release_memory((uint)lVar3 & 0x7fffffff)" (identifier "sqlite3_release_memory") (argument_list "((uint)lVar3 & 0x7fffffff)" (( "(") (binary_expression "(uint)lVar3 & 0x7fffffff" (cast_expression "(uint)lVar3" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "lVar3")) (& "&") (number_literal "0x7fffffff")) () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" (else "else") (compound_statement "{\n    local_14 = 0xffffffff;\n    local_10 = -1;\n  }" ({ "{") (expression_statement "local_14 = 0xffffffff;" (assignment_expression "local_14 = 0xffffffff" (identifier "local_14") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "local_10 = -1;" (assignment_expression "local_10 = -1" (identifier "local_10") (= "=") (number_literal "-1")) (; ";")) (} "}")))) (return_statement "return CONCAT44(local_10,local_14);" (return "return") (call_expression "CONCAT44(local_10,local_14)" (identifier "CONCAT44") (argument_list "(local_10,local_14)" (( "(") (identifier "local_10") (, ",") (identifier "local_14") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Removing unreachable block (ram,0x00056500) */
/* WARNING: Removing unreachable block (ram,0x00056530) */

type_1 function_1(type_1 var_5)

{
  type_1 sVar1;
  type_2 uVar2;
  type_2 uVar3;
  int var_3;
  type_3 var_7;
  type_3 var_8;
  type_1 var_10;
  type_2 local_14;
  type_2 local_10;
  
  var_3 = var_1();
  sVar1 = var_2(mem0.alarmThreshold._4_4_,(type_2)mem0.alarmThreshold);
  if (var_3 == 0) {
    var_4(mem0.mutex);
    uVar3 = mem0.alarmThreshold._4_4_;
    uVar2 = (type_2)mem0.alarmThreshold;
    local_14 = (type_2)mem0.alarmThreshold;
    local_10 = mem0.alarmThreshold._4_4_;
    if (var_5 < 0) {
      var_6(mem0.mutex);
      return var_2(uVar3,uVar2);
    }
    if (((-1 < mem0.hardLimit._4_4_) && ((0 < mem0.hardLimit._4_4_ || ((int)mem0.hardLimit != 0))))
       && ((var_2(mem0.hardLimit._4_4_,(int)mem0.hardLimit) < var_5 || (var_5 == 0)))) {
      var_5 = var_2(mem0.hardLimit._4_4_,(int)mem0.hardLimit);
    }
    var_3 = (int)((type_4)var_5 >> 0x20);
    var_7 = 1;
    if ((-1 < var_5) && ((0xffffffff < var_5 || (sqlite3Stat.nowValue[0] < (type_3)var_5)))) {
      var_7 = 0;
    }
    var_8 = var_3 >> 0x1f;
    mem0.nearlyFull = var_7 & (var_8 - var_3) - (type_3)(var_8 < (type_3)var_5) >> 0x1f;
    mem0.alarmThreshold = var_5;
    var_6(mem0.mutex);
    var_10 = var_9();
    sVar1 = mem0.alarmThreshold;
    if (0 < var_10 - var_5) {
      var_11((type_3)(var_10 - var_5) & 0x7fffffff);
      sVar1 = mem0.alarmThreshold;
    }
  }
  else {
    local_14 = 0xffffffff;
    local_10 = 0xffffffff;
  }
  mem0.alarmThreshold._4_4_ = (type_2)((type_4)sVar1 >> 0x20);
  mem0.alarmThreshold._0_4_ = (type_2)sVar1;
  return var_2(local_10,local_14);
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Removing unreachable block (ram,0x00056530) */

undefined8 MASKED(uint param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  longlong lVar3;
  uint local_14;
  int local_10;
  
  iVar1 = sqlite3_initialize();
  if (iVar1 == 0) {
    sqlite3_mutex_enter(DAT_000df9e4);
    iVar1 = DAT_000df9ec;
    uVar2 = DAT_000df9e8;
    local_14 = DAT_000df9e8;
    local_10 = DAT_000df9ec;
    if (param_2 < 0) {
      sqlite3_mutex_leave(DAT_000df9e4);
      return CONCAT44(iVar1,uVar2);
    }
    if (((-1 < DAT_000df9f4) && ((0 < DAT_000df9f4 || (DAT_000df9f0 != 0)))) &&
       ((DAT_000df9f4 < param_2 ||
        (((DAT_000df9f4 <= param_2 && (DAT_000df9f0 < param_1)) || (param_1 == 0 && param_2 == 0))))
       )) {
      param_1 = DAT_000df9f0;
      param_2 = DAT_000df9f4;
    }
    uVar2 = 1;
    if ((-1 < param_2) && ((0 < param_2 || (DAT_000dfa20 < param_1)))) {
      uVar2 = 0;
    }
    DAT_000df9f8 = uVar2 & ((param_2 >> 0x1f) - param_2) - (uint)((uint)(param_2 >> 0x1f) < param_1)
                           >> 0x1f;
    DAT_000df9e8 = param_1;
    DAT_000df9ec = param_2;
    sqlite3_mutex_leave(DAT_000df9e4);
    lVar3 = sqlite3_memory_used();
    lVar3 = lVar3 - CONCAT44(param_2,param_1);
    if (0 < lVar3) {
      sqlite3_release_memory((uint)lVar3 & 0x7fffffff);
    }
  }
  else {
    local_14 = 0xffffffff;
    local_10 = -1;
  }
  return CONCAT44(local_10,local_14);
}

