// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/../scg.h
// Function: scg_image_draw_circle
void scg_image_draw_circle(scg_image_t *image, int x, int y, int r,
                           scg_pixel_t color) {
    int f = 1 - r;
    int ddf_x = 0;
    int ddf_y = -2 * r;
    int xi = 0;
    int yi = r;

    scg_image_set_pixel(image, x, y + r, color);
    scg_image_set_pixel(image, x, y - r, color);
    scg_image_set_pixel(image, x + r, y, color);
    scg_image_set_pixel(image, x - r, y, color);

    while (xi < yi) {
        if (f >= 0) {
            yi--;
            ddf_y += 2;
            f += ddf_y;
        }

        xi++;
        ddf_x += 2;
        f += ddf_x + 1;

        scg_image_set_pixel(image, x + xi, y + yi, color);
        scg_image_set_pixel(image, x - xi, y + yi, color);
        scg_image_set_pixel(image, x + xi, y - yi, color);
        scg_image_set_pixel(image, x - xi, y - yi, color);
        scg_image_set_pixel(image, x + yi, y + xi, color);
        scg_image_set_pixel(image, x - yi, y + xi, color);
        scg_image_set_pixel(image, x + yi, y - xi, color);
        scg_image_set_pixel(image, x - yi, y - xi, color);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r13
leal (%r14,%r15), %edx
movl %r8d, %ecx
callq 0x2b68
movl %r15d, %edx
subl %r14d, %edx
movq %r13, %rdi
movl %r12d, %esi
movl %ebx, %ecx
callq 0x2b68
leal (%r14,%r12), %esi
movq %r13, %rdi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x2b68
movq %r12, 0x18(%rsp)
movl %r12d, %esi
subl %r14d, %esi
movq %r13, 0x38(%rsp)
movq %r13, %rdi
movq %r15, 0x20(%rsp)
movl %r15d, %edx
movl %ebx, %ecx
callq 0x2b68
testl %r14d, %r14d
jle 0x374c
leal (%r14,%r14), %esi
negl %esi
movl $0x1, %ebp
subl %r14d, %ebp
movq 0x20(%rsp), %rax
leal -0x1(%rax), %ecx
movl %ecx, 0x8(%rsp)
incl %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rax
leal -0x1(%rax), %ecx
movl %ecx, 0x4(%rsp)
incl %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movl $0x3, %edi
movq 0x38(%rsp), %r15
movl %edi, 0x14(%rsp)
leal 0x2(%rsi), %eax
xorl %ecx, %ecx
testl %ebp, %ebp
setns %cl
movl $0x0, %edx
cmovnsl %eax, %edx
cmovnsl %eax, %esi
movq %rsi, 0x40(%rsp)
subl %ecx, %r14d
movq %r14, 0x28(%rsp)
leal 0x1(%r12), %eax
movl %eax, 0x10(%rsp)
addl %edi, %ebp
addl %edx, %ebp
movq 0x30(%rsp), %rax
leal (%rax,%r12), %esi
movl %esi, (%rsp)
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %rax
leal (%rax,%r14), %r13d
movq %r15, %rdi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x2b68
movq %r15, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x2b68
movl %r14d, %r13d
movq 0x28(%rsp), %r14
subl %r14d, %r13d
movq %r15, %rdi
movl (%rsp), %esi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x2b68
movq %r15, %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x2b68
movq 0x18(%rsp), %r13
leal (%r14,%r13), %esi
movl %esi, (%rsp)
addl 0xc(%rsp), %r12d
movq %r15, %rdi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x2b68
subl %r14d, %r13d
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x2b68
movq %r15, %rdi
movl (%rsp), %esi
movl 0x8(%rsp), %r12d
movl %r12d, %edx
movl %ebx, %ecx
callq 0x2b68
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x2b68
movl 0x14(%rsp), %edi
movq 0x40(%rsp), %rsi
decl %r12d
movl %r12d, 0x8(%rsp)
decl 0x4(%rsp)
addl $0x2, %edi
movl 0x10(%rsp), %eax
movl %eax, %r12d
cmpl %r14d, %eax
jl 0x3637
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq