#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 *, float);
main() {
  float d = 6.5;
  float half, square, cube;
  half = d / 2;
  square = d * d;
  cube = d * d * d;
  printf("\nYour number is %.2f\n", d);
  printf("Half of it is %.2f\n", half);
  printf("Square it to get %.2f\n", square);
  printf("Cube it to get %.2f\n", cube);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
movss  0xec0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
movss  0xeb0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0AYour number is %.2f\0A\00"
@.str.1 = [20 x i8] c"Half of it is %.2f\0A\00"
@.str.2 = [23 x i8] c"Square it to get %.2f\0A\00"
@.str.3 = [21 x i8] c"Cube it to get %.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
store float 6.500000e+00, float* %2
%6 = load float, float* %2
%7 = fdiv float %6, 2.000000e+00
store float %7, float* %3
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fmul float %8, %9
store float %10, float* %4
%11 = load float, float* %2
%12 = load float, float* %2
%13 = fmul float %11, %12
%14 = load float, float* %2
%15 = fmul float %13, %14
store float %15, float* %5
%16 = load float, float* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %16)
%18 = load float, float* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %18)
%20 = load float, float* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), float %20)
%22 = load float, float* %5
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), float %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AYour number is %.2f\0A\00"
@.str.1 = [20 x i8] c"Half of it is %.2f\0A\00"
@.str.2 = [23 x i8] c"Square it to get %.2f\0A\00"
@.str.3 = [21 x i8] c"Cube it to get %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float 6.500000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 3.250000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), float 4.225000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), float 2.746250e+02)
ret i32 0
}