Function at 0x46f99d
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, 0x188
mov ebx, 8
cmp byte [rcx + 0x42], 0
mov rsi, rcx
mov qword [rsp + 0x1d8], rdx
mov dword [rsp + 0x1e0], r8d
mov qword [rsp + 0x1e8], r9
mov dword [rsp + 0x88], 0
jne 0x4702ae
mov r8d, 1
mov edx, 1
call sym.walLockExclusive
mov ebx, eax
mov eax, dword [rsp + 0x1e0]
test ebx, ebx
mov dword [rsp + 0x3c], eax
jne 0x46faa8
test eax, eax
mov byte [rsi + 0x41], 1
mov dword [rsp + 0x3c], 0
je 0x46fa72
mov r8, qword [rsp + 0x1f0]
xor r9d, r9d
mov rcx, rsi
mov dword [rsp + 0x20], 1
mov rdx, qword [rsp + 0x1e8]
call sym.walBusyLock
test eax, eax
jne 0x46fa52
mov eax, dword [rsp + 0x1e0]
mov byte [rsi + 0x40], 1
mov dword [rsp + 0x3c], eax
jmp 0x46fa72
cmp eax, 5
je 0x46fa66
mov edi, dword [rsp + 0x1e0]
mov ebx, eax
mov dword [rsp + 0x3c], edi
jmp 0x46faa8
mov qword [rsp + 0x1e8], 0
lea rdx, [rsp + 0x88]
mov rcx, rsi
call sym.walIndexReadHdr
cmp dword [rsp + 0x88], 0
mov ebx, eax
je 0x46faa4
mov rcx, qword [rsi + 8]
mov rax, qword [rcx]
cmp dword [rax], 2
jle 0x46faa4
xor r8d, r8d
xor edx, edx
call sym.sqlite3OsUnfetch
test ebx, ebx
je 0x46fb24
cmp dword [rsp + 0x88], 0
je 0x46fac2
lea rdx, [rsi + 0x48]
mov ecx, 0xc
xor eax, eax
mov rdi, rdx
rep stosd dword [rdi], eax
cmp byte [rsi + 0x40], 0
je 0x46fae7
mov r8d, 1
xor edx, edx
mov rcx, rsi
call sym.walUnlockExclusive
mov byte [rsi + 0x40], 0
mov dword [rsi + 0x7c], 0
mov byte [rsi + 0x43], 0
cmp byte [rsi + 0x41], 0
je 0x46fb04
mov r8d, 1
mov edx, 1
mov rcx, rsi
call sym.walUnlockExclusive
mov byte [rsi + 0x41], 0
test ebx, ebx
jne 0x4702ae
mov eax, dword [rsp + 0x3c]
cmp dword [rsp + 0x1e0], eax
mov eax, 5
cmovne ebx, eax
jmp 0x4702ae
mov eax, dword [rsi + 0x58]
mov dword [rsp + 0x38], eax
mov ax, word [rsi + 0x56]
mov edx, eax
and eax, 0xfe00
shl edx, 0x10
and edx, 0x10000
or edx, eax
cmp dword [rsp + 0x38], 0
mov dword [rsp + 0x48], edx
je 0x46fb66
cmp dword [rsp + 0x200], edx
je 0x46fb66
mov ecx, 0x10769
call sym.sqlite3CorruptError
mov ebx, eax
jmp 0x470261
mov rax, qword [rsi + 0x30]
mov rax, qword [rax]
mov qword [rsp + 0x30], rax
mov eax, dword [rax + 0x60]
cmp dword [rsp + 0x38], eax
jbe 0x4701ab
mov eax, dword [rsi + 0x5c]
xor ebx, ebx
mov edi, 4
mov r12d, 8
or r13d, 0xffffffff
mov dword [rsp + 0x58], eax
mov rax, qword [rsp + 0x30]
lea r14, [rax + 0x68]
mov r15d, dword [r14]
cmp r15d, dword [rsp + 0x38]
jae 0x46fc12
mov r8, qword [rsp + 0x1f0]
mov ebp, r12d
mov rcx, rsi
mov dword [rsp + 0x20], 1
mov rdx, qword [rsp + 0x1e8]
sub ebp, edi
mov r9d, ebp
call sym.walBusyLock
test eax, eax
mov ebx, eax
jne 0x46fbf8
mov eax, dword [rsp + 0x38]
cmp edi, 4
mov r8d, 1
mov edx, ebp
mov rcx, rsi
cmovne eax, r13d
mov dword [r14], eax
call sym.walUnlockExclusive
jmp 0x46fc12
cmp eax, 5
jne 0x470257
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x1e8], 0
add r14, 4
dec edi
jne 0x46fba0
mov rax, qword [rsp + 0x30]
xor ebp, ebp
mov eax, dword [rax + 0x60]
cmp eax, dword [rsp + 0x38]
jae 0x4701a2
mov rax, qword [rsp + 0x30]
mov ebx, 7
mov r12d, dword [rax + 0x60]
mov eax, dword [rsi + 0x58]
mov dword [rsp + 0x4c], eax
add eax, 0x1000
mov edx, dword [rsp + 0x4c]
sub rax, 0xfdf
shr rax, 0xc
mov dword [rsp + 0x78], eax
lea edi, [rax + 1]
cdqe
shl rax, 4
mov dword [rsp + 0x5c], edi
lea r13, [rax + rdx + 0x14]
add r13, r13
mov rcx, r13
call sym.sqlite3_malloc64
test rax, rax
mov rbp, rax
je 0x4701af
xor eax, eax
mov rcx, r13
mov rdi, rbp
cmp dword [rsp + 0x4c], 0x1000
rep stosb byte [rdi], al
mov eax, dword [rsp + 0x5c]
mov ecx, 0x1000
cmovbe ecx, dword [rsp + 0x4c]
lea r13, [rsp + 0xb0]
mov ecx, ecx
add rcx, rcx
mov dword [rbp + 4], eax
call sym.sqlite3_malloc64
cmp rax, 1
mov r15, rax
lea eax, [r12 + 0x1001]
sbb ebx, ebx
sub rax, 0xfdf
and ebx, 7
sar rax, 0xc
mov qword [rsp + 0x40], rax
lea rax, [r13 + 8]
mov qword [rsp + 0x60], rax
test ebx, ebx
mov edi, dword [rsp + 0x40]
jne 0x46fefd
cmp dword [rsp + 0x5c], edi
jle 0x46fefd
mov edx, dword [rsp + 0x40]
lea r8, [rsp + 0x98]
mov rcx, rsi
call sym.walHashGet
test eax, eax
mov ebx, eax
jne 0x46fef3
mov rdx, qword [rsp + 0xa0]
cmp edi, dword [rsp + 0x78]
mov eax, dword [rsp + 0xa8]
mov qword [rsp + 0x50], rdx
jne 0x46fd3c
mov r12d, dword [rsp + 0x4c]
sub r12d, eax
jmp 0x46fd4d
mov r12, qword [rsp + 0x98]
sub r12, qword [rsp + 0x50]
sar r12, 2
movsxd rcx, dword [rbp + 4]
mov edx, eax
inc eax
add rdx, rdx
mov dword [rsp + 0xa8], eax
xor eax, eax
shl rcx, 5
lea r14, [rcx + rdx + 8]
add r14, rbp
cmp r12d, eax
jle 0x46fd7c
mov word [r14 + rax*2], ax
inc rax
jmp 0x46fd6d
mov ecx, 0x34
xor eax, eax
mov rdi, r13
mov dword [rsp + 0x8c], 0
rep stosd dword [rdi], eax
xor edi, edi
mov qword [rsp + 0x90], 0
cmp r12d, edi
mov r11d, edi
jle 0x46fe5e
lea rdx, [rdi + rdi]
xor r10d, r10d
mov dword [rsp + 0x8c], 1
lea rax, [rsp + 0x90]
add rdx, r14
mov qword [rsp + 0x90], rdx
mov qword [rsp + 0x68], rax
bt r11d, r10d
mov ecx, r10d
jae 0x46fe2f
mov rax, qword [rsp + 0x60]
mov rdx, r10
mov qword [rsp + 0x28], r15
shl rdx, 4
mov r9, qword [rsp + 0x68]
mov dword [rsp + 0x7c], r11d
lea rcx, [rsp + 0x8c]
mov qword [rsp + 0x70], r10
mov qword [rsp + 0x20], rcx
mov rcx, qword [rsp + 0x50]
mov r8d, dword [r13 + rdx]
mov rdx, qword [rax + rdx]
call sym.walMerge
mov r10, qword [rsp + 0x70]
mov r11d, dword [rsp + 0x7c]
inc r10
jmp 0x46fdd7
mov r8, qword [rsp + 0x90]
mov edx, r10d
inc rdi
shl rdx, 4
mov qword [rsp + rdx + 0xb8], r8
mov r8d, dword [rsp + 0x8c]
mov dword [rsp + rdx + 0xb0], r8d
jmp 0x46fda1
lea r10d, [rcx + 1]
lea rax, [rsp + 0x90]
mov rdi, r10
shl r10, 4
mov qword [rsp + 0x68], rax
cmp edi, 0xc
ja 0x46fec2
bt r12d, edi
jae 0x46feba
mov rax, qword [rsp + 0x60]
lea rdx, [rsp + 0x8c]
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], rdx
mov r9, qword [rsp + 0x68]
mov r8d, dword [r13 + r10]
mov qword [rsp + 0x70], r10
mov rcx, qword [rsp + 0x50]
mov rdx, qword [rax + r10]
call sym.walMerge
mov r10, qword [rsp + 0x70]
inc edi
add r10, 0x10
jmp 0x46fe76
mov rax, qword [rsp + 0x40]
mov edx, dword [rsp + 0x8c]
mov ecx, dword [rsp + 0xa8]
shl rax, 5
mov dword [rbp + rax + 0x20], edx
mov rdx, qword [rsp + 0xa0]
mov dword [rbp + rax + 0x24], ecx
mov qword [rbp + rax + 0x10], r14
mov qword [rbp + rax + 0x18], rdx
inc qword [rsp + 0x40]
jmp 0x46fce4
mov rcx, r15
call sym.sqlite3_free
test ebx, ebx
je 0x46ff18
mov rcx, rbp
xor ebp, ebp
call sym.sqlite3_free
jmp 0x4701a2
mov r8, qword [rsp + 0x1f0]
mov r9d, 3
mov rcx, rsi
mov dword [rsp + 0x20], 1
mov rdx, qword [rsp + 0x1e8]
call sym.walBusyLock
test eax, eax
mov ebx, eax
jne 0x4701a2
mov rax, qword [rsp + 0x30]
mov edi, dword [rsp + 0x38]
mov rcx, qword [rsi + 0x10]
mov eax, dword [rax + 0x60]
mov dword [rsp + 0x4c], eax
mov rax, qword [rsp + 0x30]
mov dword [rax + 0x80], edi
mov eax, dword [rsp + 0x1f8]
sar eax, 2
and eax, 3
mov edx, eax
mov dword [rsp + 0x40], eax
call sym.sqlite3OsSync
test eax, eax
mov ebx, eax
jne 0x470130
movsxd r14, dword [rsp + 0x48]
xor r8d, r8d
mov edx, 0x27
mov eax, dword [rsp + 0x58]
mov rcx, qword [rsi + 8]
imul rax, r14
mov qword [rsp + 0x98], rax
call sym.sqlite3OsFileControl
mov rcx, qword [rsi + 8]
lea rdx, [rsp + 0xb0]
call sym.sqlite3OsFileSize
test eax, eax
mov ebx, eax
jne 0x470130
mov rcx, qword [rsp + 0xb0]
mov rdx, qword [rsp + 0x98]
cmp rcx, rdx
jge 0x47001c
mov eax, dword [rsi + 0x58]
imul rax, r14
lea rax, [rcx + rax + 0x10000]
cmp rdx, rax
jle 0x470006
mov ecx, 0x1005a
call sym.sqlite3CorruptError
test eax, eax
je 0x47001c
jmp 0x47012e
mov rcx, qword [rsi + 8]
lea r8, [rsp + 0x98]
mov edx, 5
call sym.sqlite3OsFileControlHint
mov eax, dword [rsp + 0x48]
xor r12d, r12d
lea r15d, [rax + 0x18]
movsxd r15, r15d
movsxd rax, dword [rbp + 4]
or edi, 0xffffffff
mov r10d, dword [rbp]
lea r8d, [rax - 1]
shl rax, 5
add rax, rbp
test r8d, r8d
js 0x47008b
mov r9d, dword [rax]
mov edx, dword [rax - 0x18]
cmp edx, r9d
jge 0x470082
mov r11, qword [rax - 0x10]
movsxd rcx, edx
movzx r13d, word [r11 + rcx*2]
mov r11, qword [rax - 8]
mov r11d, dword [r11 + r13*4]
cmp r10d, r11d
jae 0x47007b
cmp r11d, edi
jae 0x470082
movzx r12d, r13w
mov edi, r11d
add r12d, dword [rax + 4]
jmp 0x470082
inc edx
mov dword [rax - 0x18], edx
jmp 0x470048
dec r8d
sub rax, 0x20
jmp 0x470040
cmp edi, 0xffffffff
mov dword [rbp], edi
je 0x470130
mov rax, qword [rsp + 0x1d8]
mov eax, dword [rax + 0x198]
test eax, eax
je 0x4700bf
mov rax, qword [rsp + 0x1d8]
cmp byte [rax + 0x67], 1
sbb ebx, ebx
and ebx, 2
add ebx, 7
jmp 0x470130
cmp dword [rsp + 0x38], r12d
setb dl
cmp dword [rsp + 0x4c], r12d
setae al
or dl, al
jne 0x47002a
cmp dword [rsp + 0x58], edi
jb 0x47002a
lea eax, [r12 - 1]
mov rcx, qword [rsi + 0x10]
imul rax, r15
mov r8d, dword [rsp + 0x48]
mov rdx, qword [rsp + 0x208]
lea r9, [rax + 0x38]
call sym.sqlite3OsRead
test eax, eax
jne 0x47012e
lea r9d, [rdi - 1]
mov rcx, qword [rsi + 8]
imul r9, r14
mov r8d, dword [rsp + 0x48]
mov rdx, qword [rsp + 0x208]
call sym.sqlite3OsWrite
test eax, eax
je 0x47002a
mov ebx, eax
mov rcx, qword [rsi + 8]
xor r8d, r8d
mov edx, 0x25
call sym.sqlite3OsFileControl
test ebx, ebx
jne 0x47018f
mov rax, qword [rsi + 0x30]
mov rax, qword [rax]
mov eax, dword [rax + 0x10]
cmp eax, dword [rsp + 0x38]
je 0x470163
mov rax, qword [rsp + 0x30]
mov edi, dword [rsp + 0x38]
mov dword [rax + 0x60], edi
jmp 0x47018f
mov eax, dword [rsi + 0x5c]
movsxd rdx, dword [rsp + 0x48]
mov rcx, qword [rsi + 8]
imul rdx, rax
call sym.sqlite3OsTruncate
test eax, eax
jne 0x47018d
mov rcx, qword [rsi + 8]
mov edx, dword [rsp + 0x40]
call sym.sqlite3OsSync
test eax, eax
je 0x470155
mov ebx, eax
mov r8d, 1
mov edx, 3
mov rcx, rsi
call sym.walUnlockExclusive
cmp ebx, 5
jne 0x4701af
xor ebx, ebx
jmp 0x4701af
xor ebx, ebx
xor ebp, ebp
test ebx, ebx
jne 0x470259
cmp dword [rsp + 0x3c], 0
je 0x470259
mov rax, qword [rsp + 0x30]
mov ebx, 5
mov eax, dword [rax + 0x60]
cmp eax, dword [rsi + 0x58]
jb 0x470259
xor ebx, ebx
cmp dword [rsp + 0x3c], 1
jle 0x470259
lea rdx, [rsp + 0xb0]
mov ecx, 4
call sym.sqlite3_randomness
mov r8, qword [rsp + 0x1f0]
mov rcx, rsi
mov dword [rsp + 0x20], 4
mov rdx, qword [rsp + 0x1e8]
mov r9d, 4
call sym.walBusyLock
test eax, eax
mov ebx, eax
jne 0x470259
cmp dword [rsp + 0x3c], 3
jne 0x470242
mov edx, dword [rsp + 0xb0]
mov rcx, rsi
call sym.walRestartHdr
mov rcx, qword [rsi + 0x10]
xor edx, edx
call sym.sqlite3OsTruncate
mov ebx, eax
mov r8d, 4
mov edx, 4
mov rcx, rsi
call sym.walUnlockExclusive
jmp 0x470259
xor ebp, ebp
mov rcx, rbp
call sym.sqlite3_free
test ebx, ebx
je 0x47026e
cmp ebx, 5
jne 0x46faa8
cmp qword [rsp + 0x210], 0
je 0x470286
mov eax, dword [rsi + 0x58]
mov rdi, qword [rsp + 0x210]
mov dword [rdi], eax
cmp qword [rsp + 0x218], 0
je 0x46faa8
mov rax, qword [rsi + 0x30]
mov rdi, qword [rsp + 0x218]
mov rax, qword [rax]
mov eax, dword [rax + 0x60]
mov dword [rdi], eax
jmp 0x46faa8
mov eax, ebx
add rsp, 0x188
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret