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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x434
mov eax, dword [ebp + 8]
test eax, eax
push ebx
push esi
push edi
jne 0x502150
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x1c]
test ecx, ecx
mov eax, dword [ebp + 0x18]
je 0x502163
mov ecx, dword [ecx + 0x40]
test ecx, ecx
je 0x502163
mov eax, ecx
push eax
lea eax, [esp + 0x3c4]
push eax
call fcn.006be140
mov ebx, dword [ebp + 0xc]
add esp, 8
lea esi, [ebx + 0x24]
xor edi, edi
lea esp, [esp]
mov eax, dword [esi - 4]
cmp eax, 4
ja case.default.0x50218c
jmp dword [eax*4 + 0x50250c]
fld dword [0x892fa8]
push 0x3f800000
fsub dword [esi + 4]
sub esp, 8
lea ecx, [esp + edi + 0x16c]
fstp dword [esp + 4]
fld dword [esi]
fadd dword [0x895b14]
fstp dword [esp]
push ecx
jmp 0x50236f
fld dword [ebx + 0x80]
mov eax, dword [ebp + 0x10]
fsub dword [eax]
fstp dword [esp + edi + 0x160]
fld dword [ebx + 0x84]
fsub dword [eax + 4]
fstp dword [esp + edi + 0x164]
fld dword [ebx + 0x88]
fsub dword [eax + 8]
fstp dword [esp + edi + 0x168]
jmp case.default.0x50218c
fld dword [0x892fa8]
push 0x3f800000
fsub dword [esi + 4]
sub esp, 8
lea ebx, [esp + edi + 0x16c]
fstp dword [esp + 4]
fld dword [esi]
fadd dword [0x895b14]
fstp dword [esp]
push ebx
call fcn.004fc320
fld dword [ebx]
fld dword [esp + edi + 0x174]
lea ecx, [esp + 0x20]
fchs
push ecx
fstp dword [ebx]
mov edx, dword [ebx]
fld dword [esp + edi + 0x17c]
mov dword [esp + 0x24], edx
fchs
lea edx, [esp + 0x3d4]
fstp dword [esp + edi + 0x178]
mov eax, dword [esp + edi + 0x178]
mov dword [esp + 0x28], eax
push edx
fst dword [esp + edi + 0x180]
mov eax, ecx
fstp dword [esp + 0x30]
push eax
mov dword [esp + 0x38], 0
call fcn.006bd920
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov dword [ebx], ecx
mov ebx, dword [ebp + 0xc]
add esp, 0x1c
mov dword [esp + edi + 0x164], edx
mov dword [esp + edi + 0x168], eax
jmp case.default.0x50218c
cmp eax, 2
mov ecx, dword [0x9b392c]
jne 0x5022c8
mov edx, dword [ecx + 0x188]
mov eax, dword [ecx + 0x184]
mov ecx, dword [ecx + 0x180]
push edx
push eax
push ecx
lea edx, [esp + 0x2c]
push edx
jmp 0x5022f3
fld dword [ecx + 0x188]
sub esp, 0xc
fchs
lea eax, [esp + 0x2c]
fstp dword [esp + 8]
fld dword [ecx + 0x184]
fchs
fstp dword [esp + 4]
fld dword [ecx + 0x180]
fchs
fstp dword [esp]
push eax
call fcn.004fc3c0
fld dword [esp + 0x30]
add esp, 0x10
call fcn.007c4b80
movzx ecx, ax
mov dword [esp + 0xc], ecx
fild dword [esp + 0xc]
fmul dword [0x894958]
fld dword [esp + 0x24]
call fcn.007c4b80
movzx edx, ax
mov dword [esp + 0xc], edx
push 0x3f800000
sub esp, 8
fild dword [esp + 0x18]
lea eax, [esp + edi + 0x16c]
fmul dword [0x894958]
fadd dword [0x892fa8]
fxch st(1)
fadd dword [esi]
fstp dword [esp + 0x2c]
fadd dword [esi + 4]
fstp dword [esp + 0x30]
fld dword [0x892fa8]
fsub dword [esp + 0x30]
fstp dword [esp + 4]
fld dword [esp + 0x2c]
fadd dword [0x895b14]
fstp dword [esp]
push eax
call fcn.004fc320
add esp, 0x10
fld dword [esi + 0x14]
mov dword [esp + edi + 0x3c], 0
fld st(0)
add edi, 0x10
fmul dword [esi + 8]
add esi, 0x1c
cmp edi, 0x30
fmul dword [0x899dd8]
fstp dword [esp + edi + 0x20]
fld st(0)
fmul dword [esi - 0x10]
fmul dword [0x899dd8]
fstp dword [esp + edi + 0x24]
fmul dword [esi - 0xc]
fmul dword [0x899dd8]
fstp dword [esp + edi + 0x28]
jl 0x502180
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x5023f8
push eax
lea ecx, [esp + 0x404]
push ecx
call fcn.006be140
add esp, 8
lea esi, [esp + 0x160]
mov edi, 3
push esi
lea edx, [esp + 0x404]
push edx
push esi
call fcn.006bd940
add esp, 0xc
add esi, 0x10
dec edi
jne 0x5023e0
xor esi, esi
lea ebx, [ebx]
lea eax, [esp + esi + 0x160]
push eax
lea ecx, [esp + esi + 0x294]
push ecx
call fcn.0045f490
fld dword [esp + esi + 0x3c]
fld dword [esp + esi + 0x40]
mov edx, dword [esp + esi + 0x44]
fld dword [esp + esi + 0x38]
mov dword [esp + 0x14], edx
fmul dword [0x899dd0]
add esi, 0x10
add esp, 8
cmp esi, 0x30
fstp dword [esp + esi + 0x20]
fxch st(1)
fmul dword [0x899dd0]
fstp dword [esp + esi + 0x24]
fmul dword [0x899dd0]
fstp dword [esp + esi + 0x28]
fld dword [esp + 0xc]
fmul dword [0x899dd0]
fstp dword [esp + esi + 0x2c]
jl 0x502400
mov eax, dword [ebp + 8]
mov ecx, dword [esp + 0x290]
mov edx, dword [esp + 0x294]
mov dword [eax + 0x50], ecx
mov ecx, dword [esp + 0x298]
mov dword [eax + 0x60], edx
mov edx, dword [esp + 0x2a0]
mov dword [eax + 0x70], ecx
mov ecx, dword [esp + 0x2a4]
mov dword [eax + 0x54], edx
mov edx, dword [esp + 0x2a8]
mov dword [eax + 0x64], ecx
mov ecx, dword [esp + 0x2b0]
mov dword [eax + 0x74], edx
mov edx, dword [esp + 0x2b4]
mov dword [eax + 0x58], ecx
mov ecx, dword [esp + 0x2b8]
mov dword [eax + 0x68], edx
mov edx, dword [esp + 0x30]
mov dword [eax + 0x78], ecx
mov ecx, dword [esp + 0x34]
mov dword [eax + 0x10], edx
mov edx, dword [esp + 0x38]
mov dword [eax + 0x14], ecx
mov ecx, dword [esp + 0x40]
mov dword [eax + 0x18], edx
mov edx, dword [esp + 0x44]
mov dword [eax + 0x20], ecx
mov ecx, dword [esp + 0x48]
mov dword [eax + 0x24], edx
mov edx, dword [esp + 0x50]
mov dword [eax + 0x28], ecx
mov ecx, dword [esp + 0x54]
mov dword [eax + 0x30], edx
mov edx, dword [esp + 0x58]
pop edi
pop esi
mov dword [eax + 0x34], ecx
mov dword [eax + 0x38], edx
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret