
int vdbeSorterCompare(SortSubtask *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,
                     int nKey2)

{
  KeyInfo *pKeyInfo_1;
  KeyInfo *pKVar1;
  int iVar2;
  
  pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked;
  if (*pbKey2Cached == 0) {
    pKVar1 = pTask->pSorter->pKeyInfo;
    sqlite3VdbeRecordUnpack
              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,
               pKeyInfo_1);
    *pbKey2Cached = 1;
  }
  iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0);
  return iVar2;
}



void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)

{
  if (*param_2 == 0) {
    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));
    *param_2 = 1;
  }
  FUN_00053100();
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x34]
MOV EBX,dword ptr [ESP + 0x40]
MOV EAX,dword ptr [ESP + 0x30]
MOV EBP,dword ptr [ESP + 0x38]
MOV EDX,dword ptr [ESI]
MOV EDI,dword ptr [ESP + 0x3c]
MOV dword ptr [ESP + 0xc],EBX
MOV ECX,dword ptr [ESP + 0x44]
MOV EBX,dword ptr [EAX + 0xc]
TEST EDX,EDX
JZ 0x00053740
MOV dword ptr [ESP + 0x30],0x0
ADD ESP,0x1c
MOV ECX,EBX
MOV EDX,EBP
POP EBX
MOV EAX,EDI
POP ESI
POP EDI
POP EBP
JMP 0x00053100
MOV EAX,dword ptr [EAX + 0x8]
SUB ESP,0x8
MOV EAX,dword ptr [EAX + 0x1c]
PUSH EBX
PUSH dword ptr [ESP + 0x18]
LEA EDX,[EAX + 0xc]
ADD EAX,0x4
CALL 0x0002c280
MOV dword ptr [ESI],0x1
ADD ESP,0x10
JMP 0x0005371c
(translation_unit "void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)\n\n{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}\n\n" (function_definition "void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)\n\n{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" primitive_type (function_declarator "FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" identifier (parameter_list "(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) ))) (compound_statement "{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" { (if_statement "if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" if (parenthesized_expression "(*param_2 == 0)" ( (binary_expression "*param_2 == 0" (pointer_expression "*param_2" * identifier) == number_literal) )) (compound_statement "{\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" { (expression_statement "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));" (call_expression "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(param_5,*(undefined4 *)(param_1 + 0xc))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "*param_2 = 1;" (assignment_expression "*param_2 = 1" (pointer_expression "*param_2" * identifier) = number_literal) ;) })) (expression_statement "FUN_00053100();" (call_expression "FUN_00053100()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit "int vdbeSorterCompare(SortSubtask *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,\n                     int nKey2)\n\n{\n  KeyInfo *pKeyInfo_1;\n  KeyInfo *pKVar1;\n  int iVar2;\n  \n  pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked;\n  if (*pbKey2Cached == 0) {\n    pKVar1 = pTask->pSorter->pKeyInfo;\n    sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);\n    *pbKey2Cached = 1;\n  }\n  iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0);\n  return iVar2;\n}\n\n" (function_definition "int vdbeSorterCompare(SortSubtask *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,\n                     int nKey2)\n\n{\n  KeyInfo *pKeyInfo_1;\n  KeyInfo *pKVar1;\n  int iVar2;\n  \n  pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked;\n  if (*pbKey2Cached == 0) {\n    pKVar1 = pTask->pSorter->pKeyInfo;\n    sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);\n    *pbKey2Cached = 1;\n  }\n  iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0);\n  return iVar2;\n}" primitive_type (function_declarator "vdbeSorterCompare(SortSubtask *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,\n                     int nKey2)" identifier (parameter_list "(SortSubtask *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,\n                     int nKey2)" ( (parameter_declaration "SortSubtask *pTask" type_identifier (pointer_declarator "*pTask" * identifier)) , (parameter_declaration "int *pbKey2Cached" primitive_type (pointer_declarator "*pbKey2Cached" * identifier)) , (parameter_declaration "void *pKey1" primitive_type (pointer_declarator "*pKey1" * identifier)) , (parameter_declaration "int nKey1" primitive_type identifier) , (parameter_declaration "void *pKey2" primitive_type (pointer_declarator "*pKey2" * identifier)) , (parameter_declaration "int nKey2" primitive_type identifier) ))) (compound_statement "{\n  KeyInfo *pKeyInfo_1;\n  KeyInfo *pKVar1;\n  int iVar2;\n  \n  pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked;\n  if (*pbKey2Cached == 0) {\n    pKVar1 = pTask->pSorter->pKeyInfo;\n    sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);\n    *pbKey2Cached = 1;\n  }\n  iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0);\n  return iVar2;\n}" { (declaration "KeyInfo *pKeyInfo_1;" type_identifier (pointer_declarator "*pKeyInfo_1" * identifier) ;) (declaration "KeyInfo *pKVar1;" type_identifier (pointer_declarator "*pKVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked;" (assignment_expression "pKeyInfo_1 = (KeyInfo *)pTask->pUnpacked" identifier = (cast_expression "(KeyInfo *)pTask->pUnpacked" ( (type_descriptor "KeyInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pTask->pUnpacked" identifier -> field_identifier))) ;) (if_statement "if (*pbKey2Cached == 0) {\n    pKVar1 = pTask->pSorter->pKeyInfo;\n    sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);\n    *pbKey2Cached = 1;\n  }" if (parenthesized_expression "(*pbKey2Cached == 0)" ( (binary_expression "*pbKey2Cached == 0" (pointer_expression "*pbKey2Cached" * identifier) == number_literal) )) (compound_statement "{\n    pKVar1 = pTask->pSorter->pKeyInfo;\n    sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);\n    *pbKey2Cached = 1;\n  }" { (expression_statement "pKVar1 = pTask->pSorter->pKeyInfo;" (assignment_expression "pKVar1 = pTask->pSorter->pKeyInfo" identifier = (field_expression "pTask->pSorter->pKeyInfo" (field_expression "pTask->pSorter" identifier -> field_identifier) -> field_identifier)) ;) (expression_statement "sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1);" (call_expression "sqlite3VdbeRecordUnpack\n              ((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1)" identifier (argument_list "((KeyInfo *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(UnpackedRecord *)pKey2,\n               pKeyInfo_1)" ( (cast_expression "(KeyInfo *)&pKVar1->enc" ( (type_descriptor "KeyInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pKVar1->enc" & (field_expression "pKVar1->enc" identifier -> field_identifier))) , (cast_expression "(int)&pKVar1->db" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pKVar1->db" & (field_expression "pKVar1->db" identifier -> field_identifier))) , (cast_expression "(void *)nKey2" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(UnpackedRecord *)pKey2" ( (type_descriptor "UnpackedRecord *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier ))) ;) (expression_statement "*pbKey2Cached = 1;" (assignment_expression "*pbKey2Cached = 1" (pointer_expression "*pbKey2Cached" * identifier) = number_literal) ;) })) (expression_statement "iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0);" (assignment_expression "iVar2 = sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0)" identifier = (call_expression "sqlite3VdbeRecordCompareWithSkip(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0)" identifier (argument_list "(nKey1,pKey1,(UnpackedRecord *)pKeyInfo_1,0)" ( identifier , identifier , (cast_expression "(UnpackedRecord *)pKeyInfo_1" ( (type_descriptor "UnpackedRecord *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , number_literal )))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)\n\n{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}\n\n" (function_definition "void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)\n\n{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" primitive_type (function_declarator "FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" identifier (parameter_list "(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) ))) (compound_statement "{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" { (if_statement "if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" if (parenthesized_expression "(*param_2 == 0)" ( (binary_expression "*param_2 == 0" (pointer_expression "*param_2" * identifier) == number_literal) )) (compound_statement "{\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" { (expression_statement "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));" (call_expression "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(param_5,*(undefined4 *)(param_1 + 0xc))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "*param_2 = 1;" (assignment_expression "*param_2 = 1" (pointer_expression "*param_2" * identifier) = number_literal) ;) })) (expression_statement "FUN_00053100();" (call_expression "FUN_00053100()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return ;) })))
(function_definition "void FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)\n\n{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000536f0(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" (identifier "FUN_000536f0") (parameter_list "(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "undefined4 param_5" (type_identifier "undefined4") (identifier "param_5")) () ")"))) (compound_statement "{\n  if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }\n  FUN_00053100();\n  return;\n}" ({ "{") (if_statement "if (*param_2 == 0) {\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" (if "if") (parenthesized_expression "(*param_2 == 0)" (( "(") (binary_expression "*param_2 == 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));\n    *param_2 = 1;\n  }" ({ "{") (expression_statement "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));" (call_expression "FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc))" (identifier "FUN_0002c280") (argument_list "(param_5,*(undefined4 *)(param_1 + 0xc))" (( "(") (identifier "param_5") (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) () ")"))) (; ";")) (expression_statement "*param_2 = 1;" (assignment_expression "*param_2 = 1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "FUN_00053100();" (call_expression "FUN_00053100()" (identifier "FUN_00053100") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

int function_1(type_1 *pTask,int *pbKey2Cached,void *pKey1,int nKey1,void *pKey2,
                     int nKey2)

{
  type_2 *pKeyInfo_1;
  type_2 *pKVar1;
  int iVar2;
  
  pKeyInfo_1 = (type_2 *)pTask->pUnpacked;
  if (*pbKey2Cached == 0) {
    pKVar1 = pTask->pSorter->pKeyInfo;
    var_1
              ((type_2 *)&pKVar1->enc,(int)&pKVar1->db,(void *)nKey2,(type_3 *)pKey2,
               pKeyInfo_1);
    *pbKey2Cached = 1;
  }
  iVar2 = var_2(nKey1,pKey1,(type_3 *)pKeyInfo_1,0);
  return iVar2;
}


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

void MASKED(int param_1,int *param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)

{
  if (*param_2 == 0) {
    FUN_0002c280(param_5,*(undefined4 *)(param_1 + 0xc));
    *param_2 = 1;
  }
  FUN_00053100();
  return;
}

