// File: /workspace/github_c_makefile_star2_O3/yhg926[P]public_kssd/global_basic.c
// Function: organize_infile_list
infile_tab_t * organize_infile_list(char* list_path, int fmt_ck)
{
  infile_tab_t *infile_stat = malloc(sizeof(infile_tab_t));
  int alloc_usize = 1024;
  infile_stat->organized_infile_tab = malloc( sizeof(infile_entry_t) * alloc_usize );
    struct stat path_stat;
    FILE * list;
    list = fopen(list_path,"r");
    if(!list) err(errno,"can't open file %s",list_path);
    char *buf = malloc( LMAX * sizeof(char));
    int file_num = 0;
  if(fmt_ck){
     while ( (fgets(buf,LMAX,list))!=NULL){
    while(isspace(*buf)) buf++;
       buf[strcspn(buf, "\r\n")] = 0;
       if( strlen(buf) < 1 )
         continue;
       if( strlen(buf) > PATHLEN )
         err(errno,"the input list: %s\n %dth line:  %s  has %lu characters exceed the maximal allowed length %d",
            list_path,file_num, buf,strlen(buf),PATHLEN);
       memset(&path_stat, 0, sizeof path_stat);
       stat(buf, &path_stat) ;
       if(!S_ISREG(path_stat.st_mode))
          err(errno,"%dth line: %s",file_num, buf);
    else if(!isOK_fmt_infile(buf,acpt_infile_fmt,ACPT_FMT_SZ)){
      printf ("isOK_fmt_infile(): wrong format %dth line: %s\nSupported format are:\n",file_num, buf);
      for(int i=0; acpt_infile_fmt[i]!=NULL;i++)
       printf(".%s ",acpt_infile_fmt[i]);
      printf("\n");
       err(errno,"program exit");
    }
    else {
     infile_stat->organized_infile_tab[file_num].fsize = path_stat.st_size;
     infile_stat->organized_infile_tab[file_num].fpath = malloc(PATHLEN * sizeof(char) );
     strcpy(infile_stat->organized_infile_tab[file_num].fpath, buf);
     file_num++;
     if( file_num >= alloc_usize){
         alloc_usize+=alloc_usize;
          infile_stat->organized_infile_tab
                = realloc(infile_stat->organized_infile_tab, sizeof(infile_entry_t) * alloc_usize );
         }
    }
     };
  }
  else{
   while ( (fgets(buf,LMAX,list))!=NULL){
        while(isspace(*buf)) buf++;
        buf[strcspn(buf, "\r\n")] = 0;
        if( strlen(buf) < 1 )
          continue;
        if( strlen(buf) > PATHLEN )
          err(errno,"the input list: %s\n %dth line:  %s  has %lu characters exceed the maximal allowed length %d",
            list_path,file_num, buf,strlen(buf),PATHLEN);
    infile_stat->organized_infile_tab[file_num].fsize = 0;
    infile_stat->organized_infile_tab[file_num].fpath = malloc(PATHLEN * sizeof(char) );
    strcpy(infile_stat->organized_infile_tab[file_num].fpath, buf);
    file_num++;
    if( file_num >= alloc_usize){
            alloc_usize+=alloc_usize;
            infile_stat->organized_infile_tab
                = realloc(infile_stat->organized_infile_tab, sizeof(infile_entry_t) * alloc_usize );
       }
  }
 }
    infile_stat->infile_num = file_num ;
    fclose(list);
  free(buf);
    return infile_stat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %esi, %ebp
movq %rdi, %rbx
movl $0x10, %edi
callq 0x3340
movq %rax, %r14
movl $0x4000, %edi           # imm = 0x4000
callq 0x3340
movq %r14, 0x10(%rsp)
movq %rax, 0x8(%r14)
leaq 0x579e(%rip), %rsi      # 0x16e0e
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x33a0
testq %rax, %rax
je 0x11a17
movq %rax, %r13
movl $0x1000, %edi           # imm = 0x1000
callq 0x3340
movq %rax, %rbx
testl %ebp, %ebp
je 0x118ac
movl $0x400, %r14d           # imm = 0x400
leaq 0x26(%rsp), %r12
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdx
callq 0x3290
testq %rax, %rax
je 0x11985
callq 0x34d0
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x116cf
movq %rbx, %rdi
leaq 0x66d6(%rip), %rsi      # 0x17dbe
callq 0x3260
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x3130
testq %rax, %rax
je 0x116ab
movq %rax, %r15
cmpq $0x101, %rax            # imm = 0x101
jae 0x11a4e
movl %r14d, 0x20(%rsp)
movq %rbp, 0x8(%rsp)
movl $0x90, %edx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x3210
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32e0
movl 0x48(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x11a31
movq %rbx, %rdi
callq 0x3130
movq %rax, %r15
xorl %ebp, %ebp
xorl %ecx, %ecx
leaq 0xc89e(%rip), %rax      # 0x1e000
movq (%rax,%rcx,8), %r14
movq %r14, %rdi
callq 0x3130
movl %r15d, %ecx
subl %eax, %ecx
movslq %ecx, %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
testb $0x1, %bpl
jne 0x11793
movl $0x1, %ecx
movb $0x1, %bpl
testl %eax, %eax
jne 0x1175b
testl %eax, %eax
movq %rbx, %r15
leaq 0xc0(%rsp), %rax
cmoveq %rax, %r15
movq 0xc7d5(%rip), %rdx      # 0x1df80
movq %r12, %rdi
leaq 0x3c17(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %r15, %rdi
callq 0x3130
leaq (%rax,%r15), %r14
movq %r12, %rdi
callq 0x3130
subq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x32b0
testl %eax, %eax
je 0x11843
movq $-0x1, %rbp
cmpq $0x5, %rbp
je 0x119b2
leaq 0xc786(%rip), %rax      # 0x1df80
movq 0x10(%rax,%rbp,8), %rdx
movq %r12, %rdi
leaq 0x3bc3(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %r15, %rdi
callq 0x3130
leaq (%rax,%r15), %r14
movq %r12, %rdi
callq 0x3130
subq %rax, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x32b0
incq %rbp
testl %eax, %eax
jne 0x117e9
cmpq $0x6, %rbp
jae 0x119b2
movq 0x60(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %r15
movq 0x8(%rsp), %rbp
movq %rbp, %r14
shlq $0x4, %r14
movq %rax, (%r15,%r14)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r15,%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3080
incq %rbp
movl 0x20(%rsp), %r14d
cmpl %ebp, %r14d
jg 0x116ab
addl %r14d, %r14d
movslq %r14d, %rsi
shlq $0x4, %rsi
movq %r15, %rdi
callq 0x3350
movq 0x10(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0x116ab
movl $0x400, %ebp            # imm = 0x400
xorl %r12d, %r12d
leaq 0x6503(%rip), %r14      # 0x17dbe
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdx
callq 0x3290
testq %rax, %rax
je 0x11982
callq 0x34d0
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x118df
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3260
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x3130
testq %rax, %rax
je 0x118bb
movq %rax, %r15
movl %ebp, 0x8(%rsp)
cmpq $0x101, %rax            # imm = 0x101
jae 0x11a6c
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r15
movq %r12, %rbp
shlq $0x4, %r12
movq $0x0, (%r15,%r12)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r15,%r12)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3080
incq %rbp
movq %rbp, %r12
movl 0x8(%rsp), %eax
cmpl %ebp, %eax
movl %eax, %ebp
jg 0x118bb
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x4, %rsi
movq %r15, %rdi
callq 0x3350
movq 0x10(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0x118bb
movq %r12, %rbp
movq 0x10(%rsp), %r14
movl %ebp, (%r14)
movq %r13, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3040
movq %r14, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6472(%rip), %rdi      # 0x17e2b
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3170
movq 0xc5b1(%rip), %rsi      # 0x1df80
testq %rsi, %rsi
je 0x119f8
leaq 0xc5ad(%rip), %r14      # 0x1df88
leaq 0x648e(%rip), %rbx      # 0x17e70
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3170
movq (%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x119e2
movl $0xa, %edi
callq 0x3050
callq 0x3060
movl (%rax), %edi
leaq 0x6465(%rip), %rsi      # 0x17e75
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x6386(%rip), %rsi      # 0x17dab
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x63de(%rip), %rsi      # 0x17e1d
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
movl $0x100, (%rsp)          # imm = 0x100
leaq 0x635e(%rip), %rsi      # 0x17dc1
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
jmp 0x11a89
callq 0x3060
movl (%rax), %edi
movl $0x100, (%rsp)          # imm = 0x100
leaq 0x6340(%rip), %rsi      # 0x17dc1
movq 0x18(%rsp), %rdx
movl %r12d, %ecx
movq %rbx, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x3330