Function at 0x4122e5
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xc8
xor r12d, r12d
xor ebx, ebx
mov rdi, qword [rcx + 0x30]
mov r14, rcx
mov r15, rdx
test ebx, ebx
jne 0x41261f
cmp r12, rdi
je 0x41261f
mov rsi, rdi
mov rbp, qword [rsi]
lea rdx, [rsp + 0x98]
mov r8, r15
mov rcx, qword [r14 + 8]
lea r9, str.SELECT_CREATE_TEMP__substr_sql__7__FROM_sqlite_schema_WHERE_tbl_name___Q_AND_type_IN__table__trigger__ORDER_BY_type_
mov r13, qword [rbp + 8]
mov qword [rsp + 0x98], 0
mov dword [rsp + 0x90], 0
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r13
call sym.idxPrintfPrepareStmt
mov dword [rsp + 0x90], eax
cmp dword [rsp + 0x90], 0
mov rcx, qword [rsp + 0x98]
je 0x41239f
mov rdx, qword [rsp + 0x98]
lea rbx, [rsp + 0x90]
mov rcx, rbx
call sym.idxFinalize
cmp dword [rsp + 0x90], 0
jne 0x412427
jmp 0x4123d6
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412377
mov rcx, qword [rsp + 0x98]
xor edx, edx
call sym.sqlite3_column_text
test rax, rax
je 0x412365
mov rcx, qword [r14 + 0x18]
mov qword [rsp + 0x20], r15
xor r9d, r9d
xor r8d, r8d
mov rdx, rax
call sym.sqlite3_exec
jmp 0x41235e
lea r8, str.t592690916721053953805701627921227776
mov rdx, r13
lea rcx, str.ALTER_TABLE_temp._Q_RENAME_TO__Q
call sym.sqlite3_mprintf
test rax, rax
mov r13, rax
jne 0x412401
mov dword [rsp + 0x90], 7
jmp 0x412427
mov rcx, qword [r14 + 0x18]
mov qword [rsp + 0x20], r15
xor r9d, r9d
xor r8d, r8d
mov rdx, rax
call sym.sqlite3_exec
mov rcx, r13
mov dword [rsp + 0x90], eax
call sym.sqlite3_free
mov eax, dword [rsi + 8]
cmp eax, 0x12
je 0x412458
cmp eax, 0x17
jne 0x412512
lea r9, str.t592690916721053953805701627921227776
xor edx, edx
mov rcx, rbx
lea r8, str.UPDATE__Q_SET
call sym.idxAppendText
xor r11d, r11d
mov r13, rax
jmp 0x4124bf
lea r9, str.t592690916721053953805701627921227776
xor edx, edx
mov rcx, rbx
lea r8, str.INSERT_INTO__Q_VALUES_
xor r13d, r13d
call sym.idxAppendText
cmp r13d, dword [rbp]
jge 0x4124a5
lea rdx, [0x004d4196]
test r13d, r13d
mov rcx, rbx
lea r9, [0x004d4af1]
cmove r9, rdx
mov rdx, rax
inc r13d
lea r8, [0x004d625d]
call sym.idxAppendText
jmp 0x412473
lea r8, [0x004d479b]
mov rdx, rax
mov rcx, rbx
call sym.idxAppendText
mov r13, rax
jmp 0x412563
cmp dword [rbp], r11d
jle 0x412563
imul rax, r11, 0x18
mov rdx, r13
mov rcx, rbx
mov qword [rsp + 0x40], r11
add rax, qword [rbp + 0x10]
lea r9, [0x004d4196]
test r11d, r11d
lea r8, str._s_Q_
mov rax, qword [rax]
mov qword [rsp + 0x20], rax
lea rax, [0x004d4af1]
cmovne r9, rax
call sym.idxAppendText
mov r11, qword [rsp + 0x40]
mov r13, rax
inc r11
jmp 0x4124bf
cmp eax, 9
je 0x412530
lea rdx, str.src_shell.c
mov r8d, 0x2e6b
lea rcx, str.pWrite__eOpSQLITE_DELETE
call sym._assert
xor r13d, r13d
cmp dword [rsp + 0x90], 0
jne 0x412563
lea rdx, str.t592690916721053953805701627921227776
lea rcx, str.DELETE_FROM__Q
call sym.sqlite3_mprintf
test rax, rax
mov r13, rax
jne 0x412563
mov dword [rsp + 0x90], 7
cmp dword [rsp + 0x90], 0
jne 0x4125c7
mov rcx, qword [r14 + 0x18]
or r8d, 0xffffffff
mov rdx, r13
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0xa0]
mov qword [rsp + 0xa0], 0
call sym.sqlite3_prepare_v2
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
mov dword [rsp + 0x90], eax
call sym.idxFinalize
cmp dword [rsp + 0x90], 0
je 0x4125c7
mov rcx, qword [r14 + 0x18]
mov rdx, r15
call sym.idxDatabaseError
mov rcx, r13
call sym.sqlite3_free
cmp dword [rsp + 0x90], 0
jne 0x4125fb
mov rcx, qword [r14 + 0x18]
mov qword [rsp + 0x20], r15
xor r9d, r9d
xor r8d, r8d
lea rdx, str.DROP_TABLE_t592690916721053953805701627921227776
call sym.sqlite3_exec
mov dword [rsp + 0x90], eax
mov ebx, dword [rsp + 0x90]
mov rsi, qword [rsi + 0x10]
test ebx, ebx
jne 0x412613
cmp rsi, r12
jne 0x41231b
mov r12, rdi
mov rdi, qword [r14 + 0x30]
jmp 0x412307
test ebx, ebx
mov dword [rsp + 0x74], ebx
jne 0x412671
mov rsi, qword [r14 + 0x28]
test rsi, rsi
je 0x412664
test ebx, ebx
jne 0x412664
xor r8d, r8d
mov rdx, rsi
mov rcx, r14
call sym.idxCreateFromWhere
test eax, eax
mov ebx, eax
jne 0x41265e
mov r8, qword [rsi + 0x18]
test r8, r8
je 0x41265e
mov rdx, rsi
mov rcx, r14
call sym.idxCreateFromWhere
mov ebx, eax
mov rsi, qword [rsi + 0x30]
jmp 0x41262b
test ebx, ebx
mov dword [rsp + 0x74], ebx
je 0x41269a
jmp 0x412ea8
cmp ebx, 0x305
jne 0x412ea8
test r15, r15
je 0x412691
lea rcx, str.Cannot_find_a_unique_index_name_to_propose.
call sym.sqlite3_mprintf
mov qword [r15], rax
mov eax, dword [rsp + 0x74]
jmp 0x412f33
mov eax, dword [r14]
mov dword [rsp + 0x78], 0
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], 0
test eax, eax
je 0x412ea4
mov rcx, qword [r14 + 0x10]
lea rdi, [rsp + 0xa0]
mov r8, r15
mov dword [rsp + 0x98], 0
lea r9, str.SELECT_max_i.seqno__FROM___sqlite_schema_AS_s____pragma_index_list_s.name__AS_l____pragma_index_info_l.name__AS_i_WHERE_s.type__table
mov rdx, rdi
mov qword [rsp + 0xa0], 0
call sym.idxPrepareStmt
test eax, eax
mov dword [rsp + 0x98], eax
jne 0x412735
mov rcx, qword [rsp + 0xa0]
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412735
mov rcx, qword [rsp + 0xa0]
xor edx, edx
call sym.sqlite3_column_int
lea ebx, [rax + 1]
mov rdx, qword [rsp + 0xa0]
lea rcx, [rsp + 0x98]
call sym.idxFinalize
mov eax, dword [rsp + 0x98]
test ebx, ebx
mov dword [rsp + 0x78], eax
jle 0x412ea4
test eax, eax
jne 0x412ea4
mov rcx, qword [r14 + 0x10]
xor r9d, r9d
xor r8d, r8d
xor esi, esi
mov qword [rsp + 0x20], 0
lea rdx, str.ANALYZE__PRAGMA_writable_schema1
call sym.sqlite3_exec
test eax, eax
mov dword [rsp + 0x78], eax
jne 0x4128b4
imul edx, ebx, 0x28
lea rcx, [rsp + 0x78]
add edx, 0x30
call sym.idxMalloc
cmp dword [rsp + 0x78], 0
mov rsi, rax
jne 0x4128b4
cmp dword [r14], 0x64
jne 0x4127bc
mov rcx, qword [r14 + 8]
jmp 0x4127c0
mov rcx, qword [r14 + 0x18]
lea rax, [sym.idxRemFunc]
mov qword [rsp + 0x20], rsi
mov r9d, 1
mov r8d, 2
mov qword [rsp + 0x38], 0
lea rdx, [0x004d63a9]
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], rax
call sym.sqlite3_create_function
test eax, eax
mov dword [rsp + 0x78], eax
jne 0x4128b4
mov rcx, qword [r14 + 8]
lea rax, [sym.idxSampleFunc]
xor r8d, r8d
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov r9d, 1
mov qword [rsp + 0x28], rax
lea rdx, str.sample
mov qword [rsp + 0x20], rdi
call sym.sqlite3_create_function
test eax, eax
mov dword [rsp + 0x78], eax
jne 0x4128b4
mov rcx, qword [r14 + 0x10]
lea r9, str.SELECT_s.rowid__s.name__l.name_FROM___sqlite_schema_AS_s____pragma_index_list_s.name__AS_l_WHERE_s.type__table
inc ebx
mov r8, r15
mov dword [rsi], ebx
lea rdx, [rsp + 0x80]
call sym.idxPrepareStmt
test eax, eax
mov dword [rsp + 0x78], eax
jne 0x4128b4
mov rcx, qword [r14 + 0x10]
lea rdx, [rsp + 0x88]
mov r8, r15
lea r9, str.SELECT_name__coll_FROM_pragma_index_xinfo____WHERE_key
call sym.idxPrepareStmt
test eax, eax
mov dword [rsp + 0x78], eax
jne 0x4128b4
mov rcx, qword [r14 + 0x10]
lea rdx, [rsp + 0x90]
mov r8, r15
lea r9, str.INSERT_INTO_sqlite_stat1_VALUES_________
call sym.idxPrepareStmt
mov dword [rsp + 0x78], eax
mov rdi, 0xfffffffffffe7960
mov ebx, dword [rsp + 0x78]
mov rcx, qword [rsp + 0x80]
test ebx, ebx
jne 0x412dfc
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412dcc
mov rcx, qword [rsp + 0x80]
xor edx, edx
call sym.sqlite3_column_int64
mov rcx, qword [rsp + 0x80]
mov edx, 1
mov qword [rsp + 0x58], rax
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x80]
mov edx, 2
mov qword [rsp + 0x50], rax
call sym.sqlite3_column_text
cmp qword [rsp + 0x50], 0
mov qword [rsp + 0x40], rax
je 0x4128bb
test rax, rax
je 0x4128bb
cmp qword [rsp + 0x58], rdi
mov eax, dword [r14]
je 0x41293b
cmp eax, 0x63
jle 0x41298c
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x98], 0
cmp dword [r14], 0
mov dword [rsp + 0x7c], 0
mov r12, qword [rsp + 0x88]
mov qword [rsp + 0x48], rax
jg 0x412a45
lea rdx, str.src_shell.c
mov r8d, 0x2f74
lea rcx, str.p__iSample_0
call sym._assert
jmp 0x412a45
mov rcx, qword [r14 + 0x18]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
lea rdx, str.DROP_TABLE_IF_EXISTS_temp.t592690916721053953805701627921227776
mov dword [rsp + 0xa0], eax
cvtsi2sd xmm0, eax
mov qword [rsp + 0xb0], 0
divsd xmm0, qword [0x004e04e8]
mov qword [rsp + 0xb8], 0
movsd qword [rsp + 0xa8], xmm0
call sym.sqlite3_exec
test eax, eax
jne 0x412a34
mov rdx, qword [rsp + 0x50]
lea rcx, str.CREATE_TABLE_temp.t592690916721053953805701627921227776_AS_SELECT__FROM__Q
call sym.sqlite3_mprintf
test rax, rax
mov rdi, rax
jne 0x412a09
mov dword [rsp + 0x78], 7
jmp 0x412dfc
mov rcx, qword [r14 + 0x18]
xor r9d, r9d
xor r8d, r8d
mov rdx, rax
mov qword [rsp + 0x20], 0
call sym.sqlite3_exec
mov rcx, rdi
mov dword [rsp + 0x48], eax
call sym.sqlite3_free
mov eax, dword [rsp + 0x48]
test eax, eax
mov dword [rsp + 0x78], eax
je 0x41293b
jmp 0x412dfc
mov r8, qword [rsp + 0x40]
or r9d, 0xffffffff
mov edx, 1
xor ebp, ebp
mov qword [rsp + 0x20], 0
mov rcx, r12
xor edi, edi
call sym.sqlite3_bind_text
lea rax, [rsp + 0x7c]
mov qword [rsp + 0x60], rax
cmp dword [rsp + 0x7c], 0
je 0x412a94
mov rcx, r12
xor r12d, r12d
call sym.sqlite3_reset
cmp dword [rsp + 0x7c], 0
jne 0x412b5d
jmp 0x412b29
mov rcx, r12
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412a79
lea rax, [0x004d4196]
test rdi, rdi
mov rcx, r12
lea r13, [0x004d4af1]
cmove r13, rax
xor edx, edx
call sym.sqlite3_column_text
mov edx, 1
mov rcx, r12
mov qword [rsp + 0x68], rax
call sym.sqlite3_column_text
mov r8, qword [rsp + 0x68]
mov rdx, rdi
mov r9, r13
mov rcx, qword [rsp + 0x60]
mov dword [rsp + 0x28], ebx
inc ebx
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r8
mov qword [rsp + 0x20], r8
lea r8, str._sx._Q_IS_rem__d__x._Q__COLLATE__s
call sym.idxAppendText
mov rcx, qword [rsp + 0x60]
mov rdx, rbp
mov r9, r13
mov dword [rsp + 0x20], ebx
lea r8, str._s_d
mov rdi, rax
call sym.idxAppendText
mov rbp, rax
jmp 0x412a72
cmp dword [r14], 0x64
jne 0x412b48
mov r8, qword [rsp + 0x50]
mov r9, rbp
mov rdx, rdi
lea rcx, str.SELECT__s_FROM__Q_x_ORDER_BY__s
call sym.sqlite3_mprintf
jmp 0x412b5a
lea rcx, str.SELECT__s_FROM_temp.t592690916721053953805701627921227776_x_ORDER_BY__s
mov r8, rbp
mov rdx, rdi
call sym.sqlite3_mprintf
mov r12, rax
mov rcx, rdi
call sym.sqlite3_free
mov rcx, rbp
call sym.sqlite3_free
cmp dword [rsp + 0x7c], 0
jne 0x412b9b
cmp dword [r14], 0x64
jne 0x412b80
mov rcx, qword [r14 + 8]
jmp 0x412b84
mov rcx, qword [r14 + 0x18]
lea rdx, [rsp + 0x98]
mov r9, r12
mov r8, r15
call sym.idxPrepareStmt
mov dword [rsp + 0x7c], eax
mov rcx, r12
xor ebp, ebp
call sym.sqlite3_free
cmp dword [rsp + 0x7c], 0
jne 0x412da0
lea edx, [rbx*4 + 4]
lea rcx, [rsp + 0x7c]
call sym.idxMalloc
cmp dword [rsp + 0x7c], 0
mov rbp, rax
jne 0x412da0
mov rcx, qword [rsp + 0x98]
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412da0
xor eax, eax
mov dword [rbp + rax*4], 1
inc rax
cmp ebx, eax
jge 0x412be7
mov edi, dword [rsp + 0x7c]
test edi, edi
jne 0x412f2b
mov rcx, qword [rsp + 0x98]
call sym.sqlite3_step
cmp eax, 0x64
jne 0x412c44
inc dword [rbp]
cmp ebx, edi
je 0x412bf6
mov rcx, qword [rsp + 0x98]
mov edx, edi
call sym.sqlite3_column_int
test eax, eax
jne 0x412c33
movsxd rdi, edi
jmp 0x412c37
inc edi
jmp 0x412c17
cmp ebx, edi
jle 0x412bf6
inc dword [rbp + rdi*4 + 4]
inc rdi
jmp 0x412c37
cmp dword [rsp + 0x7c], 0
jne 0x412f2b
mov edi, dword [rbp]
lea rcx, [0x004d65af]
mov r13d, 1
mov edx, edi
call sym.sqlite3_mprintf
test rax, rax
mov r12, rax
je 0x412c7a
lea rax, [rsp + 0x7c]
mov qword [rsp + 0x60], rax
jmp 0x412cbe
mov dword [rsp + 0x7c], 7
jmp 0x412d45
cmp ebx, r13d
jl 0x412cc5
mov eax, dword [rbp + r13*4]
mov ecx, 2
lea r8, [0x004d65b2]
cdq
idiv ecx
mov rcx, qword [rsp + 0x60]
add eax, edi
cdq
idiv dword [rbp + r13*4]
mov rdx, r12
inc r13
mov r9d, eax
call sym.idxAppendText
mov r12, rax
cmp dword [rsp + 0x7c], 0
je 0x412c87
cmp dword [rsp + 0x7c], 0
jne 0x412d45
mov r8, qword [rsp + 0x50]
or r9d, 0xffffffff
mov edx, 1
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_bind_text
mov r8, qword [rsp + 0x40]
or r9d, 0xffffffff
mov edx, 2
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_bind_text
mov rcx, qword [rsp + 0x48]
or r9d, 0xffffffff
mov r8, r12
mov qword [rsp + 0x20], 0
mov edx, 3
call sym.sqlite3_bind_text
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_step
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_reset
mov dword [rsp + 0x7c], eax
mov rdi, qword [rsp + 0x40]
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdx, qword [rsp + 0x40]
repne scasb al, byte [rdi]
mov rax, rcx
lea rcx, [r14 + 0x58]
not rax
lea r8d, [rax - 1]
call sym.idxHashFind
test rax, rax
mov rbx, rax
je 0x412d98
cmp qword [rax + 0x10], 0
je 0x412d92
lea rdx, str.src_shell.c
mov r8d, 0x2fbb
lea rcx, str.pEntry__zVal20
call sym._assert
mov qword [rbx + 0x10], r12
jmp 0x412da0
mov rcx, r12
call sym.sqlite3_free
mov rcx, rbp
call sym.sqlite3_free
mov rdx, qword [rsp + 0x98]
lea rcx, [rsp + 0x7c]
call sym.idxFinalize
mov eax, dword [rsp + 0x7c]
mov rdi, qword [rsp + 0x58]
mov dword [rsp + 0x78], eax
jmp 0x4128bb
cmp dword [rsp + 0x78], 0
jne 0x412dfc
cmp dword [r14], 0x63
jg 0x412dfc
mov rcx, qword [r14 + 0x18]
lea rdx, str.DROP_TABLE_IF_EXISTS_temp.t592690916721053953805701627921227776
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
call sym.sqlite3_exec
mov dword [rsp + 0x78], eax
mov rdx, qword [rsp + 0x80]
lea rbx, [rsp + 0x78]
mov rcx, rbx
call sym.idxFinalize
mov rdx, qword [rsp + 0x88]
mov rcx, rbx
call sym.idxFinalize
mov rdx, qword [rsp + 0x90]
mov rcx, rbx
xor ebx, ebx
call sym.idxFinalize
test rsi, rsi
je 0x412e57
cmp dword [rsi], ebx
jle 0x412e4f
imul rax, rbx, 0x28
inc rbx
mov rcx, qword [rsi + rax + 0x28]
call sym.sqlite3_free
jmp 0x412e38
mov rcx, rsi
call sym.sqlite3_free
cmp dword [rsp + 0x78], 0
jne 0x412e81
mov rcx, qword [r14 + 0x10]
lea rdx, str.ANALYZE_sqlite_schema
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
call sym.sqlite3_exec
mov dword [rsp + 0x78], eax
mov rcx, qword [r14 + 8]
lea rdx, str.DROP_TABLE_IF_EXISTS_temp.t592690916721053953805701627921227776
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
call sym.sqlite3_exec
mov eax, dword [rsp + 0x78]
mov dword [rsp + 0x74], eax
mov rbx, qword [r14 + 0x58]
lea rsi, str.____stat1:
lea rdi, [0x004d4196]
lea rbp, [rsp + 0x74]
test rbx, rbx
je 0x412f03
mov rax, qword [rbx + 0x10]
mov rcx, rdi
mov r9, qword [rbx + 8]
lea r8, str._s__s_s_n
mov rdx, qword [r14 + 0x2058]
test rax, rax
mov qword [rsp + 0x28], rax
cmovne rcx, rsi
mov qword [rsp + 0x20], rcx
mov rcx, rbp
call sym.idxAppendText
mov rbx, qword [rbx + 0x20]
mov qword [r14 + 0x2058], rax
jmp 0x412ebf
cmp dword [rsp + 0x74], 0
jne 0x412f19
mov rdx, r15
mov rcx, r14
call sym.idxFindIndexes
mov dword [rsp + 0x74], eax
mov eax, dword [rsp + 0x74]
test eax, eax
jne 0x412f33
mov dword [r14 + 0x40], 1
jmp 0x412f33
xor r12d, r12d
jmp 0x412d45
add rsp, 0xc8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret