#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(void) {
  int quantidadeDeAlunos;
  int matricula, matriculaDoMelhorAluno;
  double nota, notaDoMelhorAluno = -1.0;
  scanf("%d", &quantidadeDeAlunos);
  while (quantidadeDeAlunos-- > 0) {
    scanf("%d %lf", &matricula, &nota);
    if (nota > notaDoMelhorAluno) {
      notaDoMelhorAluno = nota;
      matriculaDoMelhorAluno = matricula;
    }
  }
  if (notaDoMelhorAluno >= 8.0) {
    printf("%d\n", matriculaDoMelhorAluno);
  } else {
    printf("Minimum note not reached\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    119d <main+0x7d>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1198 <main+0x78>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <main+0x2e>
movsd  -0x20(%rbp),%xmm0
movsd  0xe5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11ca <main+0xaa>
mov    -0x10(%rbp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rsp)
test   %eax,%eax
jle    11ce <main+0x9e>
movsd  0xea0(%rip),%xmm1
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbp
lea    0x10(%rsp),%rbx
jmp    1195 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
maxsd  %xmm1,%xmm0
mov    (%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rsp)
movapd %xmm0,%xmm1
test   %eax,%eax
jle    11c4 <main+0x94>
movsd  %xmm1,0x8(%rsp)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1180 <main+0x50>
mov    0x4(%rsp),%r14d
jmp    1180 <main+0x50>
ucomisd 0xe3c(%rip),%xmm0
jae    11dc <main+0xac>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
jmp    11ed <main+0xbd>
lea    0xe37(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %lf\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [26 x i8] c"Minimum note not reached\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double -1.000000e+00, double* %6
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %20, %0
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
%11 = icmp sgt i32 %9, 0
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3, double* %5)
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load double, double* %5
store double %18, double* %6
%19 = load i32, i32* %3
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %12
br label %8
21: ; preds = %8
%22 = load double, double* %6
%23 = fcmp oge double %22, 8.000000e+00
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %29
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27, %24
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %lf\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [25 x i8] c"Minimum note not reached\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %27
11: ; preds = %0, %11
%12 = phi double [ %19, %11 ], [ -1.000000e+00, %0 ]
%13 = phi i32 [ %18, %11 ], [ undef, %0 ]
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, double* %3)
%15 = load double, double* %3
%16 = fcmp ogt double %15, %12
%17 = load i32, i32* %2
%18 = select i1 %16, i32 %17, i32 %13
%19 = select i1 %16, double %15, double %12
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
store i32 %21, i32* %1
%22 = icmp sgt i32 %20, 0
br i1 %22, label %11, label %23
23: ; preds = %11
%24 = fcmp ult double %19, 8.000000e+00
br i1 %24, label %27, label %25
25: ; preds = %23
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %29
27: ; preds = %0, %23
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
ret i32 0
}