#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 soma = 0, media, 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("\n");
  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("\nMédia\t\t%.2f", media);
  printf("\n----------------------------------------");
  printf("\nEntre com a matricula[1-4]: ");
  scanf("%d", &i);
  i--;
  printf("\nNome do Aluno\tAV1\tAV2\tAV3\tResultado");
  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");
  }
  printf("\n----------------------------------------");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%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    0xe95(%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    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     1267 <main+0x147>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1254 <main+0x134>
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    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1212 <main+0xf2>
jmp    1259 <main+0x139>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ed <main+0xcd>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     1306 <main+0x1e6>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xdc4(%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    0xde8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x44(%rbp),%xmm0
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1298 <main+0x178>
movss  -0x44(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd7f(%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    0xd67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     13ee <main+0x2ce>
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    0xce3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ac <main+0x28c>
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  0xbba(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xbaa(%rip),%xmm1
ucomiss %xmm1,%xmm0
jae    14ad <main+0x38d>
movss  -0x4c(%rbp),%xmm0
addss  -0x54(%rbp),%xmm0
movss  0xb93(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xb83(%rip),%xmm1
ucomiss %xmm1,%xmm0
jae    14ad <main+0x38d>
movss  -0x50(%rbp),%xmm0
addss  -0x54(%rbp),%xmm0
movss  0xb6c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xb5c(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     14c0 <main+0x3a0>
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14ce <main+0x3ae>
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xb74(%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    0xec2(%rip),%r14
lea    0xedc(%rip),%rbx
xor    %edx,%edx
nop
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <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   1050 <scanf@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <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   1050 <scanf@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <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   1050 <scanf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%edx
mov    %edx,0x8(%rsp)
cmp    $0x3,%eax
jl     1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe35(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,0x8(%rsp)
lea    0xe49(%rip),%r14
lea    0xe8b(%rip),%rbx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <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   1040 <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   1040 <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   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0x8(%rsp)
cmp    $0x3,%eax
jl     1240 <main+0x110>
lea    0xd8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,0x8(%rsp)
xorps  %xmm1,%xmm1
lea    0xd81(%rip),%r14
lea    0xdc3(%rip),%rbx
xor    %esi,%esi
nopl   0x0(%rax)
movss  %xmm1,0xc(%rsp)
add    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <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   1040 <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     1300 <main+0x1d0>
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
lea    0xcdd(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd2d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd23(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd33(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
addl   $0xffffffff,0x8(%rsp)
lea    0xd1e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
add    $0x1,%esi
lea    0xc8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x8(%rsp),%rax
lea    (%rax,%rax,2),%rax
movss  0x10(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <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   1040 <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   1040 <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  0xb95(%rip),%xmm2
lea    0xc94(%rip),%rdi
ucomiss 0xb8b(%rip),%xmm2
jae    14b2 <main+0x382>
movss  0x18(%rsp,%rax,4),%xmm2
addss  %xmm2,%xmm1
mulss  0xb73(%rip),%xmm1
ucomiss 0xb70(%rip),%xmm1
jae    14b2 <main+0x382>
addss  %xmm2,%xmm0
mulss  0xb5e(%rip),%xmm0
ucomiss 0xb5b(%rip),%xmm0
jae    14b2 <main+0x382>
lea    0xc5e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb87(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

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