// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/build.c
// Function: drawcircle16
void drawcircle16(int x1, int y1, int r, unsigned char col)
{
	int xp, yp, xpbpl, ypbpl, d, de, dse, patc=0;
	intptr_t p;

	if (r < 0) r = -r;
	if (x1+r < 0 || x1-r >= xres) return;
	if (y1+r < 0 || y1-r >= ydim16) return;

	/*
	 *      d
	 *    6 | 7
	 *   \  |  /
	 *  5  \|/  8
	 * c----+----a
	 *  4  /|\  1
	 *   /  |  \
	 *    3 | 2
	 *      b
	 */

	xp = 0;
	yp = r;
	d = 1 - r;
	de = 2;
	dse = 5 - (r << 1);

	p = ((ytop16+y1)*bytesperline)+x1+frameplace;

	if (drawlinepat & pow2long[(patc++)&31]) {
		if ((unsigned int)y1 < (unsigned int)ydim16 && (unsigned int)(x1+r) < (unsigned int)xres  )
			drawpixel((void *)(p+r), col);			// a
		if ((unsigned int)x1 < (unsigned int)xres   && (unsigned int)(y1+r) < (unsigned int)ydim16)
			drawpixel((void *)(p+(r*bytesperline)), col);	// b
		if ((unsigned int)y1 < (unsigned int)ydim16 && (unsigned int)(x1-r) < (unsigned int)xres  )
			drawpixel((void *)(p-r), col);			// c
		if ((unsigned int)x1 < (unsigned int)xres   && (unsigned int)(y1-r) < (unsigned int)ydim16)
			drawpixel((void *)(p-(r*bytesperline)), col);	// d
	}

	while (yp > xp) {
		if (d < 0) {
			d += de;
			de += 2;
			dse += 2;
			xp++;
		} else {
			d += dse;
			de += 2;
			dse += 4;
			xp++;
			yp--;
		}

		ypbpl = yp*bytesperline;
		xpbpl = xp*bytesperline;
		if (drawlinepat & pow2long[(patc++)&31]) {
			if ((unsigned int)(x1+yp) < (unsigned int)xres && (unsigned int)(y1+xp) < (unsigned int)ydim16)
				drawpixel((void *)(p+yp+xpbpl), col);	// 1
			if ((unsigned int)(x1+xp) < (unsigned int)xres && (unsigned int)(y1+yp) < (unsigned int)ydim16)
				drawpixel((void *)(p+xp+ypbpl), col);	// 2
			if ((unsigned int)(x1-xp) < (unsigned int)xres && (unsigned int)(y1+yp) < (unsigned int)ydim16)
				drawpixel((void *)(p-xp+ypbpl), col);	// 3
			if ((unsigned int)(x1-yp) < (unsigned int)xres && (unsigned int)(y1+xp) < (unsigned int)ydim16)
				drawpixel((void *)(p-yp+xpbpl), col);	// 4
			if ((unsigned int)(x1-yp) < (unsigned int)xres && (unsigned int)(y1-xp) < (unsigned int)ydim16)
				drawpixel((void *)(p-yp-xpbpl), col);	// 5
			if ((unsigned int)(x1-xp) < (unsigned int)xres && (unsigned int)(y1-yp) < (unsigned int)ydim16)
				drawpixel((void *)(p-xp-ypbpl), col);	// 6
			if ((unsigned int)(x1+xp) < (unsigned int)xres && (unsigned int)(y1-yp) < (unsigned int)ydim16)
				drawpixel((void *)(p+xp-ypbpl), col);	// 7
			if ((unsigned int)(x1+yp) < (unsigned int)xres && (unsigned int)(y1-xp) < (unsigned int)ydim16)
				drawpixel((void *)(p+yp-xpbpl), col);	// 8
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, -0x70(%rsp)
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl %eax, %ebx
movq %rdi, -0x68(%rsp)
addl %edi, %ebx
js 0x1b7d1
movl %ecx, %r12d
movq -0x68(%rsp), %rcx
movl %ecx, %r10d
subl %eax, %r10d
leaq 0x81c4f(%rip), %rcx     # 0x9d030
movl (%rcx), %esi
cmpl %esi, %r10d
jge 0x1b7d1
movl %eax, %edi
addl -0x70(%rsp), %edi
js 0x1b7d1
movq -0x70(%rsp), %rcx
movl %ecx, %r9d
subl %eax, %r9d
movl 0x10b95e(%rip), %r11d   # 0x126d68
cmpl %r11d, %r9d
jge 0x1b7d1
movl $0x1, %edx
movl %edx, %r8d
subl %eax, %r8d
movl $0x5, %r15d
subl %eax, %r15d
subl %eax, %r15d
movl 0x10b93c(%rip), %ebp    # 0x126d6c
movq -0x70(%rsp), %rcx
addl %ecx, %ebp
leaq 0x15be46(%rip), %r14    # 0x177284
imull (%r14), %ebp
addl -0x68(%rsp), %ebp
movslq %ebp, %r13
leaq 0x15bc60(%rip), %r14    # 0x1770b0
movq (%r14), %r14
movq %r13, -0x20(%rsp)
movq %r14, -0x28(%rsp)
addq %r13, %r14
movq %r14, -0x78(%rsp)
leaq 0x82344(%rip), %r14     # 0x9d7b0
movl (%r14), %r14d
movl $0x2, %ebp
testl %r14d, 0x81b9d(%rip)    # 0x9d018
je 0x1b53a
cmpl %ecx, %r11d
setbe %r14b
cmpl %esi, %ebx
setae %bl
orb %r14b, %bl
movl %eax, %ebx
jne 0x1b4ad
movq -0x78(%rsp), %rsi
movb %r12b, (%rsi,%rbx)
leaq 0x81b8c(%rip), %rsi     # 0x9d030
movl (%rsi), %esi
movl 0x10b8bb(%rip), %r11d   # 0x126d68
cmpl -0x68(%rsp), %esi
seta %r14b
cmpl %r11d, %edi
setb %dil
andb %r14b, %dil
cmpb $0x1, %dil
jne 0x1b4ef
leaq 0x15bdb8(%rip), %rsi    # 0x177284
movslq (%rsi), %rsi
movslq %eax, %rdi
imulq %rsi, %rdi
movq -0x78(%rsp), %rsi
movb %r12b, (%rsi,%rdi)
movl 0x10b882(%rip), %r11d   # 0x126d68
leaq 0x81b43(%rip), %rsi     # 0x9d030
movl (%rsi), %esi
cmpl %ecx, %r11d
jbe 0x1b514
cmpl %esi, %r10d
jae 0x1b514
movq -0x78(%rsp), %rsi
subq %rbx, %rsi
movb %r12b, (%rsi)
leaq 0x81b25(%rip), %rsi     # 0x9d030
movl (%rsi), %esi
movl 0x10b854(%rip), %r11d   # 0x126d68
xorl %r10d, %r10d
cmpl -0x68(%rsp), %esi
jbe 0x1b54d
cmpl %r11d, %r9d
jae 0x1b54d
leaq 0x15bd5b(%rip), %rcx    # 0x177284
movl (%rcx), %r11d
imull %eax, %r11d
xorl %r10d, %r10d
movq -0x78(%rsp), %rsi
jmp 0x1b53f
xorl %r10d, %r10d
jmp 0x1b54d
movslq %r11d, %rcx
subq %rcx, %rsi
movb %r12b, (%rsi)
movq -0x70(%rsp), %rcx
movl %r10d, %esi
notl %esi
leal (%rsi,%rcx), %edi
movq %rdi, -0x40(%rsp)
addl %r10d, %ecx
incl %ecx
movq %rcx, -0x48(%rsp)
movq -0x68(%rsp), %rcx
addl %ecx, %esi
movq %rsi, -0x10(%rsp)
addl %r10d, %ecx
incl %ecx
movq %rcx, -0x18(%rsp)
movq -0x20(%rsp), %rcx
movq -0x28(%rsp), %rsi
addq %rsi, %rcx
leaq 0x1(%r10,%rcx), %rsi
movq %rsi, -0x50(%rsp)
movq %r10, %rsi
notq %rsi
addq %rcx, %rsi
movq %rsi, -0x58(%rsp)
movl %edx, %ecx
movq %rcx, -0x30(%rsp)
xorl %edx, %edx
xorl %r14d, %r14d
movq %r10, -0x38(%rsp)
leaq (%r10,%r14), %rcx
movslq %eax, %rsi
cmpq %rsi, %rcx
jge 0x1b7d1
movq -0x30(%rsp), %rcx
addq %r14, %rcx
xorl %esi, %esi
testl %r8d, %r8d
movl %ebp, %edi
cmovnsl %r15d, %edi
setns %sil
subl %esi, %eax
leal (%r15,%rsi,2), %r15d
addl $0x2, %r15d
addl %edi, %r8d
andl $0x1f, %ecx
leaq 0x821c2(%rip), %rsi     # 0x9d7b0
movl (%rsi,%rcx,4), %ecx
testl %ecx, 0x81a21(%rip)     # 0x9d018
je 0x1b7c3
movq %r15, -0x8(%rsp)
leaq 0x15bc7b(%rip), %rcx    # 0x177284
movl (%rcx), %edi
leal (%r10,%r14), %r11d
incl %r11d
imull %edi, %r11d
movq -0x68(%rsp), %rcx
leal (%rax,%rcx), %r15d
leaq 0x81a0a(%rip), %rcx     # 0x9d030
movl (%rcx), %r13d
movslq %eax, %r9
movslq %r11d, %rbx
cmpl %r13d, %r15d
jae 0x1b662
movq -0x48(%rsp), %rcx
leal (%rcx,%r14), %esi
cmpl 0x10b725(%rip), %esi    # 0x126d68
movq -0x70(%rsp), %rcx
jae 0x1b667
movq -0x78(%rsp), %rsi
addq %r9, %rsi
movb %r12b, (%rbx,%rsi)
leaq 0x819d3(%rip), %rsi     # 0x9d030
movl (%rsi), %r13d
jmp 0x1b667
movq -0x70(%rsp), %rcx
movq %r9, -0x60(%rsp)
imull %eax, %edi
movq -0x18(%rsp), %rsi
leaq (%rsi,%r14), %r10
movslq %edi, %r9
cmpl %r13d, %r10d
jae 0x1b6a1
leal (%rax,%rcx), %esi
cmpl 0x10b6df(%rip), %esi    # 0x126d68
jae 0x1b6a1
movq -0x50(%rsp), %rsi
addq %r14, %rsi
movb %r12b, (%r9,%rsi)
leaq 0x81992(%rip), %rsi     # 0x9d030
movl (%rsi), %r13d
movq -0x10(%rsp), %rsi
addq %rdx, %rsi
cmpl %r13d, %esi
jae 0x1b6d0
leal (%rax,%rcx), %edi
cmpl 0x10b6b1(%rip), %edi    # 0x126d68
jae 0x1b6d0
movq -0x58(%rsp), %rcx
leaq (%rcx,%rdx), %rdi
movb %r12b, (%r9,%rdi)
leaq 0x81963(%rip), %rcx     # 0x9d030
movl (%rcx), %r13d
movq -0x68(%rsp), %rcx
movl %ecx, %edi
subl %eax, %edi
cmpl %r13d, %edi
jae 0x1b710
movl %r12d, %ecx
movq -0x48(%rsp), %r12
addl %r14d, %r12d
cmpl 0x10b678(%rip), %r12d   # 0x126d68
movl %ecx, %r12d
jae 0x1b710
movq -0x78(%rsp), %r12
subq -0x60(%rsp), %r12
movb %cl, (%r12,%rbx)
movl %ecx, %r12d
leaq 0x81923(%rip), %rcx     # 0x9d030
movl (%rcx), %r13d
cmpl %r13d, %edi
jae 0x1b746
movq -0x40(%rsp), %rcx
leal (%rcx,%rdx), %edi
cmpl 0x10b645(%rip), %edi    # 0x126d68
movq -0x70(%rsp), %rcx
jae 0x1b74b
addq -0x60(%rsp), %rbx
movq -0x78(%rsp), %rdi
subq %rbx, %rdi
movb %r12b, (%rdi)
leaq 0x818ef(%rip), %rdi     # 0x9d030
movl (%rdi), %r13d
jmp 0x1b74b
movq -0x70(%rsp), %rcx
cmpl %r13d, %esi
jae 0x1b774
movl %ecx, %esi
subl %eax, %esi
cmpl 0x10b60e(%rip), %esi    # 0x126d68
jae 0x1b774
movq -0x58(%rsp), %rsi
addq %rdx, %rsi
subq %r9, %rsi
movb %r12b, (%rsi)
leaq 0x818bf(%rip), %rsi     # 0x9d030
movl (%rsi), %r13d
cmpl %r13d, %r10d
jae 0x1b7a5
movl %ecx, %esi
subl %eax, %esi
cmpl 0x10b5e5(%rip), %esi    # 0x126d68
movq -0x38(%rsp), %r10
jae 0x1b7aa
movq -0x50(%rsp), %rcx
leaq (%rcx,%r14), %rsi
subq %r9, %rsi
movb %r12b, (%rsi)
leaq 0x81890(%rip), %rcx     # 0x9d030
movl (%rcx), %r13d
jmp 0x1b7aa
movq -0x38(%rsp), %r10
cmpl %r13d, %r15d
movq -0x8(%rsp), %r15
jae 0x1b7c3
movq -0x40(%rsp), %rcx
addl %edx, %ecx
cmpl 0x10b5a7(%rip), %ecx    # 0x126d68
jb 0x1b7dc
incq %r14
decq %rdx
addl $0x2, %ebp
jmp 0x1b5b0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x60(%rsp), %rsi
addq -0x78(%rsp), %rsi
addq %r14, %r10
incq %r10
addl $0x2, %ebp
movq -0x30(%rsp), %rcx
leal (%rcx,%r14), %edx
incl %edx
jmp 0x1b53f