#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void main() {
  float circumference, diameter, area, radius;
  ;
  printf("set the radius :");
  scanf("%f", &radius);
  area = 3.1416 * (radius * radius);
  circumference = 2 * 3.1416 * radius;
  diameter = 2 * radius;
  printf("\n\nThe area is %.2f\n", area);
  printf("\n\nThe circunference is %.2f\n", circumference);
  printf("\n\nThe diameter is %.2f\n", diameter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe71(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm2
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xea4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm2,%xmm1
mulsd  0xe9c(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0xc(%rsp)
addss  %xmm2,%xmm2
movss  %xmm2,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"set the radius :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"\0A\0AThe area is %.2f\0A\00"
@.str.3 = [29 x i8] c"\0A\0AThe circunference is %.2f\0A\00"
@.str.4 = [24 x i8] c"\0A\0AThe diameter is %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fmul double 3.141600e+00, %10
%12 = fptrunc double %11 to float
store float %12, float* %3
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fmul double 6.283200e+00, %14
%16 = fptrunc double %15 to float
store float %16, float* %1
%17 = load float, float* %4
%18 = fmul float 2.000000e+00, %17
store float %18, float* %2
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load float, float* %1
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %23)
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %26)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"set the radius :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"\0A\0AThe area is %.2f\0A\00"
@.str.3 = [29 x i8] c"\0A\0AThe circunference is %.2f\0A\00"
@.str.4 = [24 x i8] c"\0A\0AThe diameter is %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, %5
%7 = fpext float %6 to double
%8 = fmul double %7, 3.141600e+00
%9 = fptrunc double %8 to float
%10 = fpext float %5 to double
%11 = fmul double %10, 6.283200e+00
%12 = fptrunc double %11 to float
%13 = fmul float %5, 2.000000e+00
%14 = fpext float %9 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = fpext float %12 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), double %16)
%18 = fpext float %13 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %18)
ret void
}