Function at 0x5414b0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 0x18
push ebx
push esi
push edi
cmp eax, 1
jne 0x5415d9
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x5415d2
mov esi, dword [eax + 0x3c]
xor ecx, ecx
mov edx, dword [eax + 0x24]
mov dword [ebp - 0x18], esi
mov dword [ebp - 4], ecx
movzx ebx, byte [esi + 8]
mov dword [ebp + 0x10], ebx
mov dword [ebp - 8], edx
test edx, edx
je 0x54158d
mov ecx, dword [edx + 4]
xor esi, esi
mov eax, dword [edx + 0xc]
xor edi, edi
mov dword [ebp - 0x10], ecx
mov ecx, dword [edx + 8]
cmp ecx, eax
jg 0x541579
sub eax, ecx
inc eax
cmp eax, 2
jl 0x541545
mov eax, dword [edx + 0xc]
mov ebx, dword [ebp - 0x10]
dec eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
mov ebx, dword [eax + ebx*4]
movzx eax, byte [ebx + ecx]
sub eax, dword [ebp + 0x10]
imul eax, eax
add esi, eax
movzx eax, byte [ebx + ecx + 1]
sub eax, dword [ebp + 0x10]
add ecx, 2
imul eax, eax
add edi, eax
cmp ecx, edx
jle 0x541522
mov edx, dword [ebp - 8]
cmp ecx, dword [edx + 0xc]
jg 0x54156c
mov eax, dword [edx + 4]
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + eax*4]
movzx eax, byte [eax + ecx]
sub eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 4]
imul eax, eax
add ecx, eax
lea eax, [edi + esi]
add ecx, eax
mov dword [ebp - 4], ecx
jmp 0x54157c
mov ecx, dword [ebp - 4]
lea eax, [edi + esi]
add ecx, eax
mov dword [ebp - 4], ecx
jmp 0x54157c
mov ecx, dword [ebp - 4]
mov edx, dword [edx + 0x10]
mov dword [ebp - 8], edx
test edx, edx
jne 0x5414f3
mov esi, dword [ebp - 0x18]
mov eax, dword [esi]
movd xmm1, ecx
cvtdq2ps xmm1, xmm1
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x8c2a80]
mov eax, dword [ebp - 0xc]
cvtpd2ps xmm0, xmm0
divss xmm1, xmm0
movss dword [esi + 0xc], xmm1
movss dword [esi + 0x10], xmm1
movss dword [esi + 0x14], xmm1
mov eax, dword [eax + 0x2c]
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x5414d3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 3
jne 0x5416df
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0xc], edx
test edx, edx
je 0x5415d2
nop dword [eax]
mov ecx, dword [edx + 0x3c]
xor ebx, ebx
mov edx, dword [edx + 0x24]
xor esi, esi
mov dword [ebp - 8], ecx
mov dword [ebp + 0x10], esi
movzx eax, byte [ecx + 8]
mov dword [ebp - 0x18], eax
movzx eax, byte [ecx + 9]
mov dword [ebp - 0x14], eax
movzx eax, byte [ecx + 0xa]
mov dword [ebp - 0x10], eax
mov dword [ebp - 4], ebx
test edx, edx
je 0x54167c
nop dword [eax]
mov eax, dword [edx + 8]
lea ecx, [eax + eax*2]
mov eax, dword [edx + 0xc]
inc eax
lea edi, [eax + eax*2]
cmp ecx, edi
jge 0x54166f
mov eax, dword [edx + 4]
mov esi, dword [ebp + 8]
mov esi, dword [esi + eax*4]
nop word [eax + eax]
movzx eax, byte [esi + ecx]
sub eax, dword [ebp - 0x18]
imul eax, eax
add dword [ebp - 4], eax
movzx eax, byte [esi + ecx + 1]
sub eax, dword [ebp - 0x14]
imul eax, eax
add dword [ebp + 0x10], eax
movzx eax, byte [esi + ecx + 2]
add ecx, 3
sub eax, dword [ebp - 0x10]
imul eax, eax
add ebx, eax
cmp ecx, edi
jl 0x541640
mov edx, dword [edx + 0x10]
test edx, edx
jne 0x541620
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp - 8]
mov eax, dword [ecx]
mov edx, dword [ebp - 0xc]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x8c2a80]
cvtpd2ps xmm1, xmm0
movd xmm0, dword [ebp - 4]
cvtdq2ps xmm0, xmm0
divss xmm0, xmm1
movss dword [ecx + 0xc], xmm0
movd xmm0, esi
cvtdq2ps xmm0, xmm0
divss xmm0, xmm1
movss dword [ecx + 0x10], xmm0
movd xmm0, ebx
cvtdq2ps xmm0, xmm0
divss xmm0, xmm1
movss dword [ecx + 0x14], xmm0
mov edx, dword [edx + 0x2c]
mov dword [ebp - 0xc], edx
test edx, edx
jne 0x5415f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.Error:_Image2D_CcAverageColor_unsupported__of_planes__n
push 2
call fcn.005f718e
add esp, 4
push eax
call fcn.0046fae5
add esp, 8
push 0xffffffffffffffff
call fcn.005eca2b
int3