// File: /workspace/github_c_makefile_star2_O3/yhg926[P]public_kssd/global_basic.c
// Function: organize_infile_frm_arg
infile_tab_t * organize_infile_frm_arg (int num_remaining_args, char ** remaining_args,int fmt_ck)
{
 infile_tab_t *infile_stat = malloc(sizeof(infile_tab_t));
 int file_num = 0;
 struct stat path_stat;
 DIR *dirp;
 struct dirent *dirent;
 char fullpath[PATHLEN];
 int alloc_usize = 1024;
 infile_stat->organized_infile_tab = malloc( sizeof(infile_entry_t) * alloc_usize );
if(fmt_ck) {
 for(int i=0;i<num_remaining_args;i++){
  stat(remaining_args[i],&path_stat);
  if( S_ISDIR(path_stat.st_mode)){
    if (( dirp = opendir(remaining_args[i]) ) == NULL)
     err(errno, "%dth argument: can't open %s",i+1, remaining_args[i] );
    while ((dirent = readdir(dirp)) != NULL){
     if(strlen(remaining_args[i]) + strlen(dirent->d_name) + 1 >PATHLEN)
      err(errno,"path: %s/%s exceed maximal path lenth %d",remaining_args[i], dirent->d_name,PATHLEN);
     sprintf(fullpath, "%s/%s", remaining_args[i], dirent->d_name);
     stat(fullpath,&path_stat);
        if(isOK_fmt_infile(fullpath,acpt_infile_fmt,ACPT_FMT_SZ)){
      infile_stat->organized_infile_tab[file_num].fsize = path_stat.st_size;
      infile_stat->organized_infile_tab[file_num].fpath = malloc(PATHLEN * sizeof(char));
      sprintf(infile_stat->organized_infile_tab[file_num].fpath, "%s/%s", remaining_args[i], dirent->d_name);
      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 );
      }
     }
    }
    closedir(dirp);
  }
  else if(isOK_fmt_infile(remaining_args[i],acpt_infile_fmt,ACPT_FMT_SZ)){
   stat(remaining_args[i],&path_stat);
   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, remaining_args[i]);
   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{
   printf ("wrong format %dth argument: %s\nSupported format are:\n",i+1,remaining_args[i]);
      for(int i=0; acpt_infile_fmt[i]!=NULL;i++)
       printf(".%s ",acpt_infile_fmt[i]);
      printf("\n");
      err(errno,"program exit");
  }
 };
}
else{
 for(int i=0;i<num_remaining_args;i++){
  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, remaining_args[i]);
  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 ;
 return infile_stat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movl %edx, %ebp
movq %rsi, 0x18(%rsp)
movl %edi, %r15d
movl $0x10, %edi
callq 0x3340
movq %rax, %r14
movq %rax, 0x20(%rsp)
movl $0x4000, %edi           # imm = 0x4000
callq 0x3340
movq %rax, 0x8(%r14)
testl %ebp, %ebp
je 0x11f09
testl %r15d, %r15d
jle 0x11f86
movl %r15d, %eax
movq %rax, 0x38(%rsp)
movl $0x400, %ebx            # imm = 0x400
leaq 0xc50a(%rip), %r15      # 0x1e000
leaq 0x46(%rsp), %r14
xorl %r13d, %r13d
movq $0x0, 0x10(%rsp)
movl %ebx, 0xc(%rsp)
movq 0x18(%rsp), %rbx
movq (%rbx,%r13,8), %rdi
leaq 0x50(%rsp), %rsi
callq 0x32e0
movl 0x68(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movq (%rbx,%r13,8), %rbx
cmpl $0x4000, %eax           # imm = 0x4000
movq %r13, 0x28(%rsp)
jne 0x11d7e
movq %rbx, %rdi
callq 0x3110
testq %rax, %rax
je 0x1203c
movq %rax, %r12
movq %rax, %rdi
callq 0x3320
movq %rax, %rbx
testq %rax, %rax
movq %r12, 0x30(%rsp)
je 0x11d6d
movq 0x18(%rsp), %rax
movq (%rax,%r13,8), %rbp
movq %rbp, %rdi
callq 0x3130
movq %rax, %r13
addq $0x13, %rbx
movq %rbx, %rdi
callq 0x3130
addq %r13, %rax
addq $-0x100, %rax
cmpq $-0x102, %rax           # imm = 0xFEFE
jbe 0x1201b
xorl %r12d, %r12d
leaq 0xe0(%rsp), %r13
movq %r13, %rdi
leaq 0x382f(%rip), %rsi      # 0x153e3
movq %rbp, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3430
movq %r13, %rdi
leaq 0x50(%rsp), %rsi
callq 0x32e0
movq %r13, %rdi
callq 0x3130
movq %rax, %rbp
xorl %ecx, %ecx
movq (%r15,%rcx,8), %r13
movq %r13, %rdi
callq 0x3130
movl %ebp, %ecx
subl %eax, %ecx
movslq %ecx, %rax
leaq (%rsp,%rax), %rdi
addq $0xe0, %rdi
movq %r13, %rsi
callq 0x32b0
testb $0x1, %r12b
jne 0x11c13
movl $0x1, %ecx
movb $0x1, %r12b
testl %eax, %eax
jne 0x11bdb
testl %eax, %eax
leaq 0xe0(%rsp), %rbp
leaq 0x1e0(%rsp), %rax
cmoveq %rax, %rbp
movq 0xc350(%rip), %rdx      # 0x1df80
movq %r14, %rdi
leaq 0x3792(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %rbp, %rdi
callq 0x3130
leaq (%rax,%rbp), %r13
movq %r14, %rdi
callq 0x3130
subq %rax, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x32b0
testl %eax, %eax
je 0x11cc8
movq $-0x1, %r12
cmpq $0x5, %r12
je 0x11d4f
leaq 0xc301(%rip), %rax      # 0x1df80
movq 0x10(%rax,%r12,8), %rdx
movq %r14, %rdi
leaq 0x373e(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %rbp, %rdi
callq 0x3130
leaq (%rax,%rbp), %r13
movq %r14, %rdi
callq 0x3130
subq %rax, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x32b0
incq %r12
testl %eax, %eax
jne 0x11c6e
cmpq $0x6, %r12
jae 0x11d4f
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rbp
movq 0x10(%rsp), %r12
movslq %r12d, %r12
movq %r12, %r13
shlq $0x4, %r13
movq %rax, (%rbp,%r13)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%rbp,%r13)
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r13
movq (%rcx,%r13,8), %rdx
movq %rax, %rdi
leaq 0x36cf(%rip), %rsi      # 0x153e3
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3430
incl %r12d
movq %r12, 0x10(%rsp)
movl 0xc(%rsp), %eax
cmpl %eax, %r12d
jl 0x11d54
addl %eax, %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
shlq $0x4, %rsi
movq %rbp, %rdi
callq 0x3350
movq 0x20(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0x11d54
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x3320
movq %rax, %rbx
testq %rax, %rax
jne 0x11b6a
movq %r12, %rdi
callq 0x3240
movl 0xc(%rsp), %ebx
jmp 0x11ef6
movq %rbx, %rdi
callq 0x3130
movq %rax, %r13
xorl %r12d, %r12d
xorl %ecx, %ecx
movq (%r15,%rcx,8), %rbp
movq %rbp, %rdi
callq 0x3130
movl %r13d, %ecx
subl %eax, %ecx
movslq %ecx, %rdi
addq %rbx, %rdi
movq %rbp, %rsi
callq 0x32b0
testb $0x1, %r12b
jne 0x11dbf
movl $0x1, %ecx
movb $0x1, %r12b
testl %eax, %eax
jne 0x11d8e
testl %eax, %eax
leaq 0x1e0(%rsp), %rax
cmoveq %rax, %rbx
movq 0xc1ac(%rip), %rdx      # 0x1df80
movq %r14, %rdi
leaq 0x35ee(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %rbx, %rdi
callq 0x3130
leaq (%rax,%rbx), %r13
movq %r14, %rdi
callq 0x3130
subq %rax, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x32b0
testl %eax, %eax
je 0x11e6c
movq $-0x1, %r12
cmpq $0x5, %r12
je 0x11fad
leaq 0xc15d(%rip), %rax      # 0x1df80
movq 0x10(%rax,%r12,8), %rdx
movq %r14, %rdi
leaq 0x359a(%rip), %rsi      # 0x153cc
xorl %eax, %eax
callq 0x3430
movq %rbx, %rdi
callq 0x3130
leaq (%rax,%rbx), %r13
movq %r14, %rdi
callq 0x3130
subq %rax, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x32b0
incq %r12
testl %eax, %eax
jne 0x11e12
cmpq $0x6, %r12
jae 0x11fad
movq 0x28(%rsp), %r13
movq 0x18(%rsp), %rax
movq (%rax,%r13,8), %rdi
leaq 0x50(%rsp), %rsi
callq 0x32e0
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rbx
movq 0x10(%rsp), %r12
movslq %r12d, %r12
movq %r12, %rbp
shlq $0x4, %rbp
movq %rax, (%rbx,%rbp)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%rbx,%rbp)
movq %rbx, %rbp
movq 0x18(%rsp), %rcx
movq (%rcx,%r13,8), %rsi
movq %rax, %rdi
callq 0x3080
incl %r12d
movq %r12, 0x10(%rsp)
movl 0xc(%rsp), %ebx
cmpl %ebx, %r12d
jl 0x11ef6
addl %ebx, %ebx
movslq %ebx, %rsi
shlq $0x4, %rsi
movq %rbp, %rdi
callq 0x3350
movq 0x20(%rsp), %rcx
movq %rax, 0x8(%rcx)
incq %r13
cmpq 0x38(%rsp), %r13
jne 0x11b07
jmp 0x11f8f
testl %r15d, %r15d
jle 0x11f86
movq %rax, %rbx
movq %r15, 0x10(%rsp)
movl %r15d, %r14d
shlq $0x3, %r14
movl $0x400, %ebp            # imm = 0x400
movl $0x1, %r15d
xorl %r12d, %r12d
movq $0x0, (%rbx,%r12,2)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%rbx,%r12,2)
movq 0x18(%rsp), %rcx
movq (%rcx,%r12), %rsi
movq %rax, %rdi
callq 0x3080
movslq %ebp, %rax
cmpq %rax, %r15
jl 0x11f6f
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x4, %rsi
movq %rbx, %rdi
callq 0x3350
movq %rax, %rbx
addq $0x8, %r12
incq %r15
cmpq %r12, %r14
jne 0x11f2b
movq 0x20(%rsp), %rax
movq %rbx, 0x8(%rax)
jmp 0x11f8f
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rcx
leal 0x1(%rcx), %esi
movq 0x18(%rsp), %rax
movq (%rax,%rcx,8), %rdx
leaq 0x5f03(%rip), %rdi      # 0x17ec8
xorl %eax, %eax
callq 0x3170
movq 0xbfad(%rip), %rsi      # 0x1df80
testq %rsi, %rsi
je 0x11ffc
leaq 0xbfa9(%rip), %r14      # 0x1df88
leaq 0x5e8a(%rip), %rbx      # 0x17e70
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3170
movq (%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x11fe6
movl $0xa, %edi
callq 0x3050
callq 0x3060
movl (%rax), %edi
leaq 0x5e61(%rip), %rsi      # 0x17e75
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x5e76(%rip), %rsi      # 0x17e9f
movq %rbp, %rdx
movq %rbx, %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leal 0x1(%r13), %edx
movq 0x18(%rsp), %rax
movq (%rax,%r13,8), %rcx
leaq 0x5e2b(%rip), %rsi      # 0x17e82
xorl %eax, %eax
callq 0x3330