#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 */
short GetQtdVariaveis();
float atof(char *);
int /*<<< orphan*/ printf(char *, ...);
char *strtok_r(char *, char *, char **);
void ProcessaLinhaBD(char s[], int indice, float bancoDeDados[][5]) {
  char *valorPtr, *saveptr;
  short countValor = 0;
  valorPtr = strtok_r(s, "\t", &saveptr);
  while (countValor <= GetQtdVariaveis()) {
    bancoDeDados[indice][countValor++] = atof(valorPtr);
    valorPtr = strtok_r(NULL, "\t", &saveptr);
    printf("%f\t", bancoDeDados[indice][countValor - 1]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<ProcessaLinhaBD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movw   $0x0,-0x2a(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <strtok_r@plt>
mov    %rax,-0x20(%rbp)
movswl -0x2a(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1040 <GetQtdVariaveis@plt>
mov    %ax,%cx
mov    -0x30(%rbp),%eax
movswl %cx,%ecx
cmp    %ecx,%eax
jg     120d <ProcessaLinhaBD+0xcd>
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x2a(%rbp),%cx
mov    %cx,%dx
add    $0x1,%dx
mov    %dx,-0x2a(%rbp)
movswq %cx,%rcx
movss  %xmm0,(%rax,%rcx,4)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe37(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <strtok_r@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movswl -0x2a(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdff(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1171 <ProcessaLinhaBD+0x31>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessaLinhaBD>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
lea    0xe9b(%rip),%rsi
mov    %rsp,%rdx
call   1070 <strtok_r@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <GetQtdVariaveis@plt>
test   %ax,%ax
js     11f4 <ProcessaLinhaBD+0xa4>
movslq %ebp,%rax
lea    (%rax,%rax,4),%rax
lea    (%r14,%rax,4),%r13
mov    %rsp,%r15
lea    0xe6d(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <atof@plt>
lea    0x1(%rbp),%r14d
movswq %bp,%rax
movss  %xmm0,0x0(%r13,%rax,4)
xor    %edi,%edi
lea    0xe42(%rip),%rsi
mov    %r15,%rdx
call   1070 <strtok_r@plt>
mov    %rax,%rbx
movswq %r14w,%rax
movss  -0x4(%r13,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <GetQtdVariaveis@plt>
mov    %r14d,%ebp
cmp    %ax,%r14w
jle    11a0 <ProcessaLinhaBD+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [4 x i8] c"%f\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @ProcessaLinhaBD(i8* %0, i32 %1, [5 x float]* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [5 x float]*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store [5 x float]* %2, [5 x float]** %6
store i16 0, i16* %9
%10 = load i8*, i8** %4
%11 = call i8* @strtok_r(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8)
store i8* %11, i8** %7
br label %12
12: ; preds = %18, %3
%13 = load i16, i16* %9
%14 = sext i16 %13 to i32
%15 = call signext i16 (...) @GetQtdVariaveis()
%16 = sext i16 %15 to i32
%17 = icmp sle i32 %14, %16
br i1 %17, label %18, label %42
18: ; preds = %12
%19 = load i8*, i8** %7
%20 = call float @atof(i8* %19)
%21 = load [5 x float]*, [5 x float]** %6
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x float], [5 x float]* %21, i64 %23
%25 = load i16, i16* %9
%26 = add i16 %25, 1
store i16 %26, i16* %9
%27 = sext i16 %25 to i64
%28 = getelementptr inbounds [5 x float], [5 x float]* %24, i64 0, i64 %27
store float %20, float* %28
%29 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8)
store i8* %29, i8** %7
%30 = load [5 x float]*, [5 x float]** %6
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [5 x float], [5 x float]* %30, i64 %32
%34 = load i16, i16* %9
%35 = sext i16 %34 to i32
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [5 x float], [5 x float]* %33, i64 0, i64 %37
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %40)
br label %12
42: ; preds = %12
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@.str.1 = [4 x i8] c"%f\09\00"
define void @ProcessaLinhaBD(i8* %0, i32 %1, [5 x float]* nocapture %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i8* @strtok_r(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4)
%7 = call signext i16 (...) @GetQtdVariaveis()
%8 = icmp slt i16 %7, 0
br i1 %8, label %27, label %9
9: ; preds = %3
%10 = sext i32 %1 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i16 [ 0, %9 ], [ %15, %11 ]
%13 = phi i8* [ %6, %9 ], [ %18, %11 ]
%14 = call float @atof(i8* %13)
%15 = add i16 %12, 1
%16 = sext i16 %12 to i64
%17 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 %10, i64 %16
store float %14, float* %17
%18 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4)
%19 = sext i16 %15 to i64
%20 = add nsw i64 %19, -1
%21 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 %10, i64 %20
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = call signext i16 (...) @GetQtdVariaveis()
%26 = icmp sgt i16 %15, %25
br i1 %26, label %27, label %11
27: ; preds = %11, %3
%28 = call i32 @putchar(i32 10)
ret void
}