Function at 0x6513d0
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 r15, qword [rcx + 8]
mov rsi, rcx
mov edi, edx
mov rbp, r8
mov rbx, qword [r15]
call fcn.00652620
mov al, byte [rsi + 0x10]
cmp al, 2
je 0x6519c3
test edi, edi
jne 0x65140b
dec al
je 0x651a12
mov rax, qword [rsi]
test byte [rax + 0x33], 2
je 0x651420
cmp byte [rbx + 0x12], 0
jne 0x651420
and word [r15 + 0x28], 0xfffe
mov eax, dword [r15 + 0x28]
test al, 1
je 0x651437
test edi, edi
mov r14d, 8
je 0x651442
jmp 0x651a19
test edi, edi
je 0x651442
cmp byte [r15 + 0x24], 2
je 0x651446
test al, 0x80
je 0x651452
mov rax, qword [r15 + 0x80]
mov rax, qword [rax]
jmp 0x651473
cmp edi, 1
jle 0x651482
mov rax, qword [r15 + 0x78]
test rax, rax
je 0x651482
mov rdx, qword [rax]
cmp rdx, rsi
je 0x65146d
mov rax, qword [rdx]
jmp 0x651473
mov rax, qword [rax + 0x10]
jmp 0x65145b
test rax, rax
mov r14d, 0x106
jne 0x651a19
mov r8d, 1
mov edx, 1
mov rcx, rsi
call fcn.006436f0
test eax, eax
mov r14d, eax
jne 0x651a19
mov eax, dword [r15 + 0x28]
and eax, 0xffffffef
cmp dword [r15 + 0x40], 0
mov word [r15 + 0x28], ax
jne 0x6514bb
or eax, 0x10
mov word [r15 + 0x28], ax
lea rax, [rsp + 0x48]
xor r14d, r14d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x44]
mov qword [rsp + 0x30], rax
cmp qword [r15 + 0x18], 0
jne 0x651778
mov rcx, qword [r15]
call fcn.0066f4b0
test eax, eax
jne 0x651a0a
mov r8, qword [rsp + 0x28]
xor r9d, r9d
mov edx, 1
mov rcx, r15
call fcn.0060a2c0
test eax, eax
jne 0x651a0a
mov rax, qword [rsp + 0x48]
mov r14, qword [r15]
mov r13, qword [rax + 0x50]
mov eax, dword [r14 + 0x20]
mov r11d, dword [r13 + 0x1c]
mov dword [rsp + 0x38], eax
bswap r11d
test r11d, r11d
mov r12d, r11d
je 0x65154a
lea rdx, [r13 + 0x5c]
lea rcx, [r13 + 0x18]
mov r8d, 4
call sub.ntdll.dll_memcmp
test eax, eax
cmovne r12d, dword [rsp + 0x38]
jmp 0x65154f
mov r12d, dword [rsp + 0x38]
mov rax, qword [r15 + 8]
test byte [rax + 0x33], 2
jne 0x6516e7
test r12d, r12d
je 0x6516e7
lea rdx, str.SQLite_format_3
mov r8d, 0x10
mov rcx, r13
call sub.ntdll.dll_memcmp
test eax, eax
jne 0x651753
cmp byte [r13 + 0x12], 2
jbe 0x651590
or word [r15 + 0x28], 1
cmp byte [r13 + 0x13], 2
ja 0x651753
jne 0x6515e1
test byte [r15 + 0x28], 0x20
jne 0x6515e1
mov rdx, qword [rsp + 0x30]
mov rcx, r14
mov dword [rsp + 0x44], 0
call fcn.006af550
test eax, eax
mov r14d, eax
jne 0x651759
mov r14d, dword [rsp + 0x44]
test r14d, r14d
jne 0x6515e1
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call fcn.0066fa10
jmp 0x6514d2
lea rcx, [r13 + 0x15]
lea rdx, [0x007a148b]
mov r8d, 3
call sub.ntdll.dll_memcmp
test eax, eax
jne 0x651753
movzx r14d, byte [r13 + 0x10]
movzx eax, byte [r13 + 0x11]
shl r14d, 8
shl eax, 0x10
or r14d, eax
lea eax, [r14 - 1]
test eax, r14d
jne 0x651753
lea eax, [r14 - 0x101]
cmp eax, 0xfeff
ja 0x651753
or word [r15 + 0x28], 2
mov eax, r14d
movzx r8d, byte [r13 + 0x14]
sub eax, r8d
cmp r14d, dword [r15 + 0x34]
mov dword [rsp + 0x3c], r8d
je 0x651691
mov rdx, qword [rsp + 0x48]
mov dword [rsp + 0x38], eax
mov rcx, qword [rdx + 0x70]
call fcn.0066fa10
mov eax, dword [rsp + 0x38]
lea rcx, [r15 + 0x88]
mov dword [r15 + 0x34], r14d
mov dword [r15 + 0x38], eax
call fcn.00614da0
mov r8d, dword [rsp + 0x3c]
mov rcx, qword [r15]
lea rdx, [r15 + 0x34]
call fcn.0066f360
mov r14d, eax
jmp 0x65176f
cmp dword [rsp + 0x38], r12d
jae 0x6516c2
mov rdx, qword [r15 + 8]
mov r12d, dword [rsp + 0x38]
mov rdx, qword [rdx + 0x30]
and edx, 0x10000001
dec rdx
je 0x6516c2
mov ecx, 0x111d4
call fcn.00656590
mov r14d, eax
jmp 0x651759
cmp eax, 0x1df
jbe 0x651753
mov dword [r15 + 0x38], eax
cmp dword [r13 + 0x34], 0
setne byte [r15 + 0x21]
cmp dword [r13 + 0x40], 0
setne byte [r15 + 0x22]
jmp 0x6516ea
xor r12d, r12d
mov r8d, dword [r15 + 0x38]
mov r10d, 0xff
xor edx, edx
mov dword [r15 + 0x40], r12d
lea eax, [r8 + 0x3fffff4]
shl eax, 6
div r10d
xor edx, edx
lea ecx, [rax - 0x17]
lea eax, [r8 + 0x7fffff4]
sub r8d, 0x23
mov word [r15 + 0x2e], r8w
shl eax, 5
mov word [r15 + 0x2a], cx
div r10d
sub eax, 0x17
cmp cx, 0x80
mov word [r15 + 0x2c], ax
mov word [r15 + 0x30], ax
mov al, 0x7f
cmovae ecx, eax
mov rax, qword [rsp + 0x48]
xor r14d, r14d
mov byte [r15 + 0x25], cl
mov qword [r15 + 0x18], rax
jmp 0x6514d2
mov r14d, 0x1a
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax + 0x70]
call fcn.0066fa10
mov qword [r15 + 0x18], 0
test r14d, r14d
je 0x6514d2
test r14d, r14d
jne 0x6518f4
test edi, edi
je 0x6518f4
test byte [r15 + 0x28], 1
je 0x65179b
mov r14d, 8
jmp 0x6518f9
mov r14d, dword [rbx + 0x30]
test r14d, r14d
jne 0x6518d3
mov rax, qword [rsi]
cmp byte [rax + 0x66], 2
sete byte [rbx + 0x1a]
cmp byte [rbx + 0x15], 1
jne 0x6518ba
mov rax, qword [rbx + 0x128]
test rax, rax
je 0x65188a
cmp byte [rbx + 8], 0
je 0x65180d
cmp byte [rax + 0x3f], 0
jne 0x65180d
mov edx, 4
mov rcx, rbx
call fcn.0063e760
test eax, eax
mov r14d, eax
jne 0x6518d3
mov r13, qword [rbx + 0x128]
movsx edx, word [r13 + 0x3c]
mov rcx, r13
add edx, 3
call fcn.006a5ba0
mov byte [r13 + 0x3f], 1
mov r13, qword [rbx + 0x128]
cmp byte [r13 + 0x42], 0
jne 0x651790
xor edx, edx
mov r8d, 1
mov rcx, r13
call fcn.006a5590
test eax, eax
mov r14d, eax
jne 0x6518d3
mov rax, qword [r13 + 0x30]
mov byte [r13 + 0x40], 1
lea rcx, [r13 + 0x48]
mov r8d, 0x30
mov rdx, qword [rax]
call sub.ntdll.dll_memcmp
test eax, eax
jne 0x651873
mov eax, dword [rbx + 0x20]
mov byte [rbx + 0x15], 2
mov qword [rbx + 0x60], 0
mov dword [rbx + 0x2c], eax
mov dword [rbx + 0x28], eax
mov dword [rbx + 0x24], eax
jmp 0x6518ba
mov r8d, 1
xor edx, edx
mov rcx, r13
call fcn.006a5b80
mov byte [r13 + 0x40], 0
jmp 0x6518dc
mov edx, 2
mov rcx, rbx
call fcn.0063e760
cmp edi, 1
mov r14d, eax
jle 0x6518b3
test eax, eax
jne 0x6518b3
mov edx, 4
mov rcx, rbx
call fcn.00640190
mov r14d, eax
test r14d, r14d
je 0x651859
jmp 0x6518d3
cmp dword [r15 + 0x40], 0
je 0x6518c6
xor r14d, r14d
jmp 0x651901
mov rcx, r15
call fcn.0063d070
mov r14d, eax
jmp 0x6518f4
cmp r14d, 0x205
jne 0x6518f9
cmp byte [r15 + 0x24], 1
sbb r14d, r14d
and r14d, 0xfffffe00
add r14d, 0x205
jmp 0x6518f9
test r14d, r14d
je 0x6518c1
mov rcx, r15
call fcn.006a11a0
cmp r14b, 5
jne 0x651927
cmp byte [r15 + 0x24], 0
jne 0x651a19
mov rcx, r15
call fcn.0060a460
test eax, eax
jne 0x6514d2
jmp 0x651a19
test r14d, r14d
jne 0x651a19
cmp byte [rsi + 0x10], 0
jne 0x651954
inc dword [r15 + 0x3c]
cmp byte [rsi + 0x11], 0
je 0x651954
mov byte [rsi + 0x3c], 1
mov rax, qword [r15 + 0x78]
mov qword [rsi + 0x40], rax
lea rax, [rsi + 0x30]
mov qword [r15 + 0x78], rax
test edi, edi
setne al
inc eax
mov byte [rsi + 0x10], al
cmp byte [r15 + 0x24], al
jae 0x651968
mov byte [r15 + 0x24], al
test edi, edi
je 0x651a12
mov eax, dword [r15 + 0x28]
mov r12, qword [r15 + 0x18]
mov qword [r15 + 0x80], rsi
and eax, 0xffffffbf
mov edx, eax
or edx, 0x40
cmp edi, 2
cmovge eax, edx
mov word [r15 + 0x28], ax
mov rax, qword [r12 + 0x50]
mov eax, dword [rax + 0x1c]
bswap eax
cmp dword [r15 + 0x40], eax
je 0x6519e1
mov rcx, qword [r12 + 0x70]
call fcn.0066fa70
test eax, eax
mov r14d, eax
jne 0x651a19
mov eax, dword [r15 + 0x40]
mov rdx, qword [r12 + 0x50]
bswap eax
mov dword [rdx + 0x1c], eax
jmp 0x6519e1
test rbp, rbp
je 0x6519d8
mov rax, qword [r15 + 0x18]
mov rax, qword [rax + 0x50]
mov eax, dword [rax + 0x28]
bswap eax
mov dword [rbp], eax
test edi, edi
jne 0x6519e6
xor r14d, r14d
jmp 0x651a19
test rbp, rbp
jne 0x6519c8
mov rax, qword [rsi]
mov edx, dword [rax + 0x2e8]
cmp edx, dword [rbx + 0x80]
jle 0x6519dc
cmp byte [rbx + 0xa], 0
je 0x6519dc
mov rcx, rbx
call fcn.0063e7b0
mov r14d, eax
jmp 0x651a19
mov r14d, eax
jmp 0x651778
test rbp, rbp
jne 0x6519c8
jmp 0x6519dc
mov rcx, rsi
call fcn.00653400
mov eax, r14d
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret