#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*/ circle(double, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double r, a, c;
  printf("\n\n"
         "----- Circle Calculation -----"
         "\n\n");
  printf("%-4c | %-6s | %-s\n", 'n', "Area", "Circumference");
  printf("-----------------------------\n");
  for (r = 0.5; r <= 10.0; r += 0.5) {
    circle(r, &a, &c);
    printf("%-4.1f | %6.2f | %5.2f\n", r, a, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x6e,%esi
lea    0xef6(%rip),%rdx
lea    0xef4(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe87(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11d2 <main+0xb2>
movsd  -0x10(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <circle@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xec4(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  0xe3d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1179 <main+0x59>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rdx
lea    0xece(%rip),%rcx
mov    $0x6e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe86(%rip),%xmm0
lea    0x18(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeab(%rip),%rbx
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <circle@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x3,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe2f(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe29(%rip),%xmm0
ucomisd 0x8(%rsp),%xmm0
movsd  0x8(%rsp),%xmm0
jae    1190 <main+0x60>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0A\0A----- Circle Calculation -----\0A\0A\00"
@.str.1 = [19 x i8] c"%-4c | %-6s | %-s\0A\00"
@.str.2 = [5 x i8] c"Area\00"
@.str.3 = [14 x i8] c"Circumference\00"
@.str.4 = [31 x i8] c"-----------------------------\0A\00"
@.str.5 = [24 x i8] c"%-4.1f | %6.2f | %5.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store double 5.000000e-01, double* %2
br label %8
8: ; preds = %18, %0
%9 = load double, double* %2
%10 = fcmp ole double %9, 1.000000e+01
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load double, double* %2
%13 = call i32 @circle(double %12, double* %3, double* %4)
%14 = load double, double* %2
%15 = load double, double* %3
%16 = load double, double* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %14, double %15, double %16)
br label %18
18: ; preds = %11
%19 = load double, double* %2
%20 = fadd double %19, 5.000000e-01
store double %20, double* %2
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"%-4c | %-6s | %-s\0A\00"
@.str.2 = [5 x i8] c"Area\00"
@.str.3 = [14 x i8] c"Circumference\00"
@.str.5 = [24 x i8] c"%-4.1f | %6.2f | %5.2f\0A\00"
@str = [34 x i8] c"\0A\0A----- Circle Calculation -----\0A\00"
@str.6 = [30 x i8] c"-----------------------------\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.6, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
%9 = phi double [ 5.000000e-01, %0 ], [ %14, %8 ]
%10 = call i32 @circle(double %9, double* %1, double* %2)
%11 = load double, double* %1
%12 = load double, double* %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), double %9, double %11, double %12)
%14 = fadd double %9, 5.000000e-01
%15 = fcmp ugt double %14, 1.000000e+01
br i1 %15, label %16, label %8
16: ; preds = %8
ret i32 0
}