// File: /workspace/github_c_makefile_star2_O1/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, -0x54(%rsp)
movq %rsi, -0x48(%rsp)
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
movl %eax, %r8d
movq %rdi, -0x38(%rsp)
addl %edi, %r8d
js 0x1d89a
movq -0x38(%rsp), %rcx
subl %eax, %ecx
leaq 0x85b4f(%rip), %rsi     # 0xa3030
movl (%rsi), %r9d
cmpl %r9d, %ecx
jge 0x1d89a
movl %eax, %edi
addl -0x48(%rsp), %edi
js 0x1d89a
movq -0x48(%rsp), %rsi
movl %esi, %ebx
subl %eax, %ebx
movl 0x10f85f(%rip), %r10d   # 0x12cd68
cmpl %r10d, %ebx
jge 0x1d89a
movl 0x10f853(%rip), %r11d   # 0x12cd6c
addl -0x48(%rsp), %r11d
leaq 0x15fd5f(%rip), %rsi    # 0x17d284
imull (%rsi), %r11d
addl -0x38(%rsp), %r11d
movslq %r11d, %rsi
leaq 0x15fb78(%rip), %r11    # 0x17d0b0
addq (%r11), %rsi
movq %rsi, -0x50(%rsp)
leaq 0x86269(%rip), %rsi     # 0xa37b0
movl (%rsi), %r11d
testl %r11d, 0x85ac7(%rip)    # 0xa3018
je 0x1d60d
cmpl -0x48(%rsp), %r10d
setbe %r10b
cmpl %r9d, %r8d
setae %r8b
orb %r10b, %r8b
jne 0x1d57c
movl %eax, %r8d
movl -0x54(%rsp), %esi
movq -0x50(%rsp), %r9
movb %sil, (%r9,%r8)
movq -0x38(%rsp), %rsi
leaq 0x85aa8(%rip), %r8      # 0xa3030
cmpl %esi, (%r8)
jbe 0x1d5ba
cmpl 0x10f7d5(%rip), %edi    # 0x12cd68
jae 0x1d5ba
leaq 0x15fce8(%rip), %rsi    # 0x17d284
movslq (%rsi), %rdi
movslq %eax, %r8
imulq %rdi, %r8
movl -0x54(%rsp), %esi
movq -0x50(%rsp), %rdi
movb %sil, (%rdi,%r8)
leaq 0x85a76(%rip), %r8      # 0xa3030
movq -0x48(%rsp), %rsi
cmpl %esi, 0x10f7a3(%rip)    # 0x12cd68
jbe 0x1d5dc
cmpl (%r8), %ecx
jae 0x1d5dc
movl %eax, %ecx
movq -0x50(%rsp), %rdi
subq %rcx, %rdi
movl -0x54(%rsp), %ecx
movb %cl, (%rdi)
movq -0x38(%rsp), %rcx
cmpl %ecx, (%r8)
jbe 0x1d60d
cmpl 0x10f77c(%rip), %ebx    # 0x12cd68
jae 0x1d60d
leaq 0x15fc8f(%rip), %rcx    # 0x17d284
movslq (%rcx), %rdi
movslq %eax, %rcx
imulq %rdi, %rcx
movq -0x50(%rsp), %rdi
subq %rcx, %rdi
movl -0x54(%rsp), %ecx
movb %cl, (%rdi)
testl %edx, %edx
je 0x1d89a
movl $0x1, %edx
movl $0x5, %ebx
subl %eax, %ebx
subl %eax, %ebx
subl %eax, %edx
movl -0x38(%rsp), %ecx
movq %rcx, -0x28(%rsp)
movq -0x48(%rsp), %rcx
leal -0x1(%rcx), %ebp
incl %ecx
movq %rcx, -0x18(%rsp)
movl $0x2, %r12d
movq $-0x1, %r13
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movq %r8, %r11
incq %r8
xorl %r15d, %r15d
testl %edx, %edx
movl %r12d, %r10d
cmovnsl %ebx, %r10d
setns %r15b
subl %r15d, %eax
movl %r8d, %ecx
andl $0x1f, %ecx
leaq 0x86137(%rip), %rsi     # 0xa37b0
movl (%rsi,%rcx,4), %ecx
movslq %eax, %rsi
testl %ecx, 0x85993(%rip)     # 0xa3018
je 0x1d87b
movq %rsi, -0x30(%rsp)
leaq 0x15fbed(%rip), %rcx    # 0x17d284
movl (%rcx), %esi
movl %esi, %ecx
movq %r8, -0x8(%rsp)
imull %r8d, %ecx
movl %ecx, -0x3c(%rsp)
movq -0x38(%rsp), %rcx
addl %eax, %ecx
leaq 0x8597a(%rip), %r8      # 0xa3030
movl %ecx, -0x1c(%rsp)
cmpl (%r8), %ecx
jae 0x1d6f4
movq -0x18(%rsp), %rcx
leal (%rcx,%r11), %edi
cmpl 0x10f69a(%rip), %edi    # 0x12cd68
jae 0x1d6f4
movq -0x50(%rsp), %rcx
movq -0x30(%rsp), %rdi
addq %rdi, %rcx
movq %rcx, -0x10(%rsp)
movslq -0x3c(%rsp), %rdi
movl -0x54(%rsp), %ecx
movq -0x10(%rsp), %r14
movb %cl, (%rdi,%r14)
imull %eax, %esi
movq -0x28(%rsp), %rcx
leal (%rcx,%r11), %edi
incl %edi
cmpl %edi, (%r8)
jbe 0x1d72c
movq -0x48(%rsp), %rcx
leal (%rax,%rcx), %edi
cmpl 0x10f653(%rip), %edi    # 0x12cd68
jae 0x1d72c
movslq %esi, %r14
movq -0x50(%rsp), %rcx
leaq (%rcx,%r11), %rdi
movl -0x54(%rsp), %ecx
movb %cl, 0x1(%r14,%rdi)
movq -0x28(%rsp), %rcx
leal (%rcx,%r9), %edi
cmpl %edi, (%r8)
jbe 0x1d75e
movq -0x48(%rsp), %rcx
leal (%rax,%rcx), %edi
cmpl 0x10f620(%rip), %edi    # 0x12cd68
jae 0x1d75e
movslq %esi, %r14
movq -0x50(%rsp), %rcx
leaq (%rcx,%r13), %rdi
movl -0x54(%rsp), %ecx
movb %cl, (%r14,%rdi)
movq -0x38(%rsp), %rcx
movl %ecx, %edi
subl %eax, %edi
cmpl (%r8), %edi
jae 0x1d7a3
movq -0x18(%rsp), %rcx
leal (%rcx,%r11), %r8d
cmpl 0x10f5ec(%rip), %r8d    # 0x12cd68
leaq 0x858ad(%rip), %r8      # 0xa3030
jae 0x1d7a3
movq -0x50(%rsp), %r8
subq -0x30(%rsp), %r8
movslq -0x3c(%rsp), %r14
movl -0x54(%rsp), %ecx
movb %cl, (%r8,%r14)
leaq 0x8588d(%rip), %r8      # 0xa3030
cmpl (%r8), %edi
jae 0x1d7d0
cmpl 0x10f5ba(%rip), %ebp    # 0x12cd68
jae 0x1d7d0
movslq -0x3c(%rsp), %rdi
addq -0x30(%rsp), %rdi
movq -0x50(%rsp), %r8
subq %rdi, %r8
movl -0x54(%rsp), %ecx
movb %cl, (%r8)
leaq 0x85860(%rip), %r8      # 0xa3030
movq -0x28(%rsp), %rcx
leal (%rcx,%r9), %edi
cmpl %edi, (%r8)
jbe 0x1d80c
movq -0x48(%rsp), %rcx
movl %ecx, %edi
subl %eax, %edi
cmpl 0x10f57b(%rip), %edi    # 0x12cd68
jae 0x1d80c
movslq %esi, %rdi
movq -0x50(%rsp), %rcx
leaq (%rcx,%r13), %r8
subq %rdi, %r8
movl -0x54(%rsp), %ecx
movb %cl, (%r8)
leaq 0x85824(%rip), %r8      # 0xa3030
movq -0x28(%rsp), %rcx
leal (%rcx,%r11), %edi
incl %edi
cmpl %edi, (%r8)
jbe 0x1d840
movq -0x48(%rsp), %rcx
movl %ecx, %edi
subl %eax, %edi
cmpl 0x10f53d(%rip), %edi    # 0x12cd68
jae 0x1d840
movslq %esi, %rcx
addq -0x50(%rsp), %r11
subq %rcx, %r11
movl -0x54(%rsp), %ecx
movb %cl, 0x1(%r11)
movl -0x1c(%rsp), %ecx
cmpl (%r8), %ecx
movq -0x8(%rsp), %r8
movq -0x30(%rsp), %rsi
jae 0x1d87b
cmpl 0x10f50f(%rip), %ebp    # 0x12cd68
jae 0x1d87b
movq -0x50(%rsp), %rcx
movq -0x30(%rsp), %rsi
addq %rcx, %rsi
movslq -0x3c(%rsp), %rdi
subq %rdi, %rsi
movl -0x54(%rsp), %ecx
movb %cl, (%rsi)
movq -0x30(%rsp), %rsi
leal (%rbx,%r15,2), %ebx
addl $0x2, %ebx
addl %r10d, %edx
decl %ebp
decq %r13
decq %r9
addl $0x2, %r12d
cmpq %rsi, %r8
jl 0x1d653
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq