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

int sqlite3_overload_function(sqlite3 *db,char *zName,int nArg)

{
  FuncDef *pFVar1;
  int iVar2;
  char *p;
  int in_stack_ffffffdc;
  u8 in_stack_ffffffe0;
  u8 in_stack_ffffffe4;
  
  sqlite3_mutex_enter(db->mutex);
  pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,
                               in_stack_ffffffe0,in_stack_ffffffe4);
  sqlite3_mutex_leave(db->mutex);
  iVar2 = 0;
  if (pFVar1 == (FuncDef *)0x0) {
    p = sqlite3_mprintf(zName);
    iVar2 = 7;
    if (p != (char *)0x0) {
      iVar2 = sqlite3_create_function_v2
                        (db,zName,nArg,1,p,sqlite3InvalidFunction,
                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,
                         (_func_void_sqlite3_context_ptr *)0x0,
                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);
      return iVar2;
    }
  }
  return iVar2;
}



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

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

{
  int iVar1;
  undefined4 uVar2;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  iVar1 = FUN_0004ea00(1,0);
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  uVar2 = 0;
  if (iVar1 == 0) {
    iVar1 = sqlite3_mprintf(param_2);
    uVar2 = 7;
    if (iVar1 != 0) {
      uVar2 = sqlite3_create_function_v2
                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)
      ;
      return uVar2;
    }
  }
  return uVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001ddf0
ADD EBX,0x93f87
SUB ESP,0x18
MOV ESI,dword ptr [ESP + 0x2c]
MOV EDI,dword ptr [ESP + 0x30]
PUSH dword ptr [ESI + 0xc]
CALL 0x000168d0
POP EAX
POP EDX
PUSH 0x0
PUSH 0x1
MOV EDX,EDI
MOV ECX,dword ptr [ESP + 0x38]
MOV EAX,ESI
CALL 0x0004ea00
POP ECX
PUSH dword ptr [ESI + 0xc]
MOV EBP,EAX
CALL 0x00016830
ADD ESP,0x10
XOR EAX,EAX
TEST EBP,EBP
JZ 0x000720c8
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EDI
CALL 0x00016b90
MOV ECX,EAX
ADD ESP,0x10
MOV EAX,0x7
TEST ECX,ECX
JZ 0x000720b9
LEA EDX,[EBX + 0xfff6c110]
SUB ESP,0xc
PUSH dword ptr [EBX + 0xffffffe0]
PUSH 0x0
PUSH 0x0
PUSH EDX
PUSH ECX
PUSH 0x1
PUSH dword ptr [ESP + 0x4c]
PUSH EDI
PUSH ESI
CALL 0x00016c30
ADD ESP,0x30
ADD ESP,0xc
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_overload_function(int param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}\n\n" comment (function_definition "undefined4 sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" type_identifier (function_declarator "sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" 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 "iVar1 = FUN_0004ea00(1,0);" (assignment_expression "iVar1 = FUN_0004ea00(1,0)" identifier = (call_expression "FUN_0004ea00(1,0)" identifier (argument_list "(1,0)" ( number_literal , number_literal )))) ;) (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) )))) ))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" { (expression_statement "iVar1 = sqlite3_mprintf(param_2);" (assignment_expression "iVar1 = sqlite3_mprintf(param_2)" identifier = (call_expression "sqlite3_mprintf(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "uVar2 = 7;" (assignment_expression "uVar2 = 7" identifier = number_literal) ;) (if_statement "if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" { (expression_statement "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;" (assignment_expression "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" identifier = (call_expression "sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" identifier (argument_list "(param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" ( identifier , identifier , identifier , number_literal , identifier , identifier , number_literal , number_literal , identifier )))) ;) (return_statement "return uVar2;" return identifier ;) })) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint sqlite3_overload_function(sqlite3 *db,char *zName,int nArg)\n\n{\n  FuncDef *pFVar1;\n  int iVar2;\n  char *p;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  u8 in_stack_ffffffe4;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4);\n  sqlite3_mutex_leave(db->mutex);\n  iVar2 = 0;\n  if (pFVar1 == (FuncDef *)0x0) {\n    p = sqlite3_mprintf(zName);\n    iVar2 = 7;\n    if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }\n  }\n  return iVar2;\n}\n\n" comment comment (function_definition "int sqlite3_overload_function(sqlite3 *db,char *zName,int nArg)\n\n{\n  FuncDef *pFVar1;\n  int iVar2;\n  char *p;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  u8 in_stack_ffffffe4;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4);\n  sqlite3_mutex_leave(db->mutex);\n  iVar2 = 0;\n  if (pFVar1 == (FuncDef *)0x0) {\n    p = sqlite3_mprintf(zName);\n    iVar2 = 7;\n    if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "sqlite3_overload_function(sqlite3 *db,char *zName,int nArg)" identifier (parameter_list "(sqlite3 *db,char *zName,int nArg)" ( (parameter_declaration "sqlite3 *db" type_identifier (pointer_declarator "*db" * identifier)) , (parameter_declaration "char *zName" primitive_type (pointer_declarator "*zName" * identifier)) , (parameter_declaration "int nArg" primitive_type identifier) ))) (compound_statement "{\n  FuncDef *pFVar1;\n  int iVar2;\n  char *p;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  u8 in_stack_ffffffe4;\n  \n  sqlite3_mutex_enter(db->mutex);\n  pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4);\n  sqlite3_mutex_leave(db->mutex);\n  iVar2 = 0;\n  if (pFVar1 == (FuncDef *)0x0) {\n    p = sqlite3_mprintf(zName);\n    iVar2 = 7;\n    if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }\n  }\n  return iVar2;\n}" { (declaration "FuncDef *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *p;" primitive_type (pointer_declarator "*p" * identifier) ;) (declaration "int in_stack_ffffffdc;" primitive_type identifier ;) (declaration "u8 in_stack_ffffffe0;" type_identifier identifier ;) (declaration "u8 in_stack_ffffffe4;" 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 "pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4);" (assignment_expression "pFVar1 = sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4)" identifier = (call_expression "sqlite3FindFunction((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4)" identifier (argument_list "((sqlite3 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,\n                               in_stack_ffffffe0,in_stack_ffffffe4)" ( (cast_expression "(sqlite3 *)&DAT_00000001" ( (type_descriptor "sqlite3 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_00000001" & identifier)) , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , 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) ))) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (pFVar1 == (FuncDef *)0x0) {\n    p = sqlite3_mprintf(zName);\n    iVar2 = 7;\n    if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(pFVar1 == (FuncDef *)0x0)" ( (binary_expression "pFVar1 == (FuncDef *)0x0" identifier == (cast_expression "(FuncDef *)0x0" ( (type_descriptor "FuncDef *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    p = sqlite3_mprintf(zName);\n    iVar2 = 7;\n    if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }\n  }" { (expression_statement "p = sqlite3_mprintf(zName);" (assignment_expression "p = sqlite3_mprintf(zName)" identifier = (call_expression "sqlite3_mprintf(zName)" identifier (argument_list "(zName)" ( identifier )))) ;) (expression_statement "iVar2 = 7;" (assignment_expression "iVar2 = 7" identifier = number_literal) ;) (if_statement "if (p != (char *)0x0) {\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }" if (parenthesized_expression "(p != (char *)0x0)" ( (binary_expression "p != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);\n      return iVar2;\n    }" { (expression_statement "iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0);" (assignment_expression "iVar2 = sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0)" identifier = (call_expression "sqlite3_create_function_v2\n                        (db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0)" identifier (argument_list "(db,zName,nArg,1,p,sqlite3InvalidFunction,\n                         (_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0,\n                         (_func_void_sqlite3_context_ptr *)0x0,\n                         (_func_void_void_ptr *)PTR_sqlite3_free_00105fe0)" ( identifier , identifier , identifier , number_literal , identifier , identifier , (cast_expression "(_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *)0x0" ( (type_descriptor "_func_void_sqlite3_context_ptr_int_sqlite3_value_ptr_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(_func_void_sqlite3_context_ptr *)0x0" ( (type_descriptor "_func_void_sqlite3_context_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(_func_void_void_ptr *)PTR_sqlite3_free_00105fe0" ( (type_descriptor "_func_void_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "undefined4 sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" type_identifier (function_declarator "sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" 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 "iVar1 = FUN_0004ea00(1,0);" (assignment_expression "iVar1 = FUN_0004ea00(1,0)" identifier = (call_expression "FUN_0004ea00(1,0)" identifier (argument_list "(1,0)" ( number_literal , number_literal )))) ;) (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) )))) ))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" { (expression_statement "iVar1 = sqlite3_mprintf(param_2);" (assignment_expression "iVar1 = sqlite3_mprintf(param_2)" identifier = (call_expression "sqlite3_mprintf(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "uVar2 = 7;" (assignment_expression "uVar2 = 7" identifier = number_literal) ;) (if_statement "if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" { (expression_statement "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;" (assignment_expression "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" identifier = (call_expression "sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" identifier (argument_list "(param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" ( identifier , identifier , identifier , number_literal , identifier , identifier , number_literal , number_literal , identifier )))) ;) (return_statement "return uVar2;" return identifier ;) })) })) (return_statement "return uVar2;" 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 = (call_expression IDENT (argument_list ( LIT , LIT )))) ;) (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 = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , IDENT , IDENT , LIT , LIT , IDENT )))) ;) (return_statement return IDENT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" (type_identifier "undefined4") (function_declarator "sqlite3_overload_function(int param_1,undefined4 param_2,undefined4 param_3)" (identifier "sqlite3_overload_function") (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));\n  iVar1 = FUN_0004ea00(1,0);\n  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));\n  uVar2 = 0;\n  if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (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 "iVar1 = FUN_0004ea00(1,0);" (assignment_expression "iVar1 = FUN_0004ea00(1,0)" (identifier "iVar1") (= "=") (call_expression "FUN_0004ea00(1,0)" (identifier "FUN_0004ea00") (argument_list "(1,0)" (( "(") (number_literal "1") (, ",") (number_literal "0") () ")")))) (; ";")) (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")) () ")")))) () ")"))) (; ";")) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar1 == 0) {\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = sqlite3_mprintf(param_2);\n    uVar2 = 7;\n    if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }\n  }" ({ "{") (expression_statement "iVar1 = sqlite3_mprintf(param_2);" (assignment_expression "iVar1 = sqlite3_mprintf(param_2)" (identifier "iVar1") (= "=") (call_expression "sqlite3_mprintf(param_2)" (identifier "sqlite3_mprintf") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "uVar2 = 7;" (assignment_expression "uVar2 = 7" (identifier "uVar2") (= "=") (number_literal "7")) (; ";")) (if_statement "if (iVar1 != 0) {\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;\n      return uVar2;\n    }" ({ "{") (expression_statement "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)\n      ;" (assignment_expression "uVar2 = sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" (identifier "uVar2") (= "=") (call_expression "sqlite3_create_function_v2\n                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" (identifier "sqlite3_create_function_v2") (argument_list "(param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "1") (, ",") (identifier "iVar1") (, ",") (identifier "FUN_00072110") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (identifier "PTR_sqlite3_free_00105fe0") () ")")))) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

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

int function_1(type_1 *db,char *zName,int nArg)

{
  type_2 *var_4;
  int iVar2;
  char *var_6;
  int in_stack_ffffffdc;
  type_3 in_stack_ffffffe0;
  type_3 in_stack_ffffffe4;
  
  var_1(db->mutex);
  var_4 = var_2((type_1 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,
                               in_stack_ffffffe0,in_stack_ffffffe4);
  var_3(db->mutex);
  iVar2 = 0;
  if (var_4 == (type_2 *)0x0) {
    var_6 = var_5(zName);
    iVar2 = 7;
    if (var_6 != (char *)0x0) {
      iVar2 = var_7
                        (db,zName,nArg,1,var_6,sqlite3InvalidFunction,
                         (type_4 *)0x0,
                         (type_5 *)0x0,
                         (type_6 *)PTR_sqlite3_free_00105fe0);
      return iVar2;
    }
  }
  return iVar2;
}


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

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

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

{
  int iVar1;
  undefined4 uVar2;
  
  sqlite3_mutex_enter(*(undefined4 *)(param_1 + 0xc));
  iVar1 = FUN_0004ea00(1,0);
  sqlite3_mutex_leave(*(undefined4 *)(param_1 + 0xc));
  uVar2 = 0;
  if (iVar1 == 0) {
    iVar1 = sqlite3_mprintf(param_2);
    uVar2 = 7;
    if (iVar1 != 0) {
      uVar2 = sqlite3_create_function_v2
                        (param_1,param_2,param_3,1,iVar1,FUN_00072110,0,0,PTR_sqlite3_free_00105fe0)
      ;
      return uVar2;
    }
  }
  return uVar2;
}

