#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 *);
int main() {
  int n1, n2, nf;
  scanf("%d %d", &n1, &n2);
  nf = (n1 + n2) / 2;
  if (nf < 3) {
    printf("REPROVADO\n");
  } else if (nf >= 7) {
    printf("APROVADO\n");
  } else {
    printf("EXAME\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    116f <main+0x4f>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x7b>
cmpl   $0x7,-0x10(%rbp)
jl     118a <main+0x6a>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x76>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x7b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
add    0x4(%rsp),%eax
cmp    $0xe,%eax
lea    0xec6(%rip),%rcx
lea    0xeb9(%rip),%rdx
cmovae %rcx,%rdx
cmp    $0x6,%eax
lea    0xeba(%rip),%rdi
cmovge %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"REPROVADO\0A\00"
@.str.2 = [10 x i8] c"APROVADO\0A\00"
@.str.3 = [7 x i8] c"EXAME\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 2
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %22
14: ; preds = %0
%15 = load i32, i32* %4
%16 = icmp sge i32 %15, 7
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@str = [6 x i8] c"EXAME\00"
@str.4 = [9 x i8] c"APROVADO\00"
@str.5 = [10 x i8] c"REPROVADO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = icmp slt i32 %8, 6
%10 = icmp ugt i32 %8, 13
%11 = select i1 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%12 = select i1 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0), i8* %11
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}