Function at 0x14018c160
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, 0x58
mov rbx, qword [rcx + 8]
cmp byte [rcx + 0x11], 0
mov r14, qword [rbx]
mov rdi, rcx
mov r12d, edx
mov r13, r8
je 0x14018c194
add dword [rcx + 0x14], 1
cmp byte [rcx + 0x12], 0
je 0x14018c2c8
movzx eax, byte [rdi + 0x10]
cmp al, 2
je 0x14018c2d9
cmp al, 1
jne 0x14018c1ad
test r12d, r12d
je 0x14018c651
mov rdx, qword [rdi]
movzx eax, word [rbx + 0x28]
test byte [rdx + 0x33], 2
je 0x14018c210
cmp byte [r14 + 0x12], 0
jne 0x14018c210
and eax, 0xfffffffe
mov word [rbx + 0x28], ax
test r12d, r12d
je 0x14018c21f
cmp byte [rbx + 0x24], 2
je 0x14018c223
test al, 0x80
jne 0x14018c223
cmp r12d, 1
jle 0x14018c237
mov rax, qword [rbx + 0x78]
test rax, rax
jne 0x14018c1f9
jmp 0x14018c237
mov rax, qword [rax + 0x10]
test rax, rax
je 0x14018c237
mov rdx, qword [rax]
cmp rdx, rdi
je 0x14018c1f0
mov rax, qword [rdx]
jmp 0x14018c22d
mov edx, eax
and edx, 1
test dx, dx
je 0x14018c1c8
test r12d, r12d
jne 0x14018c296
test al, 0x80
je 0x14018c237
mov rax, qword [rbx + 0x80]
mov rax, qword [rax]
test rax, rax
mov esi, 0x106
jne 0x14018c2a0
mov r8d, 1
mov edx, 1
mov rcx, rdi
call dbg.querySharedCacheTableLock
test eax, eax
mov esi, eax
jne 0x14018c2a0
movzx eax, word [rbx + 0x28]
mov r10d, dword [rbx + 0x40]
and eax, 0xffffffef
test r10d, r10d
mov word [rbx + 0x28], ax
je 0x14018c678
mov rbp, qword [rbx + 0x18]
test rbp, rbp
je 0x14018c3e4
test esi, esi
jne 0x14018c338
test r12d, r12d
je 0x14018c330
test byte [rbx + 0x28], 1
je 0x14018c300
cmp byte [rbx + 0x24], 0
je 0x14018c4f0
mov esi, 8
nop dword [rax + rax]
cmp byte [rdi + 0x11], 0
je 0x14018c2b0
sub dword [rdi + 0x14], 1
je 0x14018c710
mov eax, esi
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
call dbg.btreeLockCarefully
movzx eax, byte [rdi + 0x10]
cmp al, 2
jne 0x14018c1a0
test r13, r13
je 0x14018c2ef
mov rax, qword [rbx + 0x18]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x28]
bswap eax
mov dword [r13], eax
test r12d, r12d
jne 0x14018c6e0
xor esi, esi
jmp 0x14018c2a0
mov esi, dword [r14 + 0x30]
mov rax, qword [rdi]
test esi, esi
movzx eax, byte [rax + 0x66]
jne 0x14018c5b8
cmp al, 1
setne byte [r14 + 0x1a]
cmp byte [r14 + 0x15], 1
je 0x14018c510
mov rcx, rbx
call dbg.newDatabase
mov esi, eax
nop
test esi, esi
je 0x14018c628
movzx r15d, sil
cmp byte [rbx + 0x24], 0
jne 0x14018c376
mov rbp, qword [rbx + 0x18]
test rbp, rbp
je 0x14018c500
mov rcx, qword [rbp + 0x70]
mov qword [rbx + 0x18], 0
mov rbp, qword [rcx + 0x28]
call dbg.sqlite3PcacheRelease
mov rax, qword [rbp + 0x140]
cmp qword [rax + 0x18], 0
je 0x14018c618
cmp r15d, 5
jne 0x14018c2a0
cmp byte [rbx + 0x24], 0
jne 0x14018c2a0
mov rbp, qword [rbx + 8]
mov rax, qword [rbp + 0x288]
test rax, rax
je 0x14018c2a0
mov edx, dword [rbp + 0x298]
test edx, edx
js 0x14018c2a0
mov rcx, qword [rbp + 0x290]
call rax
test eax, eax
jne 0x14018c3d0
mov dword [rbp + 0x298], 0xffffffff
jmp 0x14018c2a0
add dword [rbp + 0x298], 1
mov rbp, qword [rbx + 0x18]
test rbp, rbp
jne 0x14018c275
mov rcx, qword [rbx]
call dbg.sqlite3PagerSharedLock
test eax, eax
mov esi, eax
movzx r15d, al
jne 0x14018c33c
xor r9d, r9d
mov edx, 1
mov rcx, rbx
lea r8, [rsp + 0x48]
call sym.btreeGetPage
test eax, eax
mov esi, eax
jne 0x14018c338
mov rbp, qword [rsp + 0x48]
mov rcx, qword [rbx]
mov r10, qword [rbp + 0x50]
mov r11d, dword [rcx + 0x20]
mov eax, dword [r10 + 0x1c]
mov r8d, r11d
test eax, eax
je 0x14018c442
mov edx, dword [r10 + 0x18]
cmp dword [r10 + 0x5c], edx
je 0x14018c730
mov rax, qword [rbx + 8]
test byte [rax + 0x33], 2
jne 0x14018c455
test r8d, r8d
jne 0x14018c810
mov r9d, dword [rbx + 0x38]
xor r8d, r8d
lea eax, [r9 - 0xc]
mov r10d, 0x80808081
movzx r9d, r9w
mov qword [rbx + 0x18], rbp
movq xmm0, qword [0x1403491a0]
mov ecx, eax
shl eax, 6
mov dword [rbx + 0x40], r8d
shl ecx, 5
mov edx, eax
imul rcx, r10
imul rdx, r10
shr rcx, 0x27
movzx ecx, cx
shr rdx, 0x27
mov rax, rcx
movzx edx, dx
shl rax, 0x10
or rax, r9
shl rax, 0x10
or rax, rcx
shl rax, 0x10
or rax, rdx
mov edx, 0x7f
movq xmm1, rax
paddw xmm0, xmm1
pextrw eax, xmm0, 0
cmp ax, dx
movq qword [rbx + 0x2a], xmm0
cmova eax, edx
mov byte [rbx + 0x25], al
jmp 0x14018c275
cmp byte [rbx + 0x24], 0
jne 0x14018c296
mov rbp, qword [rbx + 0x18]
test rbp, rbp
je 0x14018c296
nop
mov r15d, 8
mov esi, 8
jmp 0x14018c34f
cmp r15d, 5
je 0x14018c38a
jmp 0x14018c2a0
mov rbp, qword [r14 + 0x148]
test rbp, rbp
je 0x14018c85a
cmp byte [r14 + 8], 0
je 0x14018c57c
cmp byte [rbp + 0x3f], 0
jne 0x14018c740
mov edx, 4
mov rcx, r14
call sym.pagerLockDb
test eax, eax
mov esi, eax
jne 0x14018c5b8
mov rsi, qword [r14 + 0x148]
cmp byte [rsi + 0x3f], 0
mov rbp, rsi
jne 0x14018c578
mov rcx, qword [rsi + 8]
mov r9d, 5
mov r8d, 1
movsx edx, word [rsi + 0x3c]
mov rax, qword [rcx]
add edx, 3
call qword [rax + 0x70]
mov rbp, qword [r14 + 0x148]
mov byte [rsi + 0x3f], 1
cmp byte [rbp + 0x42], 0
jne 0x14018c4d8
cmp byte [rbp + 0x3f], 0
jne 0x14018c74a
mov rcx, qword [rbp + 8]
xor edx, edx
mov r9d, 0xa
mov r8d, 1
mov rax, qword [rcx]
call qword [rax + 0x70]
test eax, eax
mov esi, eax
je 0x14018c74a
nop word [rax + rax]
cmp esi, 0x205
jne 0x14018c338
cmp byte [rbx + 0x24], 0
jne 0x14018c720
mov rax, qword [rbx + 0x18]
mov esi, 5
test rax, rax
je 0x14018c38a
mov rcx, qword [rax + 0x70]
mov qword [rbx + 0x18], 0
mov rsi, qword [rcx + 0x28]
call dbg.sqlite3PcacheRelease
mov rax, qword [rsi + 0x140]
cmp qword [rax + 0x18], 0
je 0x14018ca30
mov esi, 5
jmp 0x14018c380
mov rcx, rbp
call dbg.pagerUnlockAndRollback
jmp 0x14018c376
cmp byte [rdi + 0x10], 0
jne 0x14018c63c
add dword [rbx + 0x3c], 1
cmp byte [rdi + 0x11], 0
jne 0x14018c798
test r12d, r12d
movzx eax, byte [rbx + 0x24]
jne 0x14018c688
test al, al
mov byte [rdi + 0x10], 1
je 0x14018c7b8
test r13, r13
je 0x14018c2f8
mov rax, qword [rbx + 0x18]
xor esi, esi
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x28]
bswap eax
mov dword [r13], eax
jmp 0x14018c2a0
or eax, 0x10
mov word [rbx + 0x28], ax
jmp 0x14018c268
cmp al, 1
mov byte [rdi + 0x10], 2
ja 0x14018c694
mov byte [rbx + 0x24], 2
movzx eax, word [rbx + 0x28]
mov qword [rbx + 0x80], rdi
mov rbp, qword [rbx + 0x18]
mov edx, eax
or eax, 0x40
and edx, 0xffffffbf
cmp r12d, 1
cmovg edx, eax
mov word [rbx + 0x28], dx
mov rdx, qword [rbp + 0x50]
mov eax, dword [rdx + 0x1c]
bswap eax
cmp dword [rbx + 0x40], eax
jne 0x14018c7c8
test r13, r13
je 0x14018c6e0
mov eax, dword [rdx + 0x28]
bswap eax
mov dword [r13], eax
nop word cs:[rax + rax]
mov rax, qword [rdi]
mov edx, dword [rax + 0x2f0]
cmp edx, dword [r14 + 0x80]
jle 0x14018c2f8
cmp byte [r14 + 0xa], 0
je 0x14018c2f8
mov rcx, r14
call dbg.pagerOpenSavepoint
mov esi, eax
jmp 0x14018c2a0
mov rcx, rdi
call dbg.unlockBtreeMutex
jmp 0x14018c2b0
mov esi, 0x205
jmp 0x14018c2a0
bswap eax
mov r8d, eax
jmp 0x14018c442
cmp byte [rbp + 0x42], 0
jne 0x14018c4d8
mov rax, qword [rbp + 0x30]
mov byte [rbp + 0x40], 1
lea rcx, [rbp + 0x48]
mov r8d, 0x30
mov rdx, qword [rax]
call sym.memcmp
test eax, eax
jne 0x14018c898
mov eax, dword [r14 + 0x20]
mov byte [r14 + 0x15], 2
mov qword [r14 + 0x60], 0
movd xmm2, eax
mov dword [r14 + 0x2c], eax
pshufd xmm0, xmm2, 0xe0
movq qword [r14 + 0x24], xmm0
jmp 0x14018c325
mov byte [rdi + 0x3c], 1
mov rax, qword [rbx + 0x78]
mov qword [rdi + 0x40], rax
lea rax, [rdi + 0x30]
mov qword [rbx + 0x78], rax
jmp 0x14018c63c
mov byte [rbx + 0x24], 1
jmp 0x14018c651
mov rcx, qword [rbp + 0x70]
call dbg.sqlite3PagerWrite
test eax, eax
mov esi, eax
jne 0x14018c2a0
mov eax, dword [rbx + 0x40]
test r13, r13
mov rdx, qword [rbp + 0x50]
bswap eax
mov dword [rdx + 0x1c], eax
je 0x14018c6e0
mov rax, qword [rbx + 0x18]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x28]
bswap eax
mov dword [r13], eax
jmp 0x14018c6e0
movabs rax, 0x66206574694c5153
cmp qword [r10], rax
je 0x14018c8bf
mov r15d, 0x1a
mov esi, 0x1a
mov rcx, qword [rbp + 0x70]
mov rbp, qword [rcx + 0x28]
call dbg.sqlite3PcacheRelease
mov rax, qword [rbp + 0x140]
cmp qword [rax + 0x18], 0
je 0x14018c9a1
mov qword [rbx + 0x18], 0
jmp 0x14018c33c
mov edx, 2
mov rcx, r14
call sym.pagerLockDb
cmp r12d, 1
mov esi, eax
jle 0x14018c886
test eax, eax
jne 0x14018c5b8
mov edx, 4
mov rcx, r14
call dbg.pager_wait_on_lock
mov esi, eax
test esi, esi
je 0x14018c76c
jmp 0x14018c5b8
cmp byte [rbp + 0x3f], 0
jne 0x14018c8b6
mov rcx, qword [rbp + 8]
mov r9d, 9
mov r8d, 1
xor edx, edx
mov rax, qword [rcx]
call qword [rax + 0x70]
mov byte [rbp + 0x40], 0
jmp 0x14018c5c4
movabs rax, 0x332074616d726f
cmp qword [r10 + 8], rax
jne 0x14018c823
cmp byte [r10 + 0x12], 2
jbe 0x14018c8df
or word [rbx + 0x28], 1
cmp byte [r10 + 0x13], 2
ja 0x14018c823
je 0x14018c9ae
cmp word [r10 + 0x15], 0x2040
jne 0x14018c823
cmp byte [r10 + 0x17], 0x20
jne 0x14018c823
movzx eax, byte [r10 + 0x10]
movzx edx, byte [r10 + 0x11]
shl eax, 8
shl edx, 0x10
or eax, edx
lea edx, [rax - 1]
mov r15d, eax
test edx, eax
jne 0x14018c823
lea edx, [rax - 0x101]
cmp edx, 0xfeff
ja 0x14018c823
or word [rbx + 0x28], 2
mov r9d, r15d
movzx eax, byte [r10 + 0x14]
sub r9d, eax
cmp r15d, dword [rbx + 0x34]
mov dword [rsp + 0x30], eax
jne 0x14018ca3d
cmp r11d, r8d
jae 0x14018c977
mov rax, qword [rbx + 8]
mov r8d, r11d
mov rax, qword [rax + 0x30]
and eax, 0x10000001
cmp rax, 1
jne 0x14018cacc
cmp r9d, 0x1df
jbe 0x14018c823
mov dword [rbx + 0x38], r9d
mov eax, dword [r10 + 0x34]
test eax, eax
setne byte [rbx + 0x21]
mov edx, dword [r10 + 0x40]
test edx, edx
setne byte [rbx + 0x22]
jmp 0x14018c45c
mov rcx, rbp
call dbg.pagerUnlockAndRollback
jmp 0x14018c84d
test byte [rbx + 0x28], 0x20
jne 0x14018c8f0
lea rdx, [rsp + 0x44]
mov dword [rsp + 0x3c], r11d
mov dword [rsp + 0x38], r8d
mov qword [rsp + 0x30], r10
mov dword [rsp + 0x44], 0
call dbg.sqlite3PagerOpenWal
mov r10, qword [rsp + 0x30]
test eax, eax
mov r8d, dword [rsp + 0x38]
mov r11d, dword [rsp + 0x3c]
jne 0x14018cb06
mov r9d, dword [rsp + 0x44]
test r9d, r9d
jne 0x14018c8f0
mov rcx, qword [rbp + 0x70]
mov rsi, qword [rcx + 0x28]
call dbg.sqlite3PcacheRelease
mov rax, qword [rsi + 0x140]
cmp qword [rax + 0x18], 0
je 0x14018cb11
mov rbp, qword [rbx + 0x18]
xor esi, esi
jmp 0x14018c26c
mov rcx, rsi
call dbg.pagerUnlockAndRollback
jmp 0x14018c607
mov rcx, qword [rbp + 0x70]
mov dword [rsp + 0x38], r9d
mov rsi, qword [rcx + 0x28]
call dbg.sqlite3PcacheRelease
mov r9d, dword [rsp + 0x38]
mov rdx, qword [rsi + 0x140]
cmp qword [rdx + 0x18], 0
je 0x14018cabd
mov rcx, qword [rbx + 0x88]
movd xmm0, r15d
movd xmm3, r9d
punpckldq xmm0, xmm3
lea rsi, [rbx + 0x34]
movq qword [rbx + 0x34], xmm0
test rcx, rcx
je 0x14018ca9e
sub rcx, 4
mov qword [rbx + 0x88], rcx
call dbg.pcache1Free
xor ecx, ecx
mov qword [rbx + 0x88], rcx
mov rcx, qword [rbx]
mov rdx, rsi
mov r8d, dword [rsp + 0x30]
call dbg.sqlite3PagerSetPagesize
test eax, eax
mov esi, eax
je 0x14018c268
jmp 0x14018c338
mov rcx, rsi
call dbg.pagerUnlockAndRollback
mov r9d, dword [rsp + 0x38]
jmp 0x14018ca62
mov r9d, 0x11ac1
mov ecx, 0xb
mov r15d, 0xb
lea rax, [0x1403373dc]
mov esi, 0xb
mov qword [rsp + 0x20], rax
lea r8, str.database_corruption
lea rdx, str._s_at_line__d_of___.10s_
call dbg.sqlite3_log
jmp 0x14018c82e
movzx r15d, al
mov esi, eax
jmp 0x14018c82e
mov rcx, rsi
call dbg.pagerUnlockAndRollback
jmp 0x14018ca1d