#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() {
  char nome[20];
  float nota1, nota2, media;
  printf("\nentre com o nome do aluno: ");
  scanf("\n%s", nome);
  printf("\nentre com a nota1: ");
  scanf("\n%f", &nota1);
  printf("\n entre com a nota2: ");
  scanf("\n%f", &nota2);
  media = (nota1 + nota2) / 2;
  printf("\nsua média = %f", media);
  if (media >= 6) {
    printf("\n\nparabéns %s, sua média=%f", nome, media);
  } else {
    printf("\n\nInfelizmente você , %s , está reprovado pois sua media foi= %f",
           nome, media);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x24(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
movss  0xe63(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
movss  0xe32(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11f7 <main+0xd7>
lea    -0x20(%rbp),%rsi
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
lea    -0x20(%rbp),%rsi
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x20(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
mulss  0xe60(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe39(%rip),%xmm0
lea    0xeb5(%rip),%rax
lea    0xe90(%rip),%rdi
cmovb  %rax,%rdi
mov    %r14,%rsi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0Aentre com o nome do aluno: \00"
@.str.1 = [4 x i8] c"\0A%s\00"
@.str.2 = [21 x i8] c"\0Aentre com a nota1: \00"
@.str.3 = [4 x i8] c"\0A%f\00"
@.str.4 = [22 x i8] c"\0A entre com a nota2: \00"
@.str.5 = [17 x i8] c"\0Asua m\C3\A9dia = %f\00"
@.str.6 = [30 x i8] c"\0A\0Aparab\C3\A9ns %s, sua m\C3\A9dia=%f\00"
@.str.7 = [67 x i8] c"\0A\0AInfelizmente voc\C3\AA , %s , est\C3\A1 reprovado pois sua media foi= %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %4)
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fadd float %13, %14
%16 = fdiv float %15, 2.000000e+00
store float %16, float* %5
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %18)
%20 = load float, float* %5
%21 = fcmp oge float %20, 6.000000e+00
br i1 %21, label %22, label %27
22: ; preds = %0
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %23, double %25)
br label %32
27: ; preds = %0
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.7, i64 0, i64 0), i8* %28, double %30)
br label %32
32: ; preds = %27, %22
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0Aentre com o nome do aluno: \00"
@.str.1 = [4 x i8] c"\0A%s\00"
@.str.2 = [21 x i8] c"\0Aentre com a nota1: \00"
@.str.3 = [4 x i8] c"\0A%f\00"
@.str.4 = [22 x i8] c"\0A entre com a nota2: \00"
@.str.5 = [17 x i8] c"\0Asua m\C3\A9dia = %f\00"
@.str.6 = [30 x i8] c"\0A\0Aparab\C3\A9ns %s, sua m\C3\A9dia=%f\00"
@.str.7 = [67 x i8] c"\0A\0AInfelizmente voc\C3\AA , %s , est\C3\A1 reprovado pois sua media foi= %f\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca float
%3 = alloca float
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), float* %3)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fadd float %13, %14
%16 = fmul float %15, 5.000000e-01
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %17)
%19 = fcmp ult float %16, 6.000000e+00
%20 = select i1 %19, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %20, i8* %4, double %17)
ret i32 0
}