int main(int argc, char const *argv[]) {
  float v, r;
loop:
  printf("%s\n", "Please input the radius:");
  printf("%s\n", "1<=r<=10");
  scanf("%f", &r);
  if (r < 1 || r > 10) {
    printf("%s\n", "Input error!");
    goto loop;
  }
  assert(r >= 1 && r <= 10);
  v = ((4.0 / 3) * 3.14159 * (r) * (r) * (r));
  printf("The volum is %f.\n", v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  0xe76(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
ja     11aa <main+0x7a>
movss  -0x18(%rbp),%xmm0
movss  0xe63(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11c4 <main+0x94>
lea    0xe5f(%rip),%rdi
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1146 <main+0x16>
movss  -0x18(%rbp),%xmm0
xor    %eax,%eax
movss  0xe2d(%rip),%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     11f1 <main+0xc1>
movss  0xe1d(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0xe7a(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1194 <main+0x54>
ucomiss 0xe72(%rip),%xmm0
jbe    1201 <main+0xc1>
lea    0xe9a(%rip),%r14
lea    0xe6e(%rip),%r15
lea    0xe80(%rip),%r12
lea    0xe82(%rip),%r13
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0xe0d(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     11c0 <main+0x80>
ucomiss 0xe05(%rip),%xmm0
ja     11c0 <main+0x80>
ucomiss 0xdf8(%rip),%xmm0
setae  %al
movss  0xdf1(%rip),%xmm1
ucomiss %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
xor    %eax,%eax
call   1050 <assert@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdd1(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xded(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [25 x i8] c"Please input the radius:\00"
@.str.2 = [9 x i8] c"1<=r<=10\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [13 x i8] c"Input error!\00"
@.str.5 = [18 x i8] c"The volum is %f.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %17, %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %7)
%12 = load float, float* %7
%13 = fcmp olt float %12, 1.000000e+00
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = load float, float* %7
%16 = fcmp ogt float %15, 1.000000e+01
br i1 %16, label %17, label %19
17: ; preds = %14, %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %8
19: ; preds = %14
%20 = load float, float* %7
%21 = fcmp oge float %20, 1.000000e+00
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load float, float* %7
%24 = fcmp ole float %23, 1.000000e+01
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ false, %19 ], [ %24, %22 ]
%27 = zext i1 %26 to i32
%28 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %27)
%29 = load float, float* %7
%30 = fpext float %29 to double
%31 = fmul double 0x4010C1514ABD0449, %30
%32 = load float, float* %7
%33 = fpext float %32 to double
%34 = fmul double %31, %33
%35 = load float, float* %7
%36 = fpext float %35 to double
%37 = fmul double %34, %36
%38 = fptrunc double %37 to float
store float %38, float* %6
%39 = load float, float* %6
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %40)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Please input the radius:\00"
@.str.2 = [9 x i8] c"1<=r<=10\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [13 x i8] c"Input error!\00"
@.str.5 = [18 x i8] c"The volum is %f.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%8 = load float, float* %3
%9 = fcmp olt float %8, 1.000000e+00
%10 = fcmp ogt float %8, 1.000000e+01
%11 = or i1 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %2, %12
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%17 = load float, float* %3
%18 = fcmp olt float %17, 1.000000e+00
%19 = fcmp ogt float %17, 1.000000e+01
%20 = or i1 %18, %19
br i1 %20, label %12, label %21
21: ; preds = %12, %2
%22 = phi float [ %8, %2 ], [ %17, %12 ]
%23 = fcmp oge float %22, 1.000000e+00
%24 = fcmp ole float %22, 1.000000e+01
%25 = and i1 %23, %24
%26 = zext i1 %25 to i32
%27 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %26)
%28 = load float, float* %3
%29 = fpext float %28 to double
%30 = fmul double %29, 0x4010C1514ABD0449
%31 = fmul double %30, %29
%32 = fmul double %31, %29
%33 = fptrunc double %32 to float
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %34)
ret i32 0
}