#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 M_PI;
int pow(float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void sphere_volume() {
  float r, v;
  printf("Radius Length: ");
  scanf("%f", &r);
  v = (4 / 3) * (M_PI * (pow(r, 3)));
  printf("Volume is: %f", v);
  printf("\n");
}


x86 assembly (clang, -O0):
<sphere_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
shl    $0x0,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_volume>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%ebx
movss  0xc(%rsp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Radius Length: \00"
@.str.1 = [3 x i8] c"%f\00"
@M_PI = global i32 0
@.str.2 = [14 x i8] c"Volume is: %f\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @sphere_volume() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 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), float* %1)
%5 = load i32, i32* @M_PI
%6 = load float, float* %1
%7 = call i32 @pow(float %6, i32 3)
%8 = mul nsw i32 %5, %7
%9 = mul nsw i32 1, %8
%10 = sitofp i32 %9 to float
store float %10, float* %2
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Radius Length: \00"
@.str.1 = [3 x i8] c"%f\00"
@M_PI = global i32 0
@.str.2 = [14 x i8] c"Volume is: %f\00"
define void @sphere_volume() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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), float* %1)
%5 = load i32, i32* @M_PI
%6 = load float, float* %1
%7 = call i32 @pow(float %6, i32 3)
%8 = mul nsw i32 %7, %5
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = call i32 @putchar(i32 10)
ret void
}