// File: /workspace/github_c_makefile_star2_O2/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 $0x58, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r13
pushq $0x1
popq %rax
subl %ecx, %eax
movq %rax, 0x30(%rsp)
leal (%r14,%r14), %eax
negl %eax
movq %rax, 0x28(%rsp)
leal (%r14,%r15), %edx
movl %r8d, %ecx
callq 0x2b4d
movl %r15d, %edx
subl %r14d, %edx
movq %r13, %rdi
movl %ebp, %esi
movl %ebx, %ecx
callq 0x2b4d
leal (%r14,%rbp), %esi
movq %r13, %rdi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x2b4d
movl %ebp, %esi
movq %r14, 0x8(%rsp)
subl %r14d, %esi
movq %r13, 0x40(%rsp)
movq %r13, %rdi
movl %r15d, %edx
movl %ebx, 0x1c(%rsp)
movl %ebx, %ecx
callq 0x2b4d
leal -0x1(%r15), %ebx
movq %r15, 0x50(%rsp)
leal 0x1(%r15), %eax
movl %eax, 0x18(%rsp)
leal -0x1(%rbp), %r12d
movq %rbp, 0x48(%rsp)
leal 0x1(%rbp), %eax
movq %rax, 0x38(%rsp)
movl $0x0, 0x14(%rsp)
xorl %r14d, %r14d
movq 0x40(%rsp), %rbp
movl 0x1c(%rsp), %r13d
cmpl 0x8(%rsp), %r14d
jge 0x36c8
movq 0x28(%rsp), %rdi
leal 0x2(%rdi), %eax
xorl %ecx, %ecx
movq 0x30(%rsp), %rsi
testl %esi, %esi
movl $0x0, %edx
cmovnsl %eax, %edx
cmovnsl %eax, %edi
movq %rdi, 0x28(%rsp)
setns %cl
movl %ebx, 0x24(%rsp)
movq 0x8(%rsp), %rax
subl %ecx, %eax
movq %rax, 0x8(%rsp)
leal 0x1(%r14), %eax
movl %eax, 0x20(%rsp)
movl 0x14(%rsp), %eax
addl %eax, %esi
addl $0x2, %eax
movl %eax, 0x14(%rsp)
addl %edx, %esi
addl $0x3, %esi
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
leal (%rax,%r14), %esi
movl %esi, 0x4(%rsp)
movq 0x50(%rsp), %rbx
movq 0x8(%rsp), %rax
leal (%rax,%rbx), %r15d
movq %rbp, %rdi
movl %r15d, %edx
movl %r13d, %ecx
callq 0x2b4d
movq %rbp, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r13d, %ecx
callq 0x2b4d
movl %ebx, %r15d
movq 0x8(%rsp), %rbx
subl %ebx, %r15d
movq %rbp, %rdi
movl 0x4(%rsp), %esi
movl %r15d, %edx
movl %r13d, %ecx
callq 0x2b4d
movq %rbp, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r13d, %ecx
callq 0x2b4d
movq 0x48(%rsp), %r15
leal (%rbx,%r15), %esi
movl %esi, 0x4(%rsp)
addl 0x18(%rsp), %r14d
movq %rbp, %rdi
movl %r14d, %edx
movl %r13d, %ecx
callq 0x2b4d
subl %ebx, %r15d
movl 0x24(%rsp), %ebx
movq %rbp, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %r13d, %ecx
callq 0x2b4d
movq %rbp, %rdi
movl 0x4(%rsp), %esi
movl %ebx, %edx
movl %r13d, %ecx
callq 0x2b4d
movq %rbp, %rdi
movl %r15d, %esi
movl %ebx, %edx
movl %r13d, %ecx
callq 0x2b4d
decl %ebx
decl %r12d
movl 0x20(%rsp), %eax
movl %eax, %r14d
jmp 0x3598
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq