// File: /workspace/github_c_makefile_star2_O2/yhg926[P]public_kssd/command_dist_wrapper.c
// Function: parse_dist
static error_t parse_dist(int key, char* arg, struct argp_state* state) {
  struct arg_dist* dist = state->input;
  assert( dist );
  assert( dist->global );
  switch(key)
  {
  case 'k':
   dist_opt_val.k = atoi(arg);
   break;
  case 'p':
  {
#ifdef _OPENMP
    dist_opt_val.p = atoi(arg) ;
#else
     warnx("This version of kssd was built without OpenMP and "
          "thus does not support multi threading. Ignoring -p %d",atoi(arg));
      break;
#endif
  }
   break;
  case 'm':
  {
   double sys_mm = get_sys_mmry();
   double rqst_mm = atoi(arg);
   if ( rqst_mm > sys_mm ){
    warnx("Memory request is larger than system available %f. Ignoring -m %f",sys_mm,rqst_mm);
    dist_opt_val.mmry = sys_mm;
   }
   else
    dist_opt_val.mmry = rqst_mm ;
  }
  break;
  case 'r':
  {
   if(strlen(arg) > PATHLEN) {
        err(errno,"the list path should not longer than %d", PATHLEN);
        exit(EXIT_FAILURE);
      };
   strcpy(dist_opt_val.refpath,arg);
   break;
  }
  case 'l':
  {
   if(strlen(arg) > PATHLEN) {
    err(errno,"the list path should not longer than %d", PATHLEN);
    exit(EXIT_FAILURE);
   };
   strcpy(dist_opt_val.fpath,arg);
   break;
  }
  case 'L':
  {
   struct stat path_stat;
   if( stat(arg,&path_stat) >=0 && S_ISREG(path_stat.st_mode)){
    if(strlen(arg) < PATHLEN )
     strcpy(dist_opt_val.dr_file,arg);
    else
      err(errno,"-L argument path should not longer than %d",PATHLEN);
   }
   else{
    if ( atoi(arg) >= dist_opt_val.k - 2 || atoi(arg) < 0 )
     err(errno,"-L: dimension reduction level should never larger than Kmer length - 2,"
        " which is %d here",dist_opt_val.k - 2 );
    dist_opt_val.dr_level = atoi(arg);
   }
   break;
  }
  case 'n':
  {
   if( atoi(arg) > 7 ) {
    dist_opt_val.kmerocrs = 7;
    warnx("-n argument is larger than Max, it has been set to 7, ignorned -n %d ",atoi(arg));
   }else if( atoi(arg) < 1 ){
    dist_opt_val.kmerocrs = 1;
     warnx("-n argument is smaller than Min, it has been set to 1, ignorned -n %d ",atoi(arg));
   }
   else dist_opt_val.kmerocrs = atoi(arg);
  }
   break;
  case 'Q':
  {
   dist_opt_val.kmerqlty = atoi(arg);
  }
   break;
    case 'o':
  {
      if(strlen(arg) > PATHLEN) {
        err(errno,"the outdir path should not longer than %d", PATHLEN);
        exit(EXIT_FAILURE);
      };
      strcpy(dist_opt_val.outdir,arg);
   break;
    }
  case 'N':
  {
   dist_opt_val.num_neigb = atoi(arg);
   break;
  }
  case 'D':
  {
   dist_opt_val.mut_dist_max = atof(arg);
   break;
  }
  case 'A':
  {
   dist_opt_val.abundance = true;
   break;
  }
  case 'u':
    {
      dist_opt_val.u = true;
      break;
    }
  case 555:
  {
   dist_opt_val.byread = true;
   break;
  }
  case 'P':
  {
   if(strlen(arg) > PATHLEN) {
        err(errno,"the piped command should not longer than %d", PATHLEN);
        exit(EXIT_FAILURE);
      };
      strcpy(dist_opt_val.pipecmd,arg);
      break;
  }
  case 'M':
  {
   dist_opt_val.metric = atoi(arg) ;
   break;
  }
  case 'O':
    {
      dist_opt_val.outfields = atoi(arg) ;
      break;
    }
  case 'f':
  {
   strcpy(dist_opt_val.shared_kmerpath,arg);
   break;
  }
  case 888:
  {
   dist_opt_val.keepco = true;
   break;
  }
  case 999:
  {
   dist_opt_val.stage2 = true;
      break;
  }
  case 333:
    {
      dist_opt_val.correction = atoi(arg) ;
      break;
    }
  case 777:
  {
   dist_opt_val.keep_shared_kmer = true;
   break;
  }
  case ARGP_KEY_ARGS:
    dist_opt_val.num_remaining_args = state->argc - state->next;
        dist_opt_val.remaining_args = state->argv + state->next;
   break;
    case ARGP_KEY_NO_ARGS:
    {
   if(state->argc < 2)
       {
    printf("\v");
    argp_state_help(state,stdout,ARGP_HELP_SHORT_USAGE);
    printf("\v");
       argp_state_help(state,stdout,ARGP_HELP_LONG);
       printf("\v");
    exit(0);
    };
       return EINVAL;
    }
   break;
   default:
  {
#ifdef _OPENMP
  if(dist_opt_val.p == 0)
     dist_opt_val.p = omp_get_num_procs();
#else
  if(dist_opt_val.p == 0)
     dist_opt_val.p = 1;
#endif
    return ARGP_ERR_UNKNOWN;
  }
 }
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq 0x28(%rdx), %rax
testq %rax, %rax
je 0xc9ec
cmpq $0x0, (%rax)
je 0xca05
movq %rsi, %rbx
leal -0x66(%rdi), %eax
cmpl $0xf, %eax
jbe 0xc6b9
leal -0x41(%rdi), %eax
cmpl $0x10, %eax
ja 0xc6d5
leaq 0x8f20(%rip), %rcx      # 0x155c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0xf595(%rip)      # 0x1bc49
jmp 0xc92b
leaq 0x8f48(%rip), %rcx      # 0x15608
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xf67b(%rip), %rdi      # 0x1bd4b
jmp 0xc923
cmpl $0x14d, %edi            # imm = 0x14D
je 0xc95e
cmpl $0x22b, %edi            # imm = 0x22B
je 0xc98a
cmpl $0x309, %edi            # imm = 0x309
je 0xc94c
cmpl $0x378, %edi            # imm = 0x378
je 0xc955
cmpl $0x3e7, %edi            # imm = 0x3E7
je 0xc971
movq %rdx, %r14
cmpl $0x1000002, %edi        # imm = 0x1000002
je 0xc97a
cmpl $0x1000006, %edi        # imm = 0x1000006
jne 0xc74c
movl 0x8(%r14), %eax
movslq 0x18(%r14), %rcx
subl %ecx, %eax
movl %eax, 0xf718(%rip)      # 0x1be50
shlq $0x3, %rcx
addq 0x10(%r14), %rcx
movq %rcx, 0xf711(%rip)      # 0x1be58
jmp 0xc92b
pushq $0x7
popq %rbx
cmpl $0x0, 0xf0ae(%rip)      # 0x1b804
jne 0xc92d
movl $0x1, 0xf09e(%rip)      # 0x1b804
jmp 0xc92d
movb $0x1, 0xf4d8(%rip)      # 0x1bc4a
jmp 0xc92b
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xca22
leaq 0xf190(%rip), %rdi      # 0x1b922
jmp 0xc923
movq %rbx, %rdi
callq 0x3410
cmpl $0x8, %eax
jl 0xc9bf
movl $0x7, 0xf472(%rip)      # 0x1bc24
movq %rbx, %rdi
callq 0x3410
leaq 0x94aa(%rip), %rdi      # 0x15c6b
jmp 0xc81a
callq 0x1058c
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x3410
cvtsi2sd %eax, %xmm1
movsd 0x8(%rsp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0xc7fe
movapd %xmm2, %xmm0
leaq 0x938c(%rip), %rdi      # 0x15b7d
movb $0x2, %al
callq 0x3180
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0xf10a(%rip)     # 0x1b910
jmp 0xc92b
movq %rbx, %rdi
callq 0x3410
leaq 0x92fb(%rip), %rdi      # 0x15b15
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x3180
jmp 0xc92d
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xefc8(%rip)      # 0x1b800
jmp 0xc92b
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xca22
leaq 0xf1ca(%rip), %rdi      # 0x1ba22
jmp 0xc923
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xca35
leaq 0xf2aa(%rip), %rdi      # 0x1bb22
jmp 0xc923
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf3b9(%rip)      # 0x1bc44
jmp 0xc92b
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x32e0
testl %eax, %eax
js 0xc993
movl $0xf000, %eax           # imm = 0xF000
andl 0x28(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xc993
movq %rbx, %rdi
callq 0x3130
cmpq $0xff, %rax
ja 0xcaa9
leaq 0xef38(%rip), %rdi      # 0x1b80c
jmp 0xc923
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf34c(%rip)      # 0x1bc30
jmp 0xc92b
movq %rbx, %rdi
callq 0x30d0
movsd %xmm0, 0xf342(%rip)     # 0x1bc38
jmp 0xc92b
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf33a(%rip)      # 0x1bc40
jmp 0xc92b
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xca45
leaq 0xf328(%rip), %rdi      # 0x1bc4b
movq %rbx, %rsi
callq 0x3080
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf2de(%rip)      # 0x1bc28
jmp 0xc92b
movb $0x1, 0xf4f8(%rip)      # 0x1be4b
jmp 0xc92b
movb $0x1, 0xf2d0(%rip)      # 0x1bc2c
jmp 0xc92b
movq %rbx, %rdi
callq 0x3410
testl %eax, %eax
setne 0xf2d9(%rip)            # 0x1bc48
jmp 0xc92b
movb $0x1, 0xf2b5(%rip)      # 0x1bc2d
jmp 0xc92b
cmpl $0x1, 0x8(%r14)
jle 0xca55
pushq $0x16
popq %rbx
jmp 0xc92d
movb $0x1, 0xf4bb(%rip)      # 0x1be4c
jmp 0xc92b
movq %rbx, %rdi
callq 0x3410
movl 0xee5f(%rip), %ebx      # 0x1b800
addl $-0x2, %ebx
testl %eax, %eax
js 0xca97
cmpl %ebx, %eax
jge 0xca97
movl %eax, 0xee4e(%rip)      # 0x1b808
jmp 0xc92b
testl %eax, %eax
jle 0xc9ce
movl %eax, 0xf25b(%rip)      # 0x1bc24
jmp 0xc92b
movl $0x1, 0xf24c(%rip)      # 0x1bc24
movq %rbx, %rdi
callq 0x3410
leaq 0x92ca(%rip), %rdi      # 0x15cb1
jmp 0xc81a
leaq 0x8c62(%rip), %rdi      # 0x15655
leaq 0x90c2(%rip), %rsi      # 0x15abc
leaq 0x90d2(%rip), %rcx      # 0x15ad3
pushq $0x68
jmp 0xca1c
leaq 0x90fc(%rip), %rdi      # 0x15b08
leaq 0x90a9(%rip), %rsi      # 0x15abc
leaq 0x90b9(%rip), %rcx      # 0x15ad3
pushq $0x69
popq %rdx
callq 0x3200
callq 0x3060
movl (%rax), %edi
leaq 0x918f(%rip), %rsi      # 0x15bbf
jmp 0xcab7
callq 0x3060
movl (%rax), %edi
leaq 0x92b5(%rip), %rsi      # 0x15cf8
jmp 0xcab7
callq 0x3060
movl (%rax), %edi
leaq 0x92cf(%rip), %rsi      # 0x15d22
jmp 0xcab7
pushq $0xb
popq %rbx
movl %ebx, %edi
callq 0x3050
movq 0xe572(%rip), %r15      # 0x1afd8
movq (%r15), %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x30e0
movl %ebx, %edi
callq 0x3050
movq (%r15), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x30e0
movl %ebx, %edi
callq 0x3050
xorl %edi, %edi
callq 0x3440
callq 0x3060
movl (%rax), %edi
leaq 0x916d(%rip), %rsi      # 0x15c12
movl %ebx, %edx
jmp 0xcabc
callq 0x3060
movl (%rax), %edi
leaq 0x9130(%rip), %rsi      # 0x15be7
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x3330
nop