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

Disassembly:
mov eax, dword [0x17efc28]
sub esp, 0x6c
test al, 3
je 0x508f07
mov eax, dword [0x17efc10]
push eax
push str.Autosprite2_shader__s_had_odd_vertex_count_n
push 2
call dword [0x15485a0]
mov eax, dword [0x17efc28]
add esp, 0xc
sar eax, 2
lea ecx, [eax + eax*2]
mov eax, dword [0x17efc24]
shl ecx, 1
cmp eax, ecx
je 0x508f2f
mov edx, dword [0x17efc10]
push edx
push str.Autosprite2_shader__s_had_odd_index_count_n
push 2
call dword [0x15485a0]
add esp, 0xc
cmp dword [0x1548adc], 0x1534d0c
je 0x508f4b
lea ecx, [esp + 0x2c]
mov eax, 0x15487d4
call fcn.00508bc0
jmp 0x508f68
mov eax, dword [0x15487d4]
mov ecx, dword [0x15487d8]
mov edx, dword [0x15487dc]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
mov ecx, dword [0x17efc24]
xor eax, eax
test ecx, ecx
mov dword [esp + 8], eax
jle 0x50954e
push ebx
mov ebx, dword [esp + 0x4c]
push ebp
mov ebp, dword [esp + 0x54]
push esi
push edi
mov edi, dword [esp + 0x54]
jmp 0x508fa0
mov eax, dword [esp + 0x18]
jmp 0x508fa0
movzx esi, word [eax*2 + 0x1617be0]
movzx eax, word [eax*2 + 0x1617be2]
mov edx, dword [0x17efc00]
imul eax, edx
imul esi, edx
fld dword [eax*4 + 0x162fbe0]
fsub dword [esi*4 + 0x162fbe0]
fstp dword [esp + 0x24]
fld dword [eax*4 + 0x162fbe4]
fsub dword [esi*4 + 0x162fbe4]
fstp dword [esp + 0x28]
fld dword [eax*4 + 0x162fbe8]
fsub dword [esi*4 + 0x162fbe8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
lea edx, [eax*4 + 0x162fbe0]
fmul dword [esp + 0x28]
lea esi, [esi*4 + 0x162fbe0]
mov ecx, 0x7f7fffff
mov dword [esp + 0x20], ecx
faddp st(1)
mov dword [esp + 0x1c], ecx
fld dword [esp + 0x24]
mov dword [esp + 0x14], esi
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [0x55a698]
fnstsw ax
test ah, 5
jp 0x509058
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, esi
mov ebx, edx
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x18]
movzx esi, word [eax*2 + 0x1617be4]
imul esi, dword [0x17efc00]
fld dword [esi*4 + 0x162fbe0]
fsub dword [edx]
fstp dword [esp + 0x24]
fld dword [esi*4 + 0x162fbe4]
fsub dword [edx + 4]
lea esi, [esi*4 + 0x162fbe0]
fstp dword [esp + 0x28]
fld dword [esi + 8]
fsub dword [edx + 8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
fmul dword [esp + 0x28]
faddp st(1)
fld dword [esp + 0x24]
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 5
jp 0x5090de
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, edx
mov ebx, esi
mov dword [esp + 0x1c], ecx
jmp 0x5090fd
fld dword [esp + 0x10]
fcomp dword [0x55a698]
fnstsw ax
test ah, 5
jp 0x5090fd
mov ebp, edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x60], esi
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x14]
fld dword [edx]
fsub dword [esi]
fstp dword [esp + 0x24]
fld dword [edx + 4]
fsub dword [esi + 4]
fstp dword [esp + 0x28]
fld dword [edx + 8]
fsub dword [esi + 8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
fmul dword [esp + 0x28]
faddp st(1)
fld dword [esp + 0x24]
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 5
jp 0x509164
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, esi
mov ebx, edx
mov dword [esp + 0x1c], ecx
jmp 0x509181
fld dword [esp + 0x10]
fcomp dword [esp + 0x20]
fnstsw ax
test ah, 5
jp 0x509181
mov eax, dword [esp + 0x10]
mov ebp, esi
mov dword [esp + 0x60], edx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
movzx esi, word [eax*2 + 0x1617be6]
movzx eax, word [eax*2 + 0x1617be8]
mov edx, dword [0x17efc00]
imul eax, edx
imul esi, edx
fld dword [eax*4 + 0x162fbe0]
fsub dword [esi*4 + 0x162fbe0]
fstp dword [esp + 0x24]
fld dword [eax*4 + 0x162fbe4]
fsub dword [esi*4 + 0x162fbe4]
fstp dword [esp + 0x28]
fld dword [eax*4 + 0x162fbe8]
fsub dword [esi*4 + 0x162fbe8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
lea edx, [eax*4 + 0x162fbe0]
fmul dword [esp + 0x28]
lea esi, [esi*4 + 0x162fbe0]
mov dword [esp + 0x14], esi
faddp st(1)
fld dword [esp + 0x24]
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 5
jp 0x509230
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, esi
mov ebx, edx
mov dword [esp + 0x1c], ecx
jmp 0x50924d
fld dword [esp + 0x10]
fcomp dword [esp + 0x20]
fnstsw ax
test ah, 5
jp 0x50924d
mov eax, dword [esp + 0x10]
mov ebp, esi
mov dword [esp + 0x60], edx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
movzx esi, word [eax*2 + 0x1617bea]
imul esi, dword [0x17efc00]
fld dword [esi*4 + 0x162fbe0]
fsub dword [edx]
fstp dword [esp + 0x24]
fld dword [esi*4 + 0x162fbe4]
fsub dword [edx + 4]
lea esi, [esi*4 + 0x162fbe0]
fstp dword [esp + 0x28]
fld dword [esi + 8]
fsub dword [edx + 8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
fmul dword [esp + 0x28]
faddp st(1)
fld dword [esp + 0x24]
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 5
jp 0x5092d3
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, edx
mov ebx, esi
mov dword [esp + 0x1c], ecx
jmp 0x5092f0
fld dword [esp + 0x10]
fcomp dword [esp + 0x20]
fnstsw ax
test ah, 5
jp 0x5092f0
mov ebp, edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x60], esi
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x14]
fld dword [edx]
fsub dword [esi]
fstp dword [esp + 0x24]
fld dword [edx + 4]
fsub dword [esi + 4]
fstp dword [esp + 0x28]
fld dword [edx + 8]
fsub dword [esi + 8]
fstp dword [esp + 0x2c]
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
fld dword [esp + 0x28]
fmul dword [esp + 0x28]
faddp st(1)
fld dword [esp + 0x24]
fmul dword [esp + 0x24]
faddp st(1)
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 5
jp 0x509353
mov eax, dword [esp + 0x10]
mov ebp, edi
mov dword [esp + 0x60], ebx
mov edi, esi
mov ebx, edx
mov dword [esp + 0x1c], eax
jmp 0x50936c
fld dword [esp + 0x10]
fcomp dword [esp + 0x20]
fnstsw ax
test ah, 5
jp 0x509370
mov ecx, dword [esp + 0x10]
mov ebp, esi
mov dword [esp + 0x60], edx
mov dword [esp + 0x20], ecx
fld dword [ebx]
mov eax, dword [esp + 0x60]
fadd dword [edi]
lea esi, [esp + 0x30]
fmul dword [0x55a4b8]
fstp dword [esp + 0x64]
fld dword [edi + 4]
fadd dword [ebx + 4]
fmul dword [0x55a4b8]
fstp dword [esp + 0x68]
fld dword [edi + 8]
fadd dword [ebx + 8]
fmul dword [0x55a4b8]
fstp dword [esp + 0x6c]
fld dword [eax]
fadd dword [ebp]
fmul dword [0x55a4b8]
fstp dword [esp + 0x70]
fld dword [eax + 4]
fadd dword [ebp + 4]
fmul dword [0x55a4b8]
fstp dword [esp + 0x74]
fld dword [eax + 8]
fadd dword [ebp + 8]
fmul dword [0x55a4b8]
fstp dword [esp + 0x78]
fld dword [esp + 0x70]
fsub dword [esp + 0x64]
fstp dword [esp + 0x48]
fld dword [esp + 0x74]
fsub dword [esp + 0x68]
fstp dword [esp + 0x4c]
fld dword [esp + 0x78]
fsub dword [esp + 0x6c]
fstp dword [esp + 0x50]
fld dword [esp + 0x4c]
fmul dword [esp + 0x44]
fld dword [esp + 0x50]
fmul dword [esp + 0x40]
fsubp st(1)
fstp dword [esp + 0x30]
fld dword [esp + 0x50]
fmul dword [esp + 0x3c]
fld dword [esp + 0x48]
fmul dword [esp + 0x44]
fsubp st(1)
fstp dword [esp + 0x34]
fld dword [esp + 0x48]
fmul dword [esp + 0x40]
fld dword [esp + 0x4c]
fmul dword [esp + 0x3c]
fsubp st(1)
fstp dword [esp + 0x38]
call fcn.00426700
fstp st(0)
fld dword [esp + 0x1c]
call fcn.0052dc50
fmul qword [0x55a5e0]
fstp dword [esp + 0x10]
fld dword [esp + 0x10]
fchs
fstp dword [esp + 0x14]
fld dword [esp + 0x14]
fmul dword [esp + 0x30]
fadd dword [esp + 0x64]
fstp dword [edi]
fld dword [esp + 0x14]
fmul dword [esp + 0x34]
fadd dword [esp + 0x68]
fstp dword [edi + 4]
fld dword [esp + 0x14]
fmul dword [esp + 0x38]
fadd dword [esp + 0x6c]
fstp dword [edi + 8]
fld dword [esp + 0x30]
fmul dword [esp + 0x10]
fadd dword [esp + 0x64]
fstp dword [ebx]
fld dword [esp + 0x34]
fmul dword [esp + 0x10]
fadd dword [esp + 0x68]
fstp dword [ebx + 4]
fld dword [esp + 0x38]
fmul dword [esp + 0x10]
fadd dword [esp + 0x6c]
fstp dword [ebx + 8]
fld dword [esp + 0x20]
call fcn.0052dc50
fmul qword [0x55a5e0]
fstp dword [esp + 0x10]
mov eax, dword [esp + 0x60]
fld dword [esp + 0x30]
fmul dword [esp + 0x10]
fadd dword [esp + 0x70]
fstp dword [ebp]
fld dword [esp + 0x34]
fmul dword [esp + 0x10]
fadd dword [esp + 0x74]
fstp dword [ebp + 4]
fld dword [esp + 0x38]
fmul dword [esp + 0x10]
fadd dword [esp + 0x78]
fstp dword [ebp + 8]
fld dword [esp + 0x10]
fchs
fstp dword [esp + 0x14]
fld dword [esp + 0x14]
fmul dword [esp + 0x30]
fadd dword [esp + 0x70]
fstp dword [eax]
fld dword [esp + 0x14]
fmul dword [esp + 0x34]
fadd dword [esp + 0x74]
fstp dword [eax + 4]
fld dword [esp + 0x14]
fmul dword [esp + 0x38]
fadd dword [esp + 0x78]
fstp dword [eax + 8]
mov eax, dword [esp + 0x18]
mov ecx, dword [0x17efc24]
add eax, 6
cmp eax, ecx
mov dword [esp + 0x18], eax
jl 0x508f8e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret