#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 *);
int main() {
  float a;
  printf("Please enter your grade: ");
  scanf("%f", &a);
  if (a >= 0 && a <= 20) {
    if (a >= 10)
      printf("Pass.\n");
    else
      printf("Fail.\n");
  } else
    printf("your grade is out of range.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11a6 <main+0x86>
movss  0xe9c(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11a6 <main+0x86>
movss  -0x8(%rbp),%xmm0
movss  0xe89(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1195 <main+0x75>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11a1 <main+0x81>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xea5(%rip),%xmm0
lea    0xedf(%rip),%rax
lea    0xede(%rip),%rdi
cmovb  %rax,%rdi
movss  0xe8f(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xea6(%rip),%rax
cmovb  %rax,%rdi
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter your grade: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [7 x i8] c"Pass.\0A\00"
@.str.3 = [7 x i8] c"Fail.\0A\00"
@.str.4 = [29 x i8] c"your grade is out of range.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 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* %2)
%5 = load float, float* %2
%6 = fcmp oge float %5, 0.000000e+00
br i1 %6, label %7, label %18
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ole float %8, 2.000000e+01
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load float, float* %2
%12 = fcmp oge float %11, 1.000000e+01
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %20
18: ; preds = %7, %0
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter your grade: \00"
@.str.1 = [3 x i8] c"%f\00"
@str = [28 x i8] c"your grade is out of range.\00"
@str.5 = [6 x i8] c"Fail.\00"
@str.6 = [6 x i8] c"Pass.\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 float, float* %1
%6 = fcmp oge float %5, 0.000000e+00
%7 = fcmp ole float %5, 2.000000e+01
%8 = and i1 %6, %7
%9 = fcmp ult float %5, 1.000000e+01
%10 = select i1 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.6, i64 0, i64 0)
%11 = select i1 %8, i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}