#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 *);
int main(void) {
  float raggio;
  float diametro;
  float circonferenza;
  float area;
  printf("%s", "Inserire il valore del raggio: ");
  scanf("%f", &raggio);
  printf("\n\n\nIl diametro del cerchio avente raggio %.2f e' pari a: %.2f",
         raggio, diametro = (raggio * raggio));
  printf("\n\nLa circonferenza del cerchio avente raggio %.2f e' pari a: %.2f",
         raggio, circonferenza = (diametro * (float)2));
  printf("\n\nL'area del cerchio avente raggio %.2f e' pari a: %.2f\n", raggio,
         area = ((circonferenza * raggio) / 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  %xmm1,-0xc(%rbp)
cvtss2sd %xmm1,%xmm1
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xe71(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  %xmm1,-0x10(%rbp)
cvtss2sd %xmm1,%xmm1
lea    0xec4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe3a(%rip),%xmm2
divss  %xmm2,%xmm1
movss  %xmm1,-0x14(%rbp)
cvtss2sd %xmm1,%xmm1
lea    0xed0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm0
mulss  %xmm1,%xmm1
movss  %xmm1,(%rsp)
cvtss2sd %xmm1,%xmm1
lea    0xec5(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
addss  %xmm1,%xmm1
movss  %xmm1,(%rsp)
cvtss2sd %xmm1,%xmm1
lea    0xed9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movss  (%rsp),%xmm2
mulss  %xmm1,%xmm2
mulss  0xe4c(%rip),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xee8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Inserire il valore del raggio: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [62 x i8] c"\0A\0A\0AIl diametro del cerchio avente raggio %.2f e' pari a: %.2f\00"
@.str.4 = [66 x i8] c"\0A\0ALa circonferenza del cerchio avente raggio %.2f e' pari a: %.2f\00"
@.str.5 = [57 x i8] c"\0A\0AL'area del cerchio avente raggio %.2f e' pari a: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load float, float* %2
%11 = load float, float* %2
%12 = fmul float %10, %11
store float %12, float* %3
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), double %9, double %13)
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = load float, float* %3
%18 = fmul float %17, 2.000000e+00
store float %18, float* %4
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0), double %16, double %19)
%21 = load float, float* %2
%22 = fpext float %21 to double
%23 = load float, float* %4
%24 = load float, float* %2
%25 = fmul float %23, %24
%26 = fdiv float %25, 2.000000e+00
store float %26, float* %5
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), double %22, double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Inserire il valore del raggio: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [62 x i8] c"\0A\0A\0AIl diametro del cerchio avente raggio %.2f e' pari a: %.2f\00"
@.str.4 = [66 x i8] c"\0A\0ALa circonferenza del cerchio avente raggio %.2f e' pari a: %.2f\00"
@.str.5 = [57 x i8] c"\0A\0AL'area del cerchio avente raggio %.2f e' pari a: %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 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), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul float %5, %5
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), double %6, double %8)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul float %7, 2.000000e+00
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0), double %11, double %13)
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = fmul float %12, %15
%18 = fmul float %17, 5.000000e-01
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), double %16, double %19)
ret i32 0
}