#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 *, float *);
void main() {
  float PI = 3.14f;
  float jariJari, tinggi, volume, luas;
  printf("Masukan jari-jari dari tabung: ");
  scanf("%f", &jariJari);
  printf("Masukan tinggi dari tabung: ");
  scanf("%f", &tinggi);
  printf("\nJari-Jari dari tabung adalah: %.2f", jariJari);
  printf("\nTinggi dari tabung adalah: %.2f", tinggi);
  volume = PI * jariJari * jariJari * tinggi;
  luas =
      (2 * PI * jariJari * tinggi) + (2 * PI * jariJari * (tinggi + jariJari));
  printf("\nVolume dari tabung adalah: %.2f", volume);
  printf("\nLuas dari tabung adalah: %.2f", luas);
  printf("\nVolume dan Luas dari tabung adalah: %.2f, %.2f", volume, luas);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe40(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xe29(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm3
addss  -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
movss  0xe60(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0x8(%rsp),%xmm2
mulss  %xmm2,%xmm1
movss  0xe4a(%rip),%xmm3
mulss  %xmm0,%xmm3
addss  %xmm2,%xmm0
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm3
addss  %xmm0,%xmm3
movss  %xmm3,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xea5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Masukan jari-jari dari tabung: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"Masukan tinggi dari tabung: \00"
@.str.3 = [36 x i8] c"\0AJari-Jari dari tabung adalah: %.2f\00"
@.str.4 = [33 x i8] c"\0ATinggi dari tabung adalah: %.2f\00"
@.str.5 = [33 x i8] c"\0AVolume dari tabung adalah: %.2f\00"
@.str.6 = [31 x i8] c"\0ALuas dari tabung adalah: %.2f\00"
@.str.7 = [48 x i8] c"\0AVolume dan Luas dari tabung adalah: %.2f, %.2f\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float 0x40091EB860000000, float* %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), float* %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), float* %3)
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), double %11)
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), double %14)
%16 = load float, float* %1
%17 = load float, float* %2
%18 = fmul float %16, %17
%19 = load float, float* %2
%20 = fmul float %18, %19
%21 = load float, float* %3
%22 = fmul float %20, %21
store float %22, float* %4
%23 = load float, float* %1
%24 = fmul float 2.000000e+00, %23
%25 = load float, float* %2
%26 = fmul float %24, %25
%27 = load float, float* %3
%28 = load float, float* %1
%29 = fmul float 2.000000e+00, %28
%30 = load float, float* %2
%31 = fmul float %29, %30
%32 = load float, float* %3
%33 = load float, float* %2
%34 = fadd float %32, %33
%35 = fmul float %31, %34
%36 = call float @llvm.fmuladd.f32(float %26, float %27, float %35)
store float %36, float* %5
%37 = load float, float* %4
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %38)
%40 = load float, float* %5
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), double %41)
%43 = load float, float* %4
%44 = fpext float %43 to double
%45 = load float, float* %5
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), double %44, double %46)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Masukan jari-jari dari tabung: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"Masukan tinggi dari tabung: \00"
@.str.3 = [36 x i8] c"\0AJari-Jari dari tabung adalah: %.2f\00"
@.str.4 = [33 x i8] c"\0ATinggi dari tabung adalah: %.2f\00"
@.str.5 = [33 x i8] c"\0AVolume dari tabung adalah: %.2f\00"
@.str.6 = [31 x i8] c"\0ALuas dari tabung adalah: %.2f\00"
@.str.7 = [48 x i8] c"\0AVolume dan Luas dari tabung adalah: %.2f, %.2f\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %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), float* %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), float* %2)
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), double %10)
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = load float, float* %1
%16 = fmul float %15, 0x40091EB860000000
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fmul float %18, %17
%20 = fmul float %15, 0x40191EB860000000
%21 = fadd float %15, %18
%22 = fmul float %20, %21
%23 = call float @llvm.fmuladd.f32(float %20, float %18, float %22)
%24 = fpext float %19 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %24)
%26 = fpext float %23 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), double %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), double %24, double %26)
ret void
}