Function at 0x40a285
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov rax, qword [rcx + 0x10]
mov qword [rsp + 0x38], rax
mov rax, r8
mov rdi, rcx
mov r12, rdx
or rax, r9
mov rbx, r8
mov rsi, r9
mov dword [rsp + 0x68], 0
je 0x40a696
mov rax, qword [rdx]
mov dword [rsp + 0x40], 0
mov qword [rsp + 0x70], 0
mov rcx, qword [rax + 8]
mov rax, r8
test rax, rax
je 0x40a2eb
inc dword [rsp + 0x40]
mov rax, qword [rax + 0x20]
jmp 0x40a2dc
mov qword [rsp + 0x20], rcx
mov rcx, qword [rsp + 0x38]
lea rdx, [rsp + 0x70]
xor r8d, r8d
lea r9, str.PRAGMA_index_list_Q
call sym.idxPrintfPrepareStmt
mov dword [rsp + 0x6c], eax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x6c]
mov qword [rsp + 0x50], rax
cmp dword [rsp + 0x6c], 0
mov rcx, qword [rsp + 0x70]
je 0x40a354
mov rdx, qword [rsp + 0x70]
lea rcx, [rsp + 0x6c]
xor ebp, ebp
lea r14, [rsp + 0x68]
call sym.idxFinalize
mov eax, dword [rsp + 0x6c]
mov r13, qword [r12]
mov dword [rsp + 0x68], eax
jmp 0x40a4af
call sym.sqlite3_step
cmp eax, 0x64
jne 0x40a32d
mov rcx, qword [rsp + 0x70]
mov edx, 1
mov qword [rsp + 0x78], 0
call sym.sqlite3_column_text
mov rdx, rbx
test rax, rax
je 0x40a321
test rdx, rdx
je 0x40a390
mov dword [rdx + 0x10], 0
mov rdx, qword [rdx + 0x20]
jmp 0x40a37e
mov rdx, qword [rsp + 0x48]
mov qword [rsp + 0x20], rax
xor r8d, r8d
mov rbp, rsi
mov rcx, qword [rsp + 0x38]
lea r9, str.PRAGMA_index_xInfo_Q
call sym.idxPrintfPrepareStmt
mov dword [rsp + 0x6c], eax
mov r13d, dword [rsp + 0x6c]
mov rcx, qword [rsp + 0x78]
test r13d, r13d
je 0x40a3cf
mov r13d, 1
jmp 0x40a47c
call sym.sqlite3_step
cmp eax, 0x64
jne 0x40a3c4
mov rcx, qword [rsp + 0x78]
xor edx, edx
call sym.sqlite3_column_int
mov rcx, qword [rsp + 0x78]
mov edx, 1
mov r15d, eax
call sym.sqlite3_column_int
mov rcx, qword [rsp + 0x78]
mov edx, 4
mov r14d, eax
call sym.sqlite3_column_text
cmp dword [rsp + 0x40], r15d
mov r8, rax
jle 0x40a454
mov r15, rbx
test r15, r15
je 0x40a47c
cmp dword [r15 + 0x10], 0
jne 0x40a44e
cmp r14d, dword [r15 + 0xc]
jne 0x40a44e
mov rcx, qword [r15]
mov rdx, r8
mov qword [rsp + 0x58], r8
call sym.sqlite3_stricmp
mov r8, qword [rsp + 0x58]
test eax, eax
jne 0x40a44e
mov dword [r15 + 0x10], 1
jmp 0x40a3b5
mov r15, qword [r15 + 0x20]
jmp 0x40a416
test rbp, rbp
je 0x40a3b5
cmp r14d, dword [rbp + 0xc]
jne 0x40a47c
mov rcx, qword [rbp]
mov rdx, rax
call sym.sqlite3_stricmp
test eax, eax
jne 0x40a47c
mov rbp, qword [rbp + 0x20]
jmp 0x40a3b5
mov rdx, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x50]
call sym.idxFinalize
cmp dword [rsp + 0x6c], 0
jne 0x40a321
and r13b, 1
je 0x40a321
mov rcx, qword [rsp + 0x70]
call sym.sqlite3_finalize
jmp 0x40a696
test rbx, rbx
je 0x40a4cf
mov r8, qword [r13 + 0x10]
mov r9, rbx
mov rdx, rbp
mov rcx, r14
call sym.idxAppendColDefn.isra.45
mov rbx, qword [rbx + 0x20]
mov rbp, rax
jmp 0x40a4af
lea rbx, [rsp + 0x68]
test rsi, rsi
je 0x40a4f4
mov r8, qword [r13 + 0x10]
mov r9, rsi
mov rdx, rbp
mov rcx, rbx
call sym.idxAppendColDefn.isra.45
mov rsi, qword [rsi + 0x20]
mov rbp, rax
jmp 0x40a4d4
mov esi, dword [rsp + 0x68]
test esi, esi
jne 0x40a5fd
mov rax, qword [r12]
xor ebx, ebx
xor r12d, r12d
mov r13, qword [rax + 8]
mov rcx, r13
call sym.idxIdentifierRequiresQuotes
mov r15d, eax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x78], 0
movsxd rax, dword [rsp + 0x78]
mov rdx, rax
movsx eax, byte [rbp + rax]
test al, al
je 0x40a54a
lea eax, [rax + r12*8]
inc edx
add r12d, eax
mov dword [rsp + 0x78], edx
jmp 0x40a52a
mov rcx, rbx
call sym.sqlite3_free
mov r8d, r12d
mov rdx, r13
lea rcx, str._s_idx__08x
call sym.sqlite3_mprintf
test rax, rax
mov rbx, rax
je 0x40a5f1
lea rcx, str.SELECT_count___FROM_sqlite_schema_WHERE_name_Q_AND_type_in__index_table_view_
mov rdx, rax
call sym.sqlite3_mprintf
mov r9, qword [rsp + 0x40]
mov qword [rsp + 0x20], 0
lea r8, [sym.countNonzeros]
mov rcx, qword [rsp + 0x38]
mov rdx, rax
mov r14, rax
mov dword [rsp + 0x78], 0
call sym.sqlite3_exec
test eax, eax
mov dword [rsp + 0x68], eax
je 0x40a5cd
lea rdx, str.src_shell.c
mov r8d, 0x2d11
lea rcx, str.rcSQLITE_OK
call sym._assert
mov rcx, r14
call sym.sqlite3_free
cmp dword [rsp + 0x78], 0
je 0x40a60a
inc esi
cmp esi, 0x32
jne 0x40a522
mov dword [rsp + 0x68], 0x305
jmp 0x40a5fd
test esi, esi
jne 0x40a5e7
mov dword [rsp + 0x68], 7
mov rcx, rbp
call sym.sqlite3_free
jmp 0x40a696
test r15d, r15d
mov r9, rbp
mov r8, r13
lea rax, str.CREATE_INDEX__s_ON__s__s_
mov rdx, rbx
lea rcx, str.CREATE_INDEX___w__ON___w___s_
cmove rcx, rax
call sym.sqlite3_mprintf
test rax, rax
mov rsi, rax
jne 0x40a63f
mov dword [rsp + 0x68], 7
jmp 0x40a681
mov rax, qword [rdi + 0x48]
xor r9d, r9d
xor r8d, r8d
mov rdx, rsi
mov rcx, qword [rsp + 0x38]
mov qword [rsp + 0x20], rax
call sym.sqlite3_exec
test eax, eax
mov dword [rsp + 0x68], eax
je 0x40a66d
mov dword [rsp + 0x68], 0x305
jmp 0x40a681
lea rdx, [rdi + 0x58]
mov r9, rsi
mov r8, rbx
lea rcx, [rsp + 0x68]
call sym.idxHashAdd
mov rcx, rbx
call sym.sqlite3_free
mov rcx, rsi
call sym.sqlite3_free
jmp 0x40a5fd
mov eax, dword [rsp + 0x68]
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret