#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 n1, n2, n3, n4, average, bn;
  n1 = n2 = n3 = n4 = average = 0;
  printf(" *¨¨**¨¨**¨¨**¨¨* Middle Scholl *¨¨**¨¨**¨¨**¨¨* \n\n");
  printf("\nEnter first note:");
  scanf("%f", &n1);
  printf("\nEnter second note:");
  scanf("%f", &n2);
  printf("\nEnter third note:");
  scanf("%f", &n3);
  printf("\nEnter fourth note:");
  scanf("%f", &n4);
  average = (n1 + n2 + n3 + n4) / 4;
  printf("%f :", average);
  if (average >= 7) {
    printf("\n Passed the examination!!");
  } else if (average <= 7) {
    printf("\nEnter note Bonus:");
    scanf("%f", &bn);
    if (bn < 8) {
      printf("\n Failed the examination!!");
    } else {
      printf("\n Passed the examination!!");
    }
  } else if (average <= 4) {
    printf("\n Failed the examination!!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  0xe0b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  0xdda(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1242 <main+0x122>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d4 <main+0x1b4>
movss  0xdb6(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jb     12aa <main+0x18a>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfa(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xd8e(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1297 <main+0x177>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a5 <main+0x185>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cf <main+0x1af>
movss  0xd52(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jb     12ca <main+0x1aa>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cf <main+0x1af>
jmp    12d4 <main+0x1b4>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
lea    0xf53(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
mulss  0xe0c(%rip),%xmm0
movss  %xmm0,0x18(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm1
ucomiss 0xdeb(%rip),%xmm1
jae    123e <main+0x10e>
movss  0xde1(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1247 <main+0x117>
movss  0xddc(%rip),%xmm0
ucomiss %xmm1,%xmm0
jb     128c <main+0x15c>
lea    0xe58(%rip),%rdi
jmp    1285 <main+0x155>
lea    0xe21(%rip),%rdi
jmp    1285 <main+0x155>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc7(%rip),%rdi
lea    0x1c(%rsp),%rsi
call   1050 <scanf@plt>
movss  0xd9a(%rip),%xmm0
ucomiss 0x1c(%rsp),%xmm0
lea    0xe1a(%rip),%rax
lea    0xde5(%rip),%rdi
cmova  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [68 x i8] c" *\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8* Middle Scholl *\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8* \0A\0A\00"
@.str.1 = [19 x i8] c"\0AEnter first note:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [20 x i8] c"\0AEnter second note:\00"
@.str.4 = [19 x i8] c"\0AEnter third note:\00"
@.str.5 = [20 x i8] c"\0AEnter fourth note:\00"
@.str.6 = [5 x i8] c"%f :\00"
@.str.7 = [27 x i8] c"\0A Passed the examination!!\00"
@.str.8 = [19 x i8] c"\0AEnter note Bonus:\00"
@.str.9 = [27 x i8] c"\0A Failed the examination!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %5)
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fadd float %17, %18
%20 = load float, float* %4
%21 = fadd float %19, %20
%22 = load float, float* %5
%23 = fadd float %21, %22
%24 = fdiv float %23, 4.000000e+00
store float %24, float* %6
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double %26)
%28 = load float, float* %6
%29 = fcmp oge float %28, 7.000000e+00
br i1 %29, label %30, label %32
30: ; preds = %0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %52
32: ; preds = %0
%33 = load float, float* %6
%34 = fcmp ole float %33, 7.000000e+00
br i1 %34, label %35, label %45
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %7)
%38 = load float, float* %7
%39 = fcmp olt float %38, 8.000000e+00
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %44
42: ; preds = %35
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %51
45: ; preds = %32
%46 = load float, float* %6
%47 = fcmp ole float %46, 4.000000e+00
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
br label %51
51: ; preds = %50, %44
br label %52
52: ; preds = %51, %30
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"\0AEnter first note:\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [20 x i8] c"\0AEnter second note:\00"
@.str.4 = [19 x i8] c"\0AEnter third note:\00"
@.str.5 = [20 x i8] c"\0AEnter fourth note:\00"
@.str.6 = [5 x i8] c"%f :\00"
@.str.7 = [27 x i8] c"\0A Passed the examination!!\00"
@.str.8 = [19 x i8] c"\0AEnter note Bonus:\00"
@.str.9 = [27 x i8] c"\0A Failed the examination!!\00"
@str = [67 x i8] c" *\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8* Middle Scholl *\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8**\C2\A8\C2\A8* \0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%20 = load float, float* %1
%21 = load float, float* %2
%22 = fadd float %20, %21
%23 = load float, float* %3
%24 = fadd float %22, %23
%25 = load float, float* %4
%26 = fadd float %24, %25
%27 = fmul float %26, 2.500000e-01
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double %28)
%30 = fcmp ult float %27, 7.000000e+00
br i1 %30, label %31, label %41
31: ; preds = %0
%32 = fcmp ugt float %27, 7.000000e+00
br i1 %32, label %39, label %33
33: ; preds = %31
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %5)
%36 = load float, float* %5
%37 = fcmp olt float %36, 8.000000e+00
%38 = select i1 %37, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0)
br label %41
39: ; preds = %31
%40 = fcmp ugt float %27, 4.000000e+00
br i1 %40, label %44, label %41
41: ; preds = %39, %33, %0
%42 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %0 ], [ %38, %33 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), %39 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %42)
br label %44
44: ; preds = %41, %39
ret i32 0
}