#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 *, int *);
int main() {
  int auxa = 0, auxr = 0, notas = 0, cont = 0;
  while (cont < 10) {
    printf("digite o resultado: ");
    scanf("%i", &notas);
    if (notas == 1)
      auxa++;
    if (notas == 2)
      auxr++;
    if (notas != 1 && notas != 2)
      continue;
    cont++;
  }
  printf("aprovados:%i\n", auxa);
  printf("reprovados:%i\n", auxr);
  if (auxa >= 8)
    printf("bonus ao instrutor\n");
  if (auxr >= 7)
    printf("algo esta errado com o instrutor\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11c0 <main+0xa0>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1186 <main+0x66>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    1199 <main+0x79>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     11b2 <main+0x92>
cmpl   $0x2,-0x10(%rbp)
je     11b2 <main+0x92>
jmp    114b <main+0x2b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
mov    -0x8(%rbp),%esi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x8,-0x8(%rbp)
jl     11fa <main+0xda>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7,-0xc(%rbp)
jl     1212 <main+0xf2>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeb6(%rip),%r14
lea    0xec4(%rip),%r15
lea    0x4(%rsp),%r12
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %ebp,%ebp
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
add    %ecx,%r13d
add    $0xffffffff,%eax
cmp    $0x2,%eax
adc    $0x0,%ebx
cmp    $0xa,%ebx
jb     1160 <main+0x30>
lea    0xe75(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x8,%ebp
jb     11ce <main+0x9e>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x7,%r13d
jb     11e0 <main+0xb0>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"digite o resultado: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [14 x i8] c"aprovados:%i\0A\00"
@.str.3 = [15 x i8] c"reprovados:%i\0A\00"
@.str.4 = [20 x i8] c"bonus ao instrutor\0A\00"
@.str.5 = [34 x i8] c"algo esta errado com o instrutor\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %30, %29, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %33
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %9
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %17
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 1
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 2
br i1 %28, label %29, label %30
29: ; preds = %26
br label %6
30: ; preds = %26, %23
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %6
33: ; preds = %6
%34 = load i32, i32* %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %2
%39 = icmp sge i32 %38, 8
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %40, %33
%43 = load i32, i32* %3
%44 = icmp sge i32 %43, 7
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [21 x i8] c"digite o resultado: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [14 x i8] c"aprovados:%i\0A\00"
@.str.3 = [15 x i8] c"reprovados:%i\0A\00"
@str = [33 x i8] c"algo esta errado com o instrutor\00"
@str.6 = [19 x i8] c"bonus ao instrutor\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %19, %3 ]
%5 = phi i32 [ 0, %0 ], [ %15, %3 ]
%6 = phi i32 [ 0, %0 ], [ %12, %3 ]
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = icmp eq i32 %9, 2
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %5, %14
%16 = add i32 %9, -1
%17 = icmp ult i32 %16, 2
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %4, %18
%20 = icmp ult i32 %19, 10
br i1 %20, label %3, label %21
21: ; preds = %3
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%24 = icmp ugt i32 %12, 7
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %21
%28 = icmp ugt i32 %15, 6
br i1 %28, label %29, label %31
29: ; preds = %27
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
ret i32 0
}