#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*/ draw_circle(int, int, int, char, char, char, int);
int /*<<< orphan*/ draw_pixel(int, int, char, char, char, int);
void draw_fillcircle(int xCen, int yCen, int radius, char r, char g, char b,
                     int screen) {
  draw_circle(xCen, yCen, radius, r, g, b, screen);
  int x, y;
  for (y = -radius; y <= radius; y++) {
    for (x = -radius; x <= radius; x++)
      if (x * x + y * y <= radius * radius + radius * .8f)
        draw_pixel(xCen + x, yCen + y, r, g, b, screen);
  }
}


x86 assembly (clang, -O0):
<draw_fillcircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x28(%rbp)
mov    %ecx,%eax
mov    -0x28(%rbp),%ecx
mov    %eax,-0x24(%rbp)
mov    %edx,%eax
mov    -0x24(%rbp),%edx
mov    %eax,-0x20(%rbp)
mov    %esi,%eax
mov    -0x20(%rbp),%esi
mov    %eax,-0x1c(%rbp)
mov    %edi,%r8d
mov    -0x1c(%rbp),%edi
mov    %r9b,%al
mov    0x10(%rbp),%r9d
mov    %r8d,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %dl,-0xd(%rbp)
mov    %cl,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0xd(%rbp),%cl
mov    -0xe(%rbp),%r8b
mov    -0xf(%rbp),%r9b
mov    0x10(%rbp),%eax
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
mov    %eax,(%rsp)
call   1030 <draw_circle@plt>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1241 <draw_fillcircle+0x121>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     122e <draw_fillcircle+0x10e>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm2
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xe1e(%rip),%xmm3
mulss  %xmm3,%xmm0
addss  %xmm2,%xmm0
ucomiss %xmm1,%xmm0
jb     121b <draw_fillcircle+0xfb>
mov    -0x4(%rbp),%edi
add    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x18(%rbp),%esi
mov    -0xd(%rbp),%dl
mov    -0xe(%rbp),%cl
mov    -0xf(%rbp),%al
mov    0x10(%rbp),%r9d
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %al,%r8d
call   1040 <draw_pixel@plt>
jmp    1220 <draw_fillcircle+0x100>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11aa <draw_fillcircle+0x8a>
jmp    1233 <draw_fillcircle+0x113>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1196 <draw_fillcircle+0x76>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_fillcircle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r14d
mov    0x70(%rsp),%eax
mov    %eax,(%rsp)
mov    %rdi,0x30(%rsp)
mov    %rsi,0x20(%rsp)
mov    %ecx,0x14(%rsp)
mov    %r8d,%ebp
mov    %r9d,%ebx
call   1030 <draw_circle@plt>
mov    %r14,0x18(%rsp)
test   %r14d,%r14d
js     122b <draw_fillcircle+0x10b>
mov    0x18(%rsp),%rcx
mov    %ecx,%edx
mov    %ecx,%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
neg    %edx
cvtsi2ss %ecx,%xmm1
mulss  0xe83(%rip),%xmm1
addss  %xmm0,%xmm1
lea    (%rcx,%rcx,1),%eax
add    $0x1,%eax
mov    %eax,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    %edx,%ecx
movss  %xmm1,0x10(%rsp)
jmp    11b0 <draw_fillcircle+0x90>
nopl   0x0(%rax)
mov    0x28(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x18(%rsp),%ecx
mov    %eax,%ecx
je     122b <draw_fillcircle+0x10b>
mov    %ecx,%r12d
imul   %ecx,%r12d
mov    0x20(%rsp),%rax
mov    %rcx,0x28(%rsp)
lea    (%rcx,%rax,1),%r15d
mov    0x8(%rsp),%r14d
mov    0xc(%rsp),%eax
mov    %eax,%r13d
jmp    11ea <draw_fillcircle+0xca>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
add    $0xffffffff,%r14d
je     11a0 <draw_fillcircle+0x80>
mov    %r13d,%eax
imul   %r13d,%eax
add    %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ucomiss %xmm0,%xmm1
jb     11e0 <draw_fillcircle+0xc0>
mov    0x30(%rsp),%rax
lea    (%rax,%r13,1),%edi
movsbl 0x14(%rsp),%edx
movsbl %bpl,%ecx
movsbl %bl,%r8d
mov    %r15d,%esi
mov    0x70(%rsp),%r9d
call   1040 <draw_pixel@plt>
movss  0x10(%rsp),%xmm1
jmp    11e0 <draw_fillcircle+0xc0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_fillcircle(i32 %0, i32 %1, i32 %2, i8 signext %3, i8 signext %4, i8 signext %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8 %3, i8* %11
store i8 %4, i8* %12
store i8 %5, i8* %13
store i32 %6, i32* %14
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i8, i8* %11
%21 = load i8, i8* %12
%22 = load i8, i8* %13
%23 = load i32, i32* %14
%24 = call i32 @draw_circle(i32 %17, i32 %18, i32 %19, i8 signext %20, i8 signext %21, i8 signext %22, i32 %23)
%25 = load i32, i32* %10
%26 = sub nsw i32 0, %25
store i32 %26, i32* %16
br label %27
27: ; preds = %72, %7
%28 = load i32, i32* %16
%29 = load i32, i32* %10
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %75
31: ; preds = %27
%32 = load i32, i32* %10
%33 = sub nsw i32 0, %32
store i32 %33, i32* %15
br label %34
34: ; preds = %68, %31
%35 = load i32, i32* %15
%36 = load i32, i32* %10
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %71
38: ; preds = %34
%39 = load i32, i32* %15
%40 = load i32, i32* %15
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %16
%43 = load i32, i32* %16
%44 = mul nsw i32 %42, %43
%45 = add nsw i32 %41, %44
%46 = sitofp i32 %45 to float
%47 = load i32, i32* %10
%48 = load i32, i32* %10
%49 = mul nsw i32 %47, %48
%50 = sitofp i32 %49 to float
%51 = load i32, i32* %10
%52 = sitofp i32 %51 to float
%53 = call float @llvm.fmuladd.f32(float %52, float 0x3FE99999A0000000, float %50)
%54 = fcmp ole float %46, %53
br i1 %54, label %55, label %67
55: ; preds = %38
%56 = load i32, i32* %8
%57 = load i32, i32* %15
%58 = add nsw i32 %56, %57
%59 = load i32, i32* %9
%60 = load i32, i32* %16
%61 = add nsw i32 %59, %60
%62 = load i8, i8* %11
%63 = load i8, i8* %12
%64 = load i8, i8* %13
%65 = load i32, i32* %14
%66 = call i32 @draw_pixel(i32 %58, i32 %61, i8 signext %62, i8 signext %63, i8 signext %64, i32 %65)
br label %67
67: ; preds = %55, %38
br label %68
68: ; preds = %67
%69 = load i32, i32* %15
%70 = add nsw i32 %69, 1
store i32 %70, i32* %15
br label %34
71: ; preds = %34
br label %72
72: ; preds = %71
%73 = load i32, i32* %16
%74 = add nsw i32 %73, 1
store i32 %74, i32* %16
br label %27
75: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @draw_fillcircle(i32 %0, i32 %1, i32 %2, i8 signext %3, i8 signext %4, i8 signext %5, i32 %6) {
%8 = tail call i32 @draw_circle(i32 %0, i32 %1, i32 %2, i8 signext %3, i8 signext %4, i8 signext %5, i32 %6)
%9 = sub i32 0, %2
%10 = icmp slt i32 %2, 0
br i1 %10, label %35, label %11
11: ; preds = %7
%12 = mul nsw i32 %2, %2
%13 = sitofp i32 %12 to float
%14 = sitofp i32 %2 to float
%15 = tail call float @llvm.fmuladd.f32(float %14, float 0x3FE99999A0000000, float %13)
br label %16
16: ; preds = %32, %11
%17 = phi i32 [ %9, %11 ], [ %33, %32 ]
%18 = mul nsw i32 %17, %17
%19 = add nsw i32 %17, %1
br label %20
20: ; preds = %16, %29
%21 = phi i32 [ %9, %16 ], [ %30, %29 ]
%22 = mul nsw i32 %21, %21
%23 = add nuw nsw i32 %22, %18
%24 = sitofp i32 %23 to float
%25 = fcmp ult float %15, %24
br i1 %25, label %29, label %26
26: ; preds = %20
%27 = add nsw i32 %21, %0
%28 = tail call i32 @draw_pixel(i32 %27, i32 %19, i8 signext %3, i8 signext %4, i8 signext %5, i32 %6)
br label %29
29: ; preds = %20, %26
%30 = add i32 %21, 1
%31 = icmp eq i32 %21, %2
br i1 %31, label %32, label %20
32: ; preds = %29
%33 = add i32 %17, 1
%34 = icmp eq i32 %17, %2
br i1 %34, label %35, label %16
35: ; preds = %32, %7
ret void
}