#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 *, float *);
int main(int argc, char **argv) {
  int i;
  float nota;
  i = 0;
  while (i == 0) {
    printf("Insira a nota do Aluno: ");
    scanf("%f", &nota);
    if ((nota >= 0.00) && (nota <= 10.00)) {
      i = 1;
    } else {
      printf("\nErro: A nota deve estar entre 0 a 10\n\n");
    }
  }
  printf("\n\nO aluno tem nota %.2f\n\n ", nota);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11b5 <main+0x95>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a2 <main+0x82>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe74(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11a2 <main+0x82>
movl   $0x1,-0x14(%rbp)
jmp    11b0 <main+0x90>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113d <main+0x1d>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1172 <main+0x42>
movss  0xe93(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11c9 <main+0x99>
lea    0xec6(%rip),%r14
lea    0xe88(%rip),%r15
lea    0xe9a(%rip),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe4a(%rip),%xmm0
jb     1190 <main+0x60>
movss  0xe3c(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     1190 <main+0x60>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Insira a nota do Aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"\0AErro: A nota deve estar entre 0 a 10\0A\0A\00"
@.str.3 = [27 x i8] c"\0A\0AO aluno tem nota %.2f\0A\0A \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = fcmp oge double %15, 0.000000e+00
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = fcmp ole double %19, 1.000000e+01
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %6
br label %24
22: ; preds = %17, %11
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %21
br label %8
25: ; preds = %8
%26 = load float, float* %7
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Insira a nota do Aluno: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [27 x i8] c"\0A\0AO aluno tem nota %.2f\0A\0A \00"
@str = [39 x i8] c"\0AErro: A nota deve estar entre 0 a 10\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = load float, float* %3
%8 = fcmp ult float %7, 0.000000e+00
%9 = fcmp ugt float %7, 1.000000e+01
%10 = or i1 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %2, %11
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%15 = load float, float* %3
%16 = fcmp ult float %15, 0.000000e+00
%17 = fcmp ugt float %15, 1.000000e+01
%18 = or i1 %16, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %2
%20 = load float, float* %3
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %21)
ret i32 0
}