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

Disassembly:
sub esp, 0xbc
mov eax, dword [0x9c48d0]
xor eax, esp
mov dword [esp + 0xb4], eax
push ebx
push ebp
mov ebp, dword [esp + 0xcc]
push esi
push edi
mov edi, dword [ebp + 0x78]
mov eax, dword [esp + 0xd0]
imul edi, edi, 0xfc
add edi, dword [ebp + 0x70]
mov dword [esp + 0x38], eax
mov ebx, dword [edi + 0xa0]
mov eax, dword [ebx + 0x3c]
fld dword [edi + 0x98]
mov esi, ecx
fmul dword [edi + 0xa4]
mov ecx, dword [ebp]
mov dword [esp + 0x18], esi
mov dword [esp + 0x2c], ecx
fstp dword [esp + 0x78]
mov dword [esp + 0x30], edi
fldz
mov dword [esp + 0x40], ebx
fst dword [esp + 0x7c]
fst dword [esp + 0x80]
fld dword [edi + 0xa4]
fstp dword [esp + 0x84]
fstp dword [esp + 0x88]
fld dword [edi + 0xac]
fstp dword [esp + 0x8c]
test eax, eax
je 0x5134e1
lea edx, [esp + 0xa4]
push edx
push eax
mov eax, esi
call fcn.005579e0
add esp, 8
mov dword [esp + 0x34], eax
test eax, eax
jne 0x5134fe
cmp esi, dword [ebx + 0x40]
jge 0x51350d
mov eax, dword [ebx + 0x44]
movzx ecx, word [eax + esi*2]
mov dword [esp + 0xa4], ecx
mov dword [esp + 0x34], 1
jmp 0x513503
cmp eax, 1
jne 0x513520
cmp dword [esp + 0xa4], 0
jne 0x513520
mov dword [esp + 0xa4], 0x3f
mov dword [esp + 0x34], 1
mov edx, dword [ebx + 0xc]
cmp dword [edx + 0x24], 0
je 0x513538
mov eax, esi
mov ecx, ebx
call fcn.0051ac70
mov dword [esp + 0x28], eax
jmp 0x51353c
mov dword [esp + 0x28], esi
cmp dword [ebx + 0x48], 1
jne 0x513566
mov eax, dword [ebx + 0xc]
cmp dword [eax + 0x24], 0
je 0x513562
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
push ecx
push ebx
push edx
call fcn.00557150
add esp, 0xc
mov dword [esp + 0x28], eax
cmp dword [ebx + 0x48], 1
fld qword [0x9adcf8]
jne 0x5135e6
push esi
mov eax, ebx
lea esi, [esp + 0x94]
call fcn.00557e30
fld dword [edi + 0xa4]
mov ecx, dword [eax]
fabs
mov dx, word [eax + 8]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
mov dword [esp + 0x58], ecx
mov ecx, dword [eax + 4]
movsx eax, cx
mov dword [esp + 0x18], eax
mov dword [esp + 0x5c], ecx
add esp, 4
fild dword [esp + 0x14]
shr ecx, 0x10
movsx ecx, cx
fmulp st(1)
mov dword [esp + 0x14], ecx
mov word [esp + 0x5c], dx
fmul st(1)
fldz
fsubrp st(1)
fstp dword [esp + 0x88]
fild dword [esp + 0x14]
fmul dword [edi + 0xa4]
fmulp st(1)
fsubr dword [esp + 0x8c]
fstp dword [esp + 0x8c]
jmp 0x5135e8
fstp st(0)
lea ecx, [ebp + 0x50]
lea edx, [esp + 0x78]
lea eax, [esp + 0x60]
mov dword [esp + 0x14], ecx
call fcn.004bdca0
mov ecx, dword [esp + 0x2c]
mov edx, eax
mov eax, dword [esp + 0x28]
push edx
push eax
mov eax, dword [ebx + 0xc]
lea edi, [esp + 0x4c]
call fcn.005049f0
fld dword [esp + 0x4c]
fld1
add esp, 8
fsub st(1), st(0)
fxch st(1)
fstp dword [esp + 0x44]
fld dword [esp + 0x48]
fsub st(1)
fstp dword [esp + 0x48]
fld dword [esp + 0x4c]
fadd st(1)
fstp dword [esp + 0x4c]
fadd dword [esp + 0x50]
fstp dword [esp + 0x50]
mov ecx, dword [ebx + 0xc]
cmp dword [ecx + 0x24], 0
jne 0x513650
cmp dword [ebp + 0xc], 0
jg 0x513685
cmp dword [ecx + 0x5c], 0
je 0x51367b
mov eax, dword [ecx + 0x68]
test eax, eax
je 0x51367b
mov edx, dword [esp + 0x28]
test edx, edx
js 0x51367b
cmp edx, dword [ecx + 0x8c]
jge 0x51367b
movsx eax, byte [eax + edx]
shr eax, 2
not eax
and eax, 1
je 0x513685
mov dword [esp + 0x3c], 0
jmp 0x51368d
mov dword [esp + 0x3c], 1
mov edx, dword [ebp + 0x24]
test edx, edx
je 0x513738
cmp ecx, dword [edx]
jne 0x513738
mov ecx, dword [ebx + 0x48]
cmp ecx, dword [edx + 0x1c]
jne 0x513738
fld dword [esp + 0x60]
fsub dword [edx + 4]
fabs
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
fld dword [0x9ad800]
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 5
jnp 0x513736
fld dword [esp + 0x64]
fsub dword [edx + 8]
fabs
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x513736
fld dword [esp + 0x68]
fsub dword [edx + 0xc]
fabs
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
fcomp st(1)
fnstsw ax
test ah, 0x41
je 0x513736
fld dword [esp + 0x6c]
fsub dword [edx + 0x10]
fabs
fstp dword [esp + 0x24]
fcomp dword [esp + 0x24]
fnstsw ax
test ah, 5
jnp 0x513738
mov edx, dword [esp + 0x30]
mov eax, dword [edx + 0xa8]
cmp eax, dword [ebp + 0x68]
jne 0x513738
cmp dword [esp + 0x3c], 0
je 0x5137e6
jmp 0x513738
fstp st(0)
mov ecx, dword [esp + 0x38]
push ebp
push ecx
call fcn.00512f90
mov edx, dword [ebx + 0x48]
mov ecx, dword [esp + 0x34]
mov esi, eax
mov eax, dword [ebx + 0xc]
push edx
push eax
push ecx
lea edi, [esp + 0x74]
mov dword [esp + 0x44], esi
call fcn.00518580
fldz
mov dword [ebp + 0x24], eax
fst dword [eax + 0x14]
mov edx, dword [ebp + 0x24]
fstp dword [edx + 0x18]
mov eax, dword [esi + 0xa8]
mov dword [ebp + 0x68], eax
mov ecx, dword [0x7b8dfc]
mov dword [ebp + 0x28], ecx
mov edx, dword [0x7b8e00]
mov dword [ebp + 0x2c], edx
mov eax, dword [0x7b8e04]
mov dword [ebp + 0x30], eax
mov ecx, dword [0x7b8e08]
add esp, 0x14
cmp dword [esp + 0x3c], 0
mov dword [ebp + 0x34], ecx
je 0x5137e6
mov edi, esi
mov ecx, edi
lea edx, [esp + 0x60]
lea eax, [esp + 0x78]
call fcn.004bdca0
mov edx, dword [ebp + 0xc]
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x28]
mov esi, dword [ecx + 0xc]
mov ecx, dword [esp + 0x2c]
push edx
push edi
mov edi, dword [ebp + 4]
push eax
lea ebx, [esp + 0x84]
call fcn.00504940
mov ebx, dword [esp + 0x4c]
add esp, 0xc
mov dword [ebp + 0x68], 3
lea ecx, [ebp + 0x28]
lea edx, [esp + 0x44]
call fcn.004be9a0
mov esi, dword [ebp + 0x24]
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0xa4]
push esi
call fcn.00518a50
fld dword [esp + 0x74]
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x28]
add edx, edx
mov dword [eax + edx*8 + 0xc], edi
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x28]
mov eax, dword [esp + 0x2c]
add ecx, ecx
mov dword [edx + ecx*8 + 8], eax
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x28]
add ecx, ecx
fstp dword [edx + ecx*8]
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x28]
fld dword [esp + 0x78]
add eax, eax
mov edi, 1
fstp dword [ecx + eax*8 + 4]
add dword [esi + 0x20], edi
add esp, 4
cmp dword [esp + 0x34], edi
jle 0x5138b6
mov esi, dword [ebp + 0x24]
mov edx, dword [esp + edi*4 + 0xa4]
mov eax, dword [esp + 0x2c]
push esi
mov dword [esp + 0x3c], edx
call fcn.00518a50
fld dword [esp + 0x74]
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x28]
mov edx, dword [esp + 0x3c]
add eax, eax
mov dword [ecx + eax*8 + 0xc], edx
mov eax, dword [esi + 0x20]
mov ecx, dword [esi + 0x28]
add eax, eax
mov dword [ecx + eax*8 + 8], 0xffffffff
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x28]
add edx, edx
fstp dword [eax + edx*8]
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x28]
fld dword [esp + 0x78]
add ecx, ecx
fstp dword [edx + ecx*8 + 4]
inc dword [esi + 0x20]
inc edi
add esp, 4
cmp edi, dword [esp + 0x34]
jl 0x513852
cmp dword [ebx + 0x48], 0
jne 0x513977
mov ecx, dword [ebx + 0x4c]
mov edx, dword [ebx + 0x5c]
xor esi, esi
dec ecx
test edx, edx
je 0x5138f7
test ecx, ecx
js 0x5138f7
mov edi, dword [esp + 0x18]
lea eax, [ecx + esi]
sar eax, 1
movzx ebp, word [edx + eax*8]
cmp edi, ebp
jge 0x5138e7
lea ecx, [eax - 1]
jmp 0x5138f3
movzx esi, word [edx + eax*8 + 2]
cmp edi, esi
jle 0x513966
lea esi, [eax + 1]
cmp esi, ecx
jle 0x5138d1
mov eax, dword [ebx + 0x54]
mov ecx, dword [ebx + 0x58]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
fild dword [esp + 0x1c]
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x14]
fmul qword [0x9adcf8]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fmul dword [ecx + 0xa4]
fadd dword [ecx + 0x90]
fmul dword [ecx + 0x98]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fld st(0)
fmul dword [eax]
fld dword [eax + 8]
fldz
fmul st(1), st(0)
fxch st(2)
faddp st(1)
fadd dword [eax + 0x10]
fstp dword [eax + 0x10]
fld dword [eax + 4]
fmulp st(2)
fld dword [eax + 0xc]
fmul st(1)
faddp st(2)
fld dword [eax + 0x14]
faddp st(2)
fxch st(1)
fstp dword [eax + 0x14]
jmp 0x513981
mov ecx, dword [edx + eax*8]
mov edx, dword [edx + eax*8 + 4]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
jmp 0x513905
fldz
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
cmp dword [ebx + 0x48], 1
jne 0x5139df
movsx edx, word [esp + 0x5c]
mov dword [esp + 0x18], edx
fild dword [esp + 0x18]
fmul qword [0x9adcf8]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fmul dword [ecx + 0xa4]
fadd dword [ecx + 0x90]
fstp dword [esp + 0x18]
fld dword [eax + 8]
fld dword [esp + 0x18]
fld st(0)
fmulp st(2)
fld dword [eax]
fmul st(3)
faddp st(2)
fld dword [eax + 0x10]
faddp st(2)
fxch st(1)
fstp dword [eax + 0x10]
fmul dword [eax + 0xc]
fld dword [eax + 4]
fmulp st(2)
faddp st(1)
fadd dword [eax + 0x14]
fstp dword [eax + 0x14]
jmp 0x5139e1
fstp st(0)
mov ecx, dword [esp + 0xc4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0065865c
add esp, 0xbc
ret