#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 *, int);
int main(void) {
  int height, length, width, volume, weight;
  height = 0;
  length = 0;
  width = 0;
  volume = height * length * width;
  weight = (volume + 165) / 166;
  printf("Input value for height: ");
  scanf("%d", height);
  printf("\nInput value for length: ");
  scanf("%d", length);
  printf("\nInput value for width: ");
  scanf("%d", width);
  printf("\n\nDimensions: %dx%dx%d\n", length, width, height);
  printf("Volume (Cubic inches): %d\n", volume);
  printf("Dimensional weight: : %d\n", weight);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xa5,%eax
mov    $0xa6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1040 <scanf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Input value for height: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AInput value for length: \00"
@.str.3 = [25 x i8] c"\0AInput value for width: \00"
@.str.4 = [24 x i8] c"\0A\0ADimensions: %dx%dx%d\0A\00"
@.str.5 = [27 x i8] c"Volume (Cubic inches): %d\0A\00"
@.str.6 = [26 x i8] c"Dimensional weight: : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 165
%13 = sdiv i32 %12, 166
store i32 %13, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
%27 = load i32, i32* %4
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Input value for height: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0AInput value for length: \00"
@.str.3 = [25 x i8] c"\0AInput value for width: \00"
@.str.4 = [24 x i8] c"\0A\0ADimensions: %dx%dx%d\0A\00"
@.str.5 = [27 x i8] c"Volume (Cubic inches): %d\0A\00"
@.str.6 = [26 x i8] c"Dimensional weight: : %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 0, i32 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 0)
ret i32 0
}