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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
push 0xffffffffffffffff
push 0x5e8f81
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, 0x4bb8
call fcn.005ca380
push esi
push edi
mov eax, dword [0x6396a8]
xor eax, esp
push eax
lea eax, [esp + 0x4bf8]
mov dword fs:[0], eax
mov ecx, dword [ebp + 0xc]
mov esi, edx
fld1
fcom dword [ebx + 0x34]
fnstsw ax
test ah, 1
jne 0x407521
fcom dword [ebx + 0x38]
fnstsw ax
test ah, 1
jne 0x407521
mov eax, dword [ebx + 4]
fstp st(0)
xor edi, edi
cmp eax, edi
je 0x40738d
mov ecx, dword [ebx + 8]
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
jne 0x407392
call fcn.005b2af7
mov eax, dword [ebx + 4]
mov eax, dword [eax]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push eax
push edi
push ecx
mov ecx, dword [edx + 0x8c]
call ecx
push eax
mov ecx, str.SetTexture_gTexture
call fcn.00404ab0
add esp, 4
xor ecx, ecx
cmp dword [ebp + 0xc], edi
mov dword [esp + 0xc], edi
jle 0x40750a
fld dword [ebp + 0x18]
add esi, 0x10
fld dword [ebp + 0x14]
fldz
fld1
fld dword [esi - 0x10]
mov edx, dword [esi]
fadd st(3)
lea eax, [ecx + ecx*2]
shl eax, 5
lea eax, [esp + eax + 0x2644]
fstp dword [eax]
add ecx, 1
cmp edx, edi
fld dword [esi - 0xc]
fadd st(4)
fstp dword [eax + 4]
fxch st(1)
fst dword [eax + 8]
fxch st(1)
fst dword [eax + 0xc]
jne 0x407403
mov edx, dword [ebp + 0x10]
fld dword [esi - 8]
mov dword [eax + 0x10], edx
fmul dword [ebx + 0x34]
mov edx, dword [esi + 0x14]
cmp edx, edi
mov dword [eax + 0x14], edi
fstp dword [eax + 0x18]
fld dword [esi - 4]
fmul dword [ebx + 0x38]
fstp dword [eax + 0x1c]
fld dword [esi + 4]
fadd st(3)
fstp dword [eax + 0x20]
fld dword [esi + 8]
fadd st(4)
fstp dword [eax + 0x24]
fxch st(1)
fst dword [eax + 0x28]
fxch st(1)
fst dword [eax + 0x2c]
jne 0x40743f
mov edx, dword [ebp + 0x10]
fld dword [esi + 0xc]
mov dword [eax + 0x30], edx
fmul dword [ebx + 0x34]
mov edx, dword [esi + 0x28]
cmp edx, edi
mov dword [eax + 0x34], edi
fstp dword [eax + 0x38]
fld dword [esi + 0x10]
fmul dword [ebx + 0x38]
fstp dword [eax + 0x3c]
fld dword [esi + 0x18]
fadd st(3)
fstp dword [eax + 0x40]
fld dword [esi + 0x1c]
fadd st(4)
fstp dword [eax + 0x44]
fxch st(1)
fst dword [eax + 0x48]
fxch st(1)
fst dword [eax + 0x4c]
jne 0x40747b
mov edx, dword [ebp + 0x10]
cmp ecx, 0x64
fld dword [esi + 0x20]
fmul dword [ebx + 0x34]
mov dword [eax + 0x50], edx
mov dword [eax + 0x54], edi
fstp dword [eax + 0x58]
fld dword [esi + 0x24]
fmul dword [ebx + 0x38]
fstp dword [eax + 0x5c]
je 0x4074a4
mov edx, dword [ebp + 0xc]
add edx, 0xffffffff
cmp dword [esp + 0xc], edx
jne 0x4074eb
mov eax, dword [ebp + 8]
fstp st(3)
mov edx, dword [eax]
fstp st(1)
mov edx, dword [edx + 0x64]
fstp st(0)
push edi
fstp st(0)
lea ecx, [ecx + ecx*2]
push ecx
lea ecx, [esp + 0x264c]
push ecx
push 0x1c4
push 4
push eax
call edx
push eax
mov ecx, str.DrawPrimitive__TriList_
call fcn.00404ab0
fldz
fld1
add esp, 4
fld dword [ebp + 0x14]
xor ecx, ecx
fld dword [ebp + 0x18]
fxch st(3)
fxch st(1)
fxch st(2)
mov eax, dword [esp + 0xc]
add eax, 1
add esi, 0x3c
cmp eax, dword [ebp + 0xc]
mov dword [esp + 0xc], eax
jl 0x4073d1
fstp st(3)
fstp st(1)
fstp st(0)
fstp st(0)
mov ecx, dword [esp + 0x4bf8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x14
test ecx, ecx
jle 0x407508
fld dword [ebp + 0x18]
add esi, 0x10
fld dword [ebp + 0x14]
mov dword [esp + 0x24], esi
fldz
mov dword [esp + 0x28], ecx
jmp 0x40754e
fldz
fld1
fld dword [ebp + 0x14]
fld dword [ebp + 0x18]
fxch st(2)
fxch st(3)
mov eax, dword [esp + 0x24]
fld dword [eax - 0x10]
mov ecx, dword [eax]
mov esi, dword [ebp + 0x10]
fadd st(2)
xor edx, edx
cmp ecx, edx
fstp dword [esp + 0x34]
mov dword [esp + 0x44], ecx
fld dword [eax - 0xc]
fadd st(3)
fstp dword [esp + 0x38]
fst dword [esp + 0x3c]
fxch st(3)
fst dword [esp + 0x40]
jne 0x407581
mov dword [esp + 0x44], esi
fld dword [eax - 8]
mov ecx, dword [eax + 0x14]
cmp ecx, edx
fmul dword [ebx + 0x34]
mov dword [esp + 0x48], edx
mov dword [esp + 0x64], ecx
fstp dword [esp + 0x4c]
fld dword [eax - 4]
fmul dword [ebx + 0x38]
fstp dword [esp + 0x50]
fld dword [eax + 4]
fadd st(2)
fstp dword [esp + 0x54]
fld dword [eax + 8]
fadd st(3)
fstp dword [esp + 0x58]
fxch st(3)
fst dword [esp + 0x5c]
fxch st(3)
fst dword [esp + 0x60]
jne 0x4075c6
mov dword [esp + 0x64], esi
fld dword [eax + 0xc]
mov ecx, dword [eax + 0x28]
cmp ecx, edx
fmul dword [ebx + 0x34]
mov dword [esp + 0x68], edx
mov dword [esp + 0x84], ecx
fstp dword [esp + 0x6c]
fld dword [eax + 0x10]
fmul dword [ebx + 0x38]
fstp dword [esp + 0x70]
fld dword [eax + 0x18]
faddp st(2)
fxch st(1)
fstp dword [esp + 0x74]
fld dword [eax + 0x1c]
faddp st(2)
fxch st(1)
fstp dword [esp + 0x78]
fxch st(1)
fst dword [esp + 0x7c]
fxch st(1)
fstp dword [esp + 0x80]
jne 0x407618
mov dword [esp + 0x84], esi
fld dword [eax + 0x20]
mov dword [esp + 0x88], edx
fmul dword [ebx + 0x34]
fstp dword [esp + 0x8c]
fld dword [eax + 0x24]
fmul dword [ebx + 0x38]
fstp dword [esp + 0x90]
fld dword [ebx + 0x34]
fstp dword [esp + 0x18]
fld dword [ebx + 0x38]
fstp dword [esp + 0x14]
fst dword [esp + 0x10]
fst dword [esp + 0xc]
fld dword [esp + 0x4c]
fld dword [esp + 0x18]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x407664
fst dword [esp + 0x18]
fld dword [esp + 0x50]
fld dword [esp + 0x14]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x407679
fst dword [esp + 0x14]
fxch st(1)
fcom st(2)
fnstsw ax
test ah, 0x41
jne 0x40768a
fstp dword [esp + 0x10]
jmp 0x40768c
fstp st(0)
fcom st(1)
fnstsw ax
fstp st(1)
test ah, 0x41
jne 0x40769d
fstp dword [esp + 0xc]
jmp 0x40769f
fstp st(0)
fld dword [esp + 0x6c]
fld dword [esp + 0x18]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x4076b4
fst dword [esp + 0x18]
fld dword [esp + 0x70]
fld dword [esp + 0x14]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x4076c9
fst dword [esp + 0x14]
fld dword [esp + 0x10]
fcomp st(2)
fnstsw ax
test ah, 5
jp 0x4076de
fxch st(1)
fstp dword [esp + 0x10]
jmp 0x4076e0
fstp st(1)
fld dword [esp + 0xc]
fcomp st(1)
fnstsw ax
test ah, 5
jp 0x4076f3
fstp dword [esp + 0xc]
jmp 0x4076f5
fstp st(0)
fld dword [esp + 0x8c]
fld dword [esp + 0x18]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x40770d
fst dword [esp + 0x18]
fld dword [esp + 0x90]
fld dword [esp + 0x14]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x407725
fst dword [esp + 0x14]
fld dword [esp + 0x10]
fcomp st(2)
fnstsw ax
test ah, 5
jp 0x40773a
fxch st(1)
fstp dword [esp + 0x10]
jmp 0x40773c
fstp st(1)
fld dword [esp + 0xc]
fcomp st(1)
fnstsw ax
test ah, 5
jp 0x40774f
fstp dword [esp + 0xc]
jmp 0x407751
fstp st(0)
lea eax, [esp + 0xd24]
mov dword [esp + 0x19a4], eax
mov eax, 0x64
mov dword [esp + 0x19ac], eax
xor edx, edx
mov dword [esp + 0x4c00], edx
mov ecx, 8
lea esi, [esp + 0x34]
lea edi, [esp + 0xd24]
rep movsd dword es:[edi], dword [esi]
mov ecx, 8
lea esi, [esp + 0x54]
lea edi, [esp + 0xd44]
rep movsd dword es:[edi], dword [esi]
mov ecx, 8
lea esi, [esp + 0x74]
lea edi, [esp + 0xd64]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x19b4]
mov dword [esp + 0x19a8], 3
mov dword [esp + 0x2634], ecx
mov dword [esp + 0x2638], edx
mov dword [esp + 0x263c], eax
sub esp, 8
fld dword [esp + 0x20]
mov byte [esp + 0x4c08], 1
fstp qword [esp]
call fcn.005d1040
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
call fcn.005b3030
fld dword [esp + 0x1c]
mov edi, eax
fstp qword [esp]
mov dword [esp + 0x34], edi
call fcn.005d1040
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
call fcn.005b3030
fld dword [esp + 0x18]
fstp qword [esp]
mov esi, eax
call fcn.005b5e60
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
call fcn.005b3030
fld dword [esp + 0x14]
fstp qword [esp]
mov dword [esp + 0x1c], eax
call fcn.005b5e60
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
add esp, 8
call fcn.005b3030
test edi, edi
mov dword [esp + 0x18], eax
jge 0x40785f
mov dword [esp + 0x2c], 0
test esi, esi
jge 0x407865
xor esi, esi
mov eax, dword [ebx + 0x1c]
cmp dword [esp + 0x14], eax
jle 0x407872
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x20]
mov edi, dword [esp + 0x18]
cmp edi, eax
jle 0x407883
mov edi, eax
mov dword [esp + 0x18], edi
mov eax, dword [ebx + 4]
test eax, eax
je 0x4078a1
mov ecx, dword [ebx + 8]
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
jne 0x4078a6
call fcn.005b2af7
cmp esi, edi
mov ecx, dword [ebx + 4]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x10], esi
jge 0x407bad
lea esp, [esp]
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x14]
mov dword [esp + 0xc], eax
jge 0x407b98
fild dword [esp + 0x10]
fstp dword [esp + 0x20]
lea ebx, [ebx]
mov esi, dword [ebx + 0x1c]
imul esi, dword [esp + 0x10]
mov eax, dword [ebx + 4]
add esi, dword [esp + 0xc]
test eax, eax
je 0x40790c
mov ecx, dword [ebx + 8]
sub ecx, eax
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jb 0x407911
call fcn.005b2af7
mov eax, dword [ebx + 4]
mov edi, dword [esp + 0x19a8]
cmp edi, 0x64
lea edx, [esi + esi*2]
lea esi, [eax + edx*4]
lea ecx, [esp + 0x94]
mov eax, edi
mov dword [esp + 0xd14], ecx
mov dword [esp + 0xd18], eax
mov dword [esp + 0xd1c], 0x64
jle 0x4079b1
xor ecx, ecx
mov edx, 0x20
mul edx
seto cl
mov dword [esp + 0xd1c], edi
neg ecx
or ecx, eax
push ecx
call fcn.005b25e7
mov ecx, dword [esp + 0xd18]
mov edi, eax
mov eax, dword [esp + 0xd1c]
add esp, 4
shl eax, 5
push eax
push ecx
push edi
call fcn.005b92e0
mov eax, dword [esp + 0xd20]
lea edx, [esp + 0xa0]
add esp, 0xc
cmp eax, edx
je 0x4079a1
push eax
call fcn.005b28f2
add esp, 4
mov eax, dword [esp + 0xd18]
mov ecx, edi
mov dword [esp + 0xd14], ecx
shl eax, 5
push eax
mov eax, dword [esp + 0x19a8]
push eax
push ecx
call fcn.005b92e0
add esp, 0xc
fild dword [esp + 0xc]
mov byte [esp + 0x4c00], 2
mov eax, dword [esp + 0xd14]
fstp dword [esp + 0x30]
mov edx, dword [esp + 0x10]
fld dword [eax + 0x18]
fld dword [esp + 0x30]
fld st(0)
fsubp st(2)
fxch st(1)
fstp dword [eax + 0x18]
mov eax, dword [esp + 0xd14]
fld dword [eax + 0x1c]
fld dword [esp + 0x20]
fld st(0)
fsubp st(2)
fxch st(1)
fstp dword [eax + 0x1c]
mov ecx, dword [ebx + 0x20]
sub ecx, 1
cmp edx, ecx
mov ecx, dword [esp + 0x1c]
jne 0x407a29
fild dword [ecx + 8]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 8]
fmul dword [eax + 0x1c]
fstp dword [eax + 0x1c]
mov eax, dword [ebx + 0x1c]
mov edi, dword [esp + 0xc]
sub eax, 1
cmp edi, eax
jne 0x407a4a
fild dword [ecx + 4]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 4]
fmul dword [eax + 0x18]
fstp dword [eax + 0x18]
mov eax, dword [esp + 0xd14]
fld dword [eax + 0x38]
fsub st(2)
fstp dword [eax + 0x38]
mov eax, dword [esp + 0xd14]
fld dword [eax + 0x3c]
fsub st(1)
fstp dword [eax + 0x3c]
mov eax, dword [ebx + 0x20]
sub eax, 1
cmp edx, eax
jne 0x407a85
fild dword [ecx + 8]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 8]
fmul dword [eax + 0x3c]
fstp dword [eax + 0x3c]
mov eax, dword [ebx + 0x1c]
sub eax, 1
cmp edi, eax
jne 0x407aa2
fild dword [ecx + 4]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 4]
fmul dword [eax + 0x38]
fstp dword [eax + 0x38]
mov eax, dword [esp + 0xd14]
fld dword [eax + 0x58]
fsubrp st(2)
fxch st(1)
fstp dword [eax + 0x58]
mov eax, dword [esp + 0xd14]
fsubr dword [eax + 0x5c]
fstp dword [eax + 0x5c]
mov eax, dword [ebx + 0x20]
sub eax, 1
cmp edx, eax
jne 0x407add
fild dword [ecx + 8]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 8]
fmul dword [eax + 0x5c]
fstp dword [eax + 0x5c]
mov edx, dword [ebx + 0x1c]
sub edx, 1
cmp edi, edx
jne 0x407afa
fild dword [ecx + 4]
mov eax, dword [esp + 0xd14]
fidiv dword [esi + 4]
fmul dword [eax + 0x58]
fstp dword [eax + 0x58]
lea edi, [esp + 0x94]
call fcn.00406da0
cmp dword [esp + 0xd18], 3
jl 0x407b60
mov ecx, dword [esi]
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov edx, dword [eax + 0x8c]
push ecx
push 0
push edi
call edx
push eax
mov ecx, str.SetTexture_gTexture
call fcn.00404ab0
mov ecx, dword [esp + 0xd1c]
mov edx, dword [esp + 0xd18]
mov eax, dword [edi]
mov eax, dword [eax + 0x64]
add esp, 4
push 0
push ecx
push edx
push 0x1c4
push 6
push edi
call eax
push eax
mov ecx, str.DrawPrimitive__Tri__4
call fcn.00404ab0
add esp, 4
mov byte [esp + 0x4c00], 1
mov eax, dword [esp + 0xd14]
lea ecx, [esp + 0x94]
cmp eax, ecx
je 0x407b83
push eax
call fcn.005b28f2
add esp, 4
mov eax, dword [esp + 0xc]
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [esp + 0xc], eax
jl 0x4078e0
mov eax, dword [esp + 0x10]
add eax, 1
cmp eax, dword [esp + 0x18]
mov dword [esp + 0x10], eax
jl 0x4078c0
mov eax, dword [esp + 0x2634]
lea edx, [esp + 0x19b4]
cmp eax, edx
je 0x407bc8
push eax
call fcn.005b28f2
add esp, 4
mov dword [esp + 0x4c00], 0xffffffff
mov eax, dword [esp + 0x19a4]
lea ecx, [esp + 0xd24]
cmp eax, ecx
je 0x407bee
push eax
call fcn.005b28f2
add esp, 4
add dword [esp + 0x24], 0x3c
sub dword [esp + 0x28], 1
jne 0x407540
mov ecx, dword [esp + 0x4bf8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x14