#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*/ getchar();
int /*<<< orphan*/ printf(char *, float);
main() {
  int height;
  float length;
  float width;
  height = 10;
  length = 11.5;
  width = 2.5;
  printf("The volume of the box is %fcm\n\n", height * length * width);
  printf("The surface area of a box is %fcm", ((length * height) * 2) +
                                                  ((length * width) * 2) +
                                                  ((height * width) * 2));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xe7c(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm1
addss  %xmm0,%xmm1
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"The volume of the box is %fcm\0A\0A\00"
@.str.1 = [34 x i8] c"The surface area of a box is %fcm\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 10, i32* %1
store float 1.150000e+01, float* %2
store float 2.500000e+00, float* %3
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float %9)
%11 = load float, float* %2
%12 = load i32, i32* %1
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = load float, float* %2
%16 = load float, float* %3
%17 = fmul float %15, %16
%18 = fmul float %17, 2.000000e+00
%19 = call float @llvm.fmuladd.f32(float %14, float 2.000000e+00, float %18)
%20 = load i32, i32* %1
%21 = sitofp i32 %20 to float
%22 = load float, float* %3
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %23, float 2.000000e+00, float %19)
%25 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), float %24)
%26 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"The volume of the box is %fcm\0A\0A\00"
@.str.1 = [34 x i8] c"The surface area of a box is %fcm\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float 2.875000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), float 3.375000e+02)
%3 = tail call i32 (...) @getchar()
ret i32 0
}