// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %r8d, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x1, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
imull $0xfffffffe, -0x1c(%rbp), %eax # imm = 0xFFFFFFFE
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
addl -0x1c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x1c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x3f06
cmpl $0x0, -0x20(%rbp)
jl 0x3e23
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x28(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x2c(%rbp), %esi
movl -0x18(%rbp), %edx
addl -0x30(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x2c(%rbp), %esi
movl -0x18(%rbp), %edx
addl -0x30(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x2c(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x30(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x2c(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x30(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x30(%rbp), %esi
movl -0x18(%rbp), %edx
addl -0x2c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x30(%rbp), %esi
movl -0x18(%rbp), %edx
addl -0x2c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x30(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x2c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x30(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x2c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x2f60
jmp 0x3df6
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)