Function at 0x140182b80
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, 0xd8
mov rbx, qword [rcx]
movzx esi, byte [rcx + 0x40]
mov r14d, esi
mov qword [rsp + 0x50], rcx
mov edi, edx
mov word [rsp + 0x8a], dx
mov qword [rsp + 0x80], rbx
cmp esi, 1
jle 0x1401833f0
xor eax, eax
cmp esi, 2
setne al
setne bl
lea eax, [rax + rax*4 + 5]
movzx ebx, bl
mov dword [rsp + 0x6c], eax
lea rbx, [rbx + rbx*4 + 5]
mov rcx, qword [rsp + 0x50]
mov rdx, qword [rcx + 0x10]
test rdx, rdx
je 0x140182bf9
test di, di
je 0x140182bf9
movsxd rbp, dword [rdx]
mov rcx, rbp
mov dword [rsp + 0x5c], ebp
add ecx, ecx
jmp 0x140182c05
mov dword [rsp + 0x5c], 0
xor ecx, ecx
xor ebp, ebp
movzx r15d, r14b
lea rdx, [r15 + 4]
imul edx, eax
mov rax, qword [rsp + 0x80]
shl edx, 4
add edx, ecx
mov rcx, qword [rax]
movsxd rdx, edx
call sym.sqlite3DbMallocRawNN
mov qword [rsp + 0xa0], rax
mov rdx, rax
test rax, rax
je 0x14018356f
mov rax, rbx
pxor xmm0, xmm0
lea rbx, [r15*8]
shl rax, 5
lea r11, [rdx + rax]
lea r10, [r11 + rax]
mov eax, dword [rsp + 0x6c]
movups xmmword [r11], xmm0
movups xmmword [r11 + 0x10], xmm0
lea ecx, [rax + rax]
mov rax, rdx
mov r9, rcx
shl rcx, 5
add rcx, rdx
mov rdx, r10
mov qword [rax + 0x18], rdx
add rax, 0x20
add rdx, rbx
cmp rax, rcx
jne 0x140182c77
mov r12d, dword [rsp + 0x5c]
test r12d, r12d
jne 0x140183407
mov rax, qword [rsp + 0x80]
mov edx, 0x30
mov qword [rsp + 0x70], 0
movzx eax, word [rax + 0xe0]
cmp ax, dx
cmovg eax, edx
mov word [r11 + 0x10], ax
test esi, esi
je 0x1401834a9
mov r12, qword [rsp + 0xa0]
xor edx, edx
xor r8d, r8d
xor r13d, r13d
mov ebp, 1
mov byte [rsp + 0xb3], r14b
mov rcx, r11
mov word [rsp + 0x88], r8w
mov r14, r12
mov dword [rsp + 0x7c], 0
mov dword [rsp + 0x8c], esi
mov qword [rsp + 0xa8], rbx
mov dword [rsp + 0xb4], edi
mov qword [rsp + 0xb8], r15
mov dword [rsp + 0x78], edx
test ebp, ebp
jle 0x140183070
movsxd rbp, ebp
lea rax, [rdx*8]
mov r15, rcx
mov qword [rsp + 0x90], rcx
shl rbp, 5
mov qword [rsp + 0x48], rax
lea rbx, [rcx + rbp]
mov qword [rsp + 0x98], rdx
xor ebp, ebp
mov qword [rsp + 0x60], rbx
nop dword [rax]
mov rax, qword [rsp + 0x50]
mov r12, qword [rax + 0x58]
test r12, r12
je 0x140183028
mov ebx, dword [rsp + 0x6c]
jmp 0x140182d7e
mov r12, qword [r12 + 0x50]
test r12, r12
je 0x140183028
mov rsi, qword [r15]
mov rax, rsi
not rax
and rax, qword [r12]
jne 0x140182d70
mov r11, qword [r12 + 8]
test rsi, r11
jne 0x140182d70
movzx edi, word [r15 + 0x10]
test byte [r12 + 0x39], 0x40
je 0x140182daa
cmp di, 2
jle 0x140182d70
movzx edx, word [r12 + 0x14]
movsx ecx, word [r12 + 0x12]
or rsi, r11
add edx, edi
movsx edx, dx
call sym.sqlite3LogEstAdd
movsx edx, word [r15 + 0x14]
movsx ecx, ax
call sym.sqlite3LogEstAdd
movzx r11d, byte [r15 + 0x16]
add di, word [r12 + 0x16]
mov r10d, eax
test r11b, r11b
js 0x140182f80
mov rax, qword [r15 + 8]
mov qword [rsp + 0xc8], rax
movsx edx, r11b
cmp dword [rsp + 0x5c], edx
jle 0x140182fd1
mov rcx, qword [rsp + 0x70]
movsx rax, r11b
lea r9, [rcx + rax*2]
movzx r8d, word [r9]
test r8w, r8w
je 0x1401830cb
movsx ecx, r10w
movsx edx, r8w
call sym.sqlite3LogEstAdd
mov r9d, r10d
lea r10d, [rax + 3]
test ebp, ebp
jle 0x140182fe0
movsxd rdx, ebp
mov rax, r14
xor ecx, ecx
shl rdx, 5
add rdx, r14
jmp 0x140182e5c
add rax, 0x20
add ecx, 1
cmp rax, rdx
je 0x140182e6d
cmp rsi, qword [rax]
jne 0x140182e50
mov r8d, r11d
xor r8b, byte [rax + 0x16]
js 0x140182e50
mov rdx, rax
cmp ecx, ebp
jl 0x140182ff0
cmp ebx, ebp
jg 0x140182fe0
cmp r10w, r13w
jg 0x140182d70
jne 0x140182e98
cmp r9w, word [rsp + 0x88]
jge 0x140182d70
movsxd rdx, dword [rsp + 0x7c]
shl rdx, 5
add rdx, r14
mov rax, qword [r15]
or rax, qword [r12 + 8]
mov byte [rdx + 0x16], r11b
movq xmm0, rax
cmp dword [rsp + 0x48], 8
mov word [rdx + 0x10], di
movhps xmm0, qword [rsp + 0xc8]
mov word [rdx + 0x12], r10w
mov rax, qword [rdx + 0x18]
mov word [rdx + 0x14], r9w
mov rsi, qword [r15 + 0x18]
movups xmmword [rdx], xmm0
jae 0x140183078
xor edi, edi
test edi, edi
jne 0x1401831c5
mov ecx, dword [rsp + 0x48]
test ecx, ecx
je 0x140182f06
movzx ecx, byte [rsi]
xor edi, edi
mov byte [rax], cl
test edi, edi
jne 0x1401831ed
mov rax, qword [rdx + 0x18]
mov rdi, qword [rsp + 0x48]
mov qword [rax + rdi], r12
cmp ebx, ebp
jg 0x140182d70
movzx r8d, word [r14 + 0x10]
movzx r13d, word [r14 + 0x12]
lea rax, [r14 + 0x20]
mov word [rsp + 0x88], r8w
cmp ebx, 1
je 0x1401831e0
xor r9d, r9d
mov edx, 1
jmp 0x140182f62
movzx r8d, word [rax + 0x14]
mov r13d, ecx
mov r9d, edx
add edx, 1
add rax, 0x20
cmp ebx, edx
je 0x1401830b8
movzx ecx, word [rax + 0x12]
cmp cx, r13w
jg 0x140182f48
jne 0x140182f53
movzx r10d, word [rax + 0x14]
cmp r10w, r8w
jle 0x140182f53
mov r8d, r10d
jmp 0x140182f4d
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0xc8]
mov r8, r15
mov dword [rsp + 0x68], r10d
mov qword [rsp + 0xc8], 0
mov rdx, qword [rcx + 0x10]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x78]
mov qword [rsp + 0x28], r12
mov dword [rsp + 0x20], eax
movzx r9d, word [rcx + 0x3c]
call dbg.wherePathSatisfiesOrderBy
mov r10d, dword [rsp + 0x68]
test al, al
mov r11d, eax
jns 0x140182df3
lea r9d, [r10 - 2]
test ebp, ebp
jg 0x140182e38
nop dword [rax]
movsxd rdx, ebp
add ebp, 1
jmp 0x140182e9d
cmp r10w, word [rdx + 0x12]
jg 0x140182d70
jne 0x140182ea4
cmp di, word [rdx + 0x10]
jg 0x140182d70
jne 0x140182ea4
cmp r9w, word [rdx + 0x14]
jl 0x140182ea4
jmp 0x140182d70
mov rax, qword [rsp + 0x60]
add r15, 0x20
cmp r15, rax
jne 0x140182d58
mov rcx, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x98]
mov rax, rcx
add rdx, 1
mov rcx, r14
cmp dword [rsp + 0x8c], edx
jle 0x140183206
mov dword [rsp + 0x78], edx
mov r14, rax
test ebp, ebp
jg 0x140182d23
xor ebp, ebp
jmp 0x14018304a
mov rcx, qword [rsi]
lea rdi, [rax + 8]
and rdi, 0xfffffffffffffff8
mov qword [rax], rcx
mov r9, qword [rsp + 0x48]
mov ecx, r9d
mov r8, qword [rsi + rcx - 8]
mov qword [rax + rcx - 8], r8
sub rax, rdi
mov ecx, r9d
add ecx, eax
sub rsi, rax
mov eax, ecx
shr eax, 3
mov ecx, eax
rep movsq qword [rdi], qword [rsi]
jmp 0x140182f02
mov dword [rsp + 0x7c], r9d
mov word [rsp + 0x88], r8w
jmp 0x140182d70
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x68], edx
mov rax, qword [rax + 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 + 0x8a]
lea r8d, [rax + rcx]
test r11b, r11b
jne 0x14018318f
mov rax, qword [rsp + 0x50]
movzx eax, word [rax + 0x3c]
test ah, 0x40
je 0x14018314a
add r8d, 0xa
mov rax, qword [rsp + 0x50]
movzx ecx, word [rsp + 0x8a]
movzx eax, word [rax + 0x3e]
cmp cx, ax
cmovle eax, ecx
cmp ax, 0xa
jg 0x140183166
mov word [r9], r8w
jmp 0x140182e1c
test ah, 1
movzx eax, word [rsp + 0x8a]
je 0x14018313b
cmp ax, 0xa
jle 0x140183141
sub eax, 0xa
cmp ax, 0xa
jle 0x140183141
movsx rax, ax
bsr rdx, rax
lea ecx, [rdx - 3]
shr rax, cl
lea edx, [rcx + rcx*4]
lea rcx, [0x140398110]
and eax, 7
lea edx, [r8 + rdx*2 - 3]
add dx, word [rcx + rax*2]
mov r8d, edx
jmp 0x140183141
mov ecx, dword [rsp + 0x5c]
mov edx, dword [rsp + 0x68]
mov eax, ecx
sub eax, edx
imul eax, eax, 0x64
cdq
idiv ecx
movsxd rcx, eax
call sym.sqlite3LogEst
lea r8d, [r8 + rax - 0x42]
mov rax, qword [rsp + 0x50]
movzx eax, word [rax + 0x3c]
test ah, 0x40
je 0x14018314a
add r8d, 0x10
jmp 0x140183124
mov ecx, dword [rsi]
mov dword [rax], ecx
mov ecx, dword [rsp + 0x48]
mov r8d, dword [rsi + rcx - 4]
mov dword [rax + rcx - 4], r8d
mov rax, qword [rdx + 0x18]
jmp 0x140182f06
mov dword [rsp + 0x7c], 0
jmp 0x140182d70
mov ecx, dword [rsp + 0x48]
movzx r8d, word [rsi + rcx - 2]
mov word [rax + rcx - 2], r8w
mov rax, qword [rdx + 0x18]
jmp 0x140182f06
mov r12, r14
mov esi, dword [rsp + 0x8c]
mov rbx, qword [rsp + 0xa8]
movzx r14d, byte [rsp + 0xb3]
mov edi, dword [rsp + 0xb4]
mov r15, qword [rsp + 0xb8]
test ebp, ebp
je 0x140183550
cmp ebp, 1
jle 0x140183264
lea edx, [rbp - 2]
lea rax, [rcx + 0x20]
shl rdx, 5
lea rdx, [rcx + rdx + 0x40]
movzx ecx, word [r12 + 0x12]
cmp word [rax + 0x12], cx
cmovl r12, rax
add rax, 0x20
cmp rax, rdx
jne 0x14018324d
mov rax, qword [rsp + 0x50]
mov rcx, qword [r12 + 0x18]
mov r8, qword [rax + 8]
lea rdx, [rax + 0x364]
lea r9, [rcx + r15*8]
mov rax, qword [rcx]
add rcx, 8
add rdx, 0x70
mov qword [rdx - 0x14], rax
movzx eax, byte [rax + 0x10]
lea r10, [rax + rax*2]
mov byte [rdx - 0x34], al
lea rax, [rax + r10*4]
mov eax, dword [r8 + rax*8 + 0x4c]
mov dword [rdx - 0x70], eax
cmp r9, rcx
jne 0x14018327d
mov rax, qword [rsp + 0x50]
movzx eax, word [rax + 0x3c]
mov word [rsp + 0x48], ax
and ax, 0x180
cmp ax, 0x100
je 0x140183378
mov rax, qword [rsp + 0x50]
movzx edi, byte [rax + 0x44]
mov rdx, qword [rax + 0x10]
mov ecx, edi
mov byte [rsp + 0x48], dil
mov rdi, rax
and ecx, 0xfffffffb
mov byte [rax + 0x44], cl
test rdx, rdx
je 0x14018333e
movsx eax, byte [r12 + 0x16]
movzx r8d, word [rdi + 0x3c]
mov byte [rdi + 0x41], al
test r8b, 0x80
je 0x14018345c
cmp eax, dword [rdx]
je 0x140183583
mov rdi, qword [rsp + 0x50]
mov rcx, qword [rdi + 0x20]
mov rcx, qword [rcx + 0x48]
test rcx, rcx
je 0x140183321
mov ecx, dword [rcx]
cmp eax, ecx
jle 0x140183321
mov byte [rdi + 0x41], cl
test r8w, 0x200
je 0x14018333e
mov rax, qword [rsp + 0x50]
movsx eax, byte [rax + 0x41]
cmp eax, dword [rdx]
jne 0x14018333e
test esi, esi
jne 0x14018358c
movzx eax, word [r12 + 0x10]
mov rbx, qword [rsp + 0x50]
mov word [rbx + 0x48], ax
mov rax, qword [rsp + 0x80]
mov rcx, qword [rax]
mov rdx, qword [rsp + 0xa0]
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.sqlite3DbFreeNN
mov rax, qword [rsp + 0x50]
cmp byte [rax + 0x43], 0
jne 0x1401832c4
test di, di
je 0x1401832c4
mov rdx, qword [rax + 0x18]
mov rdi, rax
mov r9d, pe_nt_image_headers64
mov r8, r12
lea rax, [rsp + 0xc8]
mov rcx, rdi
mov qword [rsp + 0x30], rax
mov rax, qword [r12 + 0x18]
mov rax, qword [rax + rbx - 8]
mov qword [rsp + 0x28], rax
movzx eax, r14b
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [rdi + 0x18]
movsx eax, al
cmp eax, dword [rdx]
jne 0x1401832c4
mov rax, qword [rsp + 0x50]
mov byte [rax + 0x43], 2
jmp 0x1401832c4
mov dword [rsp + 0x6c], 1
mov eax, 1
mov ebx, 1
jmp 0x140182bd8
movsxd rax, r9d
xor edx, edx
lea r8, [rbp + rbp]
mov qword [rsp + 0x48], r11
imul rax, rbx
add rax, r10
mov rcx, rax
mov qword [rsp + 0x70], rax
call sym.memset
mov edx, 0x30
mov r11, qword [rsp + 0x48]
mov rax, qword [rsp + 0x80]
movzx eax, word [rax + 0xe0]
cmp ax, dx
cmovg eax, edx
mov word [r11 + 0x10], ax
test esi, esi
je 0x1401834a0
mov byte [r11 + 0x16], 0xff
jmp 0x140182cc5
mov r9, qword [r12 + 8]
mov rdi, qword [rsp + 0x50]
mov qword [rdi + 0x68], r9
test al, al
jle 0x1401834b1
test esi, esi
je 0x140183321
cmp al, 1
jne 0x140183321
test r8b, 3
je 0x140183321
mov rax, qword [rsp + 0x50]
or ecx, 4
mov byte [rax + 0x44], cl
jmp 0x140183321
movzx eax, byte [rsp + 0x5c]
mov byte [r11 + 0x16], al
mov r12, r11
jmp 0x1401832a8
mov byte [rdi + 0x41], 0
test esi, esi
je 0x14018333e
mov rax, qword [r12 + 0x18]
mov rcx, qword [rax + rbx - 8]
mov eax, dword [rcx + 0x38]
test ah, 0x10
jne 0x140183321
not eax
test eax, 0x104
je 0x140183321
lea rax, [rsp + 0xc8]
mov qword [rsp + 0x28], rcx
mov r9d, 0x800
mov r8, r12
mov qword [rsp + 0x30], rax
movzx eax, r14b
mov rcx, rdi
mov qword [rsp + 0xc8], 0
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [rdi + 0x10]
movsx eax, al
cmp eax, dword [rdx]
jne 0x14018353d
mov rdi, qword [rsp + 0x50]
mov rax, qword [rsp + 0xc8]
or byte [rdi + 0x44], 4
mov qword [rdi + 0x68], rax
mov rax, qword [rsp + 0x50]
movzx r8d, word [rax + 0x3c]
jmp 0x140183321
mov rbx, qword [rsp + 0x80]
lea rdx, str.no_query_solution
mov rcx, rbx
call dbg.sqlite3ErrorMsg
mov rax, rbx
jmp 0x140183355
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov byte [rdi + 0x43], 2
jmp 0x140183306
lea rax, [rsp + 0xc8]
xor r9d, r9d
mov r8, r12
mov qword [rsp + 0xc8], 0
mov qword [rsp + 0x30], rax
mov rax, qword [r12 + 0x18]
mov rax, qword [rax + rbx - 8]
mov rbx, qword [rsp + 0x50]
mov qword [rsp + 0x28], rax
movzx eax, r14b
mov rcx, rbx
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call dbg.wherePathSatisfiesOrderBy
mov rdx, qword [rbx + 0x10]
movsx eax, al
cmp eax, dword [rdx]
jne 0x14018333e
mov rbx, qword [rsp + 0x50]
mov rax, qword [rsp + 0xc8]
or byte [rbx + 0x44], 8
mov qword [rbx + 0x68], rax
jmp 0x14018333e