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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xbc
push ebx
push esi
push edi
mov esi, edx
mov edi, eax
mov ebx, ecx
call fcn.00405240
test al, al
je 0x4089ed
mov eax, dword [ebp + 8]
push eax
mov eax, esi
call fcn.004080b0
fild dword [ebx]
fld qword [0x613e20]
mov eax, dword [edi + 0xc]
shl eax, 8
fsub st(1), st(0)
or eax, dword [edi]
fxch st(1)
xor ecx, ecx
shl eax, 8
fstp dword [esp + 0x14]
or eax, dword [edi + 4]
mov dword [esp + 0x5c], ecx
fisubr dword [ebx + 4]
shl eax, 8
or eax, dword [edi + 8]
cmp dword [esi + 0x54], ecx
mov dword [esp + 0x58], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x98], eax
fstp dword [esp + 0x20]
mov dword [esp + 0x9c], ecx
fild dword [ebx + 8]
mov dword [esp + 0xb8], eax
mov dword [esp + 0xbc], ecx
fstp dword [esp + 0x10]
fild dword [ebx + 0xc]
fstp dword [esp + 0x18]
fld dword [esp + 0x14]
fst dword [esp + 0x48]
fld dword [esp + 0x20]
fst dword [esp + 0x4c]
fldz
fst dword [esp + 0x50]
fld1
fst dword [esp + 0x54]
fxch st(1)
fst dword [esp + 0x60]
fst dword [esp + 0x64]
fxch st(3)
fst dword [esp + 0x68]
fld dword [esp + 0x18]
fadd st(3)
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fst dword [esp + 0x6c]
fxch st(4)
fst dword [esp + 0x70]
fxch st(2)
fst dword [esp + 0x74]
fxch st(2)
fst dword [esp + 0x80]
fst dword [esp + 0x84]
fld dword [esp + 0x10]
fadd st(2)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fst dword [esp + 0x88]
fxch st(4)
fst dword [esp + 0x8c]
fxch st(1)
fst dword [esp + 0x90]
fxch st(3)
fst dword [esp + 0x94]
fxch st(3)
fst dword [esp + 0xa0]
fst dword [esp + 0xa4]
fst dword [esp + 0xb0]
fxch st(4)
fst dword [esp + 0xa8]
fxch st(5)
fst dword [esp + 0xac]
fxch st(3)
fstp dword [esp + 0xb4]
fxch st(3)
fst dword [esp + 0xc0]
fstp dword [esp + 0xc4]
je 0x40899e
fst dword [esp + 0x28]
lea ebx, [esp + 0x4c]
fstp dword [esp + 0x30]
lea edi, [esp + 0x28]
fxch st(1)
mov dword [esp + 0x14], 4
fst dword [esp + 0x2c]
fstp dword [esp + 0x3c]
fst dword [esp + 0x34]
fstp dword [esp + 0x44]
fst dword [esp + 0x38]
fstp dword [esp + 0x40]
jmp 0x408920
mov eax, dword [esi + 0x50]
mov eax, dword [eax + 4]
cmp eax, dword [esi + 0x50]
mov dword [esp + 0x1c], eax
jne 0x408946
call fcn.005b2af7
mov eax, dword [esp + 0x1c]
cmp eax, dword [esi + 0x50]
jne 0x408946
call fcn.005b2af7
mov eax, dword [esp + 0x1c]
lea ecx, [eax + 8]
mov edx, edi
lea eax, [esp + 0x20]
call fcn.00468b80
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [edi], ecx
fld dword [edi]
fld qword [0x613e20]
mov dword [edi + 4], edx
fsub st(1), st(0)
add edi, 8
fxch st(1)
add ebx, 0x20
sub dword [esp + 0x14], 1
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fst dword [edi - 8]
fld dword [edi - 4]
fsubrp st(2)
fxch st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fst dword [edi - 4]
fstp dword [ebx - 0x20]
fstp dword [ebx - 0x24]
jne 0x408920
xor ecx, ecx
jmp 0x4089a6
fstp st(0)
fstp st(1)
fstp st(0)
fstp st(0)
mov eax, dword [esi + 0x20]
mov edx, dword [eax]
push ecx
push ecx
push eax
mov eax, dword [edx + 0x8c]
call eax
push eax
mov ecx, str.SetTexture_NULL
call fcn.00404ab0
mov esi, dword [esi + 0x20]
mov ecx, dword [esi]
mov eax, dword [ecx + 0x64]
add esp, 4
push 0
push 4
lea edx, [esp + 0x50]
push edx
push 0x1c4
push 5
push esi
call eax
push eax
mov ecx, str.DrawPrimitive__Rect_
call fcn.00404ab0
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4