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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x98
mov ebx, r8d
mov rsi, rdx
mov r15, rcx
mov edi, r8d
test r8d, r8d
jle 0x140051d8f
mov ecx, edi
and ecx, 3
cmp ebx, 4
jae 0x140051d22
xor eax, eax
jmp 0x140051d58
mov edx, edi
and edx, 0xfffffffc
lea r8, [rsi + 0x5c]
xor eax, eax
nop dword [rax]
mov dword [r8 - 0x48], eax
lea r9d, [rax + 1]
mov dword [r8 - 0x30], r9d
lea r9d, [rax + 2]
mov dword [r8 - 0x18], r9d
lea r9d, [rax + 3]
mov dword [r8], r9d
add rax, 4
add r8, 0x60
cmp rax, rdx
jne 0x140051d30
test rcx, rcx
je 0x140051d8f
lea rdx, [rax + rax*2]
lea rdx, [rsi + rdx*8]
add rdx, 0x14
shl rcx, 3
lea rcx, [rcx + rcx*2]
xor r8d, r8d
nop word cs:[rax + rax]
mov dword [rdx + r8], eax
inc eax
add r8, 0x18
cmp rcx, r8
jne 0x140051d80
movsxd rax, ebx
mov qword [rsp + 0x60], rax
cmp ebx, 2
jb 0x140051db6
lea r9, [0x140058390]
mov r8d, 0x18
mov rcx, rsi
mov rdx, qword [rsp + 0x60]
call fcn.14013bbb0
test ebx, ebx
jle 0x140052290
lea rbp, [r15 + 0x18]
xor r10d, r10d
movabs r11, 0x7fffffff7fffffff
mov qword [rsp + 0x68], r15
mov qword [rsp + 0x48], rbp
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0x70], rdi
mov dword [rsp + 0x50], ebx
jmp 0x140051e05
mov qword [rsi + r14*8 + 0xc], 0
inc r10
cmp r10, rdi
je 0x140052290
lea r14, [r10 + r10*2]
mov r9d, dword [rsi + r14*8 + 4]
test r9d, r9d
je 0x140051df0
mov ecx, dword [rsi + r14*8 + 8]
mov rax, rcx
mov qword [rsp + 0x40], rcx
test ecx, ecx
je 0x140051df0
mov r13d, dword [r15]
mov r8d, dword [r15 + 8]
lea ecx, [r9 + r8]
dec ecx
mov eax, ecx
cdq
idiv r8d
sub ecx, edx
cmp ecx, r13d
jg 0x140052260
mov eax, dword [r15 + 4]
mov dword [rsp + 0x3c], eax
cmp eax, dword [rsp + 0x40]
jl 0x140052260
mov qword [rsp + 0x88], r14
mov qword [rsp + 0x90], r10
mov r14, qword [rbp]
mov r12d, dword [r14]
lea r10d, [r12 + rcx]
cmp r10d, r13d
mov qword [rsp + 0x80], r9
jle 0x140051eae
mov r8d, dword [r15 + 0x10]
xor eax, eax
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x2c], 0x40000000
mov dword [rsp + 0x28], 0x40000000
mov dword [rsp + 0x24], 0
cmp r8d, 1
je 0x14005203d
jmp 0x140052183
mov r8d, dword [r15 + 0x10]
mov dword [rsp + 0x2c], 0x40000000
mov qword [rsp + 0x58], r12
xor eax, eax
mov qword [rsp + 0x30], rax
mov rsi, r14
mov dword [rsp + 0x28], 0x40000000
mov dword [rsp + 0x54], r8d
mov dword [rsp + 0x24], r13d
jmp 0x140051f1b
mov eax, dword [rsp + 0x28]
cmp edx, eax
cmovl eax, edx
mov dword [rsp + 0x28], eax
mov rax, qword [rsp + 0x30]
cmovl rax, rbp
mov qword [rsp + 0x30], rax
mov r13d, dword [rsp + 0x24]
mov rbp, rsi
mov rsi, qword [rsi + 8]
add rbp, 8
mov r12d, dword [rsi]
lea r10d, [r12 + rcx]
cmp r10d, r13d
jg 0x140052005
test ecx, ecx
jle 0x140051fb0
xor r15d, r15d
mov edi, r12d
xor r11d, r11d
xor r9d, r9d
mov rbx, rsi
jmp 0x140051f7a
mov rbx, qword [rbx + 8]
mov r8d, dword [rbx]
mov r13d, r8d
sub r13d, edi
lea edi, [r11 + r13]
mov eax, ecx
sub eax, r11d
cmp edi, ecx
cmovle eax, r13d
mov r13d, r9d
sub r13d, edx
imul r13d, eax
mov edx, r9d
add r15d, r13d
add r11d, eax
mov edi, r8d
mov r9d, edx
cmp r8d, r10d
jge 0x140051fb5
mov edx, dword [rbx + 4]
mov r13d, edx
sub r13d, r9d
jle 0x140051f40
imul r13d, r11d
mov rbx, qword [rbx + 8]
mov r8d, dword [rbx]
mov eax, r8d
cmp edi, r12d
jge 0x140051fa0
sub eax, r12d
jmp 0x140051f69
sub eax, edi
jmp 0x140051f69
xor edx, edx
xor r15d, r15d
mov r8d, dword [rsp + 0x54]
test r8d, r8d
je 0x140051ee0
mov rax, qword [rsp + 0x40]
add eax, edx
cmp eax, dword [rsp + 0x3c]
mov r13d, dword [rsp + 0x24]
jg 0x140051f00
cmp edx, dword [rsp + 0x28]
jl 0x140051ff0
jne 0x140051f00
cmp r15d, dword [rsp + 0x2c]
jge 0x140051f00
mov eax, edx
mov dword [rsp + 0x28], edx
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x2c], r15d
jmp 0x140051f00
mov rax, qword [rsp + 0x30]
test rax, rax
je 0x14005201a
mov rax, qword [rax]
mov eax, dword [rax]
mov dword [rsp + 0x24], eax
jmp 0x140052029
xor eax, eax
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x24], 0
mov rbp, qword [rsp + 0x48]
mov r12, qword [rsp + 0x58]
cmp r8d, 1
jne 0x140052183
mov rdi, r14
cmp r12d, ecx
jge 0x140052086
mov rdi, r14
nop dword [rax + rax]
mov rdi, qword [rdi + 8]
cmp dword [rdi], ecx
jl 0x140052050
jmp 0x140052086
mov eax, r12d
mov dword [rsp + 0x28], r12d
mov rax, rbp
mov qword [rsp + 0x30], rbp
mov dword [rsp + 0x24], ebx
mov dword [rsp + 0x2c], r10d
mov rdi, qword [rdi + 8]
test rdi, rdi
je 0x140052183
mov r15d, dword [rdi]
mov ebx, r15d
sub ebx, ecx
mov rax, rbp
mov rdx, r14
nop word cs:[rax + rax]
mov r14, rdx
mov rbp, rax
lea rax, [rdx + 8]
mov rdx, qword [rdx + 8]
cmp dword [rdx], ebx
jle 0x1400520a0
mov esi, dword [r14]
xor r12d, r12d
mov r10d, 0
cmp esi, r15d
jge 0x140052140
xor r10d, r10d
xor edx, edx
xor r9d, r9d
mov r11, r14
jmp 0x140052108
mov r11, qword [r11 + 8]
mov r8d, dword [r11]
mov r13d, r8d
sub r13d, esi
lea esi, [rdx + r13]
mov eax, ecx
sub eax, edx
cmp esi, ecx
cmovle eax, r13d
mov r13d, r9d
sub r13d, r12d
imul r13d, eax
mov r12d, r9d
add r10d, r13d
add edx, eax
mov esi, r8d
mov r9d, r12d
cmp r8d, r15d
jge 0x140052140
mov r12d, dword [r11 + 4]
mov r13d, r12d
sub r13d, r9d
jle 0x1400520d0
imul r13d, edx
mov r11, qword [r11 + 8]
mov r8d, dword [r11]
mov eax, r8d
cmp esi, ebx
jge 0x140052130
sub eax, ebx
jmp 0x1400520f8
sub eax, esi
jmp 0x1400520f8
mov rax, qword [rsp + 0x40]
add eax, r12d
cmp eax, dword [rsp + 0x3c]
jg 0x140052079
cmp r12d, dword [rsp + 0x28]
jg 0x140052079
jl 0x140052060
cmp r10d, dword [rsp + 0x2c]
jl 0x140052060
jne 0x140052079
cmp ebx, dword [rsp + 0x24]
jl 0x140052060
jmp 0x140052079
cmp qword [rsp + 0x30], 0
mov rsi, qword [rsp + 0x78]
mov rdi, qword [rsp + 0x70]
mov ebx, dword [rsp + 0x50]
mov r15, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x48]
mov r10, qword [rsp + 0x90]
movabs r11, 0x7fffffff7fffffff
mov r14, qword [rsp + 0x88]
mov r12, qword [rsp + 0x80]
je 0x140052260
mov rcx, qword [rsp + 0x40]
add ecx, dword [rsp + 0x28]
cmp ecx, dword [rsp + 0x3c]
jg 0x140052260
mov rax, rcx
mov rcx, qword [r15 + 0x20]
test rcx, rcx
je 0x140052260
mov r9d, dword [rsp + 0x24]
mov dword [rcx], r9d
mov dword [rcx + 4], eax
mov rax, qword [rcx + 8]
mov qword [r15 + 0x20], rax
mov r8, qword [rsp + 0x30]
mov rdx, qword [r8]
cmp dword [rdx], r9d
jge 0x140052216
mov rax, qword [rdx + 8]
add rdx, 8
mov r8, rdx
mov rdx, rax
mov qword [r8], rcx
mov r8, qword [rdx + 8]
add r12d, dword [rsp + 0x24]
test r8, r8
je 0x14005226a
lea r9, [rdx + 8]
nop dword [rax + rax]
cmp dword [r8], r12d
jg 0x14005226a
mov rax, r8
mov r8, qword [r15 + 0x20]
mov qword [r9], r8
mov qword [r15 + 0x20], rdx
lea r9, [rax + 8]
mov r8, qword [rax + 8]
mov rdx, rax
test r8, r8
jne 0x140052230
jmp 0x14005226d
mov qword [rsi + r14*8 + 0xc], r11
jmp 0x140051df9
mov rax, rdx
mov qword [rcx + 8], rax
cmp dword [rax], r12d
jge 0x140052279
mov dword [rax], r12d
mov eax, dword [rsp + 0x24]
mov dword [rsi + r14*8 + 0xc], eax
mov eax, dword [rsp + 0x28]
mov dword [rsi + r14*8 + 0x10], eax
jmp 0x140051df9
cmp ebx, 2
jb 0x1400522af
lea r9, [0x1400583c0]
mov r8d, 0x18
mov rcx, rsi
mov rdx, qword [rsp + 0x60]
call fcn.14013bbb0
test ebx, ebx
jle 0x140052304
shl rdi, 3
lea rax, [rdi + rdi*2]
mov ecx, 1
xor edx, edx
xor r8d, r8d
jmp 0x1400522f1
xor r9d, r9d
cmp dword [rsi + r8 + 0x10], 0x7fffffff
setne r9b
cmove ecx, edx
mov dword [rsi + r8 + 0x14], r9d
add r8, 0x18
cmp rax, r8
je 0x140052304
cmp dword [rsi + r8 + 0xc], 0x7fffffff
je 0x1400522d0
mov r9d, 1
jmp 0x1400522e3
add rsp, 0x98
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret