Function at 0x805670
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 rsi, rcx
mov edi, edx
mov r12, r8
mov rbp, qword [rbx]
je 0x80569a
call sym.sqlite3BtreeEnter.part.93
movzx eax, byte [rsi + 0x10]
cmp al, 2
je 0x805860
cmp al, 1
jne 0x8056b2
test edi, edi
je 0x805a6c
mov rdx, qword [rsi]
movzx eax, word [rbx + 0x28]
test byte [rdx + 0x33], 2
je 0x805710
cmp byte [rbp + 0x12], 0
jne 0x805710
and eax, 0xfffffffe
mov word [rbx + 0x28], ax
test edi, edi
je 0x805722
cmp byte [rbx + 0x24], 2
je 0x805726
test al, 0x80
jne 0x805726
cmp edi, 1
jle 0x80573f
mov rax, qword [rbx + 0x78]
test rax, rax
je 0x80573f
mov rcx, qword [rax]
cmp rsi, rcx
jne 0x805d41
mov rax, qword [rax + 0x10]
test rax, rax
je 0x80573f
mov rdx, qword [rax]
cmp rdx, rcx
je 0x8056f4
mov rax, qword [rdx]
jmp 0x805730
test al, 1
je 0x8056cc
test edi, edi
mov r15d, 8
jne 0x8058b0
test al, 0x80
je 0x80573f
mov rax, qword [rbx + 0x80]
mov rax, qword [rax]
test rax, rax
mov r15d, 0x106
jne 0x8058b0
mov r8d, 1
mov edx, 1
mov rcx, rsi
call dbg.querySharedCacheTableLock
test eax, eax
mov r15d, eax
jne 0x8058b0
movzx eax, word [rbx + 0x28]
mov r10d, dword [rbx + 0x40]
and eax, 0xffffffef
test r10d, r10d
mov word [rbx + 0x28], ax
je 0x805a80
movabs r13, 0x66206574694c5153
mov rcx, qword [rbx + 0x18]
jmp 0x8057da
test edi, edi
je 0x8057e8
test byte [rbx + 0x28], 1
je 0x805a21
mov r14d, 8
mov r15d, 8
cmp byte [rbx + 0x24], 0
jne 0x8058b0
lea rcx, [rbx + 0x18]
call sym.unlockBtreeIfUnused.isra.614.part.615
cmp r14d, 5
jne 0x8058b0
cmp byte [rbx + 0x24], 0
jne 0x8058b0
mov rcx, rbx
call dbg.btreeInvokeBusyHandler
test eax, eax
je 0x8058b0
mov rcx, qword [rbx + 0x18]
test rcx, rcx
je 0x805943
test r15d, r15d
je 0x805785
test r15d, r15d
jne 0x805930
cmp byte [rsi + 0x10], 0
jne 0x805805
add dword [rbx + 0x3c], 1
cmp byte [rsi + 0x11], 0
jne 0x805c00
test edi, edi
movzx eax, byte [rbx + 0x24]
je 0x805a60
cmp al, 1
mov byte [rsi + 0x10], 2
ja 0x80581d
mov byte [rbx + 0x24], 2
movzx eax, word [rbx + 0x28]
mov qword [rbx + 0x80], rsi
mov r13, qword [rbx + 0x18]
and eax, 0xffffffbf
mov edx, eax
or edx, 0x40
cmp edi, 2
cmovge eax, edx
mov word [rbx + 0x28], ax
mov rax, qword [r13 + 0x50]
mov eax, dword [rax + 0x1c]
bswap eax
cmp dword [rbx + 0x40], eax
jne 0x805c20
test r12, r12
jne 0x805865
jmp 0x80587e
test r12, r12
je 0x805876
mov rax, qword [rbx + 0x18]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x28]
bswap eax
mov dword [r12], eax
test edi, edi
je 0x805a75
mov rax, qword [rsi]
mov edx, dword [rax + 0x2b0]
cmp edx, dword [rbp + 0x80]
jle 0x805a75
cmp byte [rbp + 0xa], 0
je 0x805a75
mov rcx, rbp
call dbg.pagerOpenSavepoint
mov r15d, eax
nop dword [rax + rax]
cmp byte [rsi + 0x11], 0
je 0x8058c5
mov eax, dword [rsi + 0x14]
sub eax, 1
mov dword [rsi + 0x14], eax
je 0x805b55
mov eax, r15d
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rdx, [rsp + 0x44]
mov rcx, rax
mov dword [rsp + 0x3c], r8d
mov dword [rsp + 0x38], r10d
mov dword [rsp + 0x44], 0
call sym.sqlite3PagerOpenWal
mov r10d, dword [rsp + 0x38]
test eax, eax
mov dword [rsp + 0x34], eax
mov r8d, dword [rsp + 0x3c]
je 0x805e54
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rdx + 0x70]
call dbg.sqlite3PagerUnrefPageOne
mov eax, dword [rsp + 0x34]
mov qword [rbx + 0x18], 0
mov r15d, eax
nop dword [rax + rax]
cmp byte [rbx + 0x24], 0
movzx r14d, r15b
jne 0x8057b2
jmp 0x8057a9
mov rcx, qword [rbx]
call dbg.sqlite3PagerSharedLock
test eax, eax
mov r15d, eax
jne 0x805930
xor r9d, r9d
mov edx, 1
mov rcx, rbx
lea r8, [rsp + 0x48]
call dbg.btreeGetPage
test eax, eax
mov r15d, eax
jne 0x805930
mov rcx, qword [rsp + 0x48]
mov rdx, qword [rbx + 8]
mov rax, qword [rbx]
mov r14, qword [rcx + 0x50]
mov rdx, qword [rdx + 0x30]
mov r8d, dword [rax + 0x1c]
mov r10d, dword [r14 + 0x1c]
and edx, 0x2000000
bswap r10d
test r10d, r10d
je 0x8059a6
mov r9d, dword [r14 + 0x5c]
cmp dword [r14 + 0x18], r9d
je 0x805bc0
test r8d, r8d
je 0x8059b4
test rdx, rdx
je 0x805c45
mov r11d, dword [rbx + 0x38]
xor r10d, r10d
lea edx, [r11 + 0x3fffff4]
mov r9d, 0x80808081
mov qword [rbx + 0x18], rcx
shl edx, 6
mov dword [rbx + 0x40], r10d
mov eax, edx
mul r9d
shr edx, 7
lea r8d, [rdx - 0x17]
lea edx, [r11 + 0x7fffff4]
sub r11d, 0x23
mov word [rbx + 0x2a], r8w
shl edx, 5
mov word [rbx + 0x2e], r11w
mov eax, edx
mul r9d
shr edx, 7
cmp r8w, 0x7f
lea eax, [rdx - 0x17]
mov word [rbx + 0x2c], ax
mov word [rbx + 0x30], ax
mov eax, 0x7f
cmova r8d, eax
mov byte [rbx + 0x25], r8b
jmp 0x8057da
mov r15d, dword [rbp + 0x2c]
test r15d, r15d
jne 0x805b90
mov rax, qword [rsi]
cmp byte [rax + 0x60], 2
sete byte [rbp + 0x19]
cmp byte [rbp + 0x14], 1
je 0x805a90
mov eax, dword [rbx + 0x40]
test eax, eax
jne 0x8057f1
mov rcx, rbx
call sym.newDatabase.part.617
mov r15d, eax
jmp 0x8057e8
test al, al
mov byte [rsi + 0x10], 1
jne 0x805a6c
mov byte [rbx + 0x24], 1
test r12, r12
jne 0x805865
xor r15d, r15d
jmp 0x8058b0
or eax, 0x10
mov word [rbx + 0x28], ax
jmp 0x805775
mov r14, qword [rbp + 0x120]
test r14, r14
je 0x805b62
cmp byte [rbp + 8], 0
je 0x805aeb
cmp byte [r14 + 0x3f], 0
jne 0x805aeb
movzx eax, byte [rbp + 0x15]
cmp al, 3
jbe 0x805c73
cmp al, 5
je 0x805c73
mov r15, r14
cmp byte [r15 + 0x3f], 0
mov r14, r15
jne 0x805ae6
movsx edx, word [r15 + 0x3c]
mov rcx, qword [r15 + 8]
add edx, 3
call sym.walUnlockShared.isra.76.part.77
mov r14, qword [rbp + 0x120]
mov byte [r15 + 0x3f], 1
cmp byte [r14 + 0x42], 0
jne 0x805793
cmp byte [r14 + 0x3f], 0
jne 0x805b15
mov rcx, qword [r14 + 8]
xor edx, edx
mov r8d, 1
call sym.walLockExclusive.isra.78.part.79
test eax, eax
mov r15d, eax
jne 0x805b90
mov rax, qword [r14 + 0x30]
mov byte [r14 + 0x40], 1
lea rcx, [r14 + 0x48]
mov r8d, 0x30
mov rdx, qword [rax]
call sym.memcmp
test eax, eax
jne 0x805d1f
mov eax, dword [rbp + 0x1c]
mov byte [rbp + 0x14], 2
mov qword [rbp + 0x60], 0
mov dword [rbp + 0x28], eax
mov dword [rbp + 0x24], eax
mov dword [rbp + 0x20], eax
jmp 0x805a3f
mov rcx, rsi
call sym.sqlite3BtreeLeave.part.94
jmp 0x8058c5
movzx eax, byte [rbp + 0x15]
cmp al, 5
je 0x805c4d
cmp al, 1
jbe 0x805c4d
cmp edi, 1
jle 0x805b38
mov edx, 4
mov rcx, rbp
call sym.pager_wait_on_lock.part.54
mov r15d, eax
test r15d, r15d
je 0x805b38
cmp r15d, 0x205
jne 0x805930
cmp byte [rbx + 0x24], 0
jne 0x805bf4
lea rcx, [rbx + 0x18]
mov r14d, 5
mov r15d, 5
jmp 0x8057ad
test rdx, rdx
jne 0x8059b4
cmp qword [r14], r13
je 0x805c97
mov rcx, qword [rcx + 0x70]
mov r14d, 0x1a
mov r15d, 0x1a
call dbg.sqlite3PagerUnrefPageOne
mov qword [rbx + 0x18], 0
jmp 0x80579f
mov r15d, 0x205
jmp 0x8058b0
mov byte [rsi + 0x3c], 1
mov rax, qword [rbx + 0x78]
mov qword [rsi + 0x40], rax
lea rax, [rsi + 0x30]
mov qword [rbx + 0x78], rax
jmp 0x805805
mov rcx, qword [r13 + 0x70]
call dbg.sqlite3PagerWrite
test eax, eax
mov r15d, eax
jne 0x8058b0
mov eax, dword [rbx + 0x40]
mov rdx, qword [r13 + 0x50]
bswap eax
mov dword [rdx + 0x1c], eax
jmp 0x805850
mov r10d, r8d
jmp 0x805bc9
mov edx, 2
mov rcx, rbp
call sym.pagerLockDb.part.38
cmp edi, 1
mov r15d, eax
jle 0x805b8b
test eax, eax
jne 0x805b8b
jmp 0x805b7b
mov edx, 4
mov rcx, rbp
call sym.pagerLockDb.part.38
test eax, eax
mov r15d, eax
jne 0x805b90
mov r15, qword [rbp + 0x120]
jmp 0x805ac4
movabs rdx, 0x332074616d726f
cmp qword [r14 + 8], rdx
jne 0x805bd2
cmp byte [r14 + 0x12], 2
jbe 0x805cb7
or word [rbx + 0x28], 1
cmp byte [r14 + 0x13], 2
ja 0x805bd2
jne 0x805cce
test byte [rbx + 0x28], 0x20
je 0x8058d9
mov edx, 3
mov rcx, rbx
mov dword [rsp + 0x38], r8d
mov dword [rsp + 0x34], r10d
call dbg.setDefaultSyncFlag
mov r8d, dword [rsp + 0x38]
mov r10d, dword [rsp + 0x34]
cmp word [r14 + 0x15], 0x2040
je 0x805d49
mov rax, qword [rsp + 0x48]
mov r14d, 0x1a
mov r15d, 0x1a
mov rcx, qword [rax + 0x70]
call dbg.sqlite3PagerUnrefPageOne
mov qword [rbx + 0x18], 0
jmp 0x80579f
cmp byte [r14 + 0x3f], 0
jne 0x805d37
mov rcx, qword [r14 + 8]
mov r8d, 1
xor edx, edx
call sym.walUnlockExclusive.isra.80.part.81
mov byte [r14 + 0x40], 0
jmp 0x805b9d
mov rdx, rcx
jmp 0x805705
cmp byte [r14 + 0x17], 0x20
jne 0x805cf8
movzx edx, byte [r14 + 0x10]
movzx eax, byte [r14 + 0x11]
shl edx, 8
shl eax, 0x10
or edx, eax
lea eax, [rdx - 1]
test eax, edx
jne 0x805cf8
lea eax, [rdx - 0x101]
cmp eax, 0xfeff
ja 0x805cf8
or word [rbx + 0x28], 2
mov r11d, edx
movzx eax, byte [r14 + 0x14]
sub r11d, eax
cmp edx, dword [rbx + 0x34]
jne 0x805dd7
mov rax, qword [rbx + 8]
mov rax, qword [rax + 0x30]
and eax, 0x10000001
cmp rax, 1
je 0x805da7
cmp r8d, r10d
jb 0x805e9d
cmp r11d, 0x1df
mov rcx, qword [rsp + 0x48]
jbe 0x805bd2
mov dword [rbx + 0x38], r11d
mov edx, dword [r14 + 0x34]
test edx, edx
setne byte [rbx + 0x21]
mov r8d, dword [r14 + 0x40]
test r8d, r8d
setne byte [rbx + 0x22]
jmp 0x8059bb
mov rcx, qword [rsp + 0x48]
mov dword [rsp + 0x3c], eax
mov dword [rsp + 0x38], r11d
mov dword [rsp + 0x34], edx
mov rcx, qword [rcx + 0x70]
call dbg.sqlite3PagerUnrefPageOne
mov rcx, qword [rbx + 0x88]
mov r11d, dword [rsp + 0x38]
mov edx, dword [rsp + 0x34]
mov eax, dword [rsp + 0x3c]
test rcx, rcx
mov dword [rbx + 0x38], r11d
mov dword [rbx + 0x34], edx
je 0x805e35
sub rcx, 4
mov dword [rsp + 0x34], eax
mov qword [rbx + 0x88], rcx
call sym.pcache1Free
mov eax, dword [rsp + 0x34]
mov qword [rbx + 0x88], 0
mov rcx, qword [rbx]
lea rdx, [rbx + 0x34]
mov r8d, eax
call dbg.sqlite3PagerSetPagesize
test eax, eax
mov r15d, eax
je 0x8057d6
jmp 0x805930
mov edx, 2
mov rcx, rbx
mov dword [rsp + 0x38], r8d
mov dword [rsp + 0x34], r10d
call dbg.setDefaultSyncFlag
mov r9d, dword [rsp + 0x44]
mov r10d, dword [rsp + 0x34]
mov r8d, dword [rsp + 0x38]
test r9d, r9d
jne 0x805cef
mov rax, qword [rsp + 0x48]
xor r15d, r15d
mov rcx, qword [rax + 0x70]
call dbg.sqlite3PagerUnrefPageOne
mov rcx, qword [rbx + 0x18]
jmp 0x8057da
lea rax, [0x00c4d9dc]
mov r9d, 0x1094d
mov ecx, 0xb
mov qword [rsp + 0x20], rax
lea r8, global_zType.0
mov r14d, 0xb
mov r15d, 0xb
lea rdx, str._s_at_line__d_of___.10s_
call dbg.sqlite3_log
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call dbg.sqlite3PagerUnrefPageOne
mov qword [rbx + 0x18], 0
jmp 0x80579f