Function at 0x546960
Capabilities:
Resolve function by parsing pe exports

Disassembly:
cmp rsp, qword [r14 + 0x10]
jbe 0x546cef
push rbp
mov rbp, rsp
sub rsp, 0x68
movq qword [rsp + 0x60], xmm15
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x80], rbx
mov qword [rsp + 0x88], rcx
mov byte [rsp + 0x2f], 0
mov dword [rsp + 0x34], 0
mov ebx, 0x10
call sym.modernc.org_libc._TLS_.Alloc
lea rcx, [sym.modernc.org_sqlite_lib._writeSuperJournal.deferwrap1]
mov qword [rsp + 0x50], rcx
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x58], rcx
lea rdx, [rsp + 0x50]
mov qword [rsp + 0x60], rdx
mov byte [rsp + 0x2f], 1
mov rdx, qword [rsp + 0x88]
test rdx, rdx
je 0x546a02
mov rsi, qword [rsp + 0x80]
mov r8, rsi
movzx r9d, byte [rsi + 9]
cmp r9d, 4
je 0x546a02
mov r9, qword [rsi + 0x50]
cmp qword [r9], 0
je 0x546a02
mov byte [rsi + 0x18], 1
xor ebx, ebx
xor esi, esi
nop
jmp 0x546a2c
mov dword [rsp + 0x34], 0
mov byte [rsp + 0x2f], 0
mov rdx, qword [rsp + 0x60]
mov rax, qword [rdx]
call rax
mov eax, dword [rsp + 0x34]
add rsp, 0x68
pop rbp
ret
movsx r9, r9b
add esi, r9d
inc ebx
movsxd r9, ebx
add r9, rdx
movzx r9d, byte [r9]
test r9b, r9b
jne 0x546a23
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x3c], esi
mov dword [rsp + 0x38], ebx
mov r9, r8
cmp byte [r8 + 0xc], 0
je 0x546a9f
mov r10, qword [r8 + 0x60]
test r10, r10
je 0x546a93
mov r11d, dword [r8 + 0xb8]
test r11, r11
je 0x546cda
dec r10
mov rdi, rax
mov rax, r10
mov r10, rdx
cmp r11, 0xffffffffffffffff
jne 0x546a84
neg rax
xor edx, edx
jmp 0x546a89
cqo
idiv r11
lea rdx, [rax + 1]
imul rdx, r11
jmp 0x546a9b
mov rdi, rax
mov r10, rdx
xor edx, edx
mov qword [r8 + 0x60], rdx
mov rsi, qword [r9 + 0x60]
mov qword [rsp + 0x40], rsi
mov rbx, qword [r9 + 0x50]
mov edi, dword [r9 + 0xc0]
mov rax, rcx
mov rcx, rsi
call sym.modernc.org_sqlite_lib._write32bits
nop
test eax, eax
je 0x546acb
mov ecx, 0
jmp 0x546b12
mov dword [rsp + 0x30], eax
mov r8, qword [rsp + 0x80]
mov rbx, qword [r8 + 0x50]
mov rsi, qword [rsp + 0x40]
lea r8, [rsi + 4]
mov r10, rbx
mov r10, qword [r10]
mov rdx, qword [r10 + 0x18]
mov r10, qword [rdx]
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x88]
mov edi, dword [rsp + 0x38]
mov rsi, r8
call r10
mov r8d, dword [rsp + 0x30]
test r8d, r8d
mov ecx, eax
je 0x546b1c
mov r8d, 1
jmp 0x546b22
test ecx, ecx
setne r8b
test r8b, r8b
je 0x546b2e
mov ecx, 0
jmp 0x546b66
mov byte [rsp + 0x2d], r8b
mov rdx, qword [rsp + 0x80]
mov rbx, qword [rdx + 0x50]
mov edi, dword [rsp + 0x38]
movsxd rdx, edi
mov r8, qword [rsp + 0x40]
lea rcx, [r8 + rdx]
lea rcx, [rcx + 4]
mov rax, qword [rsp + 0x78]
call sym.modernc.org_sqlite_lib._write32bits
movzx edx, byte [rsp + 0x2d]
test dl, dl
mov ecx, eax
je 0x546b70
mov r8d, 1
jmp 0x546b76
test ecx, ecx
setne r8b
test r8b, r8b
je 0x546b82
mov ecx, 0
jmp 0x546bc0
mov byte [rsp + 0x2c], r8b
mov rdx, qword [rsp + 0x80]
mov rbx, qword [rdx + 0x50]
mov edx, dword [rsp + 0x38]
movsxd r8, edx
mov r9, qword [rsp + 0x40]
lea rcx, [r9 + r8]
lea rcx, [rcx + 8]
mov rax, qword [rsp + 0x78]
mov edi, dword [rsp + 0x3c]
call sym.modernc.org_sqlite_lib._write32bits
movzx edx, byte [rsp + 0x2c]
test dl, dl
mov ecx, eax
nop
je 0x546bca
mov r8d, 1
jmp 0x546bd0
test ecx, ecx
setne r8b
test r8b, r8b
je 0x546bdc
mov ecx, 0
jmp 0x546c2e
mov byte [rsp + 0x2e], r8b
mov r8, qword [rsp + 0x80]
mov rbx, qword [r8 + 0x50]
lea rcx, [0x009b8928]
mov r8d, dword [rsp + 0x38]
movsxd r10, r8d
mov r11, qword [rsp + 0x40]
lea rsi, [r11 + r10]
lea rsi, [rsi + 0xc]
mov r10, rbx
mov r10, qword [r10]
mov rdx, qword [r10 + 0x18]
mov r10, qword [rdx]
mov rax, qword [rsp + 0x78]
mov edi, 8
call r10
movzx r8d, byte [rsp + 0x2e]
test r8b, r8b
mov ecx, eax
jne 0x546c34
test ecx, ecx
je 0x546c51
mov dword [rsp + 0x34], eax
mov byte [rsp + 0x2f], 0
mov rdx, qword [rsp + 0x60]
mov rax, qword [rdx]
call rax
mov eax, dword [rsp + 0x34]
add rsp, 0x68
pop rbp
ret
mov rsi, qword [rsp + 0x80]
lea rdi, [rsi + 0x60]
mov r8d, dword [rsp + 0x38]
add r8d, 0x14
movsxd r8, r8d
add qword [rdi], r8
mov rbx, qword [rsi + 0x50]
mov rsi, rbx
mov rsi, qword [rsi]
mov rdx, qword [rsi + 0x30]
mov rsi, qword [rdx]
mov rax, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x48]
call rsi
test eax, eax
jne 0x546cbd
mov rsi, qword [rsp + 0x48]
mov rdi, qword [rsp + 0x80]
mov rcx, qword [rdi + 0x60]
nop
cmp qword [rsi], rcx
jle 0x546cbd
mov rbx, qword [rdi + 0x50]
mov rsi, rbx
mov rsi, qword [rsi]
mov rdx, qword [rsi + 0x20]
mov rsi, qword [rdx]
mov rax, qword [rsp + 0x78]
call rsi
mov dword [rsp + 0x34], eax
mov byte [rsp + 0x2f], 0
mov rdx, qword [rsp + 0x60]
mov rax, qword [rdx]
call rax
mov eax, dword [rsp + 0x34]
add rsp, 0x68
pop rbp
ret
call sym.runtime.panicdivide
nop
call sym.runtime.deferreturn
mov eax, dword [rsp + 0x34]
add rsp, 0x68
pop rbp
ret
mov qword [rsp + 8], rax
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rcx
nop
call sym.runtime.morestack_noctxt.abi0
mov rax, qword [rsp + 8]
mov rbx, qword [rsp + 0x10]
mov rcx, qword [rsp + 0x18]
jmp sym.modernc.org_sqlite_lib._writeSuperJournal