#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() {
  int panjang, lebar, tinggi, luas, keliling, volume;
  printf("Masukan panjang dari balok: ");
  scanf("%d", &panjang);
  printf("Masukan lebar dari balok: ");
  scanf("%d", &lebar);
  printf("Masukan tinggi dari balok: ");
  scanf("%d", &tinggi);
  printf("Panjang, lebar, dan tinggi dari balok adalah: ");
  printf("%d,%d,%d", panjang, lebar, tinggi);
  luas = 2 * ((panjang * lebar) + (panjang * tinggi) + (lebar * tinggi));
  keliling = 4 * (panjang + lebar + tinggi);
  volume = panjang * lebar * tinggi;
  printf("\nLuas, Keliling, dan Volume dari balok adalah: ");
  printf("%d, %d, %d", luas, keliling, volume);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf62(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf87(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebx
mov    %ebx,%r14d
imul   %eax,%r14d
mov    0x4(%rsp),%ecx
add    %eax,%ebx
mov    %ebx,%ebp
imul   %ecx,%ebp
add    %r14d,%ebp
add    %ebp,%ebp
add    %ecx,%ebx
shl    $0x2,%ebx
imul   %ecx,%r14d
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Masukan panjang dari balok: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Masukan lebar dari balok: \00"
@.str.3 = [28 x i8] c"Masukan tinggi dari balok: \00"
@.str.4 = [47 x i8] c"Panjang, lebar, dan tinggi dari balok adalah: \00"
@.str.5 = [9 x i8] c"%d,%d,%d\00"
@.str.6 = [48 x i8] c"\0ALuas, Keliling, dan Volume dari balok adalah: \00"
@.str.7 = [11 x i8] c"%d, %d, %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %2
%23 = load i32, i32* %4
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %21, %24
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = mul nsw i32 %26, %27
%29 = add nsw i32 %25, %28
%30 = mul nsw i32 2, %29
store i32 %30, i32* %5
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %4
%35 = add nsw i32 %33, %34
%36 = mul nsw i32 4, %35
store i32 %36, i32* %6
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = mul nsw i32 %37, %38
%40 = load i32, i32* %4
%41 = mul nsw i32 %39, %40
store i32 %41, i32* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = load i32, i32* %7
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Masukan panjang dari balok: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Masukan lebar dari balok: \00"
@.str.3 = [28 x i8] c"Masukan tinggi dari balok: \00"
@.str.4 = [47 x i8] c"Panjang, lebar, dan tinggi dari balok adalah: \00"
@.str.5 = [9 x i8] c"%d,%d,%d\00"
@.str.6 = [48 x i8] c"\0ALuas, Keliling, dan Volume dari balok adalah: \00"
@.str.7 = [11 x i8] c"%d, %d, %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = mul nsw i32 %19, %18
%21 = load i32, i32* %3
%22 = add i32 %19, %18
%23 = mul i32 %22, %21
%24 = add i32 %23, %20
%25 = shl nsw i32 %24, 1
%26 = add nsw i32 %22, %21
%27 = shl nsw i32 %26, 2
%28 = mul nsw i32 %20, %21
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %25, i32 %27, i32 %28)
ret i32 0
}