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

Disassembly:
push rsi
sub rsp, 0x50
test byte [rcx + 8], 0x40
mov rsi, rcx
jne 0x1400181c8
cmp dword [rcx + 0x2f80], 0
jg 0x1400181b5
cmp dword [rcx + 0x2f90], 0
jle 0x140018484
mov dl, 1
call fcn.14001ed70
xor ecx, ecx
add rsp, 0x50
pop rsi
jmp 0x14001e8c0
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r15
xor r15d, r15d
cmp byte [rcx + 0xc8], r15b
je 0x140018232
mov ebx, r15d
cmp dword [rcx + 0x2f80], ebx
jle 0x140018232
mov edi, r15d
nop word [rax + rax]
mov rax, qword [rsi + 0x2f88]
mov rcx, qword [rdi + rax + 8]
test rcx, rcx
je 0x140018224
cmp qword [rcx + 0x10], r15
jne 0x140018224
cmp qword [rcx + 0x18], r15
je 0x140018224
mov ecx, dword [rcx]
call 0x14001e8c0
inc ebx
add rdi, 0x10
cmp ebx, dword [rsi + 0x2f80]
jl 0x140018200
cmp byte [rsi + 0x2fb0], r15b
je 0x140018275
xor ecx, ecx
call fcn.140015ad0
xor edx, edx
call fcn.14001ed70
xor ecx, ecx
call 0x14001e8c0
mov r8d, dword [rsi + 0x2fa0]
mov rcx, rsi
mov rdx, qword [rsi + 0x2fa8]
call fcn.140018db0
mov rcx, rsi
call fcn.140018ff0
mov byte [rsi + 0x2fb0], r15b
mov r14d, r15d
cmp dword [rsi + 0x2f90], r15d
jle 0x140018470
mov qword [rsp + 0x68], rbp
mov rbp, r15
mov qword [rsp + 0x48], r12
mov qword [rsp + 0x40], r13
mov r13d, 0x18
movaps xmmword [rsp + 0x20], xmm6
xorps xmm6, xmm6
lea r12d, [r13 + 8]
nop dword [rax]
mov rax, qword [rsi + 0x2f98]
cmp dword [rax + rbp], 2
jne 0x140018448
mov rbx, qword [rax + rbp + 0x30]
test rbx, rbx
je 0x14001830f
mov rcx, qword [rbx + 0x448]
test rcx, rcx
je 0x1400182f5
xor r8d, r8d
mov rdx, rbx
call fcn.140019a00
and byte [rbx + 0x472], 0xfc
mov byte [rbx + 0xc2], r15b
jmp 0x14001842f
and byte [rbx + 0x472], 0xfc
mov dword [rbx + 0x458], r15d
mov byte [rbx + 0xc2], r15b
jmp 0x14001842f
mov rbx, qword [rax + rbp + 0x38]
test rbx, rbx
je 0x140018448
mov rdx, qword [rbx + 0x10]
test rdx, rdx
je 0x140018378
mov eax, dword [rbx + 8]
shr eax, 0xb
test al, 1
jne 0x140018378
cmp qword [rdx + 0x18], rbx
mov rax, r13
mov r8, r12
mov rcx, rsi
cmovne rax, r12
cmovne r8, r13
mov qword [rax + rdx], r15
mov rdx, qword [rbx + 0x10]
mov r8, qword [r8 + rdx]
call fcn.14001d9e0
mov rcx, qword [rbx + 0x10]
mov eax, dword [rcx + 0xb0]
and eax, 0xfffffebf
bts eax, 7
mov dword [rcx + 0xb0], eax
mov qword [rbx + 0x10], r15
jmp 0x140018416
xor edx, edx
mov rcx, rsi
call fcn.140018490
mov rdx, rbx
mov rcx, rax
mov rdi, rax
call fcn.140019c30
mov edx, dword [rdi]
mov ecx, dword [rbx]
call fcn.14001f8e0
mov r9d, r15d
cmp dword [rdi + 0x28], r15d
jle 0x140018413
mov r8, r15
nop word [rax + rax]
mov rax, qword [rdi + 0x30]
mov rcx, qword [r8 + rax]
lea rdx, [rcx + 0x400]
mov qword [rcx + 0x3e0], r15
mov qword [rdx], rcx
mov qword [rcx + 0x3f8], rcx
mov qword [rcx + 0x3f0], rcx
mov qword [rcx + 0x3e8], rcx
test dword [rcx + 0xc], 0x800000
je 0x140018406
nop word [rax + rax]
mov rax, qword [rcx + 0x3e0]
mov qword [rdx], rax
mov rcx, rax
test dword [rax + 0xc], 0x800000
jne 0x1400183f0
inc r9d
add r8, 8
cmp r9d, dword [rdi + 0x28]
jl 0x1400183b0
mov rbx, rdi
mov eax, dword [rbx + 0xb0]
and eax, 0xffffffd2
or eax, 0x12
or byte [rbx + 0xb4], 0x80
mov dword [rbx + 0xb0], eax
mov rcx, qword [0x1400b29a0]
comiss xmm6, dword [rcx + 0x2fbc]
jb 0x140018448
mov eax, dword [rcx + 0x1c]
mov dword [rcx + 0x2fbc], eax
inc r14d
add rbp, 0x40
cmp r14d, dword [rsi + 0x2f90]
jl 0x1400182b0
movaps xmm6, xmmword [rsp + 0x20]
mov r13, qword [rsp + 0x40]
mov r12, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x68]
mov r14, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x60]
mov r15, qword [rsp + 0x30]
add rsp, 0x50
pop rsi
ret
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
mov rax, qword [0x1400b2040]
xor rax, rsp
mov qword [rsp + 0x48], rax
mov ebx, ecx
mov dword [rsp + 0x24], ecx
mov r15, qword [0x1400b29a0]
test ecx, ecx
je 0x14001e99a
mov r8, qword [r15 + 0x2f88]
movsxd rdx, dword [r15 + 0x2f80]
mov r9, rdx
shl r9, 4
add r9, r8
test rdx, rdx
je 0x14001e951
nop dword [rax]
mov rcx, rdx
shr rcx, 1
mov rax, rcx
add rax, rax
cmp dword [r8 + rax*8], ebx
jae 0x14001e949
lea r8, [r8 + rax*8]
add r8, 0x10
mov rax, 0xffffffffffffffff
sub rax, rcx
add rdx, rax
jmp 0x14001e94c
mov rdx, rcx
test rdx, rdx
jne 0x14001e920
xor edi, edi
cmp r8, r9
je 0x14001e963
cmp dword [r8], ebx
jne 0x14001e963
mov r8, qword [r8 + 8]
jmp 0x14001e966
mov r8, rdi
mov qword [rsp + 0x30], r8
test r8, r8
je 0x14001ed45
xor dl, dl
mov eax, dword [r8 + 0xb0]
shl eax, 0x1d
sar eax, 0x1d
mov dword [rsp + 0x28], eax
mov eax, dword [r8 + 0xb0]
shl eax, 0x1a
sar eax, 0x1d
mov dword [rsp + 0x2c], eax
jmp 0x14001e9ae
xor edi, edi
mov r8d, edi
mov qword [rsp + 0x30], rdi
xor dl, dl
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x2c], edi
mov dword [rsp + 0x20], edx
mov ebp, edi
mov dword [rsp + 0x3c], edi
mov esi, edi
mov dword [rsp + 0x38], esi
mov r11, rdi
mov qword [rsp + 0x40], rdi
mov r12d, edi
cmp dword [r15 + 0x2f80], 0
jle 0x14001eb4a
mov r13, rdi
mov r9d, 1
mov rax, qword [r15 + 0x2f88]
mov r14, qword [rax + r13 + 8]
test r14, r14
je 0x14001eb2d
test ebx, ebx
je 0x14001ea24
cmp dword [r14], ebx
je 0x14001eb2d
mov rax, qword [r14 + 0x10]
test rax, rax
je 0x14001eb2d
nop
lea rcx, [rax]
mov rax, qword [rax + 0x10]
test rax, rax
jne 0x14001ea10
cmp dword [rcx], ebx
jne 0x14001eb2d
mov eax, dword [r14 + 8]
shr eax, 0xb
test al, 1
movzx edx, dl
cmovne edx, r9d
mov dword [rsp + 0x20], edx
test ebx, ebx
je 0x14001ea70
mov edx, edi
cmp dword [r15 + 0x2f90], 0
jle 0x14001ea70
mov rcx, rdi
nop dword [rax + rax]
mov rax, qword [r15 + 0x2f98]
cmp qword [rcx + rax + 0x10], r14
jne 0x14001ea61
mov dword [rcx + rax], edi
inc edx
add rcx, 0x40
cmp edx, dword [r15 + 0x2f90]
jl 0x14001ea50
test r8, r8
je 0x14001ea85
mov rdx, r14
mov rcx, r8
call fcn.140019c30
mov r11, qword [rsp + 0x40]
cmp esi, ebp
jne 0x14001eb1a
lea ebx, [rsi + 1]
test ebp, ebp
je 0x14001ea9f
mov eax, ebp
cdq
sub eax, edx
sar eax, 1
add eax, ebp
jmp 0x14001eaa4
mov eax, 8
cmp eax, ebx
cmovg ebx, eax
cmp ebx, ebp
jle 0x14001eb16
mov rax, qword [0x1400b29a0]
test rax, rax
je 0x14001eabf
inc dword [rax + 0x3b0]
movsxd rcx, ebx
shl rcx, 3
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rbp, rax
mov rax, qword [rsp + 0x40]
test rax, rax
je 0x14001eb08
movsxd r8, esi
shl r8, 3
mov rdx, rax
mov rcx, rbp
call sub.VCRUNTIME140.dll_memcpy
mov rdx, qword [0x1400b29a0]
test rdx, rdx
je 0x14001eafd
dec dword [rdx + 0x3b0]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r11, rbp
mov qword [rsp + 0x40], rbp
mov ebp, ebx
mov dword [rsp + 0x3c], ebx
mov ebx, dword [rsp + 0x24]
movsxd rax, esi
mov qword [r11 + rax*8], r14
inc esi
mov dword [rsp + 0x38], esi
mov r9d, 1
inc r12d
add r13, 0x10
cmp r12d, dword [r15 + 0x2f80]
mov r8, qword [rsp + 0x30]
mov edx, dword [rsp + 0x20]
jl 0x14001e9e0
mov r13, qword [rsp + 0x30]
test r13, r13
je 0x14001eb81
mov edx, dword [rsp + 0x28]
xor edx, dword [r13 + 0xb0]
and edx, 0xfffffff8
xor edx, dword [rsp + 0x28]
mov eax, dword [rsp + 0x2c]
lea eax, [rax*8]
mov ecx, eax
xor ecx, edx
and ecx, 0xffffffc7
xor ecx, eax
mov dword [r13 + 0xb0], ecx
mov r10, qword [r15 + 0x2fe8]
test r10, r10
je 0x14001ebe8
add r10, 4
je 0x14001ebe8
mov r8d, dword [r10 + 0x14]
test r8d, r8d
je 0x14001ebbd
mov edx, edi
test esi, esi
jle 0x14001ebbd
mov rcx, r11
mov rax, qword [rcx]
cmp dword [rax], r8d
je 0x14001ebb9
inc edx
add rcx, 8
cmp edx, esi
jl 0x14001eba5
jmp 0x14001ebbd
mov dword [r10 + 0x14], ebx
movsxd r9, dword [r10 - 4]
add r9, r10
movsxd rcx, dword [r15 + 0x2fe0]
mov rdx, qword [r15 + 0x2fe8]
add rdx, 4
add rdx, rcx
mov r10, rdi
cmp r9, rdx
cmovne r10, r9
test r10, r10
jne 0x14001eb93
cmp esi, 1
jle 0x14001ec06
movsxd rdx, esi
lea r9, [0x1400186b0]
mov r8d, 8
mov rcx, r11
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_qsort]
mov r12, qword [rsp + 0x40]
test esi, esi
jle 0x14001ec99
mov r14, r12
nop word [rax + rax]
mov rbx, qword [r14]
mov rax, qword [rbx + 0x78]
test rax, rax
je 0x14001ec33
mov qword [rax + 0x450], rdi
mov rdx, qword [rbx + 0x10]
test rdx, rdx
je 0x14001ec5b
mov eax, 0x18
cmp rax, 0x28
jge 0x14001ec5b
cmp qword [rax + rdx], rbx
jne 0x14001ec55
mov rcx, qword [rbx + 0x10]
mov qword [rax + rcx], rdi
add rax, 8
jmp 0x14001ec41
xor r8d, r8d
mov edx, dword [rbx]
lea rcx, [r15 + 0x2f80]
call fcn.140002f40
mov rcx, rbx
call fcn.140019510
mov rax, qword [0x1400b29a0]
test rax, rax
je 0x14001ec86
dec dword [rax + 0x3b0]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add r14, 8
sub rsi, 1
jne 0x14001ec20
cmp dword [rsp + 0x24], 0
jne 0x14001ed0e
mov rcx, qword [r15 + 0x2f88]
test rcx, rcx
je 0x14001ecd6
mov qword [r15 + 0x2f80], 0
mov rax, qword [0x1400b29a0]
test rax, rax
je 0x14001ecc9
dec dword [rax + 0x3b0]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [r15 + 0x2f88], rdi
mov rcx, qword [r15 + 0x2f98]
test rcx, rcx
je 0x14001ed24
mov qword [r15 + 0x2f90], 0
mov rax, qword [0x1400b29a0]
test rax, rax
je 0x14001ecff
dec dword [rax + 0x3b0]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [r15 + 0x2f98], rdi
jmp 0x14001ed24
cmp byte [rsp + 0x20], 0
je 0x14001ed24
or dword [r13 + 8], 0x800
mov qword [r13 + 0x88], r13
test r12, r12
je 0x14001ed45
mov rax, qword [0x1400b29a0]
test rax, rax
je 0x14001ed3b
dec dword [rax + 0x3b0]
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
nop
mov rcx, qword [rsp + 0x48]
xor rcx, rsp
call fcn.140040db0
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret