// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]egap/tools/lib/file.c
// Function: file_load_concat
unsigned char** file_load_concat(char* c_file, char *len_file, int k, int_t *n) {

  unsigned char **c_buffer = (unsigned char**) malloc(k*sizeof(unsigned char*));
  if(c_buffer==NULL) die("out of mem");

  FILE *f = fopen(c_file,"rb");
  if(f==NULL) {perror("sequence file missing"); fprintf(stderr, "<%s> ", c_file); die("file_load_concat");}
  FILE *fl = fopen(len_file,"rb");
  if(fl==NULL) {perror("sequence file missing"); fprintf(stderr, "<%s> ", len_file); die("file_load_concat");}
  
  int i;
  for(i=0;i<k;i++) {
    uint32_t size;
    size_t r = fread(&size, 4, 1, fl);// assume big endian!
    if(r!=1) die("len file too short");
    c_buffer[i] = malloc((size+1)*sizeof(char));
    if(!c_buffer[i]) die("out of mem");
    r = fread(c_buffer[i], 1, size, f);
    if(r!=size) die("concat file too short");
    c_buffer[i][size] = 0;
    *n += size+1;
  }
  fclose(fl);
  fclose(f);
  return c_buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movslq -0x14(%rbp), %rdi
shlq $0x3, %rdi
callq 0x10960
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x639b
leaq 0xb73c(%rip), %rdi      # 0x11ad2
callq 0x4230
movq -0x8(%rbp), %rdi
leaq 0xb2f5(%rip), %rsi      # 0x1169b
callq 0x2200
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x63ea
leaq 0xb720(%rip), %rdi      # 0x11add
callq 0x2210
movq 0xec2f(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0xb71c(%rip), %rsi      # 0x11af3
movb $0x0, %al
callq 0x2190
leaq 0xb714(%rip), %rdi      # 0x11af9
callq 0x4230
movq -0x10(%rbp), %rdi
leaq 0xb2a6(%rip), %rsi      # 0x1169b
callq 0x2200
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x6439
leaq 0xb6d1(%rip), %rdi      # 0x11add
callq 0x2210
movq 0xebe0(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xb6cd(%rip), %rsi      # 0x11af3
movb $0x0, %al
callq 0x2190
leaq 0xb6c5(%rip), %rdi      # 0x11af9
callq 0x4230
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x6527
movq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2090
movq %rax, -0x48(%rbp)
cmpq $0x1, -0x48(%rbp)
je 0x647a
leaq 0xb695(%rip), %rdi      # 0x11b0a
callq 0x4230
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x10960
movq %rax, %rdx
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x64b7
leaq 0xb620(%rip), %rdi      # 0x11ad2
callq 0x4230
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x40(%rbp), %eax
movl %eax, %edx
movq -0x30(%rbp), %rcx
movl $0x1, %esi
callq 0x2090
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl -0x40(%rbp), %ecx
cmpq %rcx, %rax
je 0x64f2
leaq 0xb630(%rip), %rdi      # 0x11b1d
callq 0x4230
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x40(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6440
movq -0x38(%rbp), %rdi
callq 0x20c0
movq -0x30(%rbp), %rdi
callq 0x20c0
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)