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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x74
mov eax, dword [0x59ad00]
xor eax, esp
mov dword [esp + 0x70], eax
mov eax, dword [0x5f4210]
mov ecx, dword [0x5f4214]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [0x5f41f8], eax
cmp eax, ecx
jl 0x516855
mov eax, dword [0x5f420c]
add ecx, 0x400
push 0x10
push ecx
push eax
mov dword [0x5f4214], ecx
call fcn.00519050
mov dword [0x5f420c], eax
mov eax, dword [0x5f41f8]
add esp, 0xc
mov edx, dword [0x5f420c]
fld qword [ebp + 0xc]
mov ecx, dword [0x5f421c]
add eax, eax
mov dword [edx + eax*8], ecx
fld qword [0x594578]
fdivr st(1)
mov ecx, dword [0x5f420c]
inc dword [0x5f4210]
mov dword [esp + 0x60], esi
fstp qword [ecx + eax*8 + 8]
lea ecx, [esi + esi*2]
shl ecx, 4
mov dword [esp + 0x58], ecx
add ecx, dword [0x5f4098]
mov eax, dword [ecx]
mov ebx, dword [ecx + 4]
lea edx, [ebx + ebx*2]
mov dword [esp + 0x5c], eax
mov eax, dword [0x5f408c]
add edx, edx
fld qword [eax + edx*8 + 0x10]
fst qword [esp + 0x48]
mov edi, dword [ecx + 0x10]
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 0xc]
mov ecx, dword [ecx + 0x14]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x44], edi
mov dword [esp + 0x40], edx
mov dword [esp + 0x64], ecx
cmp edi, 2
jne 0x5168f4
cmp ecx, edi
jne 0x5168d7
jmp 0x516916
mov edi, dword [0x5f40f0]
mov ecx, edx
shl ecx, 6
cmp dword [ecx + edi], eax
je 0x516914
cmp dword [ecx + edi + 4], eax
je 0x516914
mov edi, 1
jmp 0x516916
cmp ecx, 2
jne 0x516914
mov ecx, dword [0x5f40f0]
shl eax, 6
cmp dword [eax + ecx], edx
je 0x516914
cmp dword [eax + ecx + 4], edx
je 0x516914
mov edi, 1
jmp 0x516916
xor edi, edi
mov ecx, dword [0x5f4380]
lea eax, [esi + esi*4]
add eax, eax
add eax, eax
add eax, eax
cmp byte [eax + ecx], 0
mov dword [esp + 0x54], eax
je 0x516979
fstp st(1)
test edi, edi
jne 0x51693f
push esi
fstp st(0)
call fcn.00529050
jmp 0x51695b
cmp edi, 1
jne 0x51694e
push esi
fstp st(0)
call fcn.005286e0
jmp 0x51695b
cmp edi, 2
jne 0x51696a
push esi
fstp st(0)
call fcn.00528d80
fld qword [esp + 0x4c]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x58]
add esp, 4
mov ecx, dword [0x5f4380]
fld qword [ebp + 0xc]
mov byte [eax + ecx], 0
fxch st(1)
mov eax, dword [0x5f438c]
lea ecx, [eax + esi*2]
mov byte [esi + ecx + 1], 0
test edi, edi
jne 0x5169aa
lea edx, [esp + 0x68]
fstp st(0)
push edx
sub esp, 8
fstp qword [esp]
push esi
call fcn.00529130
fld qword [esp + 0x58]
mov edx, dword [esp + 0x50]
add esp, 0x10
jmp 0x516a16
cmp edi, 1
jne 0x5169ef
lea eax, [esp + 0x68]
fstp st(0)
push eax
sub esp, 8
cmp dword [esp + 0x50], 0
fstp qword [esp]
jne 0x5169db
mov ecx, dword [esp + 0x48]
push ecx
push esi
call fcn.00528bc0
fld qword [esp + 0x5c]
mov edx, dword [esp + 0x54]
add esp, 0x14
jmp 0x516a16
push edx
push esi
call fcn.00528bc0
fld qword [esp + 0x5c]
mov edx, dword [esp + 0x54]
add esp, 0x14
jmp 0x516a16
cmp edi, 2
jne 0x516a14
lea ecx, [esp + 0x68]
fstp st(0)
push ecx
sub esp, 8
fstp qword [esp]
push esi
call fcn.00528f20
fld qword [esp + 0x58]
mov edx, dword [esp + 0x50]
add esp, 0x10
jmp 0x516a16
fstp st(1)
fcomp qword [ebp + 0xc]
mov ecx, dword [esp + 0x3c]
or esi, 0xffffffff
fnstsw ax
test ah, 0x41
jne 0x516a57
mov eax, dword [esp + 0x64]
mov edi, edx
mov dword [esp + 0x44], eax
test eax, eax
jne 0x516a43
mov eax, dword [0x5f40f0]
shl edx, 6
mov esi, dword [edx + eax + 0x38]
jmp 0x516a89
cmp eax, 2
jne 0x516a89
lea ecx, [edx + edx*4]
mov edx, dword [0x5f40d4]
mov esi, dword [edx + ecx*8 + 0x1c]
jmp 0x516a89
mov eax, dword [esp + 0x44]
mov edi, ecx
mov dword [esp + 0x44], eax
test eax, eax
jne 0x516a73
mov eax, dword [0x5f40f0]
shl ecx, 6
mov esi, dword [ecx + eax + 0x38]
jmp 0x516a85
cmp eax, 2
jne 0x516a85
mov edx, dword [0x5f40d4]
lea ecx, [ecx + ecx*4]
mov esi, dword [edx + ecx*8 + 0x1c]
mov ebx, dword [esp + 0x5c]
mov dword [esp + 0x3c], ebx
cmp esi, 0xffffffff
jne 0x516aec
mov eax, dword [0x5f4220]
mov ecx, dword [0x5f421c]
cmp ecx, eax
jl 0x516ac7
add eax, 0x8000
push 0x18
push eax
mov dword [0x5f4220], eax
mov eax, dword [0x5f4218]
push eax
call fcn.00519050
mov ecx, dword [0x5f421c]
add esp, 0xc
mov dword [0x5f4218], eax
mov edx, dword [0x5f4218]
mov esi, dword [esp + 0x44]
lea eax, [ecx + ecx*2]
add eax, eax
add eax, eax
add eax, eax
mov dword [eax + edx], edi
mov edx, dword [0x5f4218]
mov dword [eax + edx + 4], esi
jmp 0x516bd2
mov ecx, dword [0x5f40fc]
mov eax, esi
imul eax, eax, 0x68
fld qword [eax + ecx + 8]
fld qword [eax + ecx + 0x10]
fld qword [eax + ecx + 0x50]
mov ecx, dword [0x5f421c]
fxch st(2)
fsub qword [esp + 0x68]
fst qword [0x77af08]
fxch st(1)
fsub qword [esp + 0x70]
fst qword [0x77aee8]
fmul st(0), st(0)
fld st(1)
fmulp st(2)
faddp st(1)
fld st(1)
fmulp st(2)
fcompp
fnstsw ax
test ah, 5
mov eax, dword [0x5f4220]
jp 0x516b88
cmp ecx, eax
jl 0x516b66
mov edx, dword [0x5f4218]
add eax, 0x8000
push 0x18
push eax
push edx
mov dword [0x5f4220], eax
call fcn.00519050
mov ecx, dword [0x5f421c]
add esp, 0xc
mov dword [0x5f4218], eax
mov edx, dword [0x5f4218]
lea eax, [ecx + ecx*2]
add eax, eax
add eax, eax
add eax, eax
mov dword [eax + edx], esi
mov edx, dword [0x5f4218]
mov dword [eax + edx + 4], 6
jmp 0x516bd2
cmp ecx, eax
jl 0x516bb2
add eax, 0x8000
push 0x18
push eax
mov dword [0x5f4220], eax
mov eax, dword [0x5f4218]
push eax
call fcn.00519050
mov ecx, dword [0x5f421c]
add esp, 0xc
mov dword [0x5f4218], eax
mov edx, dword [0x5f4218]
lea eax, [ecx + ecx*2]
add eax, eax
add eax, eax
add eax, eax
mov dword [eax + edx], esi
mov edx, dword [0x5f4218]
mov dword [eax + edx + 4], 7
mov edx, dword [0x5f4218]
fld qword [esp + 0x68]
fstp qword [eax + edx + 8]
lea eax, [eax + edx + 8]
fld qword [esp + 0x70]
inc ecx
fstp qword [eax + 8]
mov edx, dword [0x5f4098]
mov edi, dword [0x5f408c]
fld qword [ebp + 0xc]
mov dword [0x5f421c], ecx
mov eax, dword [esp + 0x58]
cmp dword [eax + edx], ebx
jne 0x516c10
mov esi, dword [eax + edx + 0x18]
jmp 0x516c14
mov esi, dword [eax + edx + 0x20]
lea ecx, [esi + esi*2]
shl ecx, 4
mov eax, dword [ecx + edx]
mov ebx, dword [ecx + edx + 4]
mov dword [esp + 0x58], ecx
add ecx, edx
mov dword [esp + 0x5c], eax
lea eax, [eax + eax*2]
add eax, eax
fld qword [edi + eax*8 + 0x10]
lea eax, [ebx + ebx*2]
add eax, eax
fld qword [edi + eax*8 + 0x10]
fst qword [esp + 0x48]
fcom st(1)
fnstsw ax
test ah, 0x41
jne 0x516c4e
fld st(1)
jmp 0x516c50
fld st(0)
fcomp st(3)
fnstsw ax
test ah, 0x41
jp 0x516cab
fcom st(1)
fnstsw ax
test ah, 5
jnp 0x516c68
fstp st(1)
fld st(0)
fxch st(1)
fxch st(1)
fcomp st(2)
fnstsw ax
test ah, 0x41
jne 0x516cad
cmp esi, dword [esp + 0x60]
jne 0x5168b0
mov ecx, dword [0x5f421c]
fstp st(0)
mov edx, dword [0x5f41f8]
fstp st(0)
mov eax, dword [0x5f420c]
dec ecx
pop edi
add edx, edx
mov dword [eax + edx*8 + 4], ecx
mov ecx, dword [esp + 0x78]
pop esi
pop ebx
xor ecx, esp
call fcn.00551a8e
mov esp, ebp
pop ebp
ret
fstp st(1)
mov eax, dword [ecx]
fstp st(0)
cmp eax, dword [esp + 0x3c]
jne 0x516cc0
mov dword [esp + 0x3c], ebx
jmp 0x516c01
mov ebx, eax
mov dword [esp + 0x3c], ebx
jmp 0x516c01