#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 pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int r;
  float vol;
  printf("Input the radius of sphere(in meters): ");
  scanf("%d", &r);
  vol =
      (4 / 3) *
      3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068 *
      pow(r, 3);
  printf("The volume of sphere of radius %d is %f cubic meter.\n", r, vol);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1050 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x3,%esi
call   1050 <pow@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xe96(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x4(%rsp),%esi
cvtss2sd %xmm0,%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Input the radius of sphere(in meters): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [54 x i8] c"The volume of sphere of radius %d is %f cubic meter.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @pow(i32 %5, i32 3)
%7 = sitofp i32 %6 to double
%8 = fmul double 0x400921FB54442D18, %7
%9 = fptrunc double %8 to float
store float %9, float* %2
%10 = load i32, i32* %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %10, double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Input the radius of sphere(in meters): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [54 x i8] c"The volume of sphere of radius %d is %f cubic meter.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @pow(i32 %5, i32 3)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 0x400921FB54442D18
%9 = fptrunc double %8 to float
%10 = load i32, i32* %1
%11 = fpext float %9 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %10, double %11)
ret i32 0
}