#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 *, double);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float null_in_centimetres, radius;
  scanf("%f", &null_in_centimetres);
  radius = null_in_centimetres / 2.0;
  printf("Volume: %.4f m^3\n",
         (4.0 / 3.0) * 3.1416 * (radius * radius * radius) / 1000000.0);
  printf("Surface Area: %.4f m^2\n",
         4.0 * 3.1416 * (radius * radius) / 10000.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe65(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe51(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xec0(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeac(%rip),%xmm0
divsd  0xeac(%rip),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe97(%rip),%xmm0
divsd  0xe97(%rip),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [18 x i8] c"Volume: %.4f m^3\0A\00"
@.str.2 = [24 x i8] c"Surface Area: %.4f m^2\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fdiv double %5, 2.000000e+00
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fmul float %8, %9
%11 = load float, float* %2
%12 = fmul float %10, %11
%13 = fpext float %12 to double
%14 = fmul double 4.188800e+00, %13
%15 = fdiv double %14, 1.000000e+06
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %15)
%17 = load float, float* %2
%18 = load float, float* %2
%19 = fmul float %17, %18
%20 = fpext float %19 to double
%21 = fmul double 1.256640e+01, %20
%22 = fdiv double %21, 1.000000e+04
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [18 x i8] c"Volume: %.4f m^3\0A\00"
@.str.2 = [24 x i8] c"Surface Area: %.4f m^2\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 5.000000e-01
%6 = fmul float %5, %5
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = fmul double %8, 4.188800e+00
%10 = fdiv double %9, 1.000000e+06
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = fpext float %6 to double
%13 = fmul double %12, 1.256640e+01
%14 = fdiv double %13, 1.000000e+04
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %14)
ret i32 0
}