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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x68
mov ecx, dword [ebp + 0x1c]
mov dword [esp + 0x34], 0
push esi
push edi
test ecx, ecx
je 0x5d8563
mov esi, dword [ebp + 8]
mov edx, 1
mov edi, dword [ebp + 0xc]
dec esi
shl edx, cl
dec edi
add esi, edx
add edi, edx
shr esi, cl
shr edi, cl
jmp 0x5d856a
mov esi, 1
mov edi, esi
imul edi, esi
mov eax, 1
mov esi, dword [ebp + 0x20]
mov ecx, esi
shl eax, cl
xor ecx, ecx
test esi, esi
push 1
cmovle eax, ecx
mov dword [esp + 0x64], edi
push ecx
lea eax, [eax*4 + 0x115b]
imul eax, edi
add eax, 0xc
push eax
call fcn.005a6680
mov ecx, eax
add esp, 0xc
mov dword [esp + 0xc], ecx
xorps xmm0, xmm0
movsd qword [esp + 0x68], xmm0
test ecx, ecx
jne 0x5d85ba
mov dword [esp + 0xc], 0
jmp 0x5d8613
lea eax, [ecx + 0xc]
mov dword [ecx + 4], edi
push esi
push ecx
mov dword [ecx + 8], eax
mov dword [ecx], edi
call fcn.005d79d0
add esp, 8
xor ecx, ecx
test edi, edi
jle 0x5d8613
mov eax, dword [esp + 0xc]
mov eax, dword [eax + 8]
mov eax, dword [eax + ecx*4]
inc ecx
mov dword [eax + 0xca4], esi
mov dword [eax + 0xca8], 0
movups xmmword [eax + 0xcb0], xmm0
movups xmmword [eax + 0xcc0], xmm0
mov dword [eax + 0xcd0], 0
mov byte [eax + 0xcd4], 0
cmp ecx, edi
jl 0x5d85d5
cmp dword [ebp + 0x18], 0
lea esi, [edi + edi]
mov edx, 4
mov eax, 0x40
cmovne eax, edx
mov dword [esp + 0x38], eax
mov eax, esi
push edx
cdq
push edx
push eax
call fcn.005a6680
mov ecx, eax
add esp, 0xc
mov eax, edi
mov dword [esp + 0x10], ecx
add esi, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x18], esi
test eax, eax
je 0x5d8d47
test ecx, ecx
je 0x5d8d47
push eax
push dword [ebp + 0x10]
push dword [ebp + 0x1c]
push dword [ebp + 8]
call fcn.005d6e60
mov edx, dword [ebp + 0x24]
add esp, 0x10
mov eax, dword [esp + 0xc]
mov dword [esp + 0x24], 0
mov edi, dword [edx + 8]
mov ecx, dword [eax + 8]
mov dword [esp + 0x30], edi
xor edi, edi
mov dword [esp + 0x28], edi
cmp dword [eax + 4], edi
jle 0x5d8817
mov eax, dword [esp + 0x30]
sub ecx, eax
mov dword [esp + 0x50], ecx
lea eax, [eax + edi*4]
mov esi, dword [ecx + eax]
push esi
mov dword [esp + 0x44], eax
mov dword [esp + 0x24], esi
call fcn.005d7a70
add esp, 4
cmp byte [esi + 0xcd0], 0
jne 0x5d877f
cmp byte [esi + 0xcd1], 0
jne 0x5d877f
cmp byte [esi + 0xcd2], 0
jne 0x5d877f
cmp byte [esi + 0xcd3], 0
jne 0x5d877f
cmp byte [esi + 0xcd4], 0
jne 0x5d877f
mov edx, dword [ebp + 0x24]
mov eax, dword [edx + 8]
mov dword [eax + edi*4], 0
mov eax, dword [esp + 0x14]
mov ecx, dword [edx]
dec eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], eax
lea eax, [ecx - 1]
cmp edi, eax
jne 0x5d8740
cmp ecx, 1
jl 0x5d8740
mov eax, dword [edx + 8]
lea eax, [eax + ecx*4]
add eax, 0xfffffffc
cmp dword [eax], 0
jne 0x5d8740
dec ecx
sub eax, 4
mov dword [edx], ecx
cmp ecx, 1
jge 0x5d8730
mov esi, dword [esp + 0xc]
mov eax, dword [esi + 8]
mov dword [eax + edi*4], 0
mov ecx, dword [esi]
lea eax, [ecx - 1]
cmp edi, eax
jne 0x5d8775
cmp ecx, 1
jl 0x5d8775
mov eax, dword [esi + 8]
lea eax, [eax + ecx*4]
add eax, 0xfffffffc
cmp dword [eax], 0
jne 0x5d8775
dec ecx
sub eax, 4
mov dword [esi], ecx
cmp ecx, 1
jge 0x5d8765
mov eax, 0xffff
jmp 0x5d87f6
mov esi, dword [esp + 0x40]
mov esi, dword [esi]
mov eax, dword [esi]
mov edi, dword [esi + 0xca4]
mov ecx, edi
mov dword [esp + 0x40], eax
mov eax, 1
shl eax, cl
xor ecx, ecx
mov dword [esp + 0x48], eax
test edi, edi
cmovle eax, ecx
lea eax, [eax*4 + 0x1138]
push eax
push dword [esp + 0x24]
push esi
call fcn.005e86c0
mov eax, dword [esp + 0x54]
xor edx, edx
mov ecx, dword [esp + 0x4c]
test edi, edi
mov dword [esi], ecx
cmovle eax, edx
lea eax, [eax*4 + 0x460]
push eax
mov eax, dword [esp + 0x30]
push dword [eax]
push ecx
call fcn.005e86c0
mov ecx, dword [esp + 0x3c]
add esp, 0x18
mov edi, dword [esp + 0x28]
mov edx, dword [ebp + 0x24]
mov esi, dword [esp + 0xc]
movzx eax, cx
inc ecx
mov dword [esp + 0x24], ecx
mov ecx, dword [ebp + 0x2c]
mov word [ecx + edi*2], ax
inc edi
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x28], edi
cmp edi, dword [esi + 4]
jl 0x5d86a7
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x38]
movsd xmm1, qword [0x6616f0]
add eax, eax
mov ecx, dword [ebp + 0x14]
movsd qword [esp + 0x28], xmm1
cmp dword [esp + 0x14], eax
jle 0x5d8bba
cmp ecx, 0x64
jge 0x5d8bba
movsd xmm2, qword [0x6617b8]
movsd qword [esp + 0x50], xmm2
cmp ecx, 0x5a
jge 0x5d88a6
mov eax, dword [esp + 0x60]
cmp eax, 0x100
jle 0x5d886d
movsd xmm2, qword [0x6617b0]
movsd qword [esp + 0x50], xmm2
movsd xmm0, qword [0x6740f8]
cmp eax, 0x200
jle 0x5d8886
mulsd xmm2, xmm0
movsd qword [esp + 0x50], xmm2
cmp eax, 0x400
jle 0x5d8897
mulsd xmm2, xmm0
movsd qword [esp + 0x50], xmm2
cmp ecx, 0x32
jg 0x5d88a6
mulsd xmm2, xmm0
movsd qword [esp + 0x50], xmm2
mov eax, dword [edx]
xor ecx, ecx
movsd xmm3, qword [esp + 0x68]
movaps xmm5, xmm1
mov edi, dword [edx + 8]
movaps xmm4, xmm3
mov dword [esp + 0x60], edi
movaps xmm6, xmm1
mov dword [esp + 0x20], eax
movaps xmm7, xmm1
movsd qword [esp + 0x40], xmm3
test eax, eax
jle 0x5d8a2a
movaps xmm3, xmm4
mov esi, eax
nop word [eax + eax]
mov eax, dword [edi + ecx*4]
test eax, eax
je 0x5d8937
movsd xmm1, qword [eax + 0xcb8]
movaps xmm0, xmm1
minsd xmm1, xmm5
maxsd xmm0, xmm4
movaps xmm5, xmm1
movsd xmm1, qword [eax + 0xcc0]
movaps xmm4, xmm0
movaps xmm0, xmm1
minsd xmm1, xmm6
maxsd xmm0, xmm3
movaps xmm6, xmm1
movsd xmm1, qword [eax + 0xcc8]
movaps xmm3, xmm0
movaps xmm0, xmm1
maxsd xmm0, qword [esp + 0x40]
minsd xmm1, xmm7
movsd qword [esp + 0x40], xmm0
movaps xmm7, xmm1
inc ecx
cmp ecx, esi
jl 0x5d88e0
mov esi, dword [esp + 0x18]
xor edx, edx
mov eax, dword [esp + 0x20]
movsd qword [esp + 0x30], xmm4
movsd xmm4, qword [0x661800]
movsd xmm2, qword [esp + 0x30]
movsd qword [esp + 0x48], xmm3
movsd xmm3, qword [esp + 0x68]
nop word [eax + eax]
mov ecx, dword [edi + edx*4]
test ecx, ecx
je 0x5d8a18
movaps xmm1, xmm2
subsd xmm1, xmm5
comisd xmm1, xmm3
jbe 0x5d89a2
movsd xmm0, qword [ecx + 0xcb8]
subsd xmm0, xmm5
mulsd xmm0, xmm4
divsd xmm0, xmm1
cvttsd2si eax, xmm0
jmp 0x5d89a4
xor eax, eax
cmp dword [ebp + 0x18], 0
jne 0x5d8a0c
movsd xmm1, qword [esp + 0x48]
subsd xmm1, xmm6
comisd xmm1, xmm3
jbe 0x5d89d4
movsd xmm0, qword [ecx + 0xcc0]
subsd xmm0, xmm6
mulsd xmm0, xmm4
divsd xmm0, xmm1
cvttsd2si edi, xmm0
jmp 0x5d89d6
xor edi, edi
movsd xmm1, qword [esp + 0x40]
lea edi, [edi + eax*4]
subsd xmm1, xmm7
comisd xmm1, xmm3
jbe 0x5d8a03
movsd xmm0, qword [ecx + 0xcc8]
subsd xmm0, xmm7
mulsd xmm0, xmm4
divsd xmm0, xmm1
cvttsd2si eax, xmm0
jmp 0x5d8a05
xor eax, eax
lea eax, [eax + edi*4]
mov edi, dword [esp + 0x60]
mov ecx, dword [esp + 0x10]
mov word [ecx + edx*2], ax
mov eax, dword [esp + 0x20]
inc edx
cmp edx, eax
jl 0x5d8970
movsd xmm2, qword [esp + 0x50]
mov edx, dword [ebp + 0x24]
push dword [ebp + 0x18]
lea eax, [esp + 0x20]
sub esp, 8
movsd qword [esp], xmm2
push dword [esp + 0x44]
push dword [esp + 0x20]
push dword [ebp + 0x28]
push esi
push dword [ebp + 0x2c]
push eax
push edx
call fcn.005d6fd0
add esp, 0x28
xor edi, edi
mov dword [esp + 0x38], 0
cmp dword [esp + 0x14], edi
jle 0x5d8ac0
movzx ecx, word [esi + edi*2]
mov edx, ecx
movzx eax, word [esi + edx*2]
mov esi, eax
mov dword [esp + 0x60], esi
mov esi, dword [esp + 0x18]
cmp edx, eax
je 0x5d8a9b
movzx ecx, ax
nop dword [eax]
movzx eax, cx
movzx eax, word [esi + eax*2]
mov word [esi + edx*2], ax
mov edx, eax
movzx eax, word [esi + edx*2]
mov ecx, eax
cmp edx, eax
jne 0x5d8a80
movzx ecx, word [esi + edi*2]
movzx eax, cx
cmp edx, eax
je 0x5d8ab1
mov eax, 1
mov word [esi + edi*2], dx
mov dword [esp + 0x38], eax
jmp 0x5d8ab5
mov eax, dword [esp + 0x38]
inc edi
cmp edi, dword [esp + 0x14]
jl 0x5d8a62
test eax, eax
jne 0x5d8a52
mov eax, dword [ebp + 0x24]
xor edi, edi
mov eax, dword [eax + 4]
add eax, eax
push eax
push edi
push dword [esp + 0x18]
call fcn.005e8c40
mov edx, dword [ebp + 0x24]
xor ecx, ecx
add esp, 0xc
cmp dword [edx + 4], ecx
jle 0x5d8b34
mov dword [esp + 0x60], 0xffff
nop word [eax + eax]
mov eax, dword [ebp + 0x2c]
movzx eax, word [eax + ecx*2]
cmp ax, word [esp + 0x60]
je 0x5d8b2e
movzx eax, word [esi + eax*2]
test eax, eax
je 0x5d8b1c
mov edx, dword [esp + 0x10]
cmp word [edx + eax*2], 0
jne 0x5d8b1c
mov esi, edx
inc edi
mov word [esi + eax*2], di
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov ax, word [edx + eax*2]
mov edx, dword [ebp + 0x2c]
mov word [edx + ecx*2], ax
mov edx, dword [ebp + 0x24]
inc ecx
cmp ecx, dword [edx + 4]
jl 0x5d8af0
mov ecx, dword [ebp + 0x14]
mov eax, 1
cmp dword [ebp + 0x18], 0
je 0x5d8b46
test eax, eax
jne 0x5d8bc4
movd xmm1, ecx
lea eax, [esp + 0x60]
cvtdq2ps xmm1, xmm1
push eax
divss xmm1, dword [0x674178]
movaps xmm0, xmm1
mulss xmm0, xmm1
mulss xmm0, xmm1
mulss xmm0, dword [0x661810]
addss xmm0, dword [0x6740c8]
cvttss2si eax, xmm0
push eax
lea eax, [esp + 0x24]
push eax
push edx
call fcn.005d7560
add esp, 0x10
test eax, eax
je 0x5d8d43
cmp dword [esp + 0x60], 0
je 0x5d8bc1
mov esi, dword [ebp + 0x24]
push esi
call fcn.005d7a40
lea eax, [esp + 0x20]
push eax
push esi
call fcn.005d7320
add esp, 0xc
test eax, eax
je 0x5d8d43
mov edx, esi
jmp 0x5d8bc4
xor eax, eax
jmp 0x5d8b3c
mov edx, dword [ebp + 0x24]
push edx
call fcn.005d7a40
mov eax, dword [esp + 0x10]
add esp, 4
mov esi, dword [ebp + 0x24]
mov ecx, dword [eax + 8]
mov edx, dword [esi + 8]
mov eax, dword [esi + 4]
mov esi, dword [esi]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x30], esi
cmp esi, 1
jle 0x5d8d63
xor edi, edi
test eax, eax
jle 0x5d8ccf
movsd xmm2, qword [0x661820]
movsd xmm0, qword [esp + 0x28]
movsd qword [esp + 0x50], xmm2
nop word [eax + eax]
cmp dword [ecx + edi*4], 0
movaps xmm1, xmm0
mov dword [esp + 0x38], 0
movsd qword [esp + 0x60], xmm1
jne 0x5d8c41
mov eax, dword [ebp + 0x2c]
movzx eax, word [eax + edi*2 - 2]
jmp 0x5d8cb9
xor esi, esi
mov eax, dword [edx + esi*4]
lea edx, [esp + 0x68]
push edx
sub esp, 8
movsd xmm0, qword [eax + 0xcb0]
xorps xmm0, xmm2
movsd qword [esp], xmm1
push dword [ecx + edi*4]
movsd qword [esp + 0x78], xmm0
push eax
call fcn.005d6220
movsd xmm0, qword [esp + 0x7c]
add esp, 0x14
test esi, esi
je 0x5d8c86
movsd xmm1, qword [esp + 0x60]
comisd xmm1, xmm0
jbe 0x5d8c97
movaps xmm1, xmm0
mov eax, esi
movsd qword [esp + 0x60], xmm1
mov dword [esp + 0x38], eax
jmp 0x5d8c9b
mov eax, dword [esp + 0x38]
movsd xmm2, qword [esp + 0x50]
inc esi
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
cmp esi, dword [esp + 0x30]
jl 0x5d8c43
movsd xmm0, qword [esp + 0x28]
movzx eax, ax
mov esi, dword [ebp + 0x2c]
mov word [esi + edi*2], ax
inc edi
cmp edi, dword [esp + 0x18]
jl 0x5d8c20
mov esi, dword [esp + 0x30]
mov edi, dword [ebp + 0x24]
push edi
call fcn.005d9910
add esp, 4
mov dword [edi], esi
cmp dword [esp + 0x18], 0
jle 0x5d8d3b
mov eax, dword [esp + 0x1c]
xor edi, edi
nop word [eax + eax]
mov ecx, dword [eax + edi*4]
mov dword [esp + 0x60], ecx
test ecx, ecx
je 0x5d8d34
mov eax, dword [ebp + 0x2c]
mov edx, dword [esp + 0x20]
movzx eax, word [eax + edi*2]
mov esi, dword [edx + eax*4]
push esi
push esi
push ecx
call fcn.005dd880
mov eax, dword [esp + 0x6c]
or ecx, 0xffffffff
add esp, 0xc
mov eax, dword [eax + 0xca8]
cmp eax, dword [esi + 0xca8]
cmove ecx, eax
mov eax, dword [esp + 0x1c]
mov dword [esi + 0xca8], ecx
inc edi
cmp edi, dword [esp + 0x18]
jl 0x5d8cf0
mov dword [esp + 0x3c], 1
mov eax, dword [esp + 0xc]
push eax
call fcn.00447f00
push dword [esp + 0x14]
call fcn.00447f00
mov eax, dword [esp + 0x44]
add esp, 8
pop edi
pop esi
mov esp, ebp
pop ebp
ret
test eax, eax
jle 0x5d8ccf
mov edi, dword [ebp + 0x2c]
mov ecx, eax
xor eax, eax
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov edi, dword [ebp + 0x24]
push edi
call fcn.005d9910
add esp, 4
mov dword [edi], esi
jmp 0x5d8ce4