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