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

Disassembly:
sub esp, 0x80
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor esi, esi
mov dword [esp + 0x18], edi
mov eax, dword [edi + 0x56c]
cmp eax, esi
jle 0x40a48e
dec eax
mov dword [edi + 0x56c], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
call fcn.00414630
lea ecx, [esp + 0x50]
mov dword [esp + 0x20], esi
call fcn.0044d3e0
xor ebx, ebx
or ecx, 0xffffffff
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x40], ecx
lea eax, [edi + 0x5bc]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], ecx
mov ecx, 5
test byte [eax], 1
je 0x40a4ce
inc ebx
add eax, 0x28
dec ecx
jne 0x40a4c8
mov edx, dword [edi + 0x5e4]
lea eax, [edi + 0x5b8]
and edx, 0xffffff
mov dword [esp + 0x1c], ebx
or edx, 0x2000000
xor ecx, ecx
mov dword [edi + 0x5e4], edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
test byte [eax + 4], 1
je 0x40a572
test esi, esi
jne 0x40a515
mov dword [esp + 0x3c], ecx
mov esi, 1
jmp 0x40a572
xor edx, edx
test esi, esi
jle 0x40a572
mov ebp, dword [eax]
xor eax, eax
mov ecx, dword [esp + eax + 0x3c]
lea ebx, [esp + eax + 0x3c]
lea ecx, [ecx + ecx*4]
cmp ebp, dword [edi + ecx*8 + 0x5b8]
jle 0x40a55e
cmp eax, 0xc
jg 0x40a54e
mov ecx, 4
lea eax, [esp + 0x4c]
sub ecx, edx
mov edx, dword [eax - 4]
mov dword [eax], edx
add eax, 0xfffffffc
dec ecx
jne 0x40a543
mov eax, dword [esp + 0x14]
inc esi
mov dword [ebx], eax
mov edx, esi
lea eax, [esi*4]
inc edx
add eax, 4
cmp edx, esi
jl 0x40a51f
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x14]
inc ecx
add eax, 0x28
cmp ecx, 5
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
jl 0x40a500
xor eax, eax
cmp ebx, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
jle 0x40aa04
lea ecx, [esp + 0x3c]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x1c], ecx
mov edx, dword [esp + 0x1c]
mov ebx, dword [edx]
lea eax, [ebx + ebx*4]
lea ebp, [edi + eax*8]
mov al, byte [edi + eax*8 + 0x5bc]
test al, 1
je 0x40a9ea
mov eax, dword [ebp + 0x5d4]
mov dl, byte [ebp + 0x5d8]
lea ecx, [ebx + ebx*4 + 0xb9]
push 0
push edx
lea edx, [eax + 0x38]
lea esi, [edi + ecx*8]
lea ecx, [eax + 0x80]
mov eax, dword [eax + 0xc0]
push ecx
mov ecx, dword [ebp + 0x5cc]
push edx
mov edx, dword [esi]
push eax
mov eax, dword [ebp + 0x5c4]
push ecx
mov ecx, dword [ebp + 0x5c0]
push edx
push eax
push ecx
mov dword [esp + 0x50], esi
call fcn.00411f70
mov al, byte [ebp + 0x5bc]
add esp, 0x24
test al, 2
jne 0x40a71d
mov esi, dword [edi + 0x5ac]
mov dword [esp + 0x10], 0
test esi, esi
je 0x40a71d
mov edi, 0x4dfb50
test byte [esi + 4], 0x10
je 0x40a64b
push str.DEBUG_RENDER_n
call fcn.00449be0
add esp, 4
mov eax, dword [esi + 4]
test al, 2
je 0x40a70e
test al, 0x20
je 0x40a70e
mov edx, dword [ebp + 0x5bc]
and edx, eax
test edx, 0xff000000
je 0x40a70e
test al, 0x80
je 0x40a684
mov ecx, dword [esp + 0x10]
mov dword [edi], esi
inc ecx
add edi, 4
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x14]
mov eax, dword [esi + 4]
inc ecx
test ah, 8
mov dword [esp + 0x14], ecx
je 0x40a6a7
mov ecx, dword [esi + 0x24]
mov eax, dword [esi + 0x78]
mov edx, dword [ecx + 0xbc]
mov eax, dword [eax + 4]
mov dword [edx + 0xc], eax
mov eax, dword [esi + 4]
test ah, 4
je 0x40a6c8
mov ecx, esi
call fcn.0042f5a0
mov edx, dword [esi + 0x20]
lea ecx, [esi + 0x28]
push eax
mov eax, dword [esi + 0x1c]
push ecx
push edx
push eax
lea ecx, [esi + 0x38]
jmp 0x40a701
lea eax, [esi + 0x10]
mov ecx, dword [esi + 0x10]
mov dword [esp + 0x80], ecx
mov ecx, esi
mov edx, dword [eax + 4]
mov dword [esp + 0x84], edx
mov eax, dword [eax + 8]
mov dword [esp + 0x88], eax
call fcn.0042f5a0
mov edx, dword [esi + 0x20]
lea ecx, [esi + 0x28]
push eax
mov eax, dword [esi + 0x1c]
push ecx
push edx
push eax
lea ecx, [esp + 0x60]
mov edx, dword [esi + 0x24]
push ecx
push edx
call fcn.00412690
add esp, 0x18
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x40a638
mov edi, dword [esp + 0x18]
mov ebx, dword [ebx*4 + 0x814cd4]
mov dword [esp + 0x24], 0x4e5550
call fcn.00413520
test ebx, ebx
je 0x40a88f
mov eax, dword [esp + 0x20]
mov ecx, dword [ebp + 0x5bc]
inc eax
mov dword [esp + 0x20], eax
mov eax, dword [ebx + 4]
and ecx, eax
test ecx, 0xff000000
je 0x40a86f
test al, 1
je 0x40a884
test al, 0x40
je 0x40a884
test ah, 2
jne 0x40a884
lea edx, [ebx + 0x48]
mov esi, dword [ebp + 0x5d4]
sub esp, 0x40
add esi, 0x80
mov eax, dword [edx]
mov edi, esp
mov dword [esp + 0x70], eax
mov ecx, dword [edx + 4]
mov dword [esp + 0x74], ecx
mov ecx, 0x10
mov edx, dword [edx + 8]
mov dword [esp + 0x78], edx
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x70]
call fcn.0044cd60
fld dword [esp + 0x30]
fchs
fstp dword [esp + 0x30]
fld dword [esp + 0x38]
fchs
fst dword [esp + 0x38]
fchs
fmul dword [0x49739c]
fadd dword [ebx + 0x98]
fld st(0)
call fcn.0048b540
mov esi, eax
cmp esi, 0x100
jl 0x40a7e4
mov esi, 0xff
jmp 0x40a7ec
test esi, esi
jl 0x40a87e
mov eax, dword [esp + 0x24]
mov ecx, dword [esi*4 + 0x4f7090]
mov edx, eax
add eax, 0x18
test ecx, ecx
mov dword [esp + 0x24], eax
je 0x40a83d
xor edi, edi
test ecx, ecx
je 0x40a824
fcom dword [ecx + 0x10]
fnstsw ax
test ah, 1
je 0x40a820
mov edi, ecx
mov ecx, dword [ecx]
test ecx, ecx
jne 0x40a80a
mov dword [edi], edx
jmp 0x40a844
test ecx, ecx
jne 0x40a828
mov dword [edi], edx
jmp 0x40a844
test edi, edi
je 0x40a832
mov dword [edi], edx
mov dword [edx], ecx
jmp 0x40a84a
mov dword [edx], ecx
mov dword [esi*4 + 0x4f7090], edx
jmp 0x40a84a
mov dword [esi*4 + 0x4f7090], edx
mov dword [edx], 0
mov ecx, dword [esp + 0x30]
lea eax, [edx + 4]
fst dword [edx + 0x10]
mov dword [eax], ecx
mov ecx, dword [esp + 0x34]
mov dword [edx + 0x14], ebx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x38]
mov dword [eax + 8], ecx
mov dword [ebx + 0x14], esi
fstp dword [ebx + 0x18]
jmp 0x40a880
push str.Loose_Sprite_scene_viewport
call fcn.00431ca0
add esp, 4
jmp 0x40a884
fstp st(0)
mov edi, dword [esp + 0x18]
mov ebx, dword [ebx + 0xc]
test ebx, ebx
jne 0x40a739
mov ebx, 0x4f748c
mov esi, dword [ebx]
test esi, esi
je 0x40a8cd
mov ecx, dword [esi + 0x14]
test byte [ecx + 4], 2
je 0x40a8b5
mov edx, dword [ebp + 0x5d4]
add edx, 0x80
push edx
call fcn.0044e5e0
mov eax, dword [esi + 0x14]
lea ecx, [esi + 4]
push eax
push ecx
call fcn.004137d0
mov esi, dword [esi]
add esp, 8
test esi, esi
jne 0x40a89a
mov dword [ebx], esi
sub ebx, 4
cmp ebx, 0x4f7090
jge 0x40a894
call fcn.00413630
call fcn.00411de0
mov edx, dword [ebp + 0x5bc]
push edx
call fcn.0044a900
add esp, 4
call fcn.00411db0
test byte [ebp + 0x5bc], 2
jne 0x40a9ea
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a9ea
mov eax, dword [ebp + 0x5d4]
mov cl, byte [ebp + 0x5d8]
push 1
push ecx
lea edx, [eax + 0x80]
lea ecx, [eax + 0x38]
push edx
mov edx, dword [eax + 0xc0]
mov eax, dword [ebp + 0x5cc]
push ecx
mov ecx, dword [esp + 0x3c]
push edx
push eax
mov eax, dword [ebp + 0x5c4]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x5c0]
push edx
push eax
push ecx
call fcn.00411f70
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov ebx, edx
add esp, 0x24
add eax, ebx
lea edi, [edx*4 + 0x4dfb50]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov eax, dword [edi - 4]
sub edi, 4
mov ecx, dword [eax + 4]
test ch, 4
je 0x40a99c
mov esi, eax
mov ecx, esi
call fcn.0042f5a0
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x1c]
push eax
lea eax, [esi + 0x28]
push eax
push ecx
push edx
lea eax, [esi + 0x38]
jmp 0x40a9d6
add eax, 0x10
mov esi, dword [edi]
mov edx, dword [eax]
mov dword [esp + 0x80], edx
mov ecx, dword [eax + 4]
mov dword [esp + 0x84], ecx
mov ecx, esi
mov edx, dword [eax + 8]
mov dword [esp + 0x88], edx
call fcn.0042f5a0
mov ecx, dword [esi + 0x20]
mov edx, dword [esi + 0x1c]
push eax
lea eax, [esi + 0x28]
push eax
push ecx
push edx
lea eax, [esp + 0x60]
mov ecx, dword [esi + 0x24]
push eax
push ecx
call fcn.00412690
add esp, 0x18
dec ebx
jne 0x40a973
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x28]
add ecx, 4
dec eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x28], eax
jne 0x40a5a5
call fcn.00407b50
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret