// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/arduboy2/graph.cpp
// Function: graph::drawCircle(short, short, unsigned char, unsigned char)
void graph::drawCircle(int16_t x0, int16_t y0, uint8_t r, uint8_t color)
{
    int16_t f = 1 - r;
    int16_t ddF_x = 1;
    int16_t ddF_y = -2 * r;
    int16_t x = 0;
    int16_t y = r;

    drawPixel(x0, y0+r, color);
    drawPixel(x0, y0-r, color);
    drawPixel(x0+r, y0, color);
    drawPixel(x0-r, y0, color);

    while (x<y) {
        if (f >= 0) {
            y--;
            ddF_y += 2;
            f += ddF_y;
        }

        x++;
        ddF_x += 2;
        f += ddF_x;

        drawPixel(x0 + x, y0 + y, color);
        drawPixel(x0 - x, y0 + y, color);
        drawPixel(x0 + x, y0 - y, color);
        drawPixel(x0 - x, y0 - y, color);
        drawPixel(x0 + y, y0 + x, color);
        drawPixel(x0 - y, y0 + x, color);
        drawPixel(x0 + y, y0 - x, color);
        drawPixel(x0 - y, y0 - x, color);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movw %si, -0xa(%rbp)
movw %dx, -0xc(%rbp)
movb %cl, -0xd(%rbp)
movb %al, -0xe(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movzbl -0xd(%rbp), %ecx
movl $0x1, %eax
subl %ecx, %eax
movw %ax, -0x10(%rbp)
movw $0x1, -0x12(%rbp)
movzbl -0xd(%rbp), %eax
imull $0xfffffffe, %eax, %eax # imm = 0xFFFFFFFE
movw %ax, -0x14(%rbp)
movw $0x0, -0x16(%rbp)
movzbl -0xd(%rbp), %eax
movw %ax, -0x18(%rbp)
movswl -0xa(%rbp), %esi
movswl -0xc(%rbp), %edx
movzbl -0xd(%rbp), %eax
addl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0xc(%rbp), %edx
movzbl -0xd(%rbp), %eax
subl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movzbl -0xd(%rbp), %eax
addl %eax, %esi
movswl -0xc(%rbp), %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movzbl -0xd(%rbp), %eax
subl %eax, %esi
movswl -0xc(%rbp), %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movswl -0x16(%rbp), %eax
movswl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jge 0x196e
movswl -0x10(%rbp), %eax
cmpl $0x0, %eax
jl 0x183c
movw -0x18(%rbp), %ax
addw $-0x1, %ax
movw %ax, -0x18(%rbp)
movswl -0x14(%rbp), %eax
addl $0x2, %eax
movw %ax, -0x14(%rbp)
movswl -0x14(%rbp), %ecx
movswl -0x10(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
movw -0x16(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x16(%rbp)
movswl -0x12(%rbp), %eax
addl $0x2, %eax
movw %ax, -0x12(%rbp)
movswl -0x12(%rbp), %ecx
movswl -0x10(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x10(%rbp)
movswl -0xa(%rbp), %esi
movswl -0x16(%rbp), %eax
addl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x18(%rbp), %eax
addl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x16(%rbp), %eax
subl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x18(%rbp), %eax
addl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x16(%rbp), %eax
addl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x18(%rbp), %eax
subl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x16(%rbp), %eax
subl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x18(%rbp), %eax
subl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x18(%rbp), %eax
addl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x16(%rbp), %eax
addl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x18(%rbp), %eax
subl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x16(%rbp), %eax
addl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x18(%rbp), %eax
addl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x16(%rbp), %eax
subl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
movq -0x20(%rbp), %rdi
movswl -0xa(%rbp), %esi
movswl -0x18(%rbp), %eax
subl %eax, %esi
movswl -0xc(%rbp), %edx
movswl -0x16(%rbp), %eax
subl %eax, %edx
movzbl -0xe(%rbp), %ecx
callq 0x2fc0
jmp 0x17fe
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)