// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
leaq -0x40(%rsp), %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq %r9, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xa68b
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %r8
movq 0x10(%rbp), %r9
callq 0xaa90
jmp 0xa82b
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x14(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
movl -0x2c(%rbp), %eax
shll %eax
addl $0x1, %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0xa760
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x2c(%rbp), %esi
addl $0x1, %esi
movl -0x10(%rbp), %edx
subl -0x28(%rbp), %edx
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x2c(%rbp), %esi
addl $0x1, %esi
movl -0x10(%rbp), %edx
addl -0x28(%rbp), %edx
movl -0x2c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
movl -0x28(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0xa76a
jmp 0xa7c9
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x10(%rbp), %edx
subl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x10(%rbp), %edx
addl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
jmp 0xa6ca
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0xa82b
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x10(%rbp), %edx
subl -0x28(%rbp), %edx
movl -0x28(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
subl -0x28(%rbp), %esi
movl -0x10(%rbp), %edx
addl -0x28(%rbp), %edx
movl -0x28(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movl -0x18(%rbp), %r8d
movq -0x20(%rbp), %r9
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0xab10
leaq 0x40(%rsp), %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)