// File: /workspace/github_c_makefile_star2_O3/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
movl %ecx, -0x50(%rsp)
movq %rsi, -0x40(%rsp)
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl %eax, %r10d
movq %rdi, -0x30(%rsp)
addl %edi, %r10d
js 0x1dd2e
movq -0x30(%rsp), %rcx
movl %ecx, %edi
subl %eax, %edi
leaq 0x866a2(%rip), %rcx     # 0xa4030
movl (%rcx), %esi
cmpl %esi, %edi
jge 0x1dd2e
movl %eax, %r9d
addl -0x40(%rsp), %r9d
js 0x1dd2e
movq -0x40(%rsp), %rcx
subl %eax, %ecx
movl 0x1103b4(%rip), %r8d    # 0x12dd68
cmpl %r8d, %ecx
jge 0x1dd2e
movl 0x1103a8(%rip), %r11d   # 0x12dd6c
addl -0x40(%rsp), %r11d
leaq 0x1608b4(%rip), %rbx    # 0x17e284
imull (%rbx), %r11d
addl -0x30(%rsp), %r11d
movslq %r11d, %rbx
leaq 0x1606cd(%rip), %r11    # 0x17e0b0
addq (%r11), %rbx
movq %rbx, -0x48(%rsp)
leaq 0x86dbe(%rip), %r11     # 0xa47b0
movl (%r11), %r11d
testl %r11d, 0x8661c(%rip)    # 0xa4018
je 0x1dad4
cmpl -0x40(%rsp), %r8d
setbe %r11b
cmpl %esi, %r10d
setae %r10b
orb %r11b, %r10b
jne 0x1da37
movl %eax, %esi
movl -0x50(%rsp), %r8d
movq -0x48(%rsp), %r10
movb %r8b, (%r10,%rsi)
leaq 0x86602(%rip), %rsi     # 0xa4030
movl (%rsi), %esi
movl 0x110331(%rip), %r8d    # 0x12dd68
cmpl -0x30(%rsp), %esi
seta %r10b
cmpl %r8d, %r9d
setb %r9b
andb %r10b, %r9b
cmpb $0x1, %r9b
jne 0x1da7d
leaq 0x16082e(%rip), %rsi    # 0x17e284
movslq (%rsi), %rsi
movslq %eax, %r8
imulq %rsi, %r8
movl -0x50(%rsp), %esi
movq -0x48(%rsp), %r9
movb %sil, (%r9,%r8)
movl 0x1102f4(%rip), %r8d    # 0x12dd68
leaq 0x865b5(%rip), %rsi     # 0xa4030
movl (%rsi), %esi
cmpl -0x40(%rsp), %r8d
jbe 0x1daa9
cmpl %esi, %edi
jae 0x1daa9
movl %eax, %esi
movq -0x48(%rsp), %rdi
subq %rsi, %rdi
movl -0x50(%rsp), %esi
movb %sil, (%rdi)
leaq 0x86590(%rip), %rsi     # 0xa4030
movl (%rsi), %esi
movl 0x1102bf(%rip), %r8d    # 0x12dd68
cmpl -0x30(%rsp), %esi
jbe 0x1dad4
cmpl %r8d, %ecx
jae 0x1dad4
leaq 0x1607c9(%rip), %rcx    # 0x17e284
movslq (%rcx), %rcx
movslq %eax, %rsi
imulq %rcx, %rsi
movq -0x48(%rsp), %rcx
subq %rsi, %rcx
movl -0x50(%rsp), %esi
movb %sil, (%rcx)
testl %edx, %edx
je 0x1dd2e
movl $0x1, %edx
movl $0x5, %ebx
subl %eax, %ebx
subl %eax, %ebx
subl %eax, %edx
movq -0x40(%rsp), %rcx
leal -0x1(%rcx), %ebp
incl %ecx
movq %rcx, -0x18(%rsp)
movq -0x30(%rsp), %rcx
leal -0x1(%rcx), %r15d
incl %ecx
movq %rcx, -0x10(%rsp)
movl $0x2, %r13d
movq $-0x1, %r9
xorl %r10d, %r10d
movq %r10, %r11
incq %r10
xorl %r14d, %r14d
testl %edx, %edx
movl %r13d, %r12d
cmovnsl %ebx, %r12d
setns %r14b
subl %r14d, %eax
movl %r10d, %ecx
andl $0x1f, %ecx
leaq 0x86c6f(%rip), %rsi     # 0xa47b0
movl (%rsi,%rcx,4), %ecx
movslq %eax, %rdi
testl %ecx, 0x864cb(%rip)     # 0xa4018
je 0x1dd0f
movq %rdi, -0x28(%rsp)
leaq 0x160725(%rip), %rcx    # 0x17e284
movl (%rcx), %ecx
movl %ecx, -0x4c(%rsp)
imull %r10d, %ecx
movl %ecx, -0x34(%rsp)
movq -0x30(%rsp), %rcx
addl %eax, %ecx
leaq 0x864b5(%rip), %r8      # 0xa4030
movl (%r8), %edi
movl %ecx, -0x1c(%rsp)
cmpl %edi, %ecx
jae 0x1dbb3
movq -0x18(%rsp), %rcx
addl %r11d, %ecx
cmpl 0x1101d4(%rip), %ecx    # 0x12dd68
jae 0x1dbb3
movq -0x48(%rsp), %rcx
movq -0x28(%rsp), %rsi
addq %rsi, %rcx
movslq -0x34(%rsp), %rsi
movl -0x50(%rsp), %edi
movb %dil, (%rsi,%rcx)
movl (%r8), %edi
movl -0x4c(%rsp), %ecx
imull %eax, %ecx
movl %ecx, -0x4c(%rsp)
movq -0x10(%rsp), %rcx
addq %r11, %rcx
movq %rcx, -0x8(%rsp)
cmpl %edi, %ecx
jae 0x1dbf8
movq -0x40(%rsp), %rcx
leal (%rax,%rcx), %esi
cmpl 0x11018b(%rip), %esi    # 0x12dd68
jae 0x1dbf8
movslq -0x4c(%rsp), %rsi
movq -0x48(%rsp), %rcx
leaq (%rcx,%r11), %rdi
movl -0x50(%rsp), %ecx
movb %cl, 0x1(%rsi,%rdi)
movl (%r8), %edi
cmpl %edi, %r15d
jae 0x1dc25
movq -0x40(%rsp), %rcx
leal (%rax,%rcx), %esi
cmpl 0x11015d(%rip), %esi    # 0x12dd68
jae 0x1dc25
movslq -0x4c(%rsp), %rsi
movq -0x48(%rsp), %rcx
leaq (%rcx,%r9), %rdi
movl -0x50(%rsp), %ecx
movb %cl, (%rsi,%rdi)
movl (%r8), %edi
movq -0x30(%rsp), %rcx
movl %ecx, %esi
subl %eax, %esi
cmpl %edi, %esi
jae 0x1dc64
movq -0x18(%rsp), %rcx
addl %r11d, %ecx
cmpl 0x110128(%rip), %ecx    # 0x12dd68
jae 0x1dc64
movq -0x48(%rsp), %rcx
subq -0x28(%rsp), %rcx
movslq -0x34(%rsp), %rdi
movl -0x50(%rsp), %r8d
movb %r8b, (%rcx,%rdi)
leaq 0x863cf(%rip), %r8      # 0xa4030
movl (%r8), %edi
cmpl %edi, %esi
jae 0x1dc8b
cmpl 0x1100fa(%rip), %ebp    # 0x12dd68
jae 0x1dc8b
movslq -0x34(%rsp), %rcx
addq -0x28(%rsp), %rcx
movq -0x48(%rsp), %rsi
subq %rcx, %rsi
movl -0x50(%rsp), %ecx
movb %cl, (%rsi)
movl (%r8), %edi
cmpl %edi, %r15d
jae 0x1dcb8
movq -0x40(%rsp), %rcx
subl %eax, %ecx
cmpl 0x1100cb(%rip), %ecx    # 0x12dd68
jae 0x1dcb8
movslq -0x4c(%rsp), %rcx
movq -0x48(%rsp), %rsi
addq %r9, %rsi
subq %rcx, %rsi
movl -0x50(%rsp), %ecx
movb %cl, (%rsi)
movl (%r8), %edi
cmpl %edi, -0x8(%rsp)
jae 0x1dce5
movq -0x40(%rsp), %rcx
subl %eax, %ecx
cmpl 0x11009d(%rip), %ecx    # 0x12dd68
jae 0x1dce5
movslq -0x4c(%rsp), %rcx
addq -0x48(%rsp), %r11
subq %rcx, %r11
movl -0x50(%rsp), %ecx
movb %cl, 0x1(%r11)
movl (%r8), %edi
cmpl %edi, -0x1c(%rsp)
movq -0x28(%rsp), %rdi
jae 0x1dd0f
cmpl 0x110072(%rip), %ebp    # 0x12dd68
jae 0x1dd0f
movq -0x48(%rsp), %rcx
addq %rdi, %rcx
movslq -0x34(%rsp), %rsi
subq %rsi, %rcx
movl -0x50(%rsp), %esi
movb %sil, (%rcx)
leal (%rbx,%r14,2), %ebx
addl $0x2, %ebx
addl %r12d, %edx
decl %ebp
decl %r15d
decq %r9
addl $0x2, %r13d
cmpq %rdi, %r10
jl 0x1db1b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq