// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/build.c
// Function: drawline16
void drawline16(int x1, int y1, int x2, int y2, unsigned char col)
{
	int i, dx, dy, pinc, d;
	intptr_t p;
	unsigned int patc=0;

	dx = x2-x1; dy = y2-y1;
	if (dx >= 0)
	{
		if ((x1 >= xres) || (x2 < 0)) return;
		if (x1 < 0) { if (dy) y1 += scale(0-x1,dy,dx); x1 = 0; }
		if (x2 >= xres) { if (dy) y2 += scale(xres-1-x2,dy,dx); x2 = xres-1; }
	}
	else
	{
		if ((x2 >= xres) || (x1 < 0)) return;
		if (x2 < 0) { if (dy) y2 += scale(0-x2,dy,dx); x2 = 0; }
		if (x1 >= xres) { if (dy) y1 += scale(xres-1-x1,dy,dx); x1 = xres-1; }
	}
	if (dy >= 0)
	{
		if ((y1 >= ydim16) || (y2 < 0)) return;
		if (y1 < 0) { if (dx) x1 += scale(0-y1,dx,dy); y1 = 0; if (x1 < 0) x1 = 0; }
		if (y2 >= ydim16) { if (dx) x2 += scale(ydim16-1-y2,dx,dy); y2 = ydim16-1; if (x2 < 0) x2 = 0; }
	}
	else
	{
		if ((y2 >= ydim16) || (y1 < 0)) return;
		if (y2 < 0) { if (dx) x2 += scale(0-y2,dx,dy); y2 = 0; if (x2 < 0) x2 = 0; }
		if (y1 >= ydim16) { if (dx) x1 += scale(ydim16-1-y1,dx,dy); y1 = ydim16-1; if (x1 < 0) x1 = 0; }
	}

	dx = klabs(x2-x1)+1; dy = klabs(y2-y1)+1;
	if (dx >= dy)
	{
		if (x2 < x1)
		{
			i = x1; x1 = x2; x2 = i;
			i = y1; y1 = y2; y2 = i;
		}
		d = 0;
		if (y2 > y1) pinc = bytesperline; else pinc = -bytesperline;

		p = ((ytop16+y1)*bytesperline)+x1+frameplace;
		if (dy == 0 && drawlinepat == 0xffffffff) {
			i = ((int)col<<24)|((int)col<<16)|((int)col<<8)|col;
			clearbufbyte((void *)p, dx, i);
		} else
		for(i=dx;i>0;i--)
		{
			if (drawlinepat & pow2long[(patc++)&31])
				drawpixel((void *)p, col);
			d += dy;
			if (d >= dx) { d -= dx; p += pinc; }
			p++;
		}
		return;
	}

	if (y2 < y1)
	{
		i = x1; x1 = x2; x2 = i;
		i = y1; y1 = y2; y2 = i;
	}
	d = 0;
	if (x2 > x1) pinc = 1; else pinc = -1;

	p = ((ytop16+y1)*bytesperline)+x1+frameplace;
	for(i=dy;i>0;i--)
	{
		if (drawlinepat & pow2long[(patc++)&31])
			drawpixel((void *)p, col);
		d += dx;
		if (d >= dy) { d -= dy; p += pinc; }
		p += bytesperline;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl $0x0, -0x34(%rbp)
movl -0xc(%rbp), %eax
subl -0x4(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x25177
movl -0x4(%rbp), %eax
leaq 0xbb2fd(%rip), %rcx     # 0xe03f4
cmpl (%rcx), %eax
jge 0x25101
cmpl $0x0, -0xc(%rbp)
jge 0x25106
jmp 0x255a9
cmpl $0x0, -0x4(%rbp)
jge 0x2512f
cmpl $0x0, -0x20(%rbp)
je 0x25128
xorl %edi, %edi
subl -0x4(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x248a0
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0xc(%rbp), %eax
leaq 0xbb2bb(%rip), %rcx     # 0xe03f4
cmpl (%rcx), %eax
jl 0x25172
cmpl $0x0, -0x20(%rbp)
je 0x25163
leaq 0xbb2aa(%rip), %rax     # 0xe03f4
movl (%rax), %edi
subl $0x1, %edi
subl -0xc(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x248a0
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
leaq 0xbb28a(%rip), %rax     # 0xe03f4
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x251fe
movl -0xc(%rbp), %eax
leaq 0xbb273(%rip), %rcx     # 0xe03f4
cmpl (%rcx), %eax
jge 0x2518b
cmpl $0x0, -0x4(%rbp)
jge 0x25190
jmp 0x255a9
cmpl $0x0, -0xc(%rbp)
jge 0x251b9
cmpl $0x0, -0x20(%rbp)
je 0x251b2
xorl %edi, %edi
subl -0xc(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x248a0
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl -0x4(%rbp), %eax
leaq 0xbb231(%rip), %rcx     # 0xe03f4
cmpl (%rcx), %eax
jl 0x251fc
cmpl $0x0, -0x20(%rbp)
je 0x251ed
leaq 0xbb220(%rip), %rax     # 0xe03f4
movl (%rax), %edi
subl $0x1, %edi
subl -0x4(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x248a0
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
leaq 0xbb200(%rip), %rax     # 0xe03f4
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x251fe
cmpl $0x0, -0x20(%rbp)
jl 0x252a4
movl -0x8(%rbp), %eax
cmpl 0x1452b7(%rip), %eax    # 0x16a4c8
jge 0x25219
cmpl $0x0, -0x10(%rbp)
jge 0x2521e
jmp 0x255a9
cmpl $0x0, -0x8(%rbp)
jge 0x25256
cmpl $0x0, -0x1c(%rbp)
je 0x25240
xorl %edi, %edi
subl -0x8(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x248a0
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x25254
movl $0x0, -0x4(%rbp)
jmp 0x25256
movl -0x10(%rbp), %eax
cmpl 0x145269(%rip), %eax    # 0x16a4c8
jl 0x2529f
cmpl $0x0, -0x1c(%rbp)
je 0x25284
movl 0x14525b(%rip), %edi    # 0x16a4c8
subl $0x1, %edi
subl -0x10(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x248a0
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl 0x14523e(%rip), %eax    # 0x16a4c8
subl $0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x2529d
movl $0x0, -0xc(%rbp)
jmp 0x2529f
jmp 0x2533d
movl -0x10(%rbp), %eax
cmpl 0x14521b(%rip), %eax    # 0x16a4c8
jge 0x252b5
cmpl $0x0, -0x8(%rbp)
jge 0x252ba
jmp 0x255a9
cmpl $0x0, -0x10(%rbp)
jge 0x252f2
cmpl $0x0, -0x1c(%rbp)
je 0x252dc
xorl %edi, %edi
subl -0x10(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x248a0
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x252f0
movl $0x0, -0xc(%rbp)
jmp 0x252f2
movl -0x8(%rbp), %eax
cmpl 0x1451cd(%rip), %eax    # 0x16a4c8
jl 0x2533b
cmpl $0x0, -0x1c(%rbp)
je 0x25320
movl 0x1451bf(%rip), %edi    # 0x16a4c8
subl $0x1, %edi
subl -0x8(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x248a0
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl 0x1451a2(%rip), %eax    # 0x16a4c8
subl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x25339
movl $0x0, -0x4(%rbp)
jmp 0x2533b
jmp 0x2533d
movl -0xc(%rbp), %edi
subl -0x4(%rbp), %edi
callq 0x2b7f0
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %edi
subl -0x8(%rbp), %edi
callq 0x2b7f0
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x254b3
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x25397
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x8(%rbp), %eax
jle 0x253b4
leaq 0x195a37(%rip), %rax    # 0x1bade4
movl (%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x253c2
xorl %eax, %eax
leaq 0x195a27(%rip), %rcx    # 0x1bade4
subl (%rcx), %eax
movl %eax, -0x24(%rbp)
movl 0x145104(%rip), %eax    # 0x16a4cc
addl -0x8(%rbp), %eax
leaq 0x195a12(%rip), %rcx    # 0x1bade4
imull (%rcx), %eax
addl -0x4(%rbp), %eax
cltq
leaq 0x19582f(%rip), %rcx    # 0x1bac10
addq (%rcx), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x2542d
cmpl $-0x1, 0xbabc3(%rip)    # 0xdffb8
jne 0x2542d
movzbl -0x11(%rbp), %eax
shll $0x18, %eax
movzbl -0x11(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movzbl -0x11(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x11(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x6ee60
jmp 0x254ae
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x254ac
movl 0xbab79(%rip), %eax     # 0xdffb8
movl -0x34(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x34(%rbp)
andl $0x1f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0xbb848(%rip), %rcx     # 0xe0ca0
andl (%rcx,%rdx,4), %eax
cmpl $0x0, %eax
je 0x2546d
movq -0x30(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x2bbc0
movl -0x20(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x25495
movl -0x1c(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movslq -0x24(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x25433
jmp 0x254ae
jmp 0x255a9
movl -0x10(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x254df
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x28(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jle 0x254f7
movl $0x1, -0x24(%rbp)
jmp 0x254fe
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movl 0x144fc8(%rip), %eax    # 0x16a4cc
addl -0x8(%rbp), %eax
leaq 0x1958d6(%rip), %rcx    # 0x1bade4
imull (%rcx), %eax
addl -0x4(%rbp), %eax
cltq
leaq 0x1956f3(%rip), %rcx    # 0x1bac10
addq (%rcx), %rax
movq %rax, -0x30(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x255a9
movl 0xbaa82(%rip), %eax     # 0xdffb8
movl -0x34(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x34(%rbp)
andl $0x1f, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0xbb751(%rip), %rcx     # 0xe0ca0
andl (%rcx,%rdx,4), %eax
cmpl $0x0, %eax
je 0x25564
movq -0x30(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x2bbc0
movl -0x1c(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x2558c
movl -0x20(%rbp), %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movslq -0x24(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x195851(%rip), %rax    # 0x1bade4
movslq (%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2552a
addq $0x40, %rsp
popq %rbp
retq
nop