#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 jariJari, tinggi;
  float luas, volume;
  printf("Masukan jari-jari dari tabung: ");
  scanf("%d", &jariJari);
  printf("Masukan tinggi dari tabung: ");
  scanf("%d", &tinggi);
  printf("Jari-jari dan tinggi dari tabung, serta Pi, adalah: ");
  printf(" %d, %d, %f.", jariJari, tinggi, (22.0f / 7.0f));
  luas = (2 * (22.0f / 7.0f) * jariJari * (jariJari + tinggi));
  volume = (22.0f / 7.0f) * jariJari * jariJari * tinggi;
  printf("\nLuas dan Volume Tabung adalah: %.2f, %.2f.", luas, volume);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeff(%rip),%rdi
movsd  0xe7a(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm1
movss  0xe62(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  0xe3a(%rip),%xmm0
mulss  %xmm1,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe98(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xee7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xf06(%rip),%rdi
movsd  0xe79(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    0x8(%rsp),%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
movss  0xe5d(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm1
movss  0xe51(%rip),%xmm2
mulss  %xmm0,%xmm2
cvtsi2ss %ecx,%xmm3
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
lea    0xeb2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Masukan jari-jari dari tabung: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Masukan tinggi dari tabung: \00"
@.str.3 = [53 x i8] c"Jari-jari dan tinggi dari tabung, serta Pi, adalah: \00"
@.str.4 = [13 x i8] c" %d, %d, %f.\00"
@.str.5 = [44 x i8] c"\0ALuas dan Volume Tabung adalah: %.2f, %.2f.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %11, i32 %12, double 0x4009249240000000)
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to float
%16 = fmul float 0x4019249240000000, %15
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
%20 = sitofp i32 %19 to float
%21 = fmul float %16, %20
store float %21, float* %4
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to float
%24 = fmul float 0x4009249240000000, %23
%25 = load i32, i32* %2
%26 = sitofp i32 %25 to float
%27 = fmul float %24, %26
%28 = load i32, i32* %3
%29 = sitofp i32 %28 to float
%30 = fmul float %27, %29
store float %30, float* %5
%31 = load float, float* %4
%32 = fpext float %31 to double
%33 = load float, float* %5
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), double %32, double %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Masukan jari-jari dari tabung: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Masukan tinggi dari tabung: \00"
@.str.3 = [53 x i8] c"Jari-jari dan tinggi dari tabung, serta Pi, adalah: \00"
@.str.4 = [13 x i8] c" %d, %d, %f.\00"
@.str.5 = [44 x i8] c"\0ALuas dan Volume Tabung adalah: %.2f, %.2f.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %11, double 0x4009249240000000)
%13 = load i32, i32* %1
%14 = sitofp i32 %13 to float
%15 = fmul float %14, 0x4019249240000000
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %13
%18 = sitofp i32 %17 to float
%19 = fmul float %15, %18
%20 = fmul float %14, 0x4009249240000000
%21 = fmul float %20, %14
%22 = sitofp i32 %16 to float
%23 = fmul float %21, %22
%24 = fpext float %19 to double
%25 = fpext float %23 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), double %24, double %25)
ret i32 0
}