// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x10, %edi
callq 0x3310
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x400, -0x1d4(%rbp)    # imm = 0x400
movslq -0x1d4(%rbp), %rdi
shlq $0x4, %rdi
callq 0x3310
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpl $0x0, -0x14(%rbp)
je 0x17361
movl $0x0, -0x1d8(%rbp)
movl -0x1d8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x1735c
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x32b0
movl -0xa0(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x171ad
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30f0
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
jne 0x16fd1
callq 0x3050
movl (%rax), %edi
movl -0x1d8(%rbp), %edx
addl $0x1, %edx
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x7d48(%rip), %rsi      # 0x1ed12
movb $0x0, %al
callq 0x3300
jmp 0x16fd3
movq -0xc0(%rbp), %rdi
callq 0x32f0
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0x1719c
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3110
movq %rax, -0x1e8(%rbp)
movq -0xc8(%rbp), %rdi
addq $0x13, %rdi
callq 0x3110
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
addq %rcx, %rax
addq $0x1, %rax
cmpq $0x100, %rax            # imm = 0x100
jbe 0x17069
callq 0x3050
movl (%rax), %edi
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xc8(%rbp), %rcx
addq $0x13, %rcx
leaq 0x7cd3(%rip), %rsi      # 0x1ed2f
movl $0x100, %r8d            # imm = 0x100
movb $0x0, %al
callq 0x3300
leaq -0x1d0(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xc8(%rbp), %rcx
addq $0x13, %rcx
leaq 0x529a(%rip), %rsi      # 0x1c32b
movb $0x0, %al
callq 0x3400
leaq -0x1d0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x32b0
leaq -0x1d0(%rbp), %rdi
leaq 0xceb7(%rip), %rsi      # 0x23f70
movl $0x7, %edx
callq 0x16d60
cmpl $0x0, %eax
je 0x17197
movq -0x88(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl $0x100, %edi            # imm = 0x100
callq 0x3310
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xc8(%rbp), %rcx
addq $0x13, %rcx
leaq 0x51e6(%rip), %rsi      # 0x1c32b
movb $0x0, %al
callq 0x3400
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1d4(%rbp), %eax
jl 0x17195
movl -0x1d4(%rbp), %eax
addl -0x1d4(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x1d4(%rbp), %rsi
shlq $0x4, %rsi
callq 0x3320
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x17197
jmp 0x16fd3
movq -0xc0(%rbp), %rdi
callq 0x3220
jmp 0x17346
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcdad(%rip), %rsi      # 0x23f70
movl $0x7, %edx
callq 0x16d60
cmpl $0x0, %eax
je 0x172ab
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x32b0
movq -0x88(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl $0x100, %edi            # imm = 0x100
callq 0x3310
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3070
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1d4(%rbp), %eax
jl 0x172a6
movl -0x1d4(%rbp), %eax
addl -0x1d4(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x1d4(%rbp), %rsi
shlq $0x4, %rsi
callq 0x3320
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x17344
movl -0x1d8(%rbp), %esi
addl $0x1, %esi
movq -0x10(%rbp), %rax
movslq -0x1d8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x7a8e(%rip), %rdi      # 0x1ed58
movb $0x0, %al
callq 0x3150
movl $0x0, -0x1dc(%rbp)
movslq -0x1dc(%rbp), %rcx
leaq 0xcc87(%rip), %rax      # 0x23f70
cmpq $0x0, (%rax,%rcx,8)
je 0x17321
movslq -0x1dc(%rbp), %rcx
leaq 0xcc72(%rip), %rax      # 0x23f70
movq (%rax,%rcx,8), %rsi
leaq 0x79f7(%rip), %rdi      # 0x1ed00
movb $0x0, %al
callq 0x3150
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x172db
leaq 0x7c87(%rip), %rdi      # 0x1efaf
movb $0x0, %al
callq 0x3150
callq 0x3050
movl (%rax), %edi
leaq 0x79c8(%rip), %rsi      # 0x1ed05
movb $0x0, %al
callq 0x3300
jmp 0x17346
jmp 0x17348
movl -0x1d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d8(%rbp)
jmp 0x16f43
jmp 0x17444
movl $0x0, -0x1e0(%rbp)
movl -0x1e0(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x17442
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movl $0x100, %edi            # imm = 0x100
callq 0x3310
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x1e0(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3070
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1d4(%rbp), %eax
jl 0x1742c
movl -0x1d4(%rbp), %eax
addl -0x1d4(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x1d4(%rbp), %rsi
shlq $0x4, %rsi
callq 0x3320
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1742e
movl -0x1e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e0(%rbp)
jmp 0x1736b
jmp 0x17444
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
nopw (%rax,%rax)