// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl $0x10, %edi
callq 0x3340
movq %rax, %r15
movl $0x4000, %edi           # imm = 0x4000
callq 0x3340
movq %rax, 0x8(%r15)
leaq 0x5aff(%rip), %rsi      # 0x16dbe
movq %rbx, %rdi
callq 0x33a0
testq %rax, %rax
je 0x11510
movq %rax, %r13
movq %rbx, 0x18(%rsp)
movl $0x1000, %edi           # imm = 0x1000
callq 0x3340
movq %rax, %rbx
testl %ebp, %ebp
movq %r15, 0x20(%rsp)
je 0x11416
movl $0x400, 0x14(%rsp)      # imm = 0x400
xorl %r12d, %r12d
leaq 0x6a8a(%rip), %rbp      # 0x17d8e
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdx
callq 0x3290
testq %rax, %rax
je 0x114e8
callq 0x34d0
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x11328
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3260
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x3130
testq %rax, %rax
je 0x11304
movq %rax, %r14
cmpq $0x101, %rax            # imm = 0x101
jae 0x11528
movl $0x90, %edx
leaq 0x28(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x3210
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32e0
movl 0x40(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x11552
movq %rbx, %rdi
leaq 0xcbdf(%rip), %rsi      # 0x1df80
movl $0x7, %edx
callq 0x115d0
testl %eax, %eax
je 0x1156d
movq 0x58(%rsp), %rax
movq 0x8(%r15), %r14
movq %r12, %r15
shlq $0x4, %r15
movq %rax, (%r14,%r15)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r14,%r15)
movq 0x20(%rsp), %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3080
incq %r12
cmpl %r12d, 0x14(%rsp)
jg 0x11304
movl 0x14(%rsp), %eax
addl %eax, %eax
movl %eax, 0x14(%rsp)
movslq %eax, %rsi
shlq $0x4, %rsi
movq %r14, %rdi
callq 0x3350
movq %rax, 0x8(%r15)
jmp 0x11304
movl $0x400, 0x14(%rsp)      # imm = 0x400
xorl %r12d, %r12d
leaq 0x6966(%rip), %rbp      # 0x17d8e
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdx
callq 0x3290
testq %rax, %rax
je 0x114e8
callq 0x34d0
movq (%rax), %rax
decq %rbx
movsbq 0x1(%rbx), %rcx
incq %rbx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x1144c
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3260
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x3130
testq %rax, %rax
je 0x11428
movq %rax, %r14
cmpq $0x101, %rax            # imm = 0x101
jae 0x11528
movq 0x8(%r15), %r14
movq %r12, %r15
shlq $0x4, %r15
movq $0x0, (%r14,%r15)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r14,%r15)
movq 0x20(%rsp), %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3080
incq %r12
cmpl %r12d, 0x14(%rsp)
jg 0x11428
movl 0x14(%rsp), %eax
addl %eax, %eax
movl %eax, 0x14(%rsp)
movslq %eax, %rsi
shlq $0x4, %rsi
movq %r14, %rdi
callq 0x3350
movq %rax, 0x8(%r15)
jmp 0x11428
movl %r12d, (%r15)
movq %r13, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3040
movq %r15, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
leaq 0x685d(%rip), %rsi      # 0x17d7b
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
movl $0x100, (%rsp)          # imm = 0x100
leaq 0x6854(%rip), %rsi      # 0x17d91
movq 0x18(%rsp), %rdx
movl %r12d, %ecx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x688d(%rip), %rsi      # 0x17ded
movl %r12d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3330
leaq 0x6887(%rip), %rdi      # 0x17dfb
movl %r12d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3170
movq 0xc9f8(%rip), %rsi      # 0x1df80
testq %rsi, %rsi
je 0x115b1
leaq 0xc9f4(%rip), %r14      # 0x1df88
leaq 0x68a5(%rip), %rbx      # 0x17e40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3170
movq (%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x1159b
movl $0xa, %edi
callq 0x3050
callq 0x3060
movl (%rax), %edi
leaq 0x687c(%rip), %rsi      # 0x17e45
xorl %eax, %eax
callq 0x3330