// File: essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: undraw_line(int, int, int, int)
void undraw_line(int x1, int y1, int x2, int y2)
{
    // 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;
			draw_tile(x1,y1);
        }
    }
    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;
			draw_tile(x1,y1);
        }
    }
	move(y2,x2);
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movl %esi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movl 0x1c(%rsp), %eax
subl 0x24(%rsp), %eax
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, 0x14(%rsp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movb %al, 0x13(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
shll %eax
movl %eax, 0x14(%rsp)
movl 0x18(%rsp), %eax
subl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, 0xc(%rsp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movb %al, 0xb(%rsp)
movl 0xc(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
shll %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
cmpl 0xc(%rsp), %eax
jl 0x175c5
movl 0xc(%rsp), %eax
movl 0x14(%rsp), %ecx
sarl %ecx
subl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x1c(%rsp), %eax
je 0x175c3
cmpl $0x0, 0x4(%rsp)
jl 0x17599
cmpl $0x0, 0x4(%rsp)
jne 0x1757c
movsbl 0x13(%rsp), %eax
cmpl $0x0, %eax
jle 0x17597
movsbl 0xb(%rsp), %eax
addl 0x20(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x14(%rsp), %ecx
movl 0x4(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4(%rsp)
jmp 0x17599
movsbl 0x13(%rsp), %eax
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0xc(%rsp), %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
xorl %edx, %edx
callq 0x16f40
jmp 0x1755a
jmp 0x17639
movl 0x14(%rsp), %eax
movl 0xc(%rsp), %ecx
sarl %ecx
subl %ecx, %eax
movl %eax, (%rsp)
movl 0x20(%rsp), %eax
cmpl 0x18(%rsp), %eax
je 0x17637
cmpl $0x0, (%rsp)
jl 0x1760f
cmpl $0x0, (%rsp)
jne 0x175f4
movsbl 0xb(%rsp), %eax
cmpl $0x0, %eax
jle 0x1760d
movsbl 0x13(%rsp), %eax
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0xc(%rsp), %ecx
movl (%rsp), %eax
subl %ecx, %eax
movl %eax, (%rsp)
jmp 0x1760f
movsbl 0xb(%rsp), %eax
addl 0x20(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x14(%rsp), %eax
addl (%rsp), %eax
movl %eax, (%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
xorl %edx, %edx
callq 0x16f40
jmp 0x175d4
jmp 0x17639
movl 0x18(%rsp), %edi
movl 0x1c(%rsp), %esi
callq 0x5230
addq $0x28, %rsp
retq
nopl (%rax,%rax)