#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(void) {
  setlocale(LC_ALL, "Portuguese");
  struct Aluno {
    char nome[10];
    float notaMath, notaPhysics, media;
  } aluno[5];
  for (int contador = 0; contador < 5; contador++) {
    printf("Nome do aluno %d: ", contador + 1);
    scanf("%s", aluno[contador].nome);
    while (1) {
      printf("Nota de matemática: ");
      scanf("%f", &aluno[contador].notaMath);
      if (aluno[contador].notaMath > 10.0)
        printf("Apenas notas até 10.\n");
      else
        break;
    }
    while (1) {
      printf("Nota de física: ");
      scanf("%f", &aluno[contador].notaPhysics);
      if (aluno[contador].notaPhysics > 10.0)
        printf("Apenas notas até 10.\n");
      else
        break;
    }
    aluno[contador].media =
        (aluno[contador].notaMath + aluno[contador].notaPhysics) / 2;
    printf("\n");
  }
  printf("\n\n------------Informações dos Alunos------------\n");
  for (int contador = 0; contador < 5; contador++) {
    printf("Nome do aluno %d: %s\n", contador + 1, aluno[contador].nome);
    printf("Nota de matemática: %.1f\n", aluno[contador].notaMath);
    printf("Nota de física: %.1f\n", aluno[contador].notaPhysics);
    printf("Média das notas: %.1f\n", aluno[contador].media);
    printf("\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <setlocale@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x5,-0x84(%rbp)
jge    130f <main+0x1df>
mov    -0x84(%rbp),%esi
add    $0x1,%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x84(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x84(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
add    $0xc,%rsi
lea    0xe75(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1213 <main+0xe3>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0xe8>
jmp    121d <main+0xed>
jmp    11a3 <main+0x73>
jmp    1222 <main+0xf2>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x84(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
add    $0x10,%rsi
lea    0xdf6(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0x10(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1292 <main+0x162>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1297 <main+0x167>
jmp    129c <main+0x16c>
jmp    1222 <main+0xf2>
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0xc(%rax),%xmm0
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
addss  0x10(%rax),%xmm0
movss  0xd36(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0x84(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  %xmm0,0x14(%rax)
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1161 <main+0x31>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x88(%rbp)
cmpl   $0x5,-0x88(%rbp)
jge    13fa <main+0x2ca>
mov    -0x88(%rbp),%esi
add    $0x1,%esi
movslq -0x88(%rbp),%rax
lea    -0x80(%rbp),%rdx
imul   $0x18,%rax,%rax
add    %rax,%rdx
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x88(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd3a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq -0x88(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0x10(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd2c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq -0x88(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movss  0x14(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd1a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1327 <main+0x1f7>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xeac(%rip),%rbp
lea    0xebb(%rip),%r12
lea    0xf5c(%rip),%r13
lea    0xeb0(%rip),%rbx
xor    %r14d,%r14d
jmp    11d7 <main+0x87>
nopw   0x0(%rax,%rax,1)
addss  (%r15),%xmm0
mulss  0xe57(%rip),%xmm0
mov    (%rsp),%rax
movss  %xmm0,0x24(%rsp,%rax,8)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%r14
cmp    $0x5,%r14
lea    0xe58(%rip),%rbp
je     12d0 <main+0x180>
lea    0x1(%r14),%rsi
lea    0xe31(%rip),%rdi
mov    %rsi,0x8(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%r14,%r14,2),%r14
lea    (%rsp,%r14,8),%rsi
add    $0x10,%rsi
lea    0xe25(%rip),%rdi
call   1070 <scanf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    (%rsp,%r14,8),%r15
add    $0x1c,%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %r14,(%rsp)
movss  0x1c(%rsp,%r14,8),%xmm0
movss  0xdca(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    126b <main+0x11b>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movss  (%r15),%xmm0
ucomiss 0xd97(%rip),%xmm0
ja     1240 <main+0xf0>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%rbp
lea    (%rsp,%rbp,8),%r14
add    $0x20,%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
movss  0x20(%rsp,%rbp,8),%xmm0
ucomiss 0xd67(%rip),%xmm0
jbe    11a0 <main+0x50>
nop
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
movss  (%r14),%xmm0
ucomiss 0xd37(%rip),%xmm0
ja     12a0 <main+0x150>
jmp    11a0 <main+0x50>
lea    0xddd(%rip),%rdi
call   1040 <puts@plt>
lea    0xd71(%rip),%r14
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd62(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd62(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd5e(%rip),%r13
mov    %r13,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd4b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x28(%rsp),%rdx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x34(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x38(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x3c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x40(%rsp),%rdx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x4c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x50(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x54(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x58(%rsp),%rdx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x64(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x68(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x6c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x70(%rsp),%rdx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x7c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x80(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x84(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.Aluno = type { [10 x i8], float, float, float }
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [19 x i8] c"Nome do aluno %d: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [22 x i8] c"Nota de matem\C3\A1tica: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [23 x i8] c"Apenas notas at\C3\A9 10.\0A\00"
@.str.6 = [18 x i8] c"Nota de f\C3\ADsica: \00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [52 x i8] c"\0A\0A------------Informa\C3\A7\C3\B5es dos Alunos------------\0A\00"
@.str.9 = [22 x i8] c"Nome do aluno %d: %s\0A\00"
@.str.10 = [27 x i8] c"Nota de matem\C3\A1tica: %.1f\0A\00"
@.str.11 = [23 x i8] c"Nota de f\C3\ADsica: %.1f\0A\00"
@.str.12 = [24 x i8] c"M\C3\A9dia das notas: %.1f\0A\00"
@.str.13 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x %struct.Aluno]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @LC_ALL
%6 = call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %77, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %80
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %15
%17 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %16, i32 0, i32 0
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %17, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %10, %38
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %23
%25 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %24, i32 0, i32 1
%26 = bitcast float* %25 to i8*
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %29
%31 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %30, i32 0, i32 1
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = fcmp ogt double %33, 1.000000e+01
br i1 %34, label %35, label %37
35: ; preds = %20
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %38
37: ; preds = %20
br label %39
38: ; preds = %35
br label %20
39: ; preds = %37
br label %40
40: ; preds = %39, %58
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %43
%45 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %44, i32 0, i32 2
%46 = bitcast float* %45 to i8*
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %49
%51 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %50, i32 0, i32 2
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = fcmp ogt double %53, 1.000000e+01
br i1 %54, label %55, label %57
55: ; preds = %40
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %58
57: ; preds = %40
br label %59
58: ; preds = %55
br label %40
59: ; preds = %57
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %61
%63 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %62, i32 0, i32 1
%64 = load float, float* %63
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %66
%68 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %67, i32 0, i32 2
%69 = load float, float* %68
%70 = fadd float %64, %69
%71 = fdiv float %70, 2.000000e+00
%72 = load i32, i32* %3
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %73
%75 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %74, i32 0, i32 3
store float %71, float* %75
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %77
77: ; preds = %59
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %3
br label %7
80: ; preds = %7
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %4
br label %82
82: ; preds = %116, %80
%83 = load i32, i32* %4
%84 = icmp slt i32 %83, 5
br i1 %84, label %85, label %119
85: ; preds = %82
%86 = load i32, i32* %4
%87 = add nsw i32 %86, 1
%88 = load i32, i32* %4
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %89
%91 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %90, i32 0, i32 0
%92 = getelementptr inbounds [10 x i8], [10 x i8]* %91, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %87, i8* %92)
%94 = load i32, i32* %4
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %95
%97 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %96, i32 0, i32 1
%98 = load float, float* %97
%99 = fpext float %98 to double
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %99)
%101 = load i32, i32* %4
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %102
%104 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %103, i32 0, i32 2
%105 = load float, float* %104
%106 = fpext float %105 to double
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %106)
%108 = load i32, i32* %4
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %2, i64 0, i64 %109
%111 = getelementptr inbounds %struct.Aluno, %struct.Aluno* %110, i32 0, i32 3
%112 = load float, float* %111
%113 = fpext float %112 to double
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %113)
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %116
116: ; preds = %85
%117 = load i32, i32* %4
%118 = add nsw i32 %117, 1
store i32 %118, i32* %4
br label %82
119: ; preds = %82
%120 = load i32, i32* %1
ret i32 %120
}

LLVM IR (-O2):
%struct.Aluno = type { [10 x i8], float, float, float }
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [19 x i8] c"Nome do aluno %d: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [22 x i8] c"Nota de matem\C3\A1tica: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.6 = [18 x i8] c"Nota de f\C3\ADsica: \00"
@.str.9 = [22 x i8] c"Nome do aluno %d: %s\0A\00"
@.str.10 = [27 x i8] c"Nota de matem\C3\A1tica: %.1f\0A\00"
@.str.11 = [23 x i8] c"Nota de f\C3\ADsica: %.1f\0A\00"
@.str.12 = [24 x i8] c"M\C3\A9dia das notas: %.1f\0A\00"
@str = [51 x i8] c"\0A\0A------------Informa\C3\A7\C3\B5es dos Alunos------------\00"
@str.14 = [2 x i8] c"\0A\00"
@str.16 = [22 x i8] c"Apenas notas at\C3\A9 10.\00"
define i32 @main() {
%1 = alloca [5 x %struct.Aluno]
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 0, i32 0, i64 0
br label %81
5: ; preds = %113
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 1, i8* %4)
%8 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 0, i32 1
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %10)
%12 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 0, i32 2
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %14)
%16 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 0, i32 3
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%21 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 1, i32 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 2, i8* %21)
%23 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 1, i32 1
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %25)
%27 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 1, i32 2
%28 = load float, float* %27
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %29)
%31 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 1, i32 3
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %33)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%36 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 2, i32 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 3, i8* %36)
%38 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 2, i32 1
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %40)
%42 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 2, i32 2
%43 = load float, float* %42
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %44)
%46 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 2, i32 3
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %48)
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%51 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 3, i32 0, i64 0
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 4, i8* %51)
%53 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 3, i32 1
%54 = load float, float* %53
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %55)
%57 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 3, i32 2
%58 = load float, float* %57
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %59)
%61 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 3, i32 3
%62 = load float, float* %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %63)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%66 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 4, i32 0, i64 0
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 5, i8* %66)
%68 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 4, i32 1
%69 = load float, float* %68
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), double %70)
%72 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 4, i32 2
%73 = load float, float* %72
%74 = fpext float %73 to double
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), double %74)
%76 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 4, i32 3
%77 = load float, float* %76
%78 = fpext float %77 to double
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), double %78)
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
ret i32 0
81: ; preds = %0, %113
%82 = phi i64 [ 0, %0 ], [ %83, %113 ]
%83 = add nuw nsw i64 %82, 1
%84 = trunc i64 %83 to i32
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 %82, i32 0, i64 0
%87 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %86)
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%89 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 %82, i32 1
%90 = bitcast float* %89 to i8*
%91 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %90)
%92 = load float, float* %89
%93 = fcmp ogt float %92, 1.000000e+01
br i1 %93, label %101, label %94
94: ; preds = %101, %81
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%96 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 %82, i32 2
%97 = bitcast float* %96 to i8*
%98 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %97)
%99 = load float, float* %96
%100 = fcmp ogt float %99, 1.000000e+01
br i1 %100, label %107, label %113
101: ; preds = %81, %101
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%104 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %90)
%105 = load float, float* %89
%106 = fcmp ogt float %105, 1.000000e+01
br i1 %106, label %101, label %94
107: ; preds = %94, %107
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%110 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %97)
%111 = load float, float* %96
%112 = fcmp ogt float %111, 1.000000e+01
br i1 %112, label %107, label %113
113: ; preds = %107, %94
%114 = phi float [ %99, %94 ], [ %111, %107 ]
%115 = load float, float* %89
%116 = fadd float %114, %115
%117 = fmul float %116, 5.000000e-01
%118 = getelementptr inbounds [5 x %struct.Aluno], [5 x %struct.Aluno]* %1, i64 0, i64 %82, i32 3
store float %117, float* %118
%119 = call i32 @putchar(i32 10)
%120 = icmp eq i64 %83, 5
br i1 %120, label %5, label %81
}