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

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

	GenericDrawHorizontalLine(bitmap,x-r,y,2*r+1,c,comp,hlinefunc);

	for(;;)
	{
		error+=2*dy+1;
		dy++;

		if(error>=0)
		{
			GenericDrawHorizontalLine(bitmap,x-dy+1,y-dx,2*dy-1,c,comp,hlinefunc);
			GenericDrawHorizontalLine(bitmap,x-dy+1,y+dx,2*dy-1,c,comp,hlinefunc);

			error-=2*dx-1;
			dx--;
		}

		if(dx<=dy) break;

		GenericDrawHorizontalLine(bitmap,x-dx,y-dy,2*dx+1,c,comp,hlinefunc);
		GenericDrawHorizontalLine(bitmap,x-dx,y+dy,2*dx+1,c,comp,hlinefunc);
	}

	if(dx==dy)
	{
		GenericDrawHorizontalLine(bitmap,x-dx,y-dx,2*dx+1,c,comp,hlinefunc);
		GenericDrawHorizontalLine(bitmap,x-dx,y+dx,2*dx+1,c,comp,hlinefunc);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq -0x68(%rsp), %rsp
movq %r9, %r14
movl %r8d, %ebp
testl %ecx, %ecx
movl %esi, %ebx
movq %rdx, 0x20(%rsp)
je 0x5f80
movq 0xa8(%rsp), %rax
movq %rcx, 0x30(%rsp)
movq %rdi, 0x40(%rsp)
movl %ebx, %esi
movl %ecx, %r13d
movl %ebp, %r8d
movq %r14, %r9
movq 0x20(%rsp), %r12
subl %ecx, %esi
leal 0x1(%rcx,%rcx), %ecx
negl %r13d
movq %rax, 0x28(%rsp)
movl %r12d, %edx
callq *%rax
leal 0x1(%r12), %eax
leal -0x1(%r12), %edx
xorl %ecx, %ecx
movl %eax, 0x18(%rsp)
movl %edx, 0x14(%rsp)
pushq $0x1
popq %rdx
movl %edx, %r15d
movl %ebx, 0x38(%rsp)
movl %ebx, 0xc(%rsp)
movl %ebp, 0x10(%rsp)
movq %r14, 0x48(%rsp)
movl %r13d, %eax
movq %r15, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movl %edx, 0x1c(%rsp)
addl %r15d, %eax
js 0x5e76
movq 0x20(%rsp), %rax
movq %r13, %r12
movl %ebp, %r8d
movq 0x40(%rsp), %rbp
movl 0xc(%rsp), %r14d
movq 0x30(%rsp), %r13
movl %r15d, %ecx
movq 0x48(%rsp), %r9
movq 0x28(%rsp), %rbx
movl %eax, %edx
movq %rbp, %rdi
movl %r14d, %esi
subl %r13d, %edx
callq *%rbx
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %r9
movl %r14d, %esi
movq %rbp, %rdi
movl %r15d, %ecx
movl 0x10(%rsp), %r8d
leal (%r13,%rax), %edx
movq %r9, %r14
callq *%rbx
subl %r13d, %r12d
subl %r13d, %r12d
movl 0x1c(%rsp), %edx
decl %r13d
leal 0x1(%r15,%r12), %r12d
movq %r12, 0x50(%rsp)
jmp 0x5e8a
leal 0x1(%r13,%rcx,2), %r13d
movq %r13, 0x50(%rsp)
movq 0x40(%rsp), %rbp
movq 0x30(%rsp), %r13
movq %r14, %r15
cmpl %edx, %r13d
jle 0x5f1d
leal 0x1(%r13,%r13), %ecx
movl 0x38(%rsp), %r14d
movq %r13, 0x30(%rsp)
movq %rbp, %rdi
movq %rbp, %rbx
movq %r15, %r9
movl %ecx, 0x3c(%rsp)
subl %r13d, %r14d
movl 0x14(%rsp), %r13d
movl 0x10(%rsp), %ebp
movl %r14d, %esi
movq 0x28(%rsp), %r12
movl %r13d, %edx
movl %ebp, %r8d
callq *%r12
movq %rbx, %rdi
movl 0x18(%rsp), %ebx
movl %r14d, %esi
movl 0x3c(%rsp), %ecx
movl %ebp, %r8d
movq %r15, %r9
movq %r15, %r14
movl %ebx, %edx
callq *%r12
incl %ebx
decl %r13d
movq 0x58(%rsp), %r15
movl 0x1c(%rsp), %edx
movl %ebx, 0x18(%rsp)
movl %r13d, 0x14(%rsp)
decl 0xc(%rsp)
addl $0x2, %r15d
incl %edx
movq 0x60(%rsp), %rcx
movq 0x50(%rsp), %r13
incl %ecx
jmp 0x5df1
jne 0x5fa5
movq 0x58(%rsp), %r13
movl 0xc(%rsp), %r12d
movq %rbp, %rdi
movq %rbp, %rbx
movl 0x10(%rsp), %ebp
movl 0x14(%rsp), %edx
movq %r15, %r14
movq %r15, %r9
movq 0x28(%rsp), %r15
decl %r12d
addl $0x2, %r13d
movl %ebp, %r8d
movl %r12d, %esi
movl %r13d, %ecx
callq *%r15
movq %rbx, %rdi
movl %r12d, %esi
movl 0x18(%rsp), %edx
movl %r13d, %ecx
movl %ebp, %r8d
movq %r14, %r9
movq %r15, %rax
leaq 0x68(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq 0x20(%rsp), %rdx
movq 0xa0(%rsp), %rax
movl %ebx, %esi
movl %ebp, %ecx
movq %r14, %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