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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x198
mov eax, dword [0x5de00c]
xor eax, esp
mov dword [esp + 0x194], eax
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x18]
push edi
mov edi, ecx
mov dword [esp + 0x2c], eax
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ecx
mov edx, dword [edi + 0x78]
test edx, edx
je 0x40ee08
mov ecx, dword [edi + 0x7c]
test ecx, ecx
je 0x40ee08
push esi
push edx
push eax
call fcn.004cd380
movss xmm0, dword [edi + 8]
lea eax, [esp + 0x158]
push ecx
movss dword [esp], xmm0
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixRotationY]
lea eax, [esp + 0x44]
mov dword [esp + 0x44], 0
push eax
lea eax, [edi + 0x20]
mov dword [esp + 0x4c], 0x3f800000
push eax
lea eax, [edi + 0x14]
mov dword [esp + 0x54], 0
push eax
lea eax, [esp + 0xa4]
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixLookAtLH]
mov eax, dword [edi + 0x78]
lea edx, [esp + 0x98]
push edx
push str.g_viewing
push eax
mov ecx, dword [eax]
call dword [ecx + 0x98]
movss xmm1, dword [edi + 0x28]
xor ecx, ecx
subss xmm1, dword [edi + 0x1c]
mov eax, dword [edi + 0x84]
sub eax, dword [edi + 0x80]
sar eax, 2
mov dword [esp + 0x1c], eax
mulss xmm1, dword [0x5c6ebc]
mov dword [esp + 0x14], ecx
addss xmm1, dword [edi + 0x1c]
movss dword [esp + 0x10], xmm1
test eax, eax
je 0x40ec74
mov eax, dword [edi + 0x80]
sub esp, 0xc
mov esi, dword [eax + ecx*4]
lea eax, [esp + 0x5c]
movss xmm0, dword [esi + 0x30]
movss dword [esp + 8], xmm0
movss dword [esp + 4], xmm0
movss dword [esp], xmm0
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixScaling]
movss xmm0, dword [esi + 0x20]
lea eax, [esp + 0xd8]
sub esp, 0xc
movss dword [esp + 8], xmm0
movss xmm0, dword [esi + 0x1c]
movss dword [esp + 4], xmm0
movss xmm0, dword [esi + 0x18]
movss dword [esp], xmm0
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixRotationYawPitchRoll]
movss xmm0, dword [esi + 8]
lea eax, [esp + 0x118]
sub esp, 0xc
movss dword [esp + 8], xmm0
movss xmm0, dword [esi + 4]
movss dword [esp + 4], xmm0
movss xmm0, dword [esi]
movss dword [esp], xmm0
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixTranslation]
lea eax, [esp + 0xd8]
push eax
lea eax, [esp + 0x54]
push eax
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixMultiply]
lea eax, [esp + 0x118]
push eax
lea eax, [esp + 0x54]
push eax
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixMultiply]
lea eax, [esp + 0x158]
push eax
lea eax, [esp + 0x54]
push eax
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXMatrixMultiply]
movaps xmm0, xmmword [0x5c7420]
lea eax, [esp + 0x50]
push eax
lea eax, [esp + 0x34]
movaps xmmword [esp + 0x34], xmm0
push eax
push eax
call dword [sym.imp.d3dx9_43.dll_D3DXVec4Transform]
movups xmm0, xmmword [esp + 0x50]
mov ecx, dword [esp + 0x14]
inc ecx
movups xmmword [esi + 0x5c], xmm0
mov dword [esp + 0x14], ecx
movups xmm0, xmmword [esp + 0x60]
movups xmmword [esi + 0x6c], xmm0
movups xmm0, xmmword [esp + 0x70]
movups xmmword [esi + 0x7c], xmm0
movups xmm0, xmmword [esp + 0x80]
movups xmmword [esi + 0x8c], xmm0
movups xmm0, xmmword [esp + 0x30]
movups xmmword [esi + 0x9c], xmm0
cmp ecx, dword [esp + 0x1c]
jb 0x40eb44
mov edx, dword [edi + 0x84]
mov eax, edx
mov ecx, dword [edi + 0x80]
sub eax, ecx
push dword [esp + 0x28]
sar eax, 2
push eax
call fcn.0040f1b0
xor esi, esi
add esp, 8
mov dword [esp + 0x20], esi
cmp dword [esp + 0x1c], esi
jbe 0x40eddd
mov ecx, dword [ebp + 0x20]
xorps xmm2, xmm2
movss xmm1, dword [esp + 0x10]
comiss xmm2, xmm1
mov eax, dword [edi + 0x80]
mov esi, dword [eax + esi*4]
mov eax, dword [esp + 0x24]
movss xmm0, dword [edi + 0x10]
mov edi, dword [edi + 0x78]
mov eax, dword [eax + 0x7c]
movss dword [esp + 0x14], xmm0
mov dword [esp + 0x18], eax
jbe 0x40ed0a
xorps xmm1, xmmword [0x5c74e0]
cmp ecx, 1
jne 0x40ecf6
movss xmm0, dword [esi + 0xa4]
comiss xmm0, xmm1
jae 0x40edc0
jmp 0x40ed34
cmp ecx, 2
jne 0x40ed34
comiss xmm1, dword [esi + 0xa4]
ja 0x40edc0
jmp 0x40ed34
cmp ecx, 1
jne 0x40ed1e
comiss xmm1, dword [esi + 0xa4]
ja 0x40edc6
jmp 0x40ed34
cmp ecx, 2
jne 0x40ed34
movss xmm0, dword [esi + 0xa4]
comiss xmm0, xmm1
jae 0x40edc6
mov ecx, dword [edi]
lea eax, [esi + 0x5c]
push eax
push str.g_world
push edi
call dword [ecx + 0x98]
xorps xmm0, xmm0
comiss xmm0, dword [esi + 0x3c]
jbe 0x40ed7b
comiss xmm0, dword [esi + 0x40]
jbe 0x40ed7b
movss xmm3, dword [esi + 4]
movsd xmm1, qword [0x5c6f38]
cvtps2pd xmm0, xmm3
push edi
push ecx
mov ecx, dword [esp + 0x20]
comisd xmm1, xmm0
jbe 0x40edaf
mulss xmm3, dword [0x5c71d8]
jmp 0x40edb5
movss xmm3, dword [esi + 0x48]
movss xmm1, dword [esi + 4]
movaps xmm0, xmm3
subss xmm0, dword [0x5c6e9c]
push edi
push ecx
mov ecx, dword [esp + 0x20]
comiss xmm1, xmm0
jbe 0x40edaf
subss xmm3, xmm1
mulss xmm3, dword [0x5c71d8]
mulss xmm3, dword [esp + 0x1c]
jmp 0x40edb5
movss xmm3, dword [esp + 0x1c]
call fcn.004cd790
mov ecx, dword [ebp + 0x20]
xorps xmm2, xmm2
movss xmm1, dword [esp + 0x10]
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
inc esi
mov dword [esp + 0x20], esi
cmp esi, dword [esp + 0x1c]
jb 0x40ecb0
mov esi, dword [esp + 0x2c]
push 1
push 0x16
push esi
mov eax, dword [esi]
call dword [eax + 0xe4]
mov eax, dword [esi]
push 0
push 7
push esi
call dword [eax + 0xe4]
push dword [esp + 0x28]
mov eax, dword [esi]
push esi
call dword [eax + 0x15c]
mov ecx, dword [esp + 0x19c]
pop edi
pop esi
xor ecx, esp
call fcn.0052d3c5
mov esp, ebp
pop ebp
ret 0x1c