#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(void) {
  float grade;
  printf("What is the grade? (percents only): ");
  scanf("%f", &grade);
  if (grade >= 85) {
    printf("That's an A!\n");
  } else {
    if (grade < 85 && grade >= 75) {
      printf("That's a B!\n");
    } else {
      if (grade < 75 && grade >= 65) {
        printf("That's a C.\n");
      } else {
        if (grade < 65 && grade >= 55) {
          printf("That's a D.\n");
        } else {
          printf("That's an F. Fail.\n");
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1172 <main+0x52>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    1238 <main+0x118>
movss  0xe86(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11ab <main+0x8b>
movss  -0x8(%rbp),%xmm0
movss  0xe73(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ab <main+0x8b>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1233 <main+0x113>
movss  0xe51(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11e4 <main+0xc4>
movss  -0x8(%rbp),%xmm0
movss  0xe3e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11e4 <main+0xc4>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    122e <main+0x10e>
movss  0xe1c(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    121d <main+0xfd>
movss  -0x8(%rbp),%xmm0
movss  0xe09(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     121d <main+0xfd>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    1229 <main+0x109>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
jmp    122e <main+0x10e>
jmp    1233 <main+0x113>
jmp    1238 <main+0x118>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xea5(%rip),%xmm0
jae    117c <main+0x4c>
movss  0xe9b(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1185 <main+0x55>
ucomiss 0xe93(%rip),%xmm0
jb     1185 <main+0x55>
lea    0xee9(%rip),%rdi
jmp    11cc <main+0x9c>
lea    0xeec(%rip),%rdi
jmp    11cc <main+0x9c>
movss  0xe77(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11a4 <main+0x74>
ucomiss 0xe6f(%rip),%xmm0
jb     11a4 <main+0x74>
lea    0xeb5(%rip),%rdi
jmp    11cc <main+0x9c>
ucomiss 0xe61(%rip),%xmm0
lea    0xe99(%rip),%rdi
lea    0xe7f(%rip),%rax
cmovb  %rax,%rdi
movss  0xe43(%rip),%xmm1
ucomiss %xmm0,%xmm1
cmovbe %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"What is the grade? (percents only): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"That's an A!\0A\00"
@.str.3 = [13 x i8] c"That's a B!\0A\00"
@.str.4 = [13 x i8] c"That's a C.\0A\00"
@.str.5 = [13 x i8] c"That's a D.\0A\00"
@.str.6 = [20 x i8] c"That's an F. Fail.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 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, 8.500000e+01
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %38
9: ; preds = %0
%10 = load float, float* %2
%11 = fcmp olt float %10, 8.500000e+01
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load float, float* %2
%14 = fcmp oge float %13, 7.500000e+01
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %37
17: ; preds = %12, %9
%18 = load float, float* %2
%19 = fcmp olt float %18, 7.500000e+01
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load float, float* %2
%22 = fcmp oge float %21, 6.500000e+01
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %36
25: ; preds = %20, %17
%26 = load float, float* %2
%27 = fcmp olt float %26, 6.500000e+01
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load float, float* %2
%30 = fcmp oge float %29, 5.500000e+01
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %35
33: ; preds = %28, %25
%34 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
br label %35
35: ; preds = %33, %31
br label %36
36: ; preds = %35, %23
br label %37
37: ; preds = %36, %15
br label %38
38: ; preds = %37, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"What is the grade? (percents only): \00"
@.str.1 = [3 x i8] c"%f\00"
@str = [19 x i8] c"That's an F. Fail.\00"
@str.7 = [12 x i8] c"That's a D.\00"
@str.8 = [12 x i8] c"That's a C.\00"
@str.9 = [12 x i8] c"That's a B!\00"
@str.10 = [13 x i8] c"That's an A!\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 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 ult float %5, 8.500000e+01
br i1 %6, label %7, label %20
7: ; preds = %0
%8 = fcmp olt float %5, 8.500000e+01
%9 = fcmp oge float %5, 7.500000e+01
%10 = and i1 %8, %9
br i1 %10, label %20, label %11
11: ; preds = %7
%12 = fcmp olt float %5, 7.500000e+01
%13 = fcmp oge float %5, 6.500000e+01
%14 = and i1 %12, %13
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = fcmp olt float %5, 6.500000e+01
%17 = fcmp oge float %5, 5.500000e+01
%18 = and i1 %16, %17
%19 = select i1 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
br label %20
20: ; preds = %15, %11, %7, %0
%21 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.8, i64 0, i64 0), %11 ], [ %19, %15 ]
%22 = call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}