Function at 0x46bc96
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
xor r12d, r12d
lea rax, [rsp + 0x54]
mov rbp, rcx
mov qword [rsp + 0x30], rax
lea r13, [rsp + 0x6b]
mov rbx, qword [rbp + 0x88]
cmp dword [rbx + 0x14], 0
js 0x46bcd4
mov cl, byte [rbx + 0xc]
test cl, cl
je 0x46bce5
jmp 0x46bcfa
mov rcx, rbx
call sym.btreeComputeFreeSpace
test eax, eax
je 0x46bccb
jmp 0x46c18c
mov rax, qword [rbp + 0x20]
imul edx, dword [rbx + 0x14], 3
mov eax, dword [rax + 0x38]
add eax, eax
cmp edx, eax
jle 0x46c18c
movsx r14d, byte [rbp + 0x54]
test r14d, r14d
jne 0x46be94
test cl, cl
je 0x46c18f
mov rax, qword [rbp + 0x20]
mov rax, qword [rax + 0x10]
test rax, rax
je 0x46bd4c
cmp rbp, rax
je 0x46bd74
cmp byte [rax], 0
jne 0x46bd74
mov rdi, qword [rbp + 0x88]
cmp qword [rax + 0x88], rdi
jne 0x46bd74
mov ecx, 0x12f24
call sym.sqlite3CorruptError
test eax, eax
mov r14d, eax
jne 0x46c18f
mov rcx, qword [rbx + 0x70]
mov dword [rsp + 0x60], 0
mov qword [rsp + 0x78], 0
mov rsi, qword [rbx + 0x48]
call sym.sqlite3PagerWrite
test eax, eax
mov dword [rsp + 0x58], eax
jne 0x46bd7a
jmp 0x46bda2
mov rax, qword [rax + 0x28]
jmp 0x46bd18
mov qword [rbp + 0x98], 0
mov rcx, qword [rsp + 0x78]
call sym.releasePage
mov r14d, dword [rsp + 0x58]
test r14d, r14d
jne 0x46c18f
jmp 0x46be6f
mov r9d, dword [rbx + 4]
lea rdx, [rsp + 0x78]
mov rcx, rsi
mov dword [rsp + 0x20], 0
lea r8, [rsp + 0x60]
call sym.allocateBtreePage
test eax, eax
mov dword [rsp + 0x58], eax
jne 0x46bdda
mov rdx, qword [rsp + 0x78]
lea r8, [rsp + 0x58]
mov rcx, rbx
call sym.copyNodeContent.part.614
cmp byte [rsi + 0x21], 0
je 0x46be00
mov r9d, dword [rbx + 4]
lea rax, [rsp + 0x58]
mov r8d, 5
mov rcx, rsi
mov edx, dword [rsp + 0x60]
mov qword [rsp + 0x20], rax
call sym.ptrmapPut
cmp dword [rsp + 0x58], 0
mov rax, qword [rsp + 0x78]
jne 0x46bd7a
movzx ecx, byte [rbx + 0xc]
lea rdx, [rax + 0x1c]
lea rsi, [rbx + 0x1c]
mov rdi, rdx
lea rdx, [rax + 0x28]
add rcx, rcx
rep movsb byte [rdi], byte [rsi]
lea rsi, [rbx + 0x28]
mov rdi, rdx
movzx ecx, byte [rbx + 0xc]
shl rcx, 3
rep movsb byte [rdi], byte [rsi]
mov rcx, rbx
mov dl, byte [rbx + 0xc]
mov byte [rax + 0xc], dl
mov rax, qword [rax + 0x50]
movzx edx, byte [rax]
and edx, 0xfffffff7
call sym.zeroPage
mov eax, dword [rsp + 0x60]
movzx edx, byte [rbx + 9]
mov rcx, qword [rbx + 0x50]
bswap eax
mov dword [rcx + rdx + 8], eax
mov rax, qword [rsp + 0x78]
mov qword [rbp + 0x98], rax
mov rax, qword [rbp + 0x98]
mov byte [rbp + 0x54], 1
mov dword [rbp + 0x56], 0
mov qword [rbp + 0x90], rbx
mov qword [rbp + 0x88], rax
jmp 0x46bcbe
mov rax, qword [rbx + 0x70]
cmp dword [rax + 0x38], 1
jle 0x46bead
mov ecx, 0x12f60
call sym.sqlite3CorruptError
jmp 0x46c17f
lea eax, [r14 - 1]
cdqe
mov rsi, qword [rbp + rax*8 + 0x90]
mov di, word [rbp + rax*2 + 0x58]
mov rcx, qword [rsi + 0x70]
call sym.sqlite3PagerWrite
test eax, eax
jne 0x46c14f
cmp dword [rsi + 0x14], 0
js 0x46bee2
cmp byte [rbx + 2], 0
jne 0x46bef3
jmp 0x46c101
mov rcx, rsi
call sym.btreeComputeFreeSpace
test eax, eax
je 0x46bed7
jmp 0x46c14f
cmp byte [rbx + 0xc], 1
jne 0x46c101
mov eax, dword [rbx + 0x18]
cmp word [rbx + 0x1c], ax
jne 0x46c101
cmp dword [rsi + 4], 1
je 0x46c101
cmp di, word [rsi + 0x18]
jne 0x46c101
test ax, ax
jne 0x46bf32
mov ecx, 0x12ae6
call sym.sqlite3CorruptError
jmp 0x46c14f
mov rdi, qword [rbx + 0x48]
xor r9d, r9d
mov dword [rsp + 0x20], 0
mov r8, qword [rsp + 0x30]
lea rdx, [rsp + 0x58]
mov rcx, rdi
call sym.allocateBtreePage
test eax, eax
mov dword [rsp + 0x50], eax
jne 0x46c0fb
mov rdx, qword [rbx + 0x28]
mov rcx, rbx
mov qword [rsp + 0x60], rdx
call qword [rbx + 0x78]
mov rcx, qword [rsp + 0x58]
mov edx, 0xd
mov word [rsp + 0x4e], ax
call sym.zeroPage
lea rax, [rsp + 0x60]
mov r9, qword [rsp + 0x58]
xor edx, edx
mov qword [rsp + 0x88], rax
lea rax, [rsp + 0x4e]
mov r8d, 1
mov qword [rsp + 0x90], rax
mov rax, qword [rbx + 0x58]
lea rcx, [rsp + 0x78]
mov dword [rsp + 0x78], 1
mov qword [rsp + 0x80], rbx
mov dword [rsp + 0xc8], 2
mov qword [rsp + 0x98], rax
call sym.rebuildPage
mov rcx, qword [rsp + 0x58]
test eax, eax
mov dword [rsp + 0x50], eax
jne 0x46c0f6
movzx edx, word [rsp + 0x4e]
mov eax, 0xfffffffe
sub eax, edx
movzx edx, word [rcx + 0x12]
sub eax, edx
add eax, dword [rdi + 0x38]
mov dword [rcx + 0x14], eax
cmp byte [rdi + 0x21], 0
je 0x46c04a
mov r9d, dword [rsi + 4]
lea r15, [rsp + 0x50]
mov rcx, rdi
mov r8d, 5
mov edx, dword [rsp + 0x54]
mov qword [rsp + 0x20], r15
call sym.ptrmapPut
mov rcx, qword [rsp + 0x58]
mov ax, word [rsp + 0x4e]
cmp word [rcx + 0x10], ax
jae 0x46c04a
mov r8, qword [rsp + 0x60]
lea rdx, [rcx + 0x58]
mov r9, r15
call sym.ptrmapPutOvflPtr.isra.613
movzx eax, word [rbx + 0x18]
mov rdx, qword [rbx + 0x60]
lea eax, [rax + rax - 2]
cdqe
movzx eax, word [rdx + rax]
xchg al, ah
and ax, word [rbx + 0x1a]
movzx eax, ax
add rax, qword [rbx + 0x50]
mov qword [rsp + 0x60], rax
add rax, 9
mov rdx, qword [rsp + 0x60]
lea rcx, [rdx + 1]
mov qword [rsp + 0x60], rcx
cmp byte [rdx], 0
jns 0x46c08a
cmp rax, rcx
ja 0x46c072
lea r9, [r13 + 4]
add rdx, 0xa
mov rax, qword [rsp + 0x60]
inc r9
lea rcx, [rax + 1]
mov qword [rsp + 0x60], rcx
mov al, byte [rax]
cmp rdx, rcx
mov byte [r9 - 1], al
jbe 0x46c0b2
test al, al
js 0x46c092
cmp dword [rsp + 0x50], 0
jne 0x46c0df
mov eax, dword [rbx + 4]
sub r9d, r13d
mov r8, r13
mov rcx, rsi
movzx edx, word [rsi + 0x18]
mov qword [rsp + 0x20], 0
mov dword [rsp + 0x28], eax
call sym.insertCell
mov dword [rsp + 0x50], eax
mov eax, dword [rsp + 0x54]
mov rcx, qword [rsi + 0x50]
movzx edx, byte [rsi + 9]
bswap eax
mov dword [rcx + rdx + 8], eax
mov rcx, qword [rsp + 0x58]
call sym.releasePage
mov eax, dword [rsp + 0x50]
jmp 0x46c14f
mov rax, qword [rbp + 0x20]
mov ecx, dword [rax + 0x34]
call sym.pcache1Alloc
xor r9d, r9d
dec r14d
movzx edx, di
mov r15, rax
mov al, byte [rbp + 3]
sete r9b
mov rcx, rsi
mov r8, r15
and eax, 1
mov dword [rsp + 0x20], eax
call sym.balance_nonroot
test r12, r12
je 0x46c14c
mov rcx, r12
mov dword [rsp + 0x3c], eax
mov r12, r15
call sym.pcache1Free
mov eax, dword [rsp + 0x3c]
jmp 0x46c14f
mov r12, r15
mov byte [rbx + 0xc], 0
mov rcx, rbx
mov dword [rsp + 0x3c], eax
call sym.releasePage
mov al, byte [rbp + 0x54]
lea edx, [rax - 1]
mov eax, dword [rsp + 0x3c]
mov byte [rbp + 0x54], dl
movsx rdx, dl
mov rdx, qword [rbp + rdx*8 + 0x90]
mov qword [rbp + 0x88], rdx
test eax, eax
mov r14d, eax
je 0x46bcbe
jmp 0x46c18f
xor r14d, r14d
test r12, r12
je 0x46c19c
mov rcx, r12
call sym.pcache1Free
mov eax, r14d
add rsp, 0xe8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret