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

int sqlite3_trace_v2(sqlite3 *db,uint mTrace,_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace,
                    void *pArg)

{
  u8 uVar1;
  
  sqlite3_mutex_enter(db->mutex);
  if ((mTrace == 0) ||
     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)) {
    uVar1 = '\0';
    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;
  }
  db->mTrace = uVar1;
  (db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace;
  db->pTraceArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return 0;
}



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

undefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)

{
  undefined1 uVar1;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {
    uVar1 = 0;
    param_3 = 0;
  }
  *(undefined1 *)(param_1 + 0x54) = uVar1;
  *(int *)(param_1 + 0xc4) = param_3;
  *(undefined4 *)(param_1 + 200) = param_4;
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  return 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001d810
ADD EBX,0xbcff7
SUB ESP,0x18
MOV ESI,dword ptr [ESP + 0x2c]
MOV EDI,dword ptr [ESP + 0x30]
MOV EBP,dword ptr [ESP + 0x34]
PUSH dword ptr [ESI + 0xc]
CALL 0x000168d0
ADD ESP,0x10
TEST EDI,EDI
JZ 0x00021060
TEST EBP,EBP
MOV EAX,EDI
JZ 0x00021060
MOV byte ptr [ESI + 0x54],AL
MOV EAX,dword ptr [ESP + 0x2c]
SUB ESP,0xc
MOV dword ptr [ESI + 0xc4],EBP
MOV dword ptr [ESI + 0xc8],EAX
PUSH dword ptr [ESI + 0xc]
CALL 0x00016830
ADD ESP,0x1c
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR EAX,EAX
XOR EBP,EBP
JMP 0x00021033
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)\n\n{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}\n\n" comment (function_definition "undefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)\n\n{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" type_identifier (function_declarator "sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,undefined4 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" { (declaration "undefined1 uVar1;" type_identifier identifier ;) (expression_statement "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 0xc))" ( (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) )))) ))) ;) (if_statement "if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }" if (parenthesized_expression "((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0))" ( (binary_expression "(param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(uVar1 = (undefined1)param_2, param_3 == 0)" ( (comma_expression "uVar1 = (undefined1)param_2, param_3 == 0" (assignment_expression "uVar1 = (undefined1)param_2" identifier = (cast_expression "(undefined1)param_2" ( (type_descriptor "undefined1" type_identifier) ) identifier)) , (binary_expression "param_3 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    uVar1 = 0;\n    param_3 = 0;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" identifier = number_literal) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x54) = uVar1;" (assignment_expression "*(undefined1 *)(param_1 + 0x54) = uVar1" (pointer_expression "*(undefined1 *)(param_1 + 0x54)" * (cast_expression "(undefined1 *)(param_1 + 0x54)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0xc4) = param_3;" (assignment_expression "*(int *)(param_1 + 0xc4) = param_3" (pointer_expression "*(int *)(param_1 + 0xc4)" * (cast_expression "(int *)(param_1 + 0xc4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc4)" ( (binary_expression "param_1 + 0xc4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(param_1 + 200) = param_4;" (assignment_expression "*(undefined4 *)(param_1 + 200) = param_4" (pointer_expression "*(undefined4 *)(param_1 + 200)" * (cast_expression "(undefined4 *)(param_1 + 200)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 200)" ( (binary_expression "param_1 + 200" identifier + number_literal) )))) = identifier) ;) (expression_statement "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 0xc))" ( (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) )))) ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint sqlite3_trace_v2(sqlite3 *db,uint mTrace,_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace,\n                    void *pArg)\n\n{\n  u8 uVar1;\n  \n  sqlite3_mutex_enter(db->mutex);\n  if ((mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)) {\n    uVar1 = '\0';\n    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;\n  }\n  db->mTrace = uVar1;\n  (db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace;\n  db->pTraceArg = pArg;\n  sqlite3_mutex_leave(db->mutex);\n  return 0;\n}\n\n" comment (function_definition "int sqlite3_trace_v2(sqlite3 *db,uint mTrace,_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace,\n                    void *pArg)\n\n{\n  u8 uVar1;\n  \n  sqlite3_mutex_enter(db->mutex);\n  if ((mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)) {\n    uVar1 = '\0';\n    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;\n  }\n  db->mTrace = uVar1;\n  (db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace;\n  db->pTraceArg = pArg;\n  sqlite3_mutex_leave(db->mutex);\n  return 0;\n}" primitive_type (function_declarator "sqlite3_trace_v2(sqlite3 *db,uint mTrace,_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace,\n                    void *pArg)" identifier (parameter_list "(sqlite3 *db,uint mTrace,_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace,\n                    void *pArg)" ( (parameter_declaration "sqlite3 *db" type_identifier (pointer_declarator "*db" * identifier)) , (parameter_declaration "uint mTrace" type_identifier identifier) , (parameter_declaration "_func_int_uint_void_ptr_void_ptr_void_ptr *xTrace" type_identifier (pointer_declarator "*xTrace" * identifier)) , (parameter_declaration "void *pArg" primitive_type (pointer_declarator "*pArg" * identifier)) ))) (compound_statement "{\n  u8 uVar1;\n  \n  sqlite3_mutex_enter(db->mutex);\n  if ((mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)) {\n    uVar1 = '\0';\n    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;\n  }\n  db->mTrace = uVar1;\n  (db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace;\n  db->pTraceArg = pArg;\n  sqlite3_mutex_leave(db->mutex);\n  return 0;\n}" { (declaration "u8 uVar1;" type_identifier identifier ;) (expression_statement "sqlite3_mutex_enter(db->mutex);" (call_expression "sqlite3_mutex_enter(db->mutex)" identifier (argument_list "(db->mutex)" ( (field_expression "db->mutex" identifier -> field_identifier) ))) ;) (if_statement "if ((mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)) {\n    uVar1 = '\0';\n    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;\n  }" if (parenthesized_expression "((mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0))" ( (binary_expression "(mTrace == 0) ||\n     (uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)" (parenthesized_expression "(mTrace == 0)" ( (binary_expression "mTrace == 0" identifier == number_literal) )) || (parenthesized_expression "(uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0)" ( (comma_expression "uVar1 = (u8)mTrace, xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0" (assignment_expression "uVar1 = (u8)mTrace" identifier = (cast_expression "(u8)mTrace" ( (type_descriptor "u8" type_identifier) ) identifier)) , (binary_expression "xTrace == (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0" identifier == (cast_expression "(_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0" ( (type_descriptor "_func_int_uint_void_ptr_void_ptr_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    uVar1 = '\0';\n    xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;\n  }" { (expression_statement "uVar1 = '\0';" (assignment_expression "uVar1 = '\0'" identifier = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0;" (assignment_expression "xTrace = (_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0" identifier = (cast_expression "(_func_int_uint_void_ptr_void_ptr_void_ptr *)0x0" ( (type_descriptor "_func_int_uint_void_ptr_void_ptr_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (expression_statement "db->mTrace = uVar1;" (assignment_expression "db->mTrace = uVar1" (field_expression "db->mTrace" identifier -> field_identifier) = identifier) ;) (expression_statement "(db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace;" (assignment_expression "(db->trace).xLegacy = (_func_void_void_ptr_char_ptr *)xTrace" (field_expression "(db->trace).xLegacy" (parenthesized_expression "(db->trace)" ( (field_expression "db->trace" identifier -> field_identifier) )) . field_identifier) = (cast_expression "(_func_void_void_ptr_char_ptr *)xTrace" ( (type_descriptor "_func_void_void_ptr_char_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (expression_statement "db->pTraceArg = pArg;" (assignment_expression "db->pTraceArg = pArg" (field_expression "db->pTraceArg" identifier -> field_identifier) = identifier) ;) (expression_statement "sqlite3_mutex_leave(db->mutex);" (call_expression "sqlite3_mutex_leave(db->mutex)" identifier (argument_list "(db->mutex)" ( (field_expression "db->mutex" identifier -> field_identifier) ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)\n\n{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}\n\n" (function_definition "undefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)\n\n{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" type_identifier (function_declarator "sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,undefined4 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" { (declaration "undefined1 uVar1;" type_identifier identifier ;) (expression_statement "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 0xc))" ( (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) )))) ))) ;) (if_statement "if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }" if (parenthesized_expression "((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0))" ( (binary_expression "(param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(uVar1 = (undefined1)param_2, param_3 == 0)" ( (comma_expression "uVar1 = (undefined1)param_2, param_3 == 0" (assignment_expression "uVar1 = (undefined1)param_2" identifier = (cast_expression "(undefined1)param_2" ( (type_descriptor "undefined1" type_identifier) ) identifier)) , (binary_expression "param_3 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    uVar1 = 0;\n    param_3 = 0;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" identifier = number_literal) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x54) = uVar1;" (assignment_expression "*(undefined1 *)(param_1 + 0x54) = uVar1" (pointer_expression "*(undefined1 *)(param_1 + 0x54)" * (cast_expression "(undefined1 *)(param_1 + 0x54)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0xc4) = param_3;" (assignment_expression "*(int *)(param_1 + 0xc4) = param_3" (pointer_expression "*(int *)(param_1 + 0xc4)" * (cast_expression "(int *)(param_1 + 0xc4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc4)" ( (binary_expression "param_1 + 0xc4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(param_1 + 200) = param_4;" (assignment_expression "*(undefined4 *)(param_1 + 200) = param_4" (pointer_expression "*(undefined4 *)(param_1 + 200)" * (cast_expression "(undefined4 *)(param_1 + 200)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 200)" ( (binary_expression "param_1 + 200" identifier + number_literal) )))) = identifier) ;) (expression_statement "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 0xc))" ( (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) )))) ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)\n\n{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "sqlite3_trace_v2(int param_1,int param_2,int param_3,undefined4 param_4)" (identifier "sqlite3_trace_v2") (parameter_list "(int param_1,int param_2,int param_3,undefined4 param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  undefined1 uVar1;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }\n  *(undefined1 *)(param_1 + 0x54) = uVar1;\n  *(int *)(param_1 + 0xc4) = param_3;\n  *(undefined4 *)(param_1 + 200) = param_4;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return 0;\n}" ({ "{") (declaration "undefined1 uVar1;" (type_identifier "undefined1") (identifier "uVar1") (; ";")) (expression_statement "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc))" (identifier "sqlite3_mutex_enter") (argument_list "(*(undefined4 *)(param_1 + 0xc))" (( "(") (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")) () ")")))) () ")"))) (; ";")) (if_statement "if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {\n    uVar1 = 0;\n    param_3 = 0;\n  }" (if "if") (parenthesized_expression "((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0))" (( "(") (binary_expression "(param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)" (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(uVar1 = (undefined1)param_2, param_3 == 0)" (( "(") (comma_expression "uVar1 = (undefined1)param_2, param_3 == 0" (assignment_expression "uVar1 = (undefined1)param_2" (identifier "uVar1") (= "=") (cast_expression "(undefined1)param_2" (( "(") (type_descriptor "undefined1" (type_identifier "undefined1")) () ")") (identifier "param_2"))) (, ",") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    uVar1 = 0;\n    param_3 = 0;\n  }" ({ "{") (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" (identifier "param_3") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(param_1 + 0x54) = uVar1;" (assignment_expression "*(undefined1 *)(param_1 + 0x54) = uVar1" (pointer_expression "*(undefined1 *)(param_1 + 0x54)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x54)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x54)" (( "(") (binary_expression "param_1 + 0x54" (identifier "param_1") (+ "+") (number_literal "0x54")) () ")")))) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "*(int *)(param_1 + 0xc4) = param_3;" (assignment_expression "*(int *)(param_1 + 0xc4) = param_3" (pointer_expression "*(int *)(param_1 + 0xc4)" (* "*") (cast_expression "(int *)(param_1 + 0xc4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc4)" (( "(") (binary_expression "param_1 + 0xc4" (identifier "param_1") (+ "+") (number_literal "0xc4")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 200) = param_4;" (assignment_expression "*(undefined4 *)(param_1 + 200) = param_4" (pointer_expression "*(undefined4 *)(param_1 + 200)" (* "*") (cast_expression "(undefined4 *)(param_1 + 200)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 200)" (( "(") (binary_expression "param_1 + 200" (identifier "param_1") (+ "+") (number_literal "200")) () ")")))) (= "=") (identifier "param_4")) (; ";")) (expression_statement "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));" (call_expression "sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc))" (identifier "sqlite3_mutex_leave") (argument_list "(*(undefined4 *)(param_1 + 0xc))" (( "(") (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")) () ")")))) () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

int function_1(type_1 *db,type_2 var_2,type_3 *var_3,
                    void *pArg)

{
  type_4 uVar1;
  
  var_1(db->mutex);
  if ((var_2 == 0) ||
     (uVar1 = (type_4)var_2, var_3 == (type_3 *)0x0)) {
    uVar1 = '\0';
    var_3 = (type_3 *)0x0;
  }
  db->var_2 = uVar1;
  (db->trace).xLegacy = (type_5 *)var_3;
  db->pTraceArg = pArg;
  var_4(db->mutex);
  return 0;
}


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

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

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

{
  undefined1 uVar1;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  if ((param_2 == 0) || (uVar1 = (undefined1)param_2, param_3 == 0)) {
    uVar1 = 0;
    param_3 = 0;
  }
  *(undefined1 *)(param_1 + 0x54) = uVar1;
  *(int *)(param_1 + 0xc4) = param_3;
  *(undefined4 *)(param_1 + 200) = param_4;
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  return 0;
}

