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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x80
push ebx
push ebp
push esi
push edi
mov ebp, ecx
mov eax, dword [ebp]
xor ebx, ebx
cmp eax, ebx
jne 0x403965
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x20c]
xor edx, edx
cmp ecx, dword [eax + 0xc]
setge dl
mov eax, edx
cmp eax, ebx
je 0x403997
xor eax, eax
cmp dword [ebp + 4], ebx
je 0x403dfd
mov ecx, 0x80
lea edi, [ebp + 0xc]
mov dword [ebp + 8], ebx
mov dword [ebp + 0x20c], ebx
rep stosd dword es:[edi], eax
mov eax, dword [ebp]
cmp dword [eax + 8], ebx
jle 0x403df5
mov eax, dword [ebp]
lea ecx, [ebx + ebx*4]
shl ecx, 4
sub ecx, ebx
shl ecx, 4
cmp dword [ecx + eax + 0x4f8], 0
lea ecx, [ecx + eax + 0x10]
mov dword [esp + 0x10], ecx
je 0x403de6
mov esi, dword [ebp + ebx*4 + 0xc]
cmp esi, 0xffffffff
je 0x403de6
mov ecx, dword [ecx + 0x4ec]
mov edx, esi
shl edx, 5
sub edx, esi
lea edx, [ecx + edx*4]
mov ecx, dword [ebp + 8]
sub ecx, dword [edx]
mov dword [esp + 0x14], ecx
js 0x403de6
mov edi, ebx
shl edi, 4
sub edi, ebx
add edi, edi
sub edi, ebx
test ecx, ecx
lea eax, [eax + edi*4 + 0x27810]
je 0x403a3b
mov ecx, dword [ebp + 8]
cmp dword [edx + 0x7c], ecx
jne 0x403a3b
mov ecx, dword [esp + 0x10]
add esi, 1
mov dword [ebp + ebx*4 + 0xc], esi
mov ecx, dword [ecx + 0x4e8]
sub ecx, 1
cmp esi, ecx
jl 0x403a38
mov dword [ebp + ebx*4 + 0xc], 0xffffffff
add dword [ebp + 0x20c], 1
add edx, 0x7c
cmp dword [edx + 4], 0
jne 0x403a7f
mov edi, eax
lea esi, [edx + 8]
mov ecx, 0x1d
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp + ebx*4 + 0xc]
cmp eax, 0xffffffff
mov ecx, 0x1d
lea esi, [edx + 8]
lea edi, [esp + 0x18]
rep movsd dword es:[edi], dword [esi]
je case.default.0x403c08
mov ecx, dword [edx + 0x7c]
cmp ecx, dword [edx]
jne case.default.0x403c08
add eax, 1
mov dword [ebp + ebx*4 + 0xc], eax
jmp case.default.0x403c08
movss xmm0, dword [edx + 0x58]
comiss xmm0, dword [0x487664]
xorps xmm2, xmm2
jbe 0x403a95
movss dword [edx + 0x58], xmm2
movss xmm0, dword [edx + 8]
addss xmm0, dword [eax]
movss dword [eax], xmm0
movss xmm0, dword [edx + 0xc]
addss xmm0, dword [eax + 4]
movss dword [eax + 4], xmm0
movss xmm0, dword [edx + 0x10]
addss xmm0, dword [eax + 8]
movss dword [eax + 8], xmm0
movss xmm0, dword [edx + 0x14]
addss xmm0, dword [eax + 0xc]
movss dword [eax + 0xc], xmm0
movss xmm0, dword [edx + 0x18]
addss xmm0, dword [eax + 0x10]
movss dword [eax + 0x10], xmm0
movss xmm0, dword [edx + 0x1c]
addss xmm0, dword [eax + 0x14]
movss dword [eax + 0x14], xmm0
movss xmm0, dword [edx + 0x20]
addss xmm0, dword [eax + 0x18]
movss dword [eax + 0x18], xmm0
movss xmm0, dword [edx + 0x24]
addss xmm0, dword [eax + 0x1c]
movss dword [eax + 0x1c], xmm0
movss xmm0, dword [edx + 0x28]
addss xmm0, dword [eax + 0x20]
movss dword [eax + 0x20], xmm0
movss xmm0, dword [edx + 0x2c]
addss xmm0, dword [eax + 0x24]
movss dword [eax + 0x24], xmm0
movss xmm0, dword [edx + 0x30]
addss xmm0, dword [eax + 0x28]
movss dword [eax + 0x28], xmm0
movss xmm0, dword [edx + 0x34]
addss xmm0, dword [eax + 0x2c]
movss dword [eax + 0x2c], xmm0
movss xmm0, dword [edx + 0x38]
addss xmm0, dword [eax + 0x30]
movss dword [eax + 0x30], xmm0
movss xmm0, dword [edx + 0x3c]
addss xmm0, dword [eax + 0x34]
movss dword [eax + 0x34], xmm0
movss xmm0, dword [edx + 0x40]
addss xmm0, dword [eax + 0x38]
movss dword [eax + 0x38], xmm0
movss xmm0, dword [edx + 0x44]
addss xmm0, dword [eax + 0x3c]
movss dword [eax + 0x3c], xmm0
movss xmm0, dword [edx + 0x48]
addss xmm0, dword [eax + 0x40]
movss dword [eax + 0x40], xmm0
movss xmm0, dword [edx + 0x4c]
addss xmm0, dword [eax + 0x44]
movss dword [eax + 0x44], xmm0
movss xmm0, dword [edx + 0x60]
addss xmm0, dword [eax + 0x58]
movss dword [eax + 0x58], xmm0
movss xmm0, dword [edx + 0x64]
addss xmm0, dword [eax + 0x5c]
movss dword [eax + 0x5c], xmm0
movss xmm0, dword [edx + 0x68]
addss xmm0, dword [eax + 0x60]
movss dword [eax + 0x60], xmm0
movss xmm0, dword [edx + 0x6c]
addss xmm0, dword [eax + 0x64]
movss dword [eax + 0x64], xmm0
movss xmm0, dword [edx + 0x5c]
addss xmm0, dword [eax + 0x54]
movss dword [eax + 0x54], xmm0
mov ecx, 0x1d
mov esi, eax
lea edi, [esp + 0x18]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [edx + 0x54]
add ecx, 0xffffffff
cmp ecx, 4
ja case.default.0x403c08
jmp dword [ecx*4 + 0x403e08]
movss xmm0, dword [edx + 0x50]
addss xmm0, dword [eax + 0x48]
movss dword [eax + 0x48], xmm0
jmp 0x403d1e
movss xmm0, dword [eax + 0x48]
addss xmm0, dword [edx + 0x58]
mov edx, dword [esp + 0x10]
movss dword [eax + 0x48], xmm0
cvtsi2ss xmm1, dword [edx]
comiss xmm0, xmm1
jb 0x403c4c
subss xmm1, dword [0x487644]
movss dword [eax + 0x48], xmm1
movss xmm0, dword [eax + 0x48]
jmp 0x403d1e
movss xmm0, dword [eax + 0x48]
addss xmm0, dword [edx + 0x58]
mov ecx, dword [esp + 0x10]
movss dword [eax + 0x48], xmm0
cvtsi2ss xmm1, dword [ecx]
comiss xmm0, xmm1
jb 0x403c8e
movaps xmm2, xmm0
divss xmm2, xmm1
cvttss2si edx, xmm2
cvtsi2ss xmm2, edx
mulss xmm2, xmm1
subss xmm0, xmm2
movss dword [eax + 0x48], xmm0
movss xmm0, dword [eax + 0x48]
jmp 0x403d1e
movss xmm0, dword [eax + 0x48]
subss xmm0, dword [edx + 0x58]
comiss xmm2, xmm0
movss dword [eax + 0x48], xmm0
jbe 0x403cdc
mov ecx, dword [esp + 0x10]
cvtsi2ss xmm1, dword [ecx]
movaps xmm3, xmm0
divss xmm3, xmm1
cvttss2si edx, xmm3
cvtsi2ss xmm3, edx
mulss xmm3, xmm1
subss xmm0, xmm3
comiss xmm2, xmm0
jbe 0x403cd7
addss xmm1, xmm0
movaps xmm0, xmm1
movss dword [eax + 0x48], xmm0
movss xmm0, dword [eax + 0x48]
jmp 0x403d1e
cvtsi2ss xmm0, dword [esp + 0x14]
mulss xmm0, dword [edx + 0x58]
addss xmm0, dword [eax + 0x48]
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
cvttss2si esi, xmm0
mov eax, esi
sub ecx, 1
cdq
idiv ecx
test al, 1
je 0x403d15
lea edx, [eax + 1]
imul edx, ecx
sub edx, esi
mov esi, edx
jmp 0x403d1a
imul eax, ecx
sub esi, eax
cvtsi2ss xmm0, esi
movss dword [esp + 0x60], xmm0
cmp dword [ebp + 0x210], 0
je 0x403de6
test ebx, ebx
jne 0x403dbd
fld dword [esp + 0x70]
fnstcw word [esp + 0x10]
movzx eax, word [esp + 0x10]
or ah, 0xc
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov ecx, dword [esp + 0x14]
shl ecx, 8
fldcw word [esp + 0x10]
fld dword [esp + 0x74]
fnstcw word [esp + 0x10]
movzx eax, word [esp + 0x10]
or ah, 0xc
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov edx, dword [esp + 0x14]
or ecx, edx
shl ecx, 8
fldcw word [esp + 0x10]
fld dword [esp + 0x78]
fnstcw word [esp + 0x10]
movzx eax, word [esp + 0x10]
or ah, 0xc
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov eax, dword [esp + 0x14]
or ecx, eax
push ecx
mov ecx, dword [0xd36cac]
fldcw word [esp + 0x14]
call fcn.0040a730
jmp 0x403de6
mov ecx, dword [ebp + 0x218]
mov edx, dword [ebp + 0x214]
push ecx
push edx
lea eax, [esp + 0x20]
push eax
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
push ecx
mov ecx, dword [0xd36cac]
add eax, 8
push eax
call fcn.004038f0
mov edx, dword [ebp]
add ebx, 1
cmp ebx, dword [edx + 8]
jl 0x4039a3
mov eax, 1
add dword [ebp + 8], eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret