Function at 0x5c9870
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, 0xc8
mov rax, qword [rcx]
mov qword [rsp + 0x90], rax
mov rax, qword [rax]
mov r14, rcx
mov dword [rsp + 0xac], edx
mov qword [rsp + 0x98], rax
movzx eax, byte [rcx + 0x40]
mov word [rsp + 0xa8], dx
mov byte [rsp + 0xab], al
mov dword [rsp + 0x84], eax
cmp eax, 1
jle 0x5ca010
cmp eax, 2
setne al
setne bl
movzx eax, al
movzx ebx, bl
lea eax, [rax + rax*4 + 5]
lea rbx, [rbx + rbx*4 + 5]
mov dword [rsp + 0x4c], eax
cmp word [rsp + 0xac], 0
mov rdx, qword [r14 + 0x10]
je 0x5c9902
test rdx, rdx
je 0x5c9902
movsxd rsi, dword [rdx]
mov dword [rsp + 0x50], esi
lea ecx, [rsi + rsi]
jmp 0x5c990e
mov dword [rsp + 0x50], 0
xor ecx, ecx
xor esi, esi
movzx edi, byte [rsp + 0xab]
lea rdx, [rdi + 4]
imul edx, eax
shl edx, 4
add edx, ecx
mov rcx, qword [rsp + 0x98]
movsxd rdx, edx
call fcn.00594060
mov qword [rsp + 0xa0], rax
test rax, rax
je 0x5ca16b
mov rcx, rbx
lea r10, [rdi*8]
mov edi, dword [rsp + 0x4c]
shl rcx, 5
mov qword [rsp + 0x88], r10
lea rbx, [rax + rcx]
lea r8d, [rdi + rdi - 1]
mov r9, r8
mov qword [rsp + 0x78], rbx
add r8, 1
add rcx, rbx
mov qword [rbx], 0
shl r8, 5
mov rdx, rcx
mov qword [rbx + 8], 0
add r8, rax
mov qword [rbx + 0x10], 0
mov qword [rbx + 0x18], 0
mov qword [rax + 0x18], rdx
add rax, 0x20
add rdx, r10
cmp r8, rax
jne 0x5c999f
movsxd rax, r9d
mov r12d, dword [rsp + 0x50]
add rax, 1
imul rax, qword [rsp + 0x88]
add rax, rcx
mov qword [rsp + 0x68], rax
test r12d, r12d
jne 0x5ca027
mov rdi, qword [rsp + 0x90]
mov eax, 0x30
mov qword [rsp + 0x68], 0
cmp dword [rdi + 0xbc], 0x30
cmovbe eax, dword [rdi + 0xbc]
mov rdi, qword [rsp + 0x78]
mov word [rdi + 0x10], ax
mov esi, dword [rsp + 0x84]
mov r15, qword [rsp + 0x78]
test esi, esi
je 0x5c9f00
xor r9d, r9d
xor r10d, r10d
mov qword [rsp + 0x70], 0
mov r15, qword [rsp + 0xa0]
mov word [rsp + 0x66], r9w
mov r12d, 1
mov word [rsp + 0x64], r10w
mov dword [rsp + 0x80], 0
mov eax, dword [rsp + 0x70]
mov dword [rsp + 0x60], eax
test r12d, r12d
je 0x5c9d07
mov rax, qword [rsp + 0x70]
mov r13, qword [rsp + 0x78]
shl rax, 3
mov qword [rsp + 0x40], rax
lea eax, [r12 - 1]
xor r12d, r12d
add rax, 1
shl rax, 5
add rax, r13
mov qword [rsp + 0x58], rax
nop word cs:[rax + rax]
mov rbp, qword [r14 + 0x50]
test rbp, rbp
je 0x5c9cf8
mov eax, dword [rsp + 0x40]
and eax, 2
mov dword [rsp + 0x54], eax
jmp 0x5c9abd
mov rbp, qword [rbp + 0x40]
test rbp, rbp
je 0x5c9cf8
movzx r11d, byte [r13 + 0x16]
mov qword [rsp + 0xb8], 0
mov rbx, qword [r13]
mov rax, rbx
not rax
test qword [rbp], rax
jne 0x5c9ab0
mov r10, qword [rbp + 8]
test rbx, r10
jne 0x5c9ab0
movzx esi, word [r13 + 0x10]
test byte [rbp + 0x29], 0x40
je 0x5c9af8
cmp si, 2
jle 0x5c9ab0
movzx edx, word [rbp + 0x14]
movsx ecx, word [rbp + 0x12]
add edx, esi
movsx edx, dx
call fcn.00596280
movsx edx, word [r13 + 0x14]
movsx ecx, ax
call fcn.00596280
add si, word [rbp + 0x16]
mov edi, eax
or rbx, r10
test r11b, r11b
js 0x5c9ca0
mov rax, qword [r13 + 8]
mov qword [rsp + 0xb8], rax
movsx eax, r11b
cmp eax, dword [rsp + 0x50]
jge 0x5c9cd9
mov rcx, qword [rsp + 0x68]
movsx rdx, r11b
lea r9, [rcx + rdx*2]
movsx edx, word [r9]
test dx, dx
je 0x5c9de0
movsx ecx, di
call fcn.00596280
mov ecx, edi
lea edi, [rax + 5]
test r12d, r12d
je 0x5c9ce8
lea edx, [r12 - 1]
mov rax, r15
add rdx, 1
shl rdx, 5
add rdx, r15
jmp 0x5c9b9d
add rax, 0x20
cmp rdx, rax
je 0x5c9d38
cmp qword [rax], rbx
jne 0x5c9b90
mov r9d, r11d
xor r9b, byte [rax + 0x16]
js 0x5c9b90
cmp word [rax + 0x12], di
jl 0x5c9ab0
je 0x5c9dc1
mov rdx, qword [r13]
or rdx, qword [rbp + 8]
mov qword [rax], rdx
mov rdx, qword [rsp + 0xb8]
cmp dword [rsp + 0x40], 8
mov word [rax + 0x10], si
mov qword [rax + 8], rdx
mov rdx, qword [rax + 0x18]
mov byte [rax + 0x16], r11b
mov rsi, qword [r13 + 0x18]
mov word [rax + 0x12], di
mov word [rax + 0x14], cx
jae 0x5c9d70
xor edi, edi
test edi, edi
jne 0x5c9e2a
mov ebx, dword [rsp + 0x40]
test ebx, ebx
je 0x5c9c1e
movzx ecx, byte [rsi]
mov byte [rdx], cl
mov r11d, dword [rsp + 0x54]
test r11d, r11d
jne 0x5c9e65
mov rdx, qword [rax + 0x18]
mov rax, qword [rsp + 0x40]
mov qword [rdx + rax], rbp
cmp r12d, dword [rsp + 0x4c]
jl 0x5c9ab0
movzx r8d, word [r15 + 0x12]
movzx r10d, word [r15 + 0x10]
lea rax, [r15 + 0x20]
mov r9d, dword [rsp + 0x4c]
mov word [rsp + 0x64], r8w
mov word [rsp + 0x66], r10w
cmp r9d, 1
je 0x5c9e55
xor r11d, r11d
mov edx, 1
jmp 0x5c9c83
movzx r10d, word [rax + 0x14]
mov r8d, ecx
mov r11d, edx
add edx, 1
add rax, 0x20
cmp r9d, edx
je 0x5c9da8
movzx ecx, word [rax + 0x12]
cmp cx, r8w
jg 0x5c9c68
jne 0x5c9c73
movzx ebx, word [rax + 0x14]
cmp bx, r10w
jle 0x5c9c73
mov r10d, ebx
jmp 0x5c9c6d
mov qword [rsp + 0x28], rbp
mov rdx, qword [r14 + 0x10]
mov r8, r13
mov rcx, r14
lea rax, [rsp + 0xb8]
movzx r9d, word [r14 + 0x3c]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x60]
mov dword [rsp + 0x20], eax
call fcn.005c8d50
mov r11d, eax
test al, al
jns 0x5c9b35
lea ecx, [rdi - 2]
test r12d, r12d
jne 0x5c9b73
nop dword [rax]
movsxd rax, r12d
add r12d, 1
jmp 0x5c9d5f
add r13, 0x20
cmp qword [rsp + 0x58], r13
jne 0x5c9a90
add qword [rsp + 0x70], 1
mov rax, qword [rsp + 0x70]
cmp dword [rsp + 0x84], eax
jle 0x5c9e7e
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x78], r15
mov r15, rax
jmp 0x5c9a4a
cmp dword [rsp + 0x4c], r12d
jg 0x5c9ce8
cmp di, word [rsp + 0x64]
jg 0x5c9ab0
jne 0x5c9d57
cmp cx, word [rsp + 0x66]
jge 0x5c9ab0
movsxd rax, dword [rsp + 0x80]
shl rax, 5
add rax, r15
jmp 0x5c9bbb
mov rcx, qword [rsi]
lea rdi, [rdx + 8]
and rdi, 0xfffffffffffffff8
mov qword [rdx], rcx
mov rbx, qword [rsp + 0x40]
mov ecx, ebx
mov r9, qword [rsi + rcx - 8]
mov qword [rdx + rcx - 8], r9
sub rdx, rdi
mov ecx, ebx
add ecx, edx
sub rsi, rdx
shr ecx, 3
rep movsq qword [rdi], qword [rsi]
jmp 0x5c9c1a
mov dword [rsp + 0x80], r11d
mov word [rsp + 0x64], r8w
mov word [rsp + 0x66], r10w
jmp 0x5c9ab0
cmp word [rax + 0x10], si
jl 0x5c9ab0
jne 0x5c9bbb
cmp word [rax + 0x14], cx
jg 0x5c9bbb
jmp 0x5c9ab0
mov ecx, dword [rsp + 0x50]
mov edx, ecx
sub edx, eax
imul eax, edx, 0x64
cdq
idiv ecx
movsxd rcx, eax
call fcn.0058b040
movzx ecx, word [rsp + 0xa8]
lea r8d, [rcx + rax - 0x32]
mov eax, ecx
test byte [r14 + 0x3d], 0x40
je 0x5c9e17
cmp word [r14 + 0x3e], cx
cmovle ax, word [r14 + 0x3e]
cmp ax, 0xa
jg 0x5c9e45
movsx edx, r8w
mov word [r9], dx
jmp 0x5c9b5d
mov ecx, dword [rsi]
mov dword [rdx], ecx
mov ecx, dword [rsp + 0x40]
mov r9d, dword [rsi + rcx - 4]
mov dword [rdx + rcx - 4], r9d
mov rdx, qword [rax + 0x18]
jmp 0x5c9c1e
movsx rcx, ax
call fcn.0058b040
lea r8d, [r8 + rax - 0x21]
jmp 0x5c9e1d
mov dword [rsp + 0x80], 0
jmp 0x5c9ab0
mov ecx, dword [rsp + 0x40]
movzx r9d, word [rsi + rcx - 2]
mov word [rdx + rcx - 2], r9w
mov rdx, qword [rax + 0x18]
jmp 0x5c9c1e
test r12d, r12d
je 0x5ca138
cmp r12d, 1
je 0x5c9eb5
lea edx, [r12 - 2]
lea rax, [r15 + 0x20]
shl rdx, 5
lea rdx, [r15 + rdx + 0x40]
movzx edi, word [rax + 0x12]
cmp word [r15 + 0x12], di
cmovg r15, rax
add rax, 0x20
cmp rdx, rax
jne 0x5c9e9f
mov r9, qword [r15 + 0x18]
mov r10d, dword [rsp + 0x84]
lea rcx, [r14 + 0x39c]
xor r8d, r8d
mov rax, qword [r9 + r8*8]
add r8, 1
add rcx, 0x60
mov qword [rcx - 0x14], rax
movzx edx, byte [rax + 0x10]
lea rax, [rdx*8]
mov byte [rcx - 0x30], dl
sub rax, rdx
shl rax, 4
add rax, qword [r14 + 8]
mov eax, dword [rax + 0x4c]
mov dword [rcx - 0x60], eax
cmp r10d, r8d
jg 0x5c9ecb
movzx eax, word [r14 + 0x3c]
and ax, 0x180
cmp ax, 0x100
je 0x5c9f8a
mov rdx, qword [r14 + 0x10]
and byte [r14 + 0x44], 0xfb
test rdx, rdx
je 0x5c9f55
movzx ecx, word [r14 + 0x3c]
movsx eax, byte [r15 + 0x16]
test cl, 0x80
je 0x5ca074
cmp eax, dword [rdx]
je 0x5ca175
and ch, 2
je 0x5c9f55
movsx eax, byte [r14 + 0x41]
cmp eax, dword [rdx]
jne 0x5c9f55
mov eax, dword [rsp + 0x84]
test eax, eax
jne 0x5ca17f
movzx eax, word [r15 + 0x10]
mov rdx, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x98]
mov word [r14 + 0x48], ax
call fcn.00592290
xor eax, eax
add rsp, 0xc8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp byte [r14 + 0x43], 0
jne 0x5c9f0f
cmp word [rsp + 0xac], 0
je 0x5c9f0f
mov rdx, qword [r14 + 0x18]
mov r9d, pe_nt_image_headers64
mov r8, r15
mov rcx, r14
lea rax, [rsp + 0xb8]
mov rdi, qword [rsp + 0x88]
mov qword [rsp + 0x30], rax
mov rax, qword [r15 + 0x18]
mov rax, qword [rax + rdi - 8]
mov qword [rsp + 0x28], rax
movzx eax, byte [rsp + 0xab]
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call fcn.005c8d50
mov rdx, qword [r14 + 0x18]
movsx eax, al
cmp dword [rdx], eax
jne 0x5c9f0f
mov byte [r14 + 0x43], 2
jmp 0x5c9f0f
mov dword [rsp + 0x4c], 1
mov eax, 1
mov ebx, 1
jmp 0x5c98e2
xor edx, edx
lea r8, [rsi + rsi]
mov rcx, rax
call sub.msvcrt.dll_memset
mov rdi, qword [rsp + 0x90]
mov eax, 0x30
mov ebp, dword [rsp + 0x84]
cmp dword [rdi + 0xbc], 0x30
cmovbe eax, dword [rdi + 0xbc]
test ebp, ebp
mov rdi, qword [rsp + 0x78]
mov word [rdi + 0x10], ax
mov eax, 0xffffffff
cmove eax, dword [rsp + 0x50]
mov byte [rdi + 0x16], al
jmp 0x5c9a02
mov byte [r14 + 0x41], al
mov r8, qword [r15 + 8]
mov qword [r14 + 0x60], r8
test al, al
jg 0x5c9f38
mov r8d, dword [rsp + 0x84]
mov byte [r14 + 0x41], 0
test r8d, r8d
je 0x5c9f55
mov rax, qword [r15 + 0x18]
mov rdi, qword [rsp + 0x88]
mov r8, qword [rax + rdi - 8]
mov eax, dword [r8 + 0x28]
test ah, 0x10
jne 0x5c9f38
and eax, 0x104
cmp eax, 0x104
je 0x5c9f38
lea rax, [rsp + 0xb8]
mov qword [rsp + 0x28], r8
mov r9d, 0x800
mov r8, r15
mov qword [rsp + 0x30], rax
mov rcx, r14
movzx eax, byte [rsp + 0xab]
mov qword [rsp + 0xb8], 0
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call fcn.005c8d50
mov rdx, qword [r14 + 0x10]
movsx eax, al
cmp dword [rdx], eax
jne 0x5ca129
mov rax, qword [rsp + 0xb8]
or byte [r14 + 0x44], 4
mov qword [r14 + 0x60], rax
movzx ecx, word [r14 + 0x3c]
jmp 0x5c9f38
mov rcx, qword [rsp + 0x90]
lea rdx, str.no_query_solution
call fcn.005bd640
mov rdx, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x98]
call fcn.00592290
mov eax, 1
jmp 0x5c9f76
mov eax, 7
jmp 0x5c9f76
mov byte [r14 + 0x43], 2
jmp 0x5c9f38
lea rax, [rsp + 0xb8]
xor r9d, r9d
mov r8, r15
mov rcx, r14
mov qword [rsp + 0x30], rax
mov rax, qword [r15 + 0x18]
mov rdi, qword [rsp + 0x88]
mov qword [rsp + 0xb8], 0
mov rax, qword [rax + rdi - 8]
mov qword [rsp + 0x28], rax
movzx eax, byte [rsp + 0xab]
sub eax, 1
movzx eax, ax
mov dword [rsp + 0x20], eax
call fcn.005c8d50
mov rdx, qword [r14 + 0x10]
movsx eax, al
cmp dword [rdx], eax
jne 0x5c9f55
mov rax, qword [rsp + 0xb8]
or byte [r14 + 0x44], 8
mov qword [r14 + 0x60], rax
jmp 0x5c9f55