Function at 0x140161b60
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xe8
movzx r15d, byte [rcx + 0x40]
mov rdi, qword [rcx]
cmp r15d, 1
mov r14, rcx
mov dword [rsp + 0xac], edx
mov word [rsp + 0xa8], dx
mov byte [rsp + 0xab], r15b
jle 0x140162390
xor eax, eax
cmp r15d, 2
setne al
setne bl
lea eax, [rax + rax*4 + 5]
movzx ebx, bl
lea rbx, [rbx + rbx*4 + 5]
mov dword [rsp + 0x68], eax
mov rdx, qword [r14 + 0x10]
test rdx, rdx
je 0x140161bdd
cmp word [rsp + 0xac], 0
je 0x140161bdd
movsxd rbp, dword [rdx]
mov rcx, rbp
mov dword [rsp + 0x6c], ebp
add ecx, ecx
jmp 0x140161be9
xor ecx, ecx
xor ebp, ebp
mov dword [rsp + 0x6c], 0
movzx r12d, byte [rsp + 0xab]
lea rdx, [r12 + 4]
mov qword [rsp + 0xb0], r12
imul edx, eax
shl edx, 4
add edx, ecx
mov rcx, qword [rdi]
movsxd rdx, edx
call sym.sqlite3DbMallocRawNN
test rax, rax
mov r13, rax
je 0x1401624e4
shl rbx, 5
lea rsi, [rax + rbx]
mov eax, dword [rsp + 0x68]
lea r9, [rsi + rbx]
mov qword [rsi], 0
mov qword [rsi + 8], 0
lea rbx, [r12*8]
mov rdx, r9
mov qword [rsi + 0x10], 0
lea r8d, [rax + rax]
mov qword [rsi + 0x18], 0
mov rax, r13
mov rcx, r8
shl rcx, 5
add rcx, r13
mov qword [rax + 0x18], rdx
add rax, 0x20
add rdx, rbx
cmp rax, rcx
jne 0x140161c69
mov edx, dword [rsp + 0x6c]
test edx, edx
jne 0x1401623a7
mov eax, dword [rdi + 0xd0]
mov edx, 0x30
mov qword [rsp + 0x80], 0
cmp eax, edx
cmova eax, edx
test r15d, r15d
mov word [rsi + 0x10], ax
je 0x1401623e7
xor eax, eax
xor r12d, r12d
mov qword [rsp + 0x48], r13
mov ebp, 1
mov qword [rsp + 0xc0], r13
mov rdx, rsi
mov r13d, r12d
mov qword [rsp + 0x50], 0
mov word [rsp + 0x7e], ax
mov dword [rsp + 0x8c], 0
mov qword [rsp + 0xb8], rdi
mov dword [rsp + 0x9c], r15d
mov qword [rsp + 0xc8], rbx
mov qword [rsp + 0x58], r14
mov eax, dword [rsp + 0x50]
test ebp, ebp
mov dword [rsp + 0x88], eax
je 0x14016203d
mov rax, qword [rsp + 0x50]
movsxd rbp, ebp
mov rdi, rdx
mov r15d, r13d
shl rbp, 5
mov qword [rsp + 0xa0], rdx
lea rsi, [rdx + rbp]
xor ebp, ebp
mov qword [rsp + 0x70], rsi
shl rax, 3
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0xd8]
mov qword [rsp + 0x90], rax
nop word [rax + rax]
mov rax, qword [rsp + 0x58]
mov rbx, qword [rax + 0x58]
test rbx, rbx
jne 0x140161d7d
jmp 0x140162020
mov rbx, qword [rbx + 0x50]
test rbx, rbx
je 0x140162020
mov r13, qword [rdi]
mov rax, r13
not rax
and rax, qword [rbx]
jne 0x140161d70
mov r12, qword [rbx + 8]
test r13, r12
jne 0x140161d70
test byte [rbx + 0x39], 0x40
movzx esi, word [rdi + 0x10]
je 0x140161da4
cmp si, 2
jle 0x140161d70
movzx edx, word [rbx + 0x14]
or r13, r12
movsx ecx, word [rbx + 0x12]
add edx, esi
movsx edx, dx
call sym.sqlite3LogEstAdd
movsx edx, word [rdi + 0x14]
movsx ecx, ax
call sym.sqlite3LogEstAdd
movzx r12d, byte [rdi + 0x16]
add si, word [rbx + 0x16]
mov r14d, eax
test r12b, r12b
mov r10d, esi
js 0x140161f50
mov rax, qword [rdi + 8]
mov qword [rsp + 0xd8], rax
movsx edx, r12b
cmp dword [rsp + 0x6c], edx
jle 0x140161fa7
mov rcx, qword [rsp + 0x80]
movsx rax, r12b
lea r8, [rcx + rax*2]
movzx eax, word [r8]
test ax, ax
je 0x1401620a3
movsx edx, ax
movsx ecx, r14w
call sym.sqlite3LogEstAdd
cmp qword [rsp + 0x50], 0
mov edx, r14d
lea r14d, [rax + 3]
je 0x140161fb7
test ebp, ebp
je 0x140161fd8
mov rsi, qword [rsp + 0x48]
xor eax, eax
jmp 0x140161e57
add eax, 1
add rsi, 0x20
cmp eax, ebp
je 0x140161fe0
cmp r13, qword [rsi]
jne 0x140161e48
mov ecx, r12d
xor cl, byte [rsi + 0x16]
js 0x140161e48
cmp ebp, eax
jle 0x140161fe0
cmp r14w, word [rsi + 0x12]
jg 0x140161d70
je 0x140162083
mov rax, qword [rdi]
or rax, qword [rbx + 8]
mov word [rsi + 0x14], dx
mov byte [rsi + 0x16], r12b
mov rcx, qword [rsi + 0x18]
mov rdx, qword [rdi + 0x18]
movq xmm0, rax
movzx eax, r10w
mov r10d, r14d
mov r14, qword [rsp + 0x60]
shl r10d, 0x10
movhps xmm0, qword [rsp + 0xd8]
or r10d, eax
movups xmmword [rsi], xmm0
mov dword [rsi + 0x10], r10d
mov r8, r14
call sym.memcpy
mov rax, qword [rsi + 0x18]
cmp dword [rsp + 0x68], ebp
mov qword [rax + r14], rbx
jg 0x140161d70
mov rax, qword [rsp + 0x48]
mov r8d, dword [rsp + 0x68]
movzx r9d, word [rax + 0x10]
add rax, 0x20
movzx r15d, word [rax - 0xe]
cmp r8d, 1
mov word [rsp + 0x7e], r9w
je 0x1401621ae
xor r10d, r10d
mov edx, 1
jmp 0x140161f2b
movzx r9d, word [rax + 0x14]
mov r15d, ecx
mov r10d, edx
add edx, 1
add rax, 0x20
cmp r8d, edx
je 0x140162070
movzx ecx, word [rax + 0x12]
cmp cx, r15w
jg 0x140161f10
jne 0x140161f1b
movzx r11d, word [rax + 0x14]
cmp r11w, r9w
jle 0x140161f1b
mov r9d, r11d
jmp 0x140161f15
mov rax, qword [rsp + 0x58]
mov r8, rdi
mov dword [rsp + 0x78], r10d
mov rcx, qword [rsp + 0x90]
mov qword [rsp + 0xd8], 0
mov rdx, qword [rax + 0x10]
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x30], rcx
mov ecx, dword [rsp + 0x88]
mov dword [rsp + 0x20], ecx
movzx r9d, word [rax + 0x3c]
mov rcx, rax
call dbg.wherePathSatisfiesOrderBy
mov r10d, dword [rsp + 0x78]
test al, al
mov r12d, eax
jns 0x140161de9
cmp qword [rsp + 0x50], 0
lea edx, [r14 - 2]
jne 0x140161e33
test byte [rbx + 0x3b], 2
je 0x140161e33
lea r10d, [rsi - 0x1e]
sub r14d, 0xa
test ebp, ebp
jne 0x140161e3b
nop dword [rax]
movsxd r9, ebp
add ebp, 1
jmp 0x140162005
cmp dword [rsp + 0x68], ebp
jg 0x140161fd8
cmp r14w, r15w
jg 0x140161d70
jne 0x140161ffd
cmp dx, word [rsp + 0x7e]
jge 0x140161d70
movsxd r9, dword [rsp + 0x8c]
mov rax, qword [rsp + 0x48]
shl r9, 5
lea rsi, [rax + r9]
jmp 0x140161e7d
mov rax, qword [rsp + 0x70]
add rdi, 0x20
cmp rdi, rax
jne 0x140161d58
mov rdx, qword [rsp + 0xa0]
mov r13d, r15d
add qword [rsp + 0x50], 1
mov rax, rdx
mov rdi, qword [rsp + 0x50]
cmp dword [rsp + 0x9c], edi
mov rdx, qword [rsp + 0x48]
jle 0x1401621be
mov qword [rsp + 0x48], rax
jmp 0x140161d01
mov dword [rsp + 0x8c], r10d
mov word [rsp + 0x7e], r9w
jmp 0x140161d70
cmp word [rsi + 0x10], r10w
jl 0x140161d70
jne 0x140161e7d
cmp dx, word [rsi + 0x14]
jl 0x140161e7d
jmp 0x140161d70
mov r9, qword [rsp + 0x58]
mov dword [rsp + 0x98], edx
mov rax, qword [r9 + 0x20]
mov rax, qword [rax + 0x20]
mov ecx, dword [rax]
add ecx, 0x3b
movsxd rax, ecx
imul rax, rax, 0xffffffff88888889
shr rax, 0x20
add eax, ecx
sar ecx, 0x1f
sar eax, 4
sub eax, ecx
movsxd rcx, eax
call sym.sqlite3LogEst
movzx ecx, word [rsp + 0xa8]
movzx r9d, word [r9 + 0x3c]
lea r11d, [rax + rcx]
mov eax, r9d
and ax, 0x4000
test r12b, r12b
mov word [rsp + 0x78], ax
jne 0x14016217b
cmp word [rsp + 0x78], 0
je 0x140162133
add r11d, 0xa
mov rax, qword [rsp + 0x58]
movzx ecx, word [rsp + 0xa8]
movzx eax, word [rax + 0x3e]
cmp cx, ax
cmovle eax, ecx
cmp ax, 0xa
jg 0x140162152
mov eax, r11d
mov word [r8], r11w
jmp 0x140161e14
test r9w, 0x100
movzx eax, word [rsp + 0xa8]
je 0x140162121
cmp ax, 0xa
jle 0x140162127
sub eax, 0xa
cmp ax, 0xa
jle 0x140162127
movsx rax, ax
bsr rdx, rax
lea ecx, [rdx - 3]
shr rax, cl
lea ecx, [rcx + rcx*4]
and eax, 7
lea edx, [r11 + rcx*2 - 3]
lea rcx, [0x140342970]
add dx, word [rcx + rax*2]
mov r11d, edx
jmp 0x140162127
mov ecx, dword [rsp + 0x6c]
mov edx, dword [rsp + 0x98]
mov eax, ecx
sub eax, edx
imul eax, eax, 0x64
cdq
idiv ecx
movsxd rcx, eax
call sym.sqlite3LogEst
cmp word [rsp + 0x78], 0
lea r11d, [r11 + rax - 0x42]
je 0x140162133
add r11d, 0x10
jmp 0x14016210a
mov dword [rsp + 0x8c], 0
jmp 0x140161d70
test ebp, ebp
mov rdi, qword [rsp + 0xb8]
mov r15d, dword [rsp + 0x9c]
mov r13, qword [rsp + 0xc0]
mov rbx, qword [rsp + 0xc8]
mov r14, qword [rsp + 0x58]
je 0x1401624d0
cmp ebp, 1
je 0x14016221f
mov rcx, qword [rsp + 0x48]
lea edx, [rbp - 2]
shl rdx, 5
lea rax, [rcx + 0x20]
lea rdx, [rcx + rdx + 0x40]
movzx esi, word [rcx + 0x12]
cmp word [rax + 0x12], si
cmovl rcx, rax
add rax, 0x20
cmp rax, rdx
jne 0x140162205
mov qword [rsp + 0x48], rcx
test r15d, r15d
je 0x14016226b
mov rax, qword [rsp + 0x48]
lea rdx, [r14 + 0x364]
mov r8, qword [r14 + 8]
mov rcx, qword [rax + 0x18]
mov rax, qword [rsp + 0xb0]
lea r9, [rcx + rax*8]
mov rax, qword [rcx]
add rcx, 8
add rdx, 0x70
mov qword [rdx - 0x14], rax
movzx eax, byte [rax + 0x10]
mov byte [rdx - 0x34], al
imul rax, rax, 0x68
mov eax, dword [r8 + rax + 0x4c]
mov dword [rdx - 0x70], eax
cmp r9, rcx
jne 0x140162244
movzx eax, word [r14 + 0x3c]
and ax, 0x180
cmp ax, 0x100
je 0x140162314
movzx ecx, byte [r14 + 0x44]
mov rdx, qword [r14 + 0x10]
and ecx, 0xfffffffb
test rdx, rdx
mov byte [r14 + 0x44], cl
je 0x1401622e8
mov rax, qword [rsp + 0x48]
movzx r8d, word [r14 + 0x3c]
movsx eax, byte [rax + 0x16]
test r8b, 0x80
mov byte [r14 + 0x41], al
je 0x1401623fa
cmp eax, dword [rdx]
je 0x1401624f8
mov rcx, qword [r14 + 0x20]
mov rcx, qword [rcx + 0x48]
test rcx, rcx
je 0x1401622ce
mov ecx, dword [rcx]
cmp eax, ecx
jle 0x1401622ce
mov byte [r14 + 0x41], cl
test r8w, 0x200
je 0x1401622e8
movsx eax, byte [r14 + 0x41]
cmp eax, dword [rdx]
jne 0x1401622e8
test r15d, r15d
jne 0x140162502
mov rax, qword [rsp + 0x48]
movzx eax, word [rax + 0x10]
mov word [r14 + 0x48], ax
mov rcx, qword [rdi]
mov rdx, r13
add rsp, 0xe8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.sqlite3DbFreeNN
cmp byte [r14 + 0x43], 0
jne 0x14016227e
cmp word [rsp + 0xac], 0
je 0x14016227e
mov r8, qword [rsp + 0x48]
mov r9d, pe_nt_image_headers64
mov rcx, r14
lea rax, [rsp + 0xd8]
mov rdx, qword [r14 + 0x18]
mov qword [rsp + 0x30], rax
mov rax, qword [r8 + 0x18]
mov rax, qword [rax + rbx - 8]
mov qword [rsp + 0x28], rax
movzx eax, byte [rsp + 0xab]
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [r14 + 0x18]
movsx eax, al
cmp eax, dword [rdx]
jne 0x14016227e
mov byte [r14 + 0x43], 2
jmp 0x14016227e
mov eax, 1
mov ebx, 1
mov dword [rsp + 0x68], 1
jmp 0x140161bbb
imul r8, rbx
xor edx, edx
lea rax, [r9 + r8]
lea r8, [rbp + rbp]
mov rcx, rax
mov qword [rsp + 0x80], rax
call sym.memset
mov eax, dword [rdi + 0xd0]
mov edx, 0x30
cmp eax, edx
cmova eax, edx
test r15d, r15d
mov word [rsi + 0x10], ax
jne 0x1401623f1
movzx eax, byte [rsp + 0x6c]
mov byte [rsi + 0x16], al
mov qword [rsp + 0x48], rsi
jmp 0x14016226b
mov byte [rsi + 0x16], 0xff
jmp 0x140161cae
mov rsi, qword [rsp + 0x48]
test al, al
mov r9, qword [rsi + 8]
mov qword [r14 + 0x68], r9
jle 0x140162432
test r15d, r15d
je 0x1401622ce
cmp al, 1
jne 0x1401622ce
test r8b, 3
je 0x1401622ce
or ecx, 4
mov byte [r14 + 0x44], cl
jmp 0x1401622ce
test r15d, r15d
mov byte [r14 + 0x41], 0
je 0x1401622e8
mov rax, qword [rsi + 0x18]
mov rcx, qword [rax + rbx - 8]
mov eax, dword [rcx + 0x38]
test ah, 0x10
jne 0x1401622ce
and eax, 0x104
cmp eax, 0x104
je 0x1401622ce
lea rax, [rsp + 0xd8]
mov qword [rsp + 0x28], rcx
mov r9d, 0x800
mov r8, rsi
mov qword [rsp + 0x30], rax
mov rcx, r14
movzx eax, byte [rsp + 0xab]
mov qword [rsp + 0xd8], 0
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [r14 + 0x10]
movsx eax, al
cmp eax, dword [rdx]
jne 0x1401624c2
mov rax, qword [rsp + 0xd8]
or byte [r14 + 0x44], 4
mov qword [r14 + 0x68], rax
movzx r8d, word [r14 + 0x3c]
jmp 0x1401622ce
lea rdx, str.no_query_solution
mov rcx, rdi
call dbg.sqlite3ErrorMsg
jmp 0x1401622f6
add rsp, 0xe8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov byte [r14 + 0x43], 2
jmp 0x1401622b7
mov r8, qword [rsp + 0x48]
lea rax, [rsp + 0xd8]
xor r9d, r9d
mov rcx, r14
mov qword [rsp + 0x30], rax
mov qword [rsp + 0xd8], 0
mov rax, qword [r8 + 0x18]
mov rax, qword [rax + rbx - 8]
mov qword [rsp + 0x28], rax
movzx eax, byte [rsp + 0xab]
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [r14 + 0x10]
movsx eax, al
cmp eax, dword [rdx]
jne 0x1401622e8
mov rax, qword [rsp + 0xd8]
or byte [r14 + 0x44], 8
mov qword [r14 + 0x68], rax
jmp 0x1401622e8