#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() {
  int i, j;
  float notas[4][3];
  float media, soma = 0;
  float av1, av2, av3;
  for (i = 0; i <= 3; i++) {
    for (j = 0; j <= 2; j++) {
      printf("\nEntre com a av%d do aluno %d: ", j + 1, i + 1);
      scanf("%f", &notas[i][j]);
    }
  }
  printf("\nNome do aluno\tAV1\tAV2\tAV3");
  printf("\n----------------------------------");
  for (i = 0; i <= 3; i++) {
    printf("\nAluno %d\t", i + 1);
    for (j = 0; j <= 2; j++) {
      printf("\t%.2f", notas[i][j]);
    }
  }
  printf("\n----------------------------------");
  printf("\nNome do aluno\tAV1");
  printf("\n----------------------------------");
  for (i = 0; i <= 3; i++) {
    printf("\nAluno %d\t", i + 1);
    printf("\t%.2f", notas[i][0]);
    soma = soma + notas[i][0];
  }
  media = soma / i;
  printf("\n----------------------------------");
  printf("\nMedia\t\t%.2f", media);
  printf("\n----------------------------------");
  printf("\nEntre com a matricula[1-4]: ");
  scanf("%d", &i);
  i--;
  printf("\n Nome do aluno\tAV1\tAV2\tAV3");
  printf("\n-----------------------------------");
  printf("\nAluno %d\t", i + 1);
  for (j = 0; j <= 2; j++) {
    printf("\t%.2f", notas[i][j]);
  }
  av1 = notas[i][0];
  av2 = notas[i][1];
  av3 = notas[i][2];
  if ((av1 + av2) / 2 >= 6 || (av1 + av3) / 2 >= 6 || (av2 + av3) / 2 >= 6) {
    printf("\tAPROVADO");
  } else {
    printf("\tREPROVADO");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     11bc <main+0x9c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     11a9 <main+0x89>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x40(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <main+0x2f>
jmp    11ae <main+0x8e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     1259 <main+0x139>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1246 <main+0x126>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1204 <main+0xe4>
jmp    124b <main+0x12b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11df <main+0xbf>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     12f8 <main+0x1d8>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x48(%rbp),%xmm0
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    128a <main+0x16a>
movss  -0x48(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd5f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd60(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     13e0 <main+0x2c0>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcc4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    139e <main+0x27e>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4c(%rbp)
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x50(%rbp)
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x4c(%rbp),%xmm0
addss  -0x50(%rbp),%xmm0
movss  0xbc8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xbb8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jae    149f <main+0x37f>
movss  -0x4c(%rbp),%xmm0
addss  -0x54(%rbp),%xmm0
movss  0xba1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xb91(%rip),%xmm1
ucomiss %xmm1,%xmm0
jae    149f <main+0x37f>
movss  -0x50(%rbp),%xmm0
addss  -0x54(%rbp),%xmm0
movss  0xb7a(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xb6a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     14b2 <main+0x392>
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14c0 <main+0x3a0>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movl   $0x0,0x8(%rsp)
lea    0xed2(%rip),%r14
lea    0xeeb(%rip),%rbx
xor    %edx,%edx
nop
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,4),%rsi
add    $0x10,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,4),%rsi
add    $0x14,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,4),%rsi
add    $0x18,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%edx
mov    %edx,0x8(%rsp)
cmp    $0x3,%eax
jl     1140 <main+0x20>
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x8(%rsp)
lea    0xe5c(%rip),%r14
lea    0xe7a(%rip),%rbx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x10(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x14(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x18(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0x8(%rsp)
cmp    $0x3,%eax
jl     1220 <main+0x100>
lea    0xdab(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x8(%rsp)
xorps  %xmm1,%xmm1
lea    0xd9b(%rip),%r14
lea    0xdb9(%rip),%rbx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movss  %xmm1,0xc(%rsp)
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x10(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm1
movslq 0x8(%rsp),%rax
lea    0x1(%rax),%esi
lea    (%rax,%rax,2),%rcx
addss  0x10(%rsp,%rcx,4),%xmm1
mov    %esi,0x8(%rsp)
cmp    $0x3,%rax
jl     12e0 <main+0x1c0>
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
lea    0xcfc(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd23(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd18(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd28(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
addl   $0xffffffff,0x8(%rsp)
lea    0xd13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd21(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
add    $0x1,%esi
lea    0xca4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x10(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xca8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x14(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x18(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x10(%rsp,%rax,4),%xmm1
movss  0x14(%rsp,%rax,4),%xmm0
movaps %xmm1,%xmm2
addss  %xmm0,%xmm2
mulss  0xbb1(%rip),%xmm2
lea    0xca1(%rip),%rdi
ucomiss 0xba7(%rip),%xmm2
jae    1496 <main+0x376>
movss  0x18(%rsp,%rax,4),%xmm2
addss  %xmm2,%xmm1
mulss  0xb8f(%rip),%xmm1
ucomiss 0xb8c(%rip),%xmm1
jae    1496 <main+0x376>
addss  %xmm2,%xmm0
mulss  0xb7a(%rip),%xmm0
ucomiss 0xb77(%rip),%xmm0
jae    1496 <main+0x376>
lea    0xc6b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0AEntre com a av%d do aluno %d: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"\0ANome do aluno\09AV1\09AV2\09AV3\00"
@.str.3 = [36 x i8] c"\0A----------------------------------\00"
@.str.4 = [11 x i8] c"\0AAluno %d\09\00"
@.str.5 = [6 x i8] c"\09%.2f\00"
@.str.6 = [19 x i8] c"\0ANome do aluno\09AV1\00"
@.str.7 = [13 x i8] c"\0AMedia\09\09%.2f\00"
@.str.8 = [30 x i8] c"\0AEntre com a matricula[1-4]: \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [28 x i8] c"\0A Nome do aluno\09AV1\09AV2\09AV3\00"
@.str.11 = [37 x i8] c"\0A-----------------------------------\00"
@.str.12 = [10 x i8] c"\09APROVADO\00"
@.str.13 = [11 x i8] c"\09REPROVADO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x [3 x float]]
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %6
store i32 0, i32* %2
br label %10
10: ; preds = %34, %0
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 3
br i1 %12, label %13, label %37
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %30, %13
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 2
br i1 %16, label %17, label %33
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21)
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %24
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0, i64 %27
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %28)
br label %30
30: ; preds = %17
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %14
33: ; preds = %14
br label %34
34: ; preds = %33
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %10
37: ; preds = %10
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %40
40: ; preds = %64, %37
%41 = load i32, i32* %2
%42 = icmp sle i32 %41, 3
br i1 %42, label %43, label %67
43: ; preds = %40
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %45)
store i32 0, i32* %3
br label %47
47: ; preds = %60, %43
%48 = load i32, i32* %3
%49 = icmp sle i32 %48, 2
br i1 %49, label %50, label %63
50: ; preds = %47
%51 = load i32, i32* %2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %52
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [3 x float], [3 x float]* %53, i64 0, i64 %55
%57 = load float, float* %56
%58 = fpext float %57 to double
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %58)
br label %60
60: ; preds = %50
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %47
63: ; preds = %47
br label %64
64: ; preds = %63
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %40
67: ; preds = %40
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %71
71: ; preds = %92, %67
%72 = load i32, i32* %2
%73 = icmp sle i32 %72, 3
br i1 %73, label %74, label %95
74: ; preds = %71
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %2
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %79
%81 = getelementptr inbounds [3 x float], [3 x float]* %80, i64 0, i64 0
%82 = load float, float* %81
%83 = fpext float %82 to double
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %83)
%85 = load float, float* %6
%86 = load i32, i32* %2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %87
%89 = getelementptr inbounds [3 x float], [3 x float]* %88, i64 0, i64 0
%90 = load float, float* %89
%91 = fadd float %85, %90
store float %91, float* %6
br label %92
92: ; preds = %74
%93 = load i32, i32* %2
%94 = add nsw i32 %93, 1
store i32 %94, i32* %2
br label %71
95: ; preds = %71
%96 = load float, float* %6
%97 = load i32, i32* %2
%98 = sitofp i32 %97 to float
%99 = fdiv float %96, %98
store float %99, float* %5
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%101 = load float, float* %5
%102 = fpext float %101 to double
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%106 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %2)
%107 = load i32, i32* %2
%108 = add nsw i32 %107, -1
store i32 %108, i32* %2
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%111 = load i32, i32* %2
%112 = add nsw i32 %111, 1
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %112)
store i32 0, i32* %3
br label %114
114: ; preds = %127, %95
%115 = load i32, i32* %3
%116 = icmp sle i32 %115, 2
br i1 %116, label %117, label %130
117: ; preds = %114
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %119
%121 = load i32, i32* %3
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [3 x float], [3 x float]* %120, i64 0, i64 %122
%124 = load float, float* %123
%125 = fpext float %124 to double
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %125)
br label %127
127: ; preds = %117
%128 = load i32, i32* %3
%129 = add nsw i32 %128, 1
store i32 %129, i32* %3
br label %114
130: ; preds = %114
%131 = load i32, i32* %2
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %132
%134 = getelementptr inbounds [3 x float], [3 x float]* %133, i64 0, i64 0
%135 = load float, float* %134
store float %135, float* %7
%136 = load i32, i32* %2
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %137
%139 = getelementptr inbounds [3 x float], [3 x float]* %138, i64 0, i64 1
%140 = load float, float* %139
store float %140, float* %8
%141 = load i32, i32* %2
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %4, i64 0, i64 %142
%144 = getelementptr inbounds [3 x float], [3 x float]* %143, i64 0, i64 2
%145 = load float, float* %144
store float %145, float* %9
%146 = load float, float* %7
%147 = load float, float* %8
%148 = fadd float %146, %147
%149 = fdiv float %148, 2.000000e+00
%150 = fcmp oge float %149, 6.000000e+00
br i1 %150, label %163, label %151
151: ; preds = %130
%152 = load float, float* %7
%153 = load float, float* %9
%154 = fadd float %152, %153
%155 = fdiv float %154, 2.000000e+00
%156 = fcmp oge float %155, 6.000000e+00
br i1 %156, label %163, label %157
157: ; preds = %151
%158 = load float, float* %8
%159 = load float, float* %9
%160 = fadd float %158, %159
%161 = fdiv float %160, 2.000000e+00
%162 = fcmp oge float %161, 6.000000e+00
br i1 %162, label %163, label %165
163: ; preds = %157, %151, %130
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
br label %167
165: ; preds = %157
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %167
167: ; preds = %165, %163
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AEntre com a av%d do aluno %d: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"\0ANome do aluno\09AV1\09AV2\09AV3\00"
@.str.3 = [36 x i8] c"\0A----------------------------------\00"
@.str.4 = [11 x i8] c"\0AAluno %d\09\00"
@.str.5 = [6 x i8] c"\09%.2f\00"
@.str.6 = [19 x i8] c"\0ANome do aluno\09AV1\00"
@.str.7 = [13 x i8] c"\0AMedia\09\09%.2f\00"
@.str.8 = [30 x i8] c"\0AEntre com a matricula[1-4]: \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [28 x i8] c"\0A Nome do aluno\09AV1\09AV2\09AV3\00"
@.str.11 = [37 x i8] c"\0A-----------------------------------\00"
@.str.12 = [10 x i8] c"\09APROVADO\00"
@.str.13 = [11 x i8] c"\09REPROVADO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [3 x float]]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [4 x [3 x float]]* %2 to i8*
store i32 0, i32* %1
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %28, %5 ]
%7 = add nsw i32 %6, 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1, i32 %7)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %10, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %11)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 2, i32 %14)
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %17, i64 1
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %18)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 3, i32 %21)
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %24, i64 2
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %25)
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
%29 = icmp slt i32 %27, 3
br i1 %29, label %5, label %30
30: ; preds = %5
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %33
33: ; preds = %30, %33
%34 = phi i32 [ 0, %30 ], [ %56, %33 ]
%35 = add nsw i32 %34, 1
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %38, i64 0
%40 = load float, float* %39
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %41)
%43 = load i32, i32* %1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %44, i64 1
%46 = load float, float* %45
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %47)
%49 = load i32, i32* %1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %50, i64 2
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %53)
%55 = load i32, i32* %1
%56 = add nsw i32 %55, 1
store i32 %56, i32* %1
%57 = icmp slt i32 %55, 3
br i1 %57, label %33, label %58
58: ; preds = %33
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %62
62: ; preds = %58, %62
%63 = phi float [ 0.000000e+00, %58 ], [ %77, %62 ]
%64 = phi i32 [ 0, %58 ], [ %78, %62 ]
%65 = add nsw i32 %64, 1
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %68, i64 0
%70 = load float, float* %69
%71 = fpext float %70 to double
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %71)
%73 = load i32, i32* %1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %74, i64 0
%76 = load float, float* %75
%77 = fadd float %63, %76
%78 = add nsw i32 %73, 1
store i32 %78, i32* %1
%79 = icmp slt i32 %73, 3
br i1 %79, label %62, label %80
80: ; preds = %62
%81 = sitofp i32 %78 to float
%82 = fdiv float %77, %81
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%84 = fpext float %82 to double
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %84)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%89 = load i32, i32* %1
%90 = add nsw i32 %89, -1
store i32 %90, i32* %1
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%93 = load i32, i32* %1
%94 = add nsw i32 %93, 1
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %1
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %97, i64 0
%99 = load float, float* %98
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %100)
%102 = load i32, i32* %1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %103, i64 1
%105 = load float, float* %104
%106 = fpext float %105 to double
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %106)
%108 = load i32, i32* %1
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %109, i64 2
%111 = load float, float* %110
%112 = fpext float %111 to double
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %112)
%114 = load i32, i32* %1
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %115, i64 0
%117 = load float, float* %116
%118 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %115, i64 1
%119 = load float, float* %118
%120 = getelementptr inbounds [4 x [3 x float]], [4 x [3 x float]]* %2, i64 0, i64 %115, i64 2
%121 = load float, float* %120
%122 = fadd float %117, %119
%123 = fmul float %122, 5.000000e-01
%124 = fcmp ult float %123, 6.000000e+00
br i1 %124, label %125, label %134
125: ; preds = %80
%126 = fadd float %117, %121
%127 = fmul float %126, 5.000000e-01
%128 = fcmp ult float %127, 6.000000e+00
br i1 %128, label %129, label %134
129: ; preds = %125
%130 = fadd float %119, %121
%131 = fmul float %130, 5.000000e-01
%132 = fcmp ult float %131, 6.000000e+00
br i1 %132, label %133, label %134
133: ; preds = %129
br label %134
134: ; preds = %80, %125, %129, %133
%135 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), %133 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), %129 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), %125 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), %80 ]
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %135)
ret i32 0
}