#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 argc, char const *argv[]) {
  int i, j, quantidadeDeDisciplinas;
  for (i = 0; i < 45; i++) {
    printf("Informe a quantidade de disciplinas: ");
    scanf("%d", &quantidadeDeDisciplinas);
    float notas[quantidadeDeDisciplinas];
    for (j = 0; j < quantidadeDeDisciplinas; j++) {
      printf("Nota %d", j + 1);
      scanf("%f", notas[j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2d,-0x14(%rbp)
jge    11fb <main+0xdb>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x39(%rbp)
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
lea    0xec9(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e6 <main+0xc6>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1199 <main+0x79>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeee(%rip),%r13
lea    0xeef(%rip),%rbx
xor    %eax,%eax
jmp    1163 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x38(%rbp),%rsp
mov    -0x30(%rbp),%eax
add    $0x1,%eax
cmp    $0x2d,%eax
je     11e6 <main+0xc6>
mov    %eax,-0x30(%rbp)
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1150 <main+0x30>
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    0x1(%r14),%r15
mov    %r13,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%r12,%r14,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <scanf@plt>
movslq -0x2c(%rbp),%rax
mov    %r15,%r14
cmp    %rax,%r15
jl     11b0 <main+0x90>
jmp    1150 <main+0x30>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Informe a quantidade de disciplinas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Nota %d\00"
@.str.3 = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %11
11: ; preds = %40, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 45
br i1 %13, label %14, label %43
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%17 = load i32, i32* %8
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %9
%20 = alloca float, i64 %18
store i64 %18, i64* %10
store i32 0, i32* %7
br label %21
21: ; preds = %35, %14
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %38
25: ; preds = %21
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %20, i64 %30
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %33)
br label %35
35: ; preds = %25
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %21
38: ; preds = %21
%39 = load i8*, i8** %9
br label %40
40: ; preds = %38
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %11
43: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Informe a quantidade de disciplinas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Nota %d\00"
@.str.3 = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %2, %27
%6 = phi i32 [ 0, %2 ], [ %28, %27 ]
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
%12 = alloca float, i64 %10
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %5, %15
%16 = phi i64 [ %17, %15 ], [ 0, %5 ]
%17 = add nuw nsw i64 %16, 1
%18 = trunc i64 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds float, float* %12, i64 %16
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %22)
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %17, %25
br i1 %26, label %15, label %27
27: ; preds = %15, %5
%28 = add nuw nsw i32 %6, 1
%29 = icmp eq i32 %28, 45
br i1 %29, label %30, label %5
30: ; preds = %27
ret i32 0
}