// File: /workspace/github_cpp_makefile_star2_O1/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: los_exists(int, int, int, int, bool (*)(int, int))
bool los_exists(int x1, int y1, int x2, int y2, bool (*opacity_test)(int,int))
{
    // if x1 == x2 or y1 == y2, then it does not matter what we set here
    int delta_x(x2 - x1);
    signed char ix((delta_x > 0) - (delta_x < 0));
    delta_x = std::abs(delta_x) << 1;
 
    int delta_y(y2 - y1);
    signed char iy((delta_y > 0) - (delta_y < 0));
    delta_y = std::abs(delta_y) << 1;
 
    if (delta_x >= delta_y)
    {
        // error may go below zero
        int error(delta_y - (delta_x >> 1));
 
        while (x1 != x2)
        {
            if (error >= 0)
            {
                if (error || (ix > 0))
                {
                    y1 += iy;
                    error -= delta_x;
                }
                // else do nothing
            }
            // else do nothing
 
            x1 += ix;
            error += delta_y;
			if (x1 != x2)//(x1 != x2 && y1 != y2)
			{
				if (opacity_test(x1, y1)) return false;
			}
        }
    }
    else
    {
        // error may go below zero
        int error(delta_x - (delta_y >> 1));
 
        while (y1 != y2)
        {
            if (error >= 0)
            {
                if (error || (iy > 0))
                {
                    x1 += ix;
                    error -= delta_y;
                }
                // else do nothing
            }
            // else do nothing
 
            y1 += iy;
            error += delta_x;
 
            if (y1 != y2)//(x1 != x2 && y1 != y2)
			{
				if (opacity_test(x1, y1)) return false;
			}
        }
    }
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movl %esi, %r15d
movl %edi, %r14d
xorl %edi, %edi
movl %edx, %eax
subl %r14d, %eax
setne %dil
movl %eax, %esi
sarl $0x1f, %esi
orl %esi, %edi
movq %rdi, 0x18(%rsp)
movl %eax, %r8d
negl %r8d
cmovsl %eax, %r8d
addl %r8d, %r8d
xorl %esi, %esi
movl %ecx, %eax
subl %r15d, %eax
setne %sil
movl %eax, %edi
sarl $0x1f, %edi
orl %edi, %esi
movq %rsi, 0x10(%rsp)
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
addl %ebp, %ebp
movl %r8d, 0xc(%rsp)
movb $0x1, %al
cmpl %ebp, %r8d
jge 0xfc05
cmpl %r15d, %ecx
je 0xfc71
movl %ebp, %eax
sarl %eax
movl 0xc(%rsp), %ebx
subl %eax, %ebx
movq 0x10(%rsp), %rax
movl %eax, %r12d
subl %ecx, %r12d
negl %ecx
testl %ebx, %ebx
js 0xfbd3
cmpl $0x0, 0x10(%rsp)
jg 0xfbcc
testl %ebx, %ebx
jne 0xfbcc
xorl %ebx, %ebx
jmp 0xfbd3
addl 0x18(%rsp), %r14d
subl %ebp, %ebx
movq 0x10(%rsp), %rax
leal (%r15,%rax), %r13d
addl %r12d, %r15d
je 0xfbf5
movl %r14d, %edi
movl %r13d, %esi
movl %ecx, %r15d
callq *0x20(%rsp)
movl %r15d, %ecx
testb %al, %al
jne 0xfc6f
addl 0xc(%rsp), %ebx
movl %r13d, %eax
movl %r13d, %r15d
addl %ecx, %eax
jne 0xfbb9
jmp 0xfc6b
cmpl %r14d, %edx
je 0xfc71
movl 0xc(%rsp), %eax
sarl %eax
movl %ebp, %ebx
subl %eax, %ebx
movq 0x18(%rsp), %rax
movl %eax, %r13d
subl %edx, %r13d
negl %edx
testl %ebx, %ebx
js 0xfc3d
cmpl $0x0, 0x18(%rsp)
jg 0xfc34
testl %ebx, %ebx
jne 0xfc34
xorl %ebx, %ebx
jmp 0xfc3d
addl 0x10(%rsp), %r15d
subl 0xc(%rsp), %ebx
movq 0x18(%rsp), %rax
leal (%r14,%rax), %r12d
addl %r13d, %r14d
je 0xfc5f
movl %r12d, %edi
movl %r15d, %esi
movl %edx, %r14d
callq *0x20(%rsp)
movl %r14d, %edx
testb %al, %al
jne 0xfc6f
addl %ebp, %ebx
movl %r12d, %eax
movl %r12d, %r14d
addl %edx, %eax
jne 0xfc21
movb $0x1, %al
jmp 0xfc71
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq