Function at 0x40a440
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 0x40a46e
dec eax
mov dword [edi + 0x56c], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
call fcn.00414600
lea ecx, [esp + 0x50]
mov dword [esp + 0x20], esi
call fcn.0044d210
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 0x40a4ae
inc ebx
add eax, 0x28
dec ecx
jne 0x40a4a8
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 0x40a552
test esi, esi
jne 0x40a4f5
mov dword [esp + 0x3c], ecx
mov esi, 1
jmp 0x40a552
xor edx, edx
test esi, esi
jle 0x40a552
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 0x40a53e
cmp eax, 0xc
jg 0x40a52e
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 0x40a523
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 0x40a4ff
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 0x40a4e0
xor eax, eax
cmp ebx, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
jle 0x40a9e4
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 0x40a9ca
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.00411f50
mov al, byte [ebp + 0x5bc]
add esp, 0x24
test al, 2
jne 0x40a6fd
mov esi, dword [edi + 0x5ac]
mov dword [esp + 0x10], 0
test esi, esi
je 0x40a6fd
mov edi, 0x4e2b30
test byte [esi + 4], 0x10
je 0x40a62b
push str.DEBUG_RENDER_n
call fcn.00449c00
add esp, 4
mov eax, dword [esi + 4]
test al, 2
je 0x40a6ee
test al, 0x20
je 0x40a6ee
mov edx, dword [ebp + 0x5bc]
and edx, eax
test edx, 0xff000000
je 0x40a6ee
test al, 0x80
je 0x40a664
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 0x40a687
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 0x40a6a8
mov ecx, esi
call fcn.0042f5c0
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 0x40a6e1
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.0042f5c0
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.00412670
add esp, 0x18
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x40a618
mov edi, dword [esp + 0x18]
mov ebx, dword [ebx*4 + 0x817cb4]
mov dword [esp + 0x24], 0x4e8530
call fcn.004134f0
test ebx, ebx
je 0x40a86f
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 0x40a84f
test al, 1
je 0x40a864
test al, 0x40
je 0x40a864
test ah, 2
jne 0x40a864
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.0044cb90
fld dword [esp + 0x30]
fchs
fstp dword [esp + 0x30]
fld dword [esp + 0x38]
fchs
fst dword [esp + 0x38]
fchs
fmul dword [0x49839c]
fadd dword [ebx + 0x98]
fld st(0)
call fcn.0048b38c
mov esi, eax
cmp esi, 0x100
jl 0x40a7c4
mov esi, 0xff
jmp 0x40a7cc
test esi, esi
jl 0x40a85e
mov eax, dword [esp + 0x24]
mov ecx, dword [esi*4 + 0x4fa070]
mov edx, eax
add eax, 0x18
test ecx, ecx
mov dword [esp + 0x24], eax
je 0x40a81d
xor edi, edi
test ecx, ecx
je 0x40a804
fcom dword [ecx + 0x10]
fnstsw ax
test ah, 1
je 0x40a800
mov edi, ecx
mov ecx, dword [ecx]
test ecx, ecx
jne 0x40a7ea
mov dword [edi], edx
jmp 0x40a824
test ecx, ecx
jne 0x40a808
mov dword [edi], edx
jmp 0x40a824
test edi, edi
je 0x40a812
mov dword [edi], edx
mov dword [edx], ecx
jmp 0x40a82a
mov dword [edx], ecx
mov dword [esi*4 + 0x4fa070], edx
jmp 0x40a82a
mov dword [esi*4 + 0x4fa070], 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 0x40a860
push str.Loose_Sprite_scene_viewport
call fcn.00431cc0
add esp, 4
jmp 0x40a864
fstp st(0)
mov edi, dword [esp + 0x18]
mov ebx, dword [ebx + 0xc]
test ebx, ebx
jne 0x40a719
mov ebx, 0x4fa46c
mov esi, dword [ebx]
test esi, esi
je 0x40a8ad
mov ecx, dword [esi + 0x14]
test byte [ecx + 4], 2
je 0x40a895
mov edx, dword [ebp + 0x5d4]
add edx, 0x80
push edx
call fcn.0044e410
mov eax, dword [esi + 0x14]
lea ecx, [esi + 4]
push eax
push ecx
call fcn.004137a0
mov esi, dword [esi]
add esp, 8
test esi, esi
jne 0x40a87a
mov dword [ebx], esi
sub ebx, 4
cmp ebx, 0x4fa070
jge 0x40a874
call fcn.00413600
call fcn.00411dc0
mov edx, dword [ebp + 0x5bc]
push edx
call fcn.0044a730
add esp, 4
call fcn.00411d90
test byte [ebp + 0x5bc], 2
jne 0x40a9ca
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a9ca
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.00411f50
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov ebx, edx
add esp, 0x24
add eax, ebx
lea edi, [edx*4 + 0x4e2b30]
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 0x40a97c
mov esi, eax
mov ecx, esi
call fcn.0042f5c0
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 0x40a9b6
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.0042f5c0
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.00412670
add esp, 0x18
dec ebx
jne 0x40a953
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 0x40a585
call fcn.00415dd0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret