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

void * sqlite3_profile(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)

{
  void *pvVar1;
  byte bVar2;
  
  sqlite3_mutex_enter(db->mutex);
  pvVar1 = db->pProfileArg;
  db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile;
  db->pProfileArg = pArg;
  bVar2 = db->mTrace & 0xf;
  if (xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0) {
    bVar2 = bVar2 | 0x80;
  }
  db->mTrace = bVar2;
  sqlite3_mutex_leave(db->mutex);
  return pvVar1;
}



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

undefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)

{
  undefined4 uVar1;
  byte bVar2;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  uVar1 = *(undefined4 *)(param_1 + 0xd0);
  *(int *)(param_1 + 0xcc) = param_2;
  *(undefined4 *)(param_1 + 0xd0) = param_3;
  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;
  if (param_2 != 0) {
    bVar2 = bVar2 | 0x80;
  }
  *(byte *)(param_1 + 0x54) = bVar2;
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  return uVar1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001ddf0
ADD EBX,0xe57c7
SUB ESP,0x18
MOV ESI,dword ptr [ESP + 0x2c]
MOV EDI,dword ptr [ESP + 0x30]
PUSH dword ptr [ESI + 0xc]
CALL 0x000168d0
MOVZX EDX,byte ptr [ESI + 0x54]
MOV EAX,dword ptr [ESP + 0x38]
MOV EBP,dword ptr [ESI + 0xd0]
MOV dword ptr [ESI + 0xcc],EDI
MOV dword ptr [ESI + 0xd0],EAX
AND EDX,0xf
POP EAX
MOV EAX,EDX
OR EAX,0xffffff80
TEST EDI,EDI
CMOVNZ EDX,EAX
MOV byte ptr [ESI + 0x54],DL
PUSH dword ptr [ESI + 0xc]
CALL 0x00016830
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}\n\n" comment (function_definition "undefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" type_identifier (function_declarator "sqlite3_profile(int param_1,int param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,int param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "byte bVar2;" 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) )))) ))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0xd0);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0xd0)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0xcc) = param_2;" (assignment_expression "*(int *)(param_1 + 0xcc) = param_2" (pointer_expression "*(int *)(param_1 + 0xcc)" * (cast_expression "(int *)(param_1 + 0xcc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xcc)" ( (binary_expression "param_1 + 0xcc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(param_1 + 0xd0) = param_3;" (assignment_expression "*(undefined4 *)(param_1 + 0xd0) = param_3" (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) = identifier) ;) (expression_statement "bVar2 = *(byte *)(param_1 + 0x54) & 0xf;" (assignment_expression "bVar2 = *(byte *)(param_1 + 0x54) & 0xf" identifier = (binary_expression "*(byte *)(param_1 + 0x54) & 0xf" (pointer_expression "*(byte *)(param_1 + 0x54)" * (cast_expression "(byte *)(param_1 + 0x54)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" identifier + number_literal) )))) & number_literal)) ;) (if_statement "if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    bVar2 = bVar2 | 0x80;\n  }" { (expression_statement "bVar2 = bVar2 | 0x80;" (assignment_expression "bVar2 = bVar2 | 0x80" identifier = (binary_expression "bVar2 | 0x80" identifier | number_literal)) ;) })) (expression_statement "*(byte *)(param_1 + 0x54) = bVar2;" (assignment_expression "*(byte *)(param_1 + 0x54) = bVar2" (pointer_expression "*(byte *)(param_1 + 0x54)" * (cast_expression "(byte *)(param_1 + 0x54)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" 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 uVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid * sqlite3_profile(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)\n\n{\n  void *pvVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pvVar1 = db->pProfileArg;\n  db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile;\n  db->pProfileArg = pArg;\n  bVar2 = db->mTrace & 0xf;\n  if (xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  db->mTrace = bVar2;\n  sqlite3_mutex_leave(db->mutex);\n  return pvVar1;\n}\n\n" comment comment (function_definition "void * sqlite3_profile(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)\n\n{\n  void *pvVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pvVar1 = db->pProfileArg;\n  db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile;\n  db->pProfileArg = pArg;\n  bVar2 = db->mTrace & 0xf;\n  if (xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  db->mTrace = bVar2;\n  sqlite3_mutex_leave(db->mutex);\n  return pvVar1;\n}" primitive_type (pointer_declarator "* sqlite3_profile(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)" * (function_declarator "sqlite3_profile(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)" identifier (parameter_list "(sqlite3 *db,_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile,void *pArg)" ( (parameter_declaration "sqlite3 *db" type_identifier (pointer_declarator "*db" * identifier)) , (parameter_declaration "_func_void_void_ptr_char_ptr_sqlite_uint64 *xProfile" type_identifier (pointer_declarator "*xProfile" * identifier)) , (parameter_declaration "void *pArg" primitive_type (pointer_declarator "*pArg" * identifier)) )))) (compound_statement "{\n  void *pvVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pvVar1 = db->pProfileArg;\n  db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile;\n  db->pProfileArg = pArg;\n  bVar2 = db->mTrace & 0xf;\n  if (xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  db->mTrace = bVar2;\n  sqlite3_mutex_leave(db->mutex);\n  return pvVar1;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (declaration "byte bVar2;" 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) ))) ;) (expression_statement "pvVar1 = db->pProfileArg;" (assignment_expression "pvVar1 = db->pProfileArg" identifier = (field_expression "db->pProfileArg" identifier -> field_identifier)) ;) (expression_statement "db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile;" (assignment_expression "db->xProfile = (_func_void_void_ptr_char_ptr_u64 *)xProfile" (field_expression "db->xProfile" identifier -> field_identifier) = (cast_expression "(_func_void_void_ptr_char_ptr_u64 *)xProfile" ( (type_descriptor "_func_void_void_ptr_char_ptr_u64 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (expression_statement "db->pProfileArg = pArg;" (assignment_expression "db->pProfileArg = pArg" (field_expression "db->pProfileArg" identifier -> field_identifier) = identifier) ;) (expression_statement "bVar2 = db->mTrace & 0xf;" (assignment_expression "bVar2 = db->mTrace & 0xf" identifier = (binary_expression "db->mTrace & 0xf" (field_expression "db->mTrace" identifier -> field_identifier) & number_literal)) ;) (if_statement "if (xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0) {\n    bVar2 = bVar2 | 0x80;\n  }" if (parenthesized_expression "(xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0)" ( (binary_expression "xProfile != (_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0" identifier != (cast_expression "(_func_void_void_ptr_char_ptr_sqlite_uint64 *)0x0" ( (type_descriptor "_func_void_void_ptr_char_ptr_sqlite_uint64 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    bVar2 = bVar2 | 0x80;\n  }" { (expression_statement "bVar2 = bVar2 | 0x80;" (assignment_expression "bVar2 = bVar2 | 0x80" identifier = (binary_expression "bVar2 | 0x80" identifier | number_literal)) ;) })) (expression_statement "db->mTrace = bVar2;" (assignment_expression "db->mTrace = bVar2" (field_expression "db->mTrace" 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 pvVar1;" return identifier ;) })))
(translation_unit "undefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}\n\n" (function_definition "undefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" type_identifier (function_declarator "sqlite3_profile(int param_1,int param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,int param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "byte bVar2;" 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) )))) ))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0xd0);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0xd0)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0xcc) = param_2;" (assignment_expression "*(int *)(param_1 + 0xcc) = param_2" (pointer_expression "*(int *)(param_1 + 0xcc)" * (cast_expression "(int *)(param_1 + 0xcc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xcc)" ( (binary_expression "param_1 + 0xcc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(param_1 + 0xd0) = param_3;" (assignment_expression "*(undefined4 *)(param_1 + 0xd0) = param_3" (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) = identifier) ;) (expression_statement "bVar2 = *(byte *)(param_1 + 0x54) & 0xf;" (assignment_expression "bVar2 = *(byte *)(param_1 + 0x54) & 0xf" identifier = (binary_expression "*(byte *)(param_1 + 0x54) & 0xf" (pointer_expression "*(byte *)(param_1 + 0x54)" * (cast_expression "(byte *)(param_1 + 0x54)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" identifier + number_literal) )))) & number_literal)) ;) (if_statement "if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    bVar2 = bVar2 | 0x80;\n  }" { (expression_statement "bVar2 = bVar2 | 0x80;" (assignment_expression "bVar2 = bVar2 | 0x80" identifier = (binary_expression "bVar2 | 0x80" identifier | number_literal)) ;) })) (expression_statement "*(byte *)(param_1 + 0x54) = bVar2;" (assignment_expression "*(byte *)(param_1 + 0x54) = bVar2" (pointer_expression "*(byte *)(param_1 + 0x54)" * (cast_expression "(byte *)(param_1 + 0x54)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x54)" ( (binary_expression "param_1 + 0x54" 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 uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_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 IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_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 (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (return_statement return IDENT ;) })))
(function_definition "undefined4 sqlite3_profile(int param_1,int param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" (type_identifier "undefined4") (function_declarator "sqlite3_profile(int param_1,int param_2,undefined4 param_3)" (identifier "sqlite3_profile") (parameter_list "(int param_1,int param_2,undefined4 param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  byte bVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  uVar1 = *(undefined4 *)(param_1 + 0xd0);\n  *(int *)(param_1 + 0xcc) = param_2;\n  *(undefined4 *)(param_1 + 0xd0) = param_3;\n  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;\n  if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }\n  *(byte *)(param_1 + 0x54) = bVar2;\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  return uVar1;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "byte bVar2;" (type_identifier "byte") (identifier "bVar2") (; ";")) (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")) () ")")))) () ")"))) (; ";")) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0xd0);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0xd0)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xd0)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd0)" (( "(") (binary_expression "param_1 + 0xd0" (identifier "param_1") (+ "+") (number_literal "0xd0")) () ")"))))) (; ";")) (expression_statement "*(int *)(param_1 + 0xcc) = param_2;" (assignment_expression "*(int *)(param_1 + 0xcc) = param_2" (pointer_expression "*(int *)(param_1 + 0xcc)" (* "*") (cast_expression "(int *)(param_1 + 0xcc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xcc)" (( "(") (binary_expression "param_1 + 0xcc" (identifier "param_1") (+ "+") (number_literal "0xcc")) () ")")))) (= "=") (identifier "param_2")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xd0) = param_3;" (assignment_expression "*(undefined4 *)(param_1 + 0xd0) = param_3" (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xd0)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd0)" (( "(") (binary_expression "param_1 + 0xd0" (identifier "param_1") (+ "+") (number_literal "0xd0")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (expression_statement "bVar2 = *(byte *)(param_1 + 0x54) & 0xf;" (assignment_expression "bVar2 = *(byte *)(param_1 + 0x54) & 0xf" (identifier "bVar2") (= "=") (binary_expression "*(byte *)(param_1 + 0x54) & 0xf" (pointer_expression "*(byte *)(param_1 + 0x54)" (* "*") (cast_expression "(byte *)(param_1 + 0x54)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x54)" (( "(") (binary_expression "param_1 + 0x54" (identifier "param_1") (+ "+") (number_literal "0x54")) () ")")))) (& "&") (number_literal "0xf"))) (; ";")) (if_statement "if (param_2 != 0) {\n    bVar2 = bVar2 | 0x80;\n  }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    bVar2 = bVar2 | 0x80;\n  }" ({ "{") (expression_statement "bVar2 = bVar2 | 0x80;" (assignment_expression "bVar2 = bVar2 | 0x80" (identifier "bVar2") (= "=") (binary_expression "bVar2 | 0x80" (identifier "bVar2") (| "|") (number_literal "0x80"))) (; ";")) (} "}"))) (expression_statement "*(byte *)(param_1 + 0x54) = bVar2;" (assignment_expression "*(byte *)(param_1 + 0x54) = bVar2" (pointer_expression "*(byte *)(param_1 + 0x54)" (* "*") (cast_expression "(byte *)(param_1 + 0x54)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x54)" (( "(") (binary_expression "param_1 + 0x54" (identifier "param_1") (+ "+") (number_literal "0x54")) () ")")))) (= "=") (identifier "bVar2")) (; ";")) (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 uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

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

void * function_1(type_1 *db,type_2 *var_2,void *pArg)

{
  void *pvVar1;
  type_3 var_3;
  
  var_1(db->mutex);
  pvVar1 = db->pProfileArg;
  db->var_2 = (type_4 *)var_2;
  db->pProfileArg = pArg;
  var_3 = db->mTrace & 0xf;
  if (var_2 != (type_2 *)0x0) {
    var_3 = var_3 | 0x80;
  }
  db->mTrace = var_3;
  var_4(db->mutex);
  return pvVar1;
}


(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: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (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)))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (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 (assignment_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_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 (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 (identifier)))))

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

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

{
  undefined4 uVar1;
  byte bVar2;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  uVar1 = *(undefined4 *)(param_1 + 0xd0);
  *(int *)(param_1 + 0xcc) = param_2;
  *(undefined4 *)(param_1 + 0xd0) = param_3;
  bVar2 = *(byte *)(param_1 + 0x54) & 0xf;
  if (param_2 != 0) {
    bVar2 = bVar2 | 0x80;
  }
  *(byte *)(param_1 + 0x54) = bVar2;
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  return uVar1;
}

