#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*/ printf(char *, char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int radius = 0;
  printf("%s", "Give the Circle radius: ");
  scanf("%d", &radius);
  printf("%s %d \n", "Diameter: ", (radius * 2));
  printf("%s %f \n", "Circumference: ", (2 * 3.14159 * radius));
  printf("%s %f \n", "Area: ", (3.14159 * (radius * radius)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
lea    0xec7(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe85(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xeb4(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xe51(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe88(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edx
add    %edx,%edx
lea    0xecf(%rip),%rdi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  0xe84(%rip),%xmm0
lea    0xebf(%rip),%rbx
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
imul   %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe5e(%rip),%xmm0
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"Give the Circle radius: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"%s %d \0A\00"
@.str.4 = [11 x i8] c"Diameter: \00"
@.str.5 = [8 x i8] c"%s %f \0A\00"
@.str.6 = [16 x i8] c"Circumference: \00"
@.str.7 = [7 x i8] c"Area: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fmul double 6.283180e+00, %9
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = sitofp i32 %14 to double
%16 = fmul double 3.141590e+00, %15
%17 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"Give the Circle radius: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"%s %d \0A\00"
@.str.4 = [11 x i8] c"Diameter: \00"
@.str.5 = [8 x i8] c"%s %f \0A\00"
@.str.6 = [16 x i8] c"Circumference: \00"
@.str.7 = [7 x i8] c"Area: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = shl nsw i32 %5, 1
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 6.283180e+00
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %10)
%12 = load i32, i32* %1
%13 = mul nsw i32 %12, %12
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 3.141590e+00
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %15)
ret i32 0
}