#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, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int nota;
  puts("Ce nota ai luat la ultimul test?");
  scanf("%d", &nota);
  if (nota > 0 && nota <= 10)
    printf("Asadar ai luat %d, o nota %s. Bravo!\n\n\r", nota,
           (nota > +8) ? "buna" : "rea");
  else
    puts("O nota de la 1 la 10 ba baiatule!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    119b <main+0x6b>
cmpl   $0xa,-0x8(%rbp)
jg     119b <main+0x6b>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdx
lea    0xec9(%rip),%rax
cmp    $0x8,%ecx
cmovg  %rax,%rdx
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
jmp    11a7 <main+0x77>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x9,%eax
ja     117d <main+0x4d>
cmp    $0x9,%esi
lea    0xee8(%rip),%rax
lea    0xee6(%rip),%rdx
cmovae %rax,%rdx
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
jmp    1189 <main+0x59>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Ce nota ai luat la ultimul test?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Asadar ai luat %d, o nota %s. Bravo!\0A\0A\0D\00"
@.str.3 = [5 x i8] c"buna\00"
@.str.4 = [4 x i8] c"rea\00"
@.str.5 = [34 x i8] c"O nota de la 1 la 10 ba baiatule!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 8
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %11, i8* %15)
br label %19
17: ; preds = %7, %0
%18 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Ce nota ai luat la ultimul test?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Asadar ai luat %d, o nota %s. Bravo!\0A\0A\0D\00"
@.str.3 = [5 x i8] c"buna\00"
@.str.4 = [4 x i8] c"rea\00"
@.str.5 = [34 x i8] c"O nota de la 1 la 10 ba baiatule!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = icmp ugt i32 %5, 8
%10 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %5, i8* %10)
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
ret i32 0
}