#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 *, float *);
int main() {
  float n1, n2, media;
  printf("\nColoque suas notas para o calculo da Media\n");
  scanf("%f%f", &n1, &n2);
  media = (n1 + n2) / 2;
  if (media >= 6) {
    printf("\nPARABENS voce foi aprovado com Media %.2f\n", media);
  } else {
    printf("\nEstude um pouco mais, sua Media e %.2f\n", media);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xea1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe87(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     119e <main+0x7e>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11b5 <main+0x95>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
mulss  0xe9c(%rip),%xmm0
ucomiss 0xe99(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec3(%rip),%rax
lea    0xe90(%rip),%rdi
cmovb  %rax,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"\0AColoque suas notas para o calculo da Media\0A\00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [44 x i8] c"\0APARABENS voce foi aprovado com Media %.2f\0A\00"
@.str.3 = [41 x i8] c"\0AEstude um pouco mais, sua Media e %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fadd float %7, %8
%10 = fdiv float %9, 2.000000e+00
store float %10, float* %4
%11 = load float, float* %4
%12 = fcmp oge float %11, 6.000000e+00
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load float, float* %4
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %21
17: ; preds = %0
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), double %19)
br label %21
21: ; preds = %17, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [44 x i8] c"\0APARABENS voce foi aprovado com Media %.2f\0A\00"
@.str.3 = [41 x i8] c"\0AEstude um pouco mais, sua Media e %.2f\0A\00"
@str = [44 x i8] c"\0AColoque suas notas para o calculo da Media\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fadd float %7, %8
%10 = fmul float %9, 5.000000e-01
%11 = fcmp ult float %10, 6.000000e+00
%12 = fpext float %10 to double
%13 = select i1 %11, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %13, double %12)
ret i32 0
}