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

Disassembly:
sub esp, 0x9ec
push ebx
push ebp
mov ebp, dword [esp + 0x9f8]
cmp byte [ebp + 0xa4], 0
push esi
push edi
jne 0x520683
mov edx, dword [ebp + 0xa0]
cmp edx, 2
jl 0x520683
mov eax, dword [ebp + 0xb0]
fild dword [ebp + 0xac]
sub eax, 1
mov dword [esp + 0x14], eax
fidiv dword [esp + 0x14]
lea ecx, [edx + edx - 2]
mov dword [esp + 0x60], ecx
mov ecx, 0x71
lea eax, [esp + 0x120]
fstp dword [esp + 0x20]
lea esp, [esp]
mov dword [eax], 0
add eax, 0x14
sub ecx, 1
jns 0x520050
fldz
add edx, 0xffffffff
test edx, edx
fst dword [esp + 0x2c]
fst dword [esp + 0x30]
mov byte [esp + 0x13], 0
mov dword [esp + 0x1c], 0
jle 0x52065f
lea edi, [esp + 0x114]
lea ebx, [ebp + 8]
cmp byte [esp + 0x13], 0
jne 0x5200b1
mov eax, dword [esp + 0x1c]
fstp st(0)
lea esi, [esp + 0x2c]
mov ecx, ebp
call fcn.0051fe60
fldz
test al, al
je 0x52063d
mov byte [esp + 0x13], 1
mov eax, dword [esp + 0x30]
fst dword [esp + 0x24]
mov edx, dword [esp + 0x2c]
fstp dword [esp + 0x28]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x1c]
add eax, 1
lea esi, [esp + 0x24]
mov ecx, ebp
mov dword [esp + 0x78], edx
mov dword [esp + 0x18], eax
call fcn.0051fe60
test al, al
jne 0x5200f5
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
jmp 0x520105
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
mov edx, dword [ebp + 0xa0]
sub edx, 1
mov dword [esp + 0x14], edx
fild dword [esp + 0x14]
mov esi, dword [ebp + 0xb4]
sub esp, 8
lea eax, [esi + 0x18]
fstp dword [esp + 0x1c]
fild dword [esp + 0x24]
fld dword [esp + 0x1c]
fld st(0)
fdivp st(2)
fld qword [0x668940]
fld st(0)
fsubrp st(3)
fxch st(2)
fstp dword [esp + 0x44]
fidivr dword [esp + 0x20]
fsubp st(1)
fstp dword [esp + 0x1c]
fld dword [ebp + 0xbc]
fstp dword [esp + 4]
fld dword [esp + 0x44]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0x74]
lea eax, [esi + 0x18]
fld dword [ebp + 0xbc]
fstp dword [esp + 4]
fld dword [esp + 0x1c]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0xcc]
lea eax, [esi + 0x20]
fld dword [ebp + 0xc0]
fstp dword [esp + 4]
fld dword [esp + 0x28]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0xe8]
lea eax, [esi + 0x20]
fld dword [ebp + 0xc0]
fstp dword [esp + 4]
fld dword [esp + 0x28]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0xec]
lea eax, [esi + 0x28]
fld dword [ebp + 0xc4]
mov dword [esp + 0x20], eax
fstp dword [esp + 4]
fld dword [esp + 0x1c]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0x40]
add esi, 0x30
fld dword [ebp + 0xc8]
mov eax, esi
fstp dword [esp + 4]
fld dword [esp + 0x28]
fstp dword [esp]
call fcn.00446a10
mov eax, dword [esp + 0x20]
fstp dword [esp + 0xc0]
fild dword [ebp + 0xe4]
fstp dword [esp + 0x3c]
fld dword [ebp + 0xc4]
fstp dword [esp + 4]
fld dword [esp + 0x44]
fstp dword [esp]
call fcn.00446a10
fstp dword [esp + 0x20]
mov eax, esi
fld dword [ebp + 0xc8]
fstp dword [esp + 4]
fld dword [esp + 0x28]
fstp dword [esp]
call fcn.00446a10
fmul dword [esp + 0x20]
add esp, 8
fld dword [esp + 0x34]
fld st(0)
fmulp st(2)
fxch st(1)
fstp dword [esp + 0x34]
fldz
fld dword [esp + 0x34]
fcom st(1)
fnstsw ax
fld qword [0x6885c0]
test ah, 0x41
jne 0x520277
fadd st(1), st(0)
jmp 0x520279
fsub st(1), st(0)
fxch st(1)
call fcn.00643d70
test eax, eax
jg 0x520288
xor esi, esi
jmp 0x520296
cmp eax, 0xff
mov esi, 0xff
jge 0x520296
mov esi, eax
fld dword [esp + 0xb8]
fmul dword [esp + 0x38]
fmulp st(3)
fxch st(2)
fstp dword [esp + 0x38]
fld dword [esp + 0x38]
fcom st(1)
fnstsw ax
test ah, 0x41
jne 0x5202ba
faddp st(2)
jmp 0x5202bc
fsubrp st(2)
fxch st(1)
call fcn.00643d70
test eax, eax
jg 0x5202cb
xor eax, eax
jmp 0x5202d7
cmp eax, 0xff
jl 0x5202d7
mov eax, 0xff
fld dword [esp + 0x78]
mov edx, dword [ebp + 0xdc]
fld st(0)
mov ecx, dword [ebp + 0xd8]
fld dword [esp + 0x6c]
mov dword [esp + 0xf4], edx
fld st(0)
mov edx, dword [ebp + 0xe4]
fmulp st(2)
mov dword [esp + 0xf0], ecx
fxch st(1)
mov ecx, dword [ebp + 0xe0]
mov dword [esp + 0xfc], edx
fstp dword [esp + 0x48]
mov edx, dword [ebp + 0xdc]
fld dword [esp + 0x7c]
mov dword [esp + 0xf8], ecx
fld st(0)
mov ecx, dword [ebp + 0xd8]
fmul st(2)
mov dword [esp + 0x104], edx
mov edx, dword [ebp + 0xe4]
mov dword [esp + 0x100], ecx
fstp dword [esp + 0x4c]
mov ecx, dword [ebp + 0xe0]
fld dword [esp + 0x48]
mov dword [esp + 0x10c], edx
fld dword [esp + 0xe0]
mov dword [esp + 0x108], ecx
fld st(0)
mov dword [esp + 0xfc], esi
fmulp st(2)
mov dword [esp + 0x10c], eax
fxch st(1)
fstp dword [esp + 0xe8]
fld dword [esp + 0x4c]
fmul st(1)
fstp dword [esp + 0xec]
fld dword [ebx - 8]
fadd dword [ebp + 0xcc]
fstp dword [esp + 0x88]
fld dword [ebp + 0xd0]
fadd dword [ebx - 4]
fstp dword [esp + 0x8c]
fld dword [esp + 0x88]
fadd dword [esp + 0xe8]
fstp dword [esp + 0xbc]
fld dword [esp + 0x8c]
fadd dword [esp + 0xec]
fstp dword [esp + 0xc0]
fxch st(3)
fchs
fstp dword [esp + 0x98]
fchs
fstp dword [esp + 0x9c]
fld dword [esp + 0x98]
fmul st(1)
fstp dword [esp + 0xd0]
fmul dword [esp + 0x9c]
fstp dword [esp + 0xd4]
fld dword [esp + 0xd0]
fmul st(1)
fstp dword [esp + 0x50]
fmul dword [esp + 0xd4]
fstp dword [esp + 0x54]
fld dword [ebx - 8]
fadd dword [ebp + 0xcc]
fstp dword [esp + 0xa8]
fld dword [ebp + 0xd0]
fadd dword [ebx - 4]
fstp dword [esp + 0xac]
fld dword [esp + 0xa8]
fadd dword [esp + 0x50]
fstp dword [esp + 0xc8]
fld dword [esp + 0xac]
fadd dword [esp + 0x54]
fstp dword [esp + 0xcc]
fld dword [esp + 0x24]
fld st(0)
fld dword [esp + 0xc4]
fld st(0)
fmulp st(2)
lea ecx, [esp + 0xf0]
fxch st(1)
fstp dword [esp + 0x58]
fld dword [esp + 0x28]
fld st(0)
fmul st(2)
fstp dword [esp + 0x5c]
fld dword [esp + 0x58]
fld dword [esp + 0xe4]
fld st(0)
fmulp st(2)
fxch st(1)
fstp dword [esp + 0x70]
fld dword [esp + 0x5c]
fmul st(1)
fstp dword [esp + 0x74]
fld dword [ebp + 0xcc]
fadd dword [ebx]
fstp dword [esp + 0x64]
fld dword [ebp + 0xd0]
fadd dword [ebx + 4]
fstp dword [esp + 0x68]
fld dword [esp + 0x64]
fadd dword [esp + 0x70]
fstp dword [esp + 0x40]
fld dword [esp + 0x68]
fadd dword [esp + 0x74]
fstp dword [esp + 0x44]
fxch st(3)
fchs
fstp dword [esp + 0x80]
fchs
fstp dword [esp + 0x84]
fld dword [esp + 0x80]
fmul st(1)
fstp dword [esp + 0x90]
fmul dword [esp + 0x84]
fstp dword [esp + 0x94]
fld dword [esp + 0x90]
fmul st(1)
fstp dword [esp + 0xb0]
fmul dword [esp + 0x94]
fstp dword [esp + 0xb4]
fld dword [ebx]
fadd dword [ebp + 0xcc]
fstp dword [esp + 0xa0]
fld dword [ebp + 0xd0]
fadd dword [ebx + 4]
fstp dword [esp + 0xa4]
fld dword [esp + 0xa0]
fadd dword [esp + 0xb0]
fstp dword [esp + 0xd8]
fld dword [esp + 0xa4]
fadd dword [esp + 0xb4]
fstp dword [esp + 0xdc]
fld dword [esp + 0xbc]
fstp dword [edi - 4]
fld dword [esp + 0xc0]
fstp dword [edi]
fld dword [esp + 0x3c]
fst dword [edi + 4]
fld1
fst dword [edi + 8]
call fcn.0056a420
fld dword [esp + 0xc8]
fst dword [edi + 0x10]
mov edx, eax
fld dword [esp + 0xcc]
mov dword [edi + 0xc], edx
fst dword [edi + 0x14]
mov dword [edi + 0x20], edx
fxch st(3)
fst dword [edi + 0x18]
fxch st(4)
fst dword [edi + 0x1c]
fld dword [esp + 0x40]
fst dword [edi + 0x24]
fld dword [esp + 0x44]
fstp dword [edi + 0x28]
fld dword [esp + 0x14]
fst dword [edi + 0x2c]
lea ecx, [esp + 0x100]
fxch st(4)
fst dword [edi + 0x30]
call fcn.0056a420
fxch st(1)
mov dword [edi + 0x34], eax
fstp dword [edi + 0x38]
mov dword [edi + 0x48], eax
fld dword [esp + 0x44]
mov dword [edi + 0x5c], edx
fstp dword [edi + 0x3c]
mov dword [edi + 0x70], eax
fxch st(3)
fst dword [edi + 0x40]
fxch st(3)
fstp dword [edi + 0x44]
fxch st(1)
fstp dword [edi + 0x4c]
fxch st(2)
fstp dword [edi + 0x50]
fxch st(2)
fstp dword [edi + 0x54]
fst dword [edi + 0x58]
fld dword [esp + 0xd8]
fstp dword [edi + 0x60]
fld dword [esp + 0xdc]
fstp dword [edi + 0x64]
fxch st(1)
fstp dword [edi + 0x68]
fst dword [edi + 0x6c]
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 0xa0]
add eax, 1
sub ecx, 1
add ebx, 8
add edi, 0x78
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x52008a
mov edx, dword [esp + 0x60]
fstp st(0)
mov ecx, dword [ebp + 0xb4]
push edx
mov edx, dword [ecx]
lea eax, [esp + 0x114]
push eax
mov eax, dword [esp + 0xa0c]
push edx
call fcn.0058d7e0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9ec
ret 8