#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 main() {
  float nota, limiar;
  int faltas, maxFaltas;
  printf("Digite a nota e o limiar: ");
  scanf("%f %f", &nota, &limiar);
  printf("Digite as faltas e o limiar: ");
  scanf("%d %d", &faltas, &maxFaltas);
  if (faltas > maxFaltas) {
    printf("O\n");
  } else {
    if (nota > limiar) {
      printf("A\n");
    } else {
      printf("R\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1190 <main+0x70>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11b0 <main+0x90>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    11bc <main+0x9c>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
ucomiss 0x10(%rsp),%xmm0
lea    0xeb9(%rip),%rax
lea    0xeb0(%rip),%rcx
cmova  %rax,%rcx
mov    0xc(%rsp),%eax
cmp    0x8(%rsp),%eax
lea    0xea1(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Digite a nota e o limiar: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [30 x i8] c"Digite as faltas e o limiar: \00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [3 x i8] c"O\0A\00"
@.str.5 = [3 x i8] c"A\0A\00"
@.str.6 = [3 x i8] c"R\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %4, i32* %5)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %24
15: ; preds = %0
%16 = load float, float* %2
%17 = load float, float* %3
%18 = fcmp ogt float %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Digite a nota e o limiar: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [30 x i8] c"Digite as faltas e o limiar: \00"
@.str.3 = [6 x i8] c"%d %d\00"
@str = [2 x i8] c"R\00"
@str.7 = [2 x i8] c"A\00"
@str.8 = [2 x i8] c"O\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %3, i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp sgt i32 %13, %14
%16 = load float, float* %1
%17 = load float, float* %2
%18 = fcmp ogt float %16, %17
%19 = select i1 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
%20 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0), i8* %19
%21 = call i32 @puts(i8* dereferenceable(1) %20)
ret i32 0
}