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

Disassembly:
push rbx
push rbp
push rdi
push r13
push r14
sub rsp, 0x50
xor r14d, r14d
mov ebp, r9d
mov ebx, r8d
mov r13d, edx
mov rdi, rcx
cmp r8d, 2
jae 0x180065126
mov ecx, r14d
jmp 0x18006515f
add r8d, 0xfffffffe
mov eax, 0xcccccccd
mul dword [rcx + 0x34]
mov eax, r8d
mov ecx, edx
xor edx, edx
shr ecx, 2
inc ecx
div ecx
mov eax, dword [0x18018f228]
mov ecx, r14d
sub r8d, edx
xor edx, edx
div dword [rdi + 0x30]
dec eax
cmp r8d, eax
sete cl
add ecx, 2
add ecx, r8d
mov qword [rsp + 0x80], rsi
mov qword [rsp + 0x88], r12
mov qword [rsp + 0x98], r15
cmp ecx, ebx
je 0x180065469
mov eax, dword [0x18018f228]
xor edx, edx
div dword [rdi + 0x30]
inc eax
cmp ebx, eax
je 0x180065469
mov rax, qword [rdi + 0x18]
mov rcx, qword [rax + 0x50]
mov eax, dword [rcx + 0x24]
bswap eax
test eax, eax
jne 0x1800651af
mov eax, 0x65
jmp 0x1800654ce
lea r9, [rsp + 0x34]
mov edx, ebx
lea r8, [rsp + 0x90]
mov rcx, rdi
call fcn.180061d20
test eax, eax
jne 0x1800654ce
movzx eax, byte [rsp + 0x90]
cmp al, 1
jne 0x18006520e
lea rax, [0x180160304]
mov r9d, 0x10578
lea r8, str.database_corruption
mov qword [rsp + 0x20], rax
lea rdx, str._s_at_line__d_of___.10s_
mov ecx, 0xb
call fcn.18004f880
mov eax, 0xb
jmp 0x1800654ce
cmp al, 2
jne 0x1800652ae
test ebp, ebp
jne 0x1800654cc
mov r9d, ebx
mov byte [rsp + 0x20], 1
lea r8, [rsp + 0x90]
mov rcx, rdi
lea rdx, [rsp + 0x38]
call fcn.1800678a0
test eax, eax
jne 0x1800654ce
mov r8, qword [rsp + 0x38]
test r8, r8
je 0x18006546d
mov r8, qword [r8 + 0x70]
test byte [r8 + 0x34], 0x20
je 0x1800652a1
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + 0x90]
jmp 0x18006546d
mov rcx, r8
call fcn.180056f90
jmp 0x18006546d
xor r9d, r9d
lea r8, [rsp + 0x38]
mov edx, ebx
mov rcx, rdi
call fcn.180062fc0
test eax, eax
jne 0x1800654ce
test ebp, ebp
mov r15d, r13d
mov r12d, 2
cmovne r15d, r14d
cmovne r12d, r14d
nop dword [rax + rax]
mov r9d, r15d
mov byte [rsp + 0x20], r12b
lea r8, [rsp + 0x30]
mov rcx, rdi
lea rdx, [rsp + 0x40]
call fcn.1800678a0
mov esi, eax
test eax, eax
jne 0x180065404
mov r8, qword [rsp + 0x40]
test r8, r8
je 0x180065363
mov r8, qword [r8 + 0x70]
test byte [r8 + 0x34], 0x20
je 0x18006535b
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + 0x90]
jmp 0x180065363
mov rcx, r8
call fcn.180056f90
mov eax, dword [rsp + 0x30]
test ebp, ebp
je 0x180065374
cmp eax, r13d
ja 0x1800652e0
mov rsi, qword [rsp + 0x38]
mov rcx, rdi
mov r9d, dword [rsp + 0x34]
mov rdx, rsi
movzx r8d, byte [rsp + 0x90]
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], eax
call fcn.180064e90
mov r15d, eax
test rsi, rsi
je 0x1800653f7
mov r8, qword [rsi + 0x70]
test byte [r8 + 0x34], 0x20
je 0x1800653ef
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rcx, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rcx
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + 0x90]
jmp 0x1800653f7
mov rcx, r8
call fcn.180056f90
test r15d, r15d
je 0x180065469
mov eax, r15d
jmp 0x1800654ce
mov r8, qword [rsp + 0x38]
test r8, r8
je 0x180065465
mov r8, qword [r8 + 0x70]
test byte [r8 + 0x34], 0x20
je 0x18006545d
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + 0x90]
mov eax, esi
jmp 0x1800654ce
mov rcx, r8
call fcn.180056f90
mov eax, esi
jmp 0x1800654ce
test ebp, ebp
jne 0x1800654cc
mov eax, dword [0x18018f228]
xor edx, edx
div dword [rdi + 0x30]
lea r9d, [rax + 1]
nop dword [rax]
dec ebx
cmp ebx, r9d
je 0x180065480
cmp ebx, 2
jae 0x180065491
mov ecx, r14d
jmp 0x1800654c1
lea r8d, [rbx - 2]
mov eax, 0xcccccccd
mul dword [rdi + 0x34]
mov eax, r8d
mov ecx, edx
xor edx, edx
shr ecx, 2
inc ecx
div ecx
mov ecx, r14d
sub r8d, edx
lea eax, [r8 + 2]
cmp eax, r9d
sete cl
add ecx, 2
add ecx, r8d
cmp ecx, ebx
je 0x180065480
mov byte [rdi + 0x23], 1
mov dword [rdi + 0x3c], ebx
xor eax, eax
mov r15, qword [rsp + 0x98]
mov r12, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x80]
add rsp, 0x50
pop r14
pop r13
pop rdi
pop rbp
pop rbx
ret