#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 l, s, r, v;
  void print();
  printf("input radius:\n");
  scanf("%f", &r);
  l = 2.0 * 3.14159265 * r;
  s = 3.14159265 * r * r;
  v = 4.0 / 3 * 3.14159265 * r * r * r;
  printf("l=%10.4f\ns=%10.4f\nv=%10.4f\n", l, s, v);
  print();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe83(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe50(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe31(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe90(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
cvtsd2ss %xmm2,%xmm2
movsd  0xe7c(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
cvtsd2ss %xmm3,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
lea    0xe5b(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <print@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"input radius:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"l=%10.4f\0As=%10.4f\0Av=%10.4f\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 ([15 x i8], [15 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* %3)
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double 0x401921FB53C8D4F1, %8
%10 = fptrunc double %9 to float
store float %10, float* %1
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = fmul double 0x400921FB53C8D4F1, %12
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = fptrunc double %16 to float
store float %17, float* %2
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fmul double 0x4010C15237DB38A0, %19
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = fmul double %20, %22
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = fmul double %23, %25
%27 = fptrunc double %26 to float
store float %27, float* %4
%28 = load float, float* %1
%29 = fpext float %28 to double
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %29, double %31, double %33)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"l=%10.4f\0As=%10.4f\0Av=%10.4f\0A\00"
@str = [14 x i8] c"input radius:\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 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 = fpext float %5 to double
%7 = fmul double %6, 0x401921FB53C8D4F1
%8 = fptrunc double %7 to float
%9 = fmul double %6, 0x400921FB53C8D4F1
%10 = fmul double %9, %6
%11 = fptrunc double %10 to float
%12 = fmul double %6, 0x4010C15237DB38A0
%13 = fmul double %12, %6
%14 = fmul double %13, %6
%15 = fptrunc double %14 to float
%16 = fpext float %8 to double
%17 = fpext float %11 to double
%18 = fpext float %15 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %16, double %17, double %18)
ret void
}