#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*/ instruct();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ thanks();
int main(void) {
  double radius, height, volume, surface;
  instruct();
  printf("\n\nEnter the radius of the Cylinder>\n");
  scanf("%lf", &radius);
  printf("Enter the height of the Cylinder>\n");
  scanf("%lf", &height);
  volume = 3.1416 * radius * radius * height;
  surface = 2 * 3.1416 * radius * height + 2 * 3.1416 * radius * radius;
  printf("The volume of the Cylinder is  = %.2f\n", volume);
  printf("The surface of the Cylinder is = %.2f\n", surface);
  thanks();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <instruct@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xe6e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe4a(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe38(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe71(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <thanks@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1040 <instruct@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0xe5d(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe4b(%rip),%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rsp)
lea    0xe3a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <thanks@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0AEnter the radius of the Cylinder>\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [35 x i8] c"Enter the height of the Cylinder>\0A\00"
@.str.3 = [39 x i8] c"The volume of the Cylinder is = %.2f\0A\00"
@.str.4 = [39 x i8] c"The surface of the Cylinder is = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 (...) @instruct()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%11 = load double, double* %2
%12 = fmul double 3.141600e+00, %11
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = load double, double* %3
%16 = fmul double %14, %15
store double %16, double* %4
%17 = load double, double* %2
%18 = fmul double 6.283200e+00, %17
%19 = load double, double* %3
%20 = load double, double* %2
%21 = fmul double 6.283200e+00, %20
%22 = load double, double* %2
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %18, double %19, double %23)
store double %24, double* %5
%25 = load double, double* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %25)
%27 = load double, double* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), double %27)
%29 = call i32 (...) @thanks()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [39 x i8] c"The volume of the Cylinder is = %.2f\0A\00"
@.str.4 = [39 x i8] c"The surface of the Cylinder is = %.2f\0A\00"
@str = [36 x i8] c"\0A\0AEnter the radius of the Cylinder>\00"
@str.5 = [34 x i8] c"Enter the height of the Cylinder>\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (...) @instruct()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = load double, double* %1
%11 = fmul double %10, 3.141600e+00
%12 = fmul double %10, %11
%13 = load double, double* %2
%14 = fmul double %13, %12
%15 = fmul double %10, 6.283200e+00
%16 = fmul double %10, %15
%17 = call double @llvm.fmuladd.f64(double %15, double %13, double %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %14)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), double %17)
%20 = call i32 (...) @thanks()
ret i32 0
}