// File: /workspace/github_c_makefile_star2_O1/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 $0x1c8, %rsp            # imm = 0x1C8
movl %edx, %r14d
movq %rsi, 0x10(%rsp)
movl %edi, %ebp
movl $0x10, %edi
callq 0x3340
movq %rax, %rbx
movl $0x4000, %edi           # imm = 0x4000
callq 0x3340
movq %rbx, (%rsp)
movq %rax, 0x8(%rbx)
testl %r14d, %r14d
je 0x119d4
testl %ebp, %ebp
jle 0x11a50
movl %ebp, %eax
movq %rax, 0x28(%rsp)
movl $0x400, %r15d           # imm = 0x400
leaq 0x3c1a(%rip), %rbp      # 0x15393
xorl %r13d, %r13d
xorl %eax, %eax
movq (%rsp), %rbx
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %r14
movq (%r14,%r13,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x32e0
movl 0x48(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movq (%r14,%r13,8), %rdi
cmpl $0x4000, %eax           # imm = 0x4000
movl %r15d, 0xc(%rsp)
jne 0x11918
callq 0x3110
testq %rax, %rax
je 0x11a8e
movq %rax, %rbx
movq %rax, %rdi
callq 0x3320
movq %rax, %r15
testq %rax, %rax
movq %rbx, 0x20(%rsp)
je 0x118fd
movq 0x10(%rsp), %rax
movq %r13, %rbx
movq (%rax,%r13,8), %r14
movq %r14, %rdi
callq 0x3130
movq %rax, %r12
addq $0x13, %r15
movq %r15, %rdi
callq 0x3130
addq %r12, %rax
addq $-0x100, %rax
cmpq $-0x102, %rax           # imm = 0xFEFE
jbe 0x11a6d
leaq 0xc0(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
leaq 0x30(%rsp), %rsi
callq 0x32e0
movq %r12, %rdi
leaq 0xc733(%rip), %rsi      # 0x1df80
movl $0x7, %edx
callq 0x115d0
testl %eax, %eax
je 0x118e1
movq 0x60(%rsp), %rax
movq (%rsp), %rcx
movq 0x8(%rcx), %r14
movq 0x18(%rsp), %r12
movslq %r12d, %r12
movq %r12, %r13
shlq $0x4, %r13
movq %rax, (%r14,%r13)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r14,%r13)
movq 0x10(%rsp), %rcx
movq %rbx, %r13
movq (%rcx,%rbx,8), %rdx
movq %rax, %rdi
movq %rbp, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x3430
incl %r12d
movl 0xc(%rsp), %eax
movq %r12, 0x18(%rsp)
cmpl %eax, %r12d
jl 0x118d8
addl %eax, %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
shlq $0x4, %rsi
movq %r14, %rdi
callq 0x3350
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0x3ab4(%rip), %rbp      # 0x15393
jmp 0x118e4
movq %rbx, %r13
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x3320
movq %rax, %r15
testq %rax, %rax
jne 0x117e3
movq %rbx, %rdi
callq 0x3240
movq (%rsp), %rbx
movl 0xc(%rsp), %r15d
movq 0x18(%rsp), %rax
jmp 0x119c1
leaq 0xc661(%rip), %rsi      # 0x1df80
movl $0x7, %edx
callq 0x115d0
testl %eax, %eax
je 0x11ab0
movq 0x10(%rsp), %r12
movq (%r12,%r13,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x32e0
movq 0x60(%rsp), %rax
movq 0x8(%rbx), %r14
movq 0x18(%rsp), %rbp
movslq %ebp, %rbp
movq %rbp, %r15
shlq $0x4, %r15
movq %rax, (%r14,%r15)
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, 0x8(%r14,%r15)
movq (%r12,%r13,8), %rsi
movq %rax, %rdi
callq 0x3080
movq %rbp, %rax
incl %eax
movl 0xc(%rsp), %r15d
cmpl %r15d, %eax
jge 0x11997
leaq 0x3a02(%rip), %rbp      # 0x15393
movq (%rsp), %rbx
jmp 0x119c1
addl %r15d, %r15d
movslq %r15d, %rsi
shlq $0x4, %rsi
movq %r14, %rdi
movq %rax, %rbx
callq 0x3350
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
movq %rbx, %rax
leaq 0x39d5(%rip), %rbp      # 0x15393
movq %rcx, %rbx
incq %r13
cmpq 0x28(%rsp), %r13
jne 0x11782
jmp 0x11a56
testl %ebp, %ebp
jle 0x11a50
movq (%rsp), %rax
movq 0x8(%rax), %r15
movl %ebp, %r14d
movl $0x400, %ebp            # imm = 0x400
movl $0x8, %r12d
xorl %eax, %eax
movq $0x0, -0x8(%r15,%r12)
movl $0x100, %edi            # imm = 0x100
movq %rax, %rbx
callq 0x3340
movq %rax, (%r15,%r12)
movq 0x10(%rsp), %rcx
movq (%rcx,%rbx,8), %rsi
movq %rax, %rdi
callq 0x3080
incq %rbx
movslq %ebp, %rax
cmpq %rax, %rbx
jl 0x11a3a
addl %ebp, %ebp
movslq %ebp, %rsi
shlq $0x4, %rsi
movq %r15, %rdi
callq 0x3350
movq %rax, %r15
movq %rbx, %rax
addq $0x10, %r12
cmpq %rbx, %r14
jne 0x119f0
movq (%rsp), %rbx
movq %r15, 0x8(%rbx)
jmp 0x11a56
xorl %eax, %eax
movq (%rsp), %rbx
movl %eax, (%rbx)
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
leaq 0x63f4(%rip), %rsi      # 0x17e6f
movq %r14, %rdx
movq %r15, %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leal 0x1(%r13), %edx
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %rcx
leaq 0x63a9(%rip), %rsi      # 0x17e52
xorl %eax, %eax
callq 0x3330
leal 0x1(%r13), %esi
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %rdx
leaq 0x63d4(%rip), %rdi      # 0x17e98
xorl %eax, %eax
callq 0x3170
movq 0xc4ae(%rip), %rsi      # 0x1df80
testq %rsi, %rsi
je 0x11afb
leaq 0xc4aa(%rip), %r14      # 0x1df88
leaq 0x635b(%rip), %rbx      # 0x17e40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3170
movq (%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x11ae5
movl $0xa, %edi
callq 0x3050
callq 0x3060
movl (%rax), %edi
leaq 0x6332(%rip), %rsi      # 0x17e45
xorl %eax, %eax
callq 0x3330