#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ LeVariaveis(char *);
int /*<<< orphan*/ ProcessaLinhaBD(char *, int /*<<< orphan*/, float **);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int LeBancoDeDados(char nomeArquivo[], float bancoDeDados[][5]) {
  FILE *arq = fopen(nomeArquivo, "r");
  char linha[200];
  fgets(linha, 200, arq);
  int dataBaseSize = 0;
  printf("Banco de dados: \n");
  LeVariaveis(linha);
  short count = 0;
  while (fgets(linha, 200, arq) != NULL) {
    ProcessaLinhaBD(linha, count++, bancoDeDados);
    dataBaseSize++;
  }
  return dataBaseSize;
}


x86 assembly (clang, -O0):
<LeBancoDeDados>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xc8,%esi
call   1060 <fgets@plt>
movl   $0x0,-0xe4(%rbp)
lea    0xe65(%rip),%rdi
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <LeVariaveis@plt>
movw   $0x0,-0xe6(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xc8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1212 <LeBancoDeDados+0xc2>
lea    -0xe0(%rbp),%rdi
mov    -0xe6(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0xe6(%rbp)
movswl %ax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ProcessaLinhaBD@plt>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    11b7 <LeBancoDeDados+0x67>
mov    -0xe4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeBancoDeDados>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%r14
lea    0xe97(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <LeVariaveis@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     11f0 <LeBancoDeDados+0xa0>
xor    %ebx,%ebx
mov    %rsp,%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
mov    %ebx,%esi
sar    $0x10,%esi
mov    %r12,%rdi
mov    %r14,%rdx
call   1040 <ProcessaLinhaBD@plt>
mov    %r12,%rdi
mov    $0xc8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
add    $0x10000,%ebx
test   %rax,%rax
jne    11c0 <LeBancoDeDados+0x70>
jmp    11f2 <LeBancoDeDados+0xa2>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"Banco de dados: \0A\00"
define i32 @LeBancoDeDados(i8* %0, [5 x float]* %1) {
%3 = alloca i8*
%4 = alloca [5 x float]*
%5 = alloca i32*
%6 = alloca [200 x i8]
%7 = alloca i32
%8 = alloca i16
store i8* %0, i8** %3
store [5 x float]* %1, [5 x float]** %4
%9 = load i8*, i8** %3
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %5
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%12 = load i32*, i32** %5
%13 = call i32* @fgets(i8* %11, i32 200, i32* %12)
store i32 0, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%16 = call i32 @LeVariaveis(i8* %15)
store i16 0, i16* %8
br label %17
17: ; preds = %22, %2
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%19 = load i32*, i32** %5
%20 = call i32* @fgets(i8* %18, i32 200, i32* %19)
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%24 = load i16, i16* %8
%25 = add i16 %24, 1
store i16 %25, i16* %8
%26 = sext i16 %24 to i32
%27 = load [5 x float]*, [5 x float]** %4
%28 = bitcast [5 x float]* %27 to float**
%29 = call i32 @ProcessaLinhaBD(i8* %23, i32 %26, float** %28)
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %17
32: ; preds = %17
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@str = [17 x i8] c"Banco de dados: \00"
define i32 @LeBancoDeDados(i8* nocapture %0, [5 x float]* %1) {
%3 = alloca [200 x i8]
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = call i32* @fgets(i8* %5, i32 200, i32* %4)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = call i32 @LeVariaveis(i8* %5)
%9 = call i32* @fgets(i8* %5, i32 200, i32* %4)
%10 = icmp eq i32* %9, null
br i1 %10, label %21, label %11
11: ; preds = %2
%12 = bitcast [5 x float]* %1 to float**
br label %13
13: ; preds = %11, %13
%14 = phi i32 [ 0, %11 ], [ %15, %13 ]
%15 = add nuw nsw i32 %14, 1
%16 = shl i32 %14, 16
%17 = ashr exact i32 %16, 16
%18 = call i32 @ProcessaLinhaBD(i8* %5, i32 %17, float** %12)
%19 = call i32* @fgets(i8* %5, i32 200, i32* %4)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %13
21: ; preds = %13, %2
%22 = phi i32 [ 0, %2 ], [ %15, %13 ]
ret i32 %22
}