#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, ...);
int main() {
  float hi = 10.0;
  float len = 11.5;
  float wid = 2.5;
  printf("Box has dimensions:-\nheight: %f\nlength: %f\nwidth: %f\n", hi, len,
         wid);
  float vol = hi * wid * len;
  printf("\nThe volume is: %f\n", vol);
  float tot_area = 2 * hi + 2 * wid + 2 * len;
  printf("\nThe total surface area is: %f", tot_area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeca(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xeb3(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm1
movss  0xe68(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movss  0xee0(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
movss  0xebe(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
movss  0xeac(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Box has dimensions:-\0Aheight: %f\0Alength: %f\0Awidth: %f\0A\00"
@.str.1 = [20 x i8] c"\0AThe volume is: %f\0A\00"
@.str.2 = [31 x i8] c"\0AThe total surface area is: %f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float 1.000000e+01, float* %1
store float 1.150000e+01, float* %2
store float 2.500000e+00, float* %3
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), float %6, double %8, double %10)
%12 = load float, float* %1
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = load float, float* %2
%16 = fmul float %14, %15
store float %16, float* %4
%17 = load float, float* %4
%18 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %17)
%19 = load float, float* %1
%20 = load float, float* %3
%21 = fmul float 2.000000e+00, %20
%22 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %19, float %21)
%23 = load float, float* %2
%24 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %23, float %22)
store float %24, float* %5
%25 = load float, float* %5
%26 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), float %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Box has dimensions:-\0Aheight: %f\0Alength: %f\0Awidth: %f\0A\00"
@.str.1 = [20 x i8] c"\0AThe volume is: %f\0A\00"
@.str.2 = [31 x i8] c"\0AThe total surface area is: %f\00"
define i32 @main() {
%1 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), float 1.000000e+01, double 1.150000e+01, double 2.500000e+00)
%2 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 2.875000e+02)
%3 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), float 4.800000e+01)
ret i32 0
}