// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/lib/file.c
// Function: load_multiple_fasta
char** load_multiple_fasta(FILE* f_in, size_t *k, size_t *n){

  int n_alloc = N_ALLOC;
	char **c_buffer = (char**) malloc(n_alloc*sizeof(char*));

	char *buf = NULL;
	size_t len = 0;

	getline(&buf, &len, f_in);// first sequence
	free(buf);

	size_t count=0;
	size_t i;
 	for(i=0; i<*k; i++){

		if(i!=count){
			*k = i;
			break;		
		}

		int c_alloc = 128;
		c_buffer[i] = (char*) malloc(c_alloc*sizeof(char));

		size_t p=0;
		len = 0; buf=NULL;
		while(getline(&buf, &len, f_in)!=-1){

			if(buf[0] == '>'){
				count++;
				break;
			}

			if(p+len>c_alloc){
				c_alloc += len+128;
				c_buffer[i] = (char*) realloc(c_buffer[i], sizeof(char) * c_alloc);
			}

			strcpy(&c_buffer[i][p], buf);
			p+=strlen(buf)-1;

			free(buf);
			buf=NULL; len=0;
		}

		free(buf);
		c_buffer[i][p] = 0;
		(*n) += p+1;

		if(i==n_alloc-1){
			n_alloc+=N_ALLOC;
      			c_buffer = (char**) realloc(c_buffer, n_alloc*sizeof(char*));
		}
	}

return c_buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x800, -0x1c(%rbp)     # imm = 0x800
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
callq 0xb6a0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2220
movq -0x30(%rbp), %rdi
callq 0xb810
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x4722
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x45a1
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x4722
movl $0x80, -0x4c(%rbp)
movslq -0x4c(%rbp), %rdi
shlq $0x0, %rdi
callq 0xb6a0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2220
cmpq $-0x1, %rax
je 0x46ae
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x4614
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x46ae
movq -0x58(%rbp), %rax
addq -0x38(%rbp), %rax
movslq -0x4c(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x4662
movq -0x38(%rbp), %rcx
addq $0x80, %rcx
movslq -0x4c(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x4c(%rbp), %rsi
shlq $0x0, %rsi
callq 0xb990
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq -0x58(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2060
movq -0x30(%rbp), %rdi
callq 0x20b0
subq $0x1, %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
callq 0xb810
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
jmp 0x45dc
movq -0x30(%rbp), %rdi
callq 0xb810
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x58(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x58(%rbp), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jne 0x470f
movl -0x1c(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
shlq $0x3, %rsi
callq 0xb990
movq %rax, -0x28(%rbp)
jmp 0x4711
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x4576
movq -0x28(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)