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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebp, dword [esp + 0x6c]
mov edi, dword [esp + 0x90]
mov eax, dword [esp + 0x7c]
cmp dword [esp + 0x78], eax
jge 0x403469
mov eax, 1
mov ecx, ebp
shl eax, cl
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x78]
imul eax, dword [esp + 0x70]
mov dword [esp + 0x3c], eax
mov esi, dword [esp + 0x78]
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x78]
add esi, esi
mov eax, dword [eax + 0x20]
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x78]
movsx edx, word [eax + esi*2 + 2]
movsx ebx, word [eax + esi*2]
mov eax, dword [esp + 0x8c]
mov esi, edx
xor edx, edx
mov eax, dword [eax + ecx*4]
sub esi, ebx
mov ecx, ebp
add eax, 1
div esi
shr eax, cl
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
fmul dword [0x41e230]
fld qword [0x41e228]
fmulp st(1)
fstp qword [esp]
call dbg.exp
mov eax, esi
mov ecx, ebp
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fmul dword [0x41e234]
shl eax, cl
mov dword [esp + 0x38], eax
fstp dword [esp + 0x2c]
fild dword [esp + 0x38]
fldz
fucompi st(1)
ja 0x403471
fsqrt
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
mov eax, dword [esp + 0x3c]
fdivr dword [0x41e1f8]
add eax, dword [esp + 0x68]
mov dword [esp + 0x28], 0
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], 0
fstp dword [esp + 0x30]
lea esi, [esi]
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x84]
mov edx, dword [eax + 8]
mov eax, dword [esp + 0x20]
imul eax, edx
add eax, dword [esp + 0x78]
cmp dword [esp + 0x70], 1
fld dword [ecx + eax*4]
mov ecx, dword [esp + 0x88]
fld dword [ecx + eax*4]
jne 0x403295
mov ecx, dword [esp + 0x84]
add edx, dword [esp + 0x78]
fld dword [ecx + edx*4]
fxch st(2)
mov ecx, dword [esp + 0x88]
fcomi st(2)
fcmovbe st(0), st(2)
fstp st(2)
fld dword [ecx + edx*4]
fxch st(1)
fcomi st(1)
fcmovbe st(0), st(1)
fstp st(1)
mov ecx, dword [esp + 0x80]
fcomi st(1)
fcmovnbe st(0), st(1)
fstp st(1)
fsubr dword [ecx + eax*4]
fldz
fcompi st(1)
ja 0x403400
fchs
fld qword [0x41e228]
fmulp st(1)
fstp qword [esp]
call dbg.exp
mov eax, ebx
mov ecx, ebp
mov ebx, dword [esp + 0x64]
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
shl eax, cl
add eax, dword [esp + 0x28]
lea ebx, [ebx + eax*4]
fadd st(0)
cmp ebp, 3
je 0x403410
fld dword [esp + 0x2c]
fxch st(1)
mov edx, dword [esp + 0x1c]
fucomi st(1)
fcmovnbe st(0), st(1)
fstp st(1)
fmul dword [esp + 0x30]
test edx, edx
jle 0x403396
fld st(0)
mov dword [esp + 0x24], 0
xor edx, edx
fchs
jmp 0x403321
add edx, 1
cmp edx, dword [esp + 0x1c]
jge 0x403388
mov eax, dword [esp + 0x18]
mov ecx, edx
movzx eax, byte [eax]
sar eax, cl
and eax, 1
jne 0x403318
test esi, esi
jle 0x403438
mov ecx, ebp
mov ebp, ebx
mov ebx, edx
nop
imul edi, edi, 0x19660d
fld st(1)
mov edx, eax
add edi, 0x3c6ef35f
test edi, 0x8000
fcmove st(0), st(1)
shl edx, cl
add eax, 1
add edx, ebx
fstp dword [ebp + edx*4]
cmp esi, eax
jne 0x403340
mov edx, ebx
mov dword [esp + 0x24], 1
mov ebx, ebp
mov ebp, ecx
add edx, 1
cmp edx, dword [esp + 0x1c]
jl 0x403321
fstp st(0)
fstp st(0)
jmp 0x40338c
fstp st(0)
fstp st(0)
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x4033d8
jmp 0x4033a0
fstp st(0)
lea esi, [esi]
nop
add dword [esp + 0x20], 1
mov ecx, dword [esp + 0x74]
add dword [esp + 0x18], 1
mov eax, dword [esp + 0x20]
add dword [esp + 0x28], ecx
cmp dword [esp + 0x70], eax
jle 0x40344e
mov eax, dword [esp + 0x60]
mov ebx, dword [esp + 0x34]
mov eax, dword [eax + 0x20]
movsx ebx, word [eax + ebx]
jmp 0x403240
mov eax, dword [esp + 0x94]
mov dword [esp + 8], 0x3f800000
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 4], eax
call dbg.renormalise_vector
jmp 0x4033a0
fstp st(0)
fldz
fchs
jmp 0x4032b9
fmul dword [0x41e238]
fld dword [esp + 0x2c]
fxch st(1)
fcomi st(1)
fstp st(1)
jbe 0x403445
fstp st(0)
fld dword [esp + 0x2c]
fmul dword [esp + 0x30]
jmp 0x403301
mov dword [esp + 0x24], 1
jmp 0x403318
fmul dword [esp + 0x30]
jmp 0x403301
add dword [esp + 0x78], 1
mov esi, dword [esp + 0x70]
mov eax, dword [esp + 0x78]
add dword [esp + 0x3c], esi
cmp dword [esp + 0x7c], eax
jne 0x40318a
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
fstp qword [esp]
call dbg.sqrt
jmp 0x40320f