#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fillCircleHelper(short, short, short, int,
                                    int /*<<< orphan*/, short);
int /*<<< orphan*/ writeFastVLine(short, short, int, short);
void fillCircle(short x0, short y0, short r, short color) {
  writeFastVLine(x0, y0 - r, 2 * r + 1, color);
  fillCircleHelper(x0, y0, r, 3, 0, color);
}


x86 assembly (clang, -O0):
<fillCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%cx
movswl -0x4(%rbp),%eax
movswl -0x6(%rbp),%edx
sub    %edx,%eax
movswl -0x6(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
movswl %cx,%edi
movswl %ax,%esi
movswl -0x8(%rbp),%ecx
call   1040 <writeFastVLine@plt>
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x6(%rbp),%ax
mov    $0x3,%ecx
xor    %r8d,%r8d
movswl %si,%edi
movswl %dx,%esi
movswl %ax,%edx
movswl -0x8(%rbp),%r9d
call   1030 <fillCircleHelper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillCircle>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%ebp
mov    %esi,%eax
sub    %edx,%eax
lea    (%rbx,%rbx,1),%edx
add    $0x1,%edx
movswl %ax,%esi
call   1040 <writeFastVLine@plt>
mov    %ebp,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fillCircleHelper@plt>

LLVM IR (-O0):
define void @fillCircle(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = sext i16 %10 to i32
%12 = load i16, i16* %7
%13 = sext i16 %12 to i32
%14 = sub nsw i32 %11, %13
%15 = trunc i32 %14 to i16
%16 = load i16, i16* %7
%17 = sext i16 %16 to i32
%18 = mul nsw i32 2, %17
%19 = add nsw i32 %18, 1
%20 = load i16, i16* %8
%21 = call i32 @writeFastVLine(i16 signext %9, i16 signext %15, i32 %19, i16 signext %20)
%22 = load i16, i16* %5
%23 = load i16, i16* %6
%24 = load i16, i16* %7
%25 = load i16, i16* %8
%26 = call i32 @fillCircleHelper(i16 signext %22, i16 signext %23, i16 signext %24, i32 3, i32 0, i16 signext %25)
ret void
}

LLVM IR (-O2):
define void @fillCircle(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = sext i16 %2 to i32
%6 = sub i16 %1, %2
%7 = shl nsw i32 %5, 1
%8 = or i32 %7, 1
%9 = tail call i32 @writeFastVLine(i16 signext %0, i16 signext %6, i32 %8, i16 signext %3)
%10 = tail call i32 @fillCircleHelper(i16 signext %0, i16 signext %1, i16 signext %2, i32 3, i32 0, i16 signext %3)
ret void
}