// File: /workspace/github_c_makefile_star2_O0/nkanaev[P]tipsy/src/tigr.c
// Function: tigrCircle
void tigrCircle(Tigr* bmp, int x0, int y0, int r, TPixel color) {
    int E = 1 - r;
    int dx = 0;
    int dy = -2 * r;
    int x = 0;
    int y = r;

    tigrPlot(bmp, x0, y0 + r, color);
    tigrPlot(bmp, x0, y0 - r, color);
    tigrPlot(bmp, x0 + r, y0, color);
    tigrPlot(bmp, x0 - r, y0, color);

    while (x < y - 1) {
        x++;

        if (E >= 0) {
            y--;
            dy += 2;
            E += dy;
        }

        dx += 2;
        E += dx + 1;

        tigrPlot(bmp, x0 + x, y0 + y, color);
        tigrPlot(bmp, x0 - x, y0 + y, color);
        tigrPlot(bmp, x0 + x, y0 - y, color);
        tigrPlot(bmp, x0 - x, y0 - y, color);

        if (x != y) {
            tigrPlot(bmp, x0 + y, y0 + x, color);
            tigrPlot(bmp, x0 - y, y0 + x, color);
            tigrPlot(bmp, x0 + y, y0 - x, color);
            tigrPlot(bmp, x0 - y, y0 - x, 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 0x3e90
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
subl -0x1c(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x3e90
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
addl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x3e90
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
callq 0x3e90
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x46e3
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x4601
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 -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 0x3e90
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 0x3e90
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 0x3e90
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 0x3e90
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0x46de
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 0x3e90
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 0x3e90
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 0x3e90
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 0x3e90
jmp 0x45c6
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)