// File: /workspace/github_c_makefile_star2_O2/halcy[P]quasi_crystals_bot/Graphics/DrawingCircles.c
// Function: GenericDrawCircle
static inline void GenericDrawCircle(Bitmap *bitmap,int x,int y,int r,Pixel c,
CompositionMode comp,GenericDrawPixelFunction *pixelfunc)
{
	if(r==0)
	{
		GenericDrawPixel(bitmap,x,y,c,comp,pixelfunc);
		return;
	}

	int error=-r;
	int dx=r;
	int dy=0;

	GenericDrawPixel(bitmap,x,y-r,c,comp,pixelfunc);
	GenericDrawPixel(bitmap,x-r,y,c,comp,pixelfunc);
	GenericDrawPixel(bitmap,x+r,y,c,comp,pixelfunc);
	GenericDrawPixel(bitmap,x,y+r,c,comp,pixelfunc);

	for(;;)
	{
		error+=2*dy+1;
		dy++;
 
		if(error>=0)
		{
			error-=2*dx-1;
			dx--;
		}
		if(dx<=dy) break;

		GenericDrawPixel(bitmap,x-dx,y-dy,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dx,y-dy,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x-dx,y+dy,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dx,y+dy,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x-dy,y-dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x-dy,y+dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dy,y-dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dy,y+dx,c,comp,pixelfunc);
	}

	if(dx==dy)
	{
		GenericDrawPixel(bitmap,x-dx,y-dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dx,y-dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x-dx,y+dx,c,comp,pixelfunc);
		GenericDrawPixel(bitmap,x+dx,y+dx,c,comp,pixelfunc);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq -0x68(%rsp), %rsp
movl %r8d, %r13d
movl %edx, %ebp
movl %esi, %r15d
testl %ecx, %ecx
movq %rdi, %r14
movq 0xa0(%rsp), %rax
je 0x5c0e
movl %ecx, %r12d
movl %ebp, %edx
negl %ecx
movq %r14, %rdi
movl %r15d, %esi
movq %r9, %r8
movq %rax, %rbx
movq %rcx, 0x50(%rsp)
subl %r12d, %edx
movl %r13d, %ecx
movq %r9, 0x20(%rsp)
callq *%rax
movl %r15d, %esi
movq %r14, %rdi
movl %ebp, %edx
movl %r13d, %ecx
movq 0x20(%rsp), %r8
subl %r12d, %esi
callq *%rbx
leal (%r12,%r15), %esi
movq %r14, %rdi
movl %ebp, %edx
movl %r13d, %ecx
movq 0x20(%rsp), %r8
callq *%rbx
movq %r14, 0x30(%rsp)
leal (%r12,%rbp), %edx
movq %r14, %rdi
movl %r15d, %esi
movl %r13d, %ecx
movq 0x20(%rsp), %r8
movq %rbx, 0x38(%rsp)
callq *%rbx
leal 0x1(%rbp), %eax
leal 0x1(%r15), %edx
leal -0x1(%r15), %ecx
movl %eax, 0x18(%rsp)
movl %edx, 0x10(%rsp)
leal -0x1(%rbp), %edx
movq %rbp, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movl %ecx, 0xc(%rsp)
pushq $0x1
popq %rsi
movl %r13d, 0x28(%rsp)
movl %esi, %edi
xorl %r8d, %r8d
movq 0x20(%rsp), %rbp
movq 0x38(%rsp), %rbx
movq 0x50(%rsp), %rcx
movl %r13d, %r14d
leal (%rcx,%rdi), %eax
movl %eax, %r15d
notl %r15d
sarl $0x1f, %r15d
addl %r12d, %r15d
cmpl %esi, %r15d
jle 0x5ba5
testl %eax, %eax
leal -0x1(%r12,%r12), %eax
movl $0x0, %r9d
movl %esi, 0x2c(%rsp)
leal 0x1(%rcx,%r8,2), %ecx
cmovsl %r9d, %eax
movq 0x40(%rsp), %rsi
subl %eax, %ecx
movl %esi, %r13d
movq %rcx, 0x50(%rsp)
subl %r15d, %r13d
movl %r14d, %ecx
movq 0x30(%rsp), %r12
movq %rdi, 0x60(%rsp)
movl %edx, 0x1c(%rsp)
movl %r13d, %esi
movl 0x1c(%rsp), %edx
movq %r8, 0x58(%rsp)
movq %r12, %rdi
movq %rbp, %r8
callq *%rbx
movq 0x40(%rsp), %rax
movq %r12, %rdi
movl %r14d, %ecx
movq %rbp, %r8
leal (%r15,%rax), %esi
movl %esi, 0x14(%rsp)
movl 0x1c(%rsp), %edx
callq *%rbx
movl %r13d, %esi
movl 0x18(%rsp), %r13d
movq %r12, %rdi
movl %r14d, %ecx
movq %rbp, %r8
movl %r13d, %edx
callq *%rbx
movq %r12, %rdi
movl 0x14(%rsp), %esi
movl %r13d, %edx
movl %r14d, %ecx
movq %rbp, %r8
callq *%rbx
movq 0x48(%rsp), %rax
movq %r12, %rdi
movl 0xc(%rsp), %esi
movl %r14d, %ecx
movq %rbp, %r8
movl %eax, %r13d
subl %r15d, %r13d
movl %r13d, %edx
callq *%rbx
movq 0x48(%rsp), %rax
movq %r12, %rdi
movl %r14d, %ecx
movq %rbp, %r8
leal (%r15,%rax), %edx
movl %edx, 0x14(%rsp)
movl 0xc(%rsp), %esi
callq *%rbx
movl 0x10(%rsp), %r14d
movl %r13d, %edx
movl 0x28(%rsp), %r13d
movq %r12, %rdi
movq %rbp, %r8
movl %r14d, %esi
movl %r13d, %ecx
callq *%rbx
movq %r12, %rdi
movl %r14d, %esi
movl 0x14(%rsp), %edx
movl %r13d, %ecx
movq %rbp, %r8
callq *%rbx
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl 0x1c(%rsp), %edx
incl %r14d
incl 0x18(%rsp)
movl %r15d, %r12d
movl %r14d, 0x10(%rsp)
addl $0x2, %edi
decl %edx
decl 0xc(%rsp)
incl %esi
incl %r8d
jmp 0x5a55
jne 0x5c2d
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %rbx
movl 0xc(%rsp), %esi
movl %r14d, %ecx
movq 0x38(%rsp), %r12
movl %edx, %r13d
movl %r14d, %ebp
movq %r15, %rdi
movq %rbx, %r8
callq *%r12
movq %r15, %rdi
movl 0x10(%rsp), %esi
movl %r13d, %edx
movl %r14d, %ecx
movq %rbx, %r8
callq *%r12
movl 0x18(%rsp), %r14d
movq %r15, %rdi
movl 0xc(%rsp), %esi
movl %ebp, %ecx
movq %rbx, %r8
movl %r14d, %edx
callq *%r12
movq %r15, %rdi
movl 0x10(%rsp), %esi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
movq %r12, %rax
jmp 0x5c1c
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %r13d, %ecx
movq %r9, %r8
leaq 0x68(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x68(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq