// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x98, %rsp
movq 0x28(%rdx), %rax
testq %rax, %rax
je 0xd497
cmpq $0x0, (%rax)
je 0xd4b6
movq %rsi, %rbx
cmpl $0x14c, %edi            # imm = 0x14C
jle 0xd102
cmpl $0x377, %edi            # imm = 0x377
jle 0xd12a
cmpl $0x1000001, %edi        # imm = 0x1000001
jg 0xd15a
cmpl $0x378, %edi            # imm = 0x378
je 0xd1bd
cmpl $0x3e7, %edi            # imm = 0x3E7
jne 0xd247
movb $0x1, 0xfb30(%rip)      # 0x1cc2d
jmp 0xd408
leal -0x66(%rdi), %eax
cmpl $0xf, %eax
ja 0xd195
leaq 0x9543(%rip), %rcx      # 0x16658
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xfc26(%rip), %rdi      # 0x1cd4b
jmp 0xd400
cmpl $0x14d, %edi            # imm = 0x14D
je 0xd225
cmpl $0x22b, %edi            # imm = 0x22B
je 0xd23b
cmpl $0x309, %edi            # imm = 0x309
jne 0xd247
movb $0x1, 0xfcf6(%rip)      # 0x1ce4b
jmp 0xd408
movq %rdx, %r14
cmpl $0x1000002, %edi        # imm = 0x1000002
je 0xd1c9
cmpl $0x1000006, %edi        # imm = 0x1000006
jne 0xd247
movl 0x8(%r14), %eax
movslq 0x18(%r14), %rcx
subl %ecx, %eax
movl %eax, 0xfccf(%rip)      # 0x1ce50
shlq $0x3, %rcx
addq 0x10(%r14), %rcx
movq %rcx, 0xfcc8(%rip)      # 0x1ce58
jmp 0xd408
addl $-0x41, %edi
cmpl $0x10, %edi
ja 0xd247
leaq 0x946c(%rip), %rax      # 0x16614
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb $0x1, 0xfa91(%rip)      # 0x1cc49
jmp 0xd408
movb $0x1, 0xfa68(%rip)      # 0x1cc2c
jmp 0xd408
movl $0x16, %ebx
cmpl $0x1, 0x8(%r14)
jg 0xd40a
movl $0xb, %edi
callq 0x3050
movq 0xedee(%rip), %rbx      # 0x1bfd8
movq (%rbx), %rsi
movq %r14, %rdi
movl $0x2, %edx
callq 0x30e0
movl $0xb, %edi
callq 0x3050
movq (%rbx), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x30e0
movl $0xb, %edi
callq 0x3050
xorl %edi, %edi
callq 0x3440
movq %rbx, %rdi
callq 0x3410
testl %eax, %eax
setne 0xfa12(%rip)            # 0x1cc48
jmp 0xd408
movb $0x1, 0xfc0a(%rip)      # 0x1ce4c
jmp 0xd408
movl $0x7, %ebx
cmpl $0x0, 0xf5b1(%rip)      # 0x1c804
jne 0xd40a
movl $0x1, 0xf5a1(%rip)      # 0x1c804
jmp 0xd40a
movq %rbx, %rdi
callq 0x3410
leaq 0x98ee(%rip), %rdi      # 0x16b65
jmp 0xd487
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd4e5
leaq 0xf88b(%rip), %rdi      # 0x1cb22
jmp 0xd400
callq 0x114a8
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x3410
cvtsi2sd %eax, %xmm1
movsd (%rsp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0xd2d4
movapd %xmm2, %xmm0
leaq 0x9905(%rip), %rdi      # 0x16bcd
movb $0x2, %al
callq 0x3180
movsd (%rsp), %xmm1
movsd %xmm1, 0xf634(%rip)     # 0x1c910
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf511(%rip)      # 0x1c800
jmp 0xd408
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd4d5
leaq 0xf613(%rip), %rdi      # 0x1c922
jmp 0xd400
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd4d5
leaq 0xf6f3(%rip), %rdi      # 0x1ca22
jmp 0xd400
movb $0x1, 0xf90f(%rip)      # 0x1cc4a
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
cmpl $0x8, %eax
jl 0xd462
movl $0x7, 0xf8c9(%rip)      # 0x1cc24
movq %rbx, %rdi
callq 0x3410
leaq 0x9951(%rip), %rdi      # 0x16cbb
jmp 0xd487
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x32e0
testl %eax, %eax
js 0xd439
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xd439
movq %rbx, %rdi
callq 0x3130
cmpq $0xff, %rax
ja 0xd517
leaq 0xf459(%rip), %rdi      # 0x1c80c
jmp 0xd400
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf881(%rip)      # 0x1cc44
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf86d(%rip)      # 0x1cc40
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf84d(%rip)      # 0x1cc30
jmp 0xd408
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd4f5
leaq 0xf84b(%rip), %rdi      # 0x1cc4b
movq %rbx, %rsi
callq 0x3080
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x30d0
movsd %xmm0, 0xf811(%rip)     # 0x1cc38
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf7f1(%rip)      # 0x1cc28
jmp 0xd408
movq %rbx, %rdi
callq 0x3410
movl 0xf3b9(%rip), %ebx      # 0x1c800
addl $-0x2, %ebx
testl %eax, %eax
js 0xd505
cmpl %ebx, %eax
jge 0xd505
movl %eax, 0xf3a8(%rip)      # 0x1c808
jmp 0xd408
testl %eax, %eax
jle 0xd46e
movl %eax, 0xf7b8(%rip)      # 0x1cc24
jmp 0xd408
movl $0x1, 0xf7ac(%rip)      # 0x1cc24
movq %rbx, %rdi
callq 0x3410
leaq 0x987a(%rip), %rdi      # 0x16d01
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x3180
jmp 0xd40a
leaq 0x9207(%rip), %rdi      # 0x166a5
leaq 0x9667(%rip), %rsi      # 0x16b0c
leaq 0x9677(%rip), %rcx      # 0x16b23
movl $0x68, %edx
callq 0x3200
leaq 0x969b(%rip), %rdi      # 0x16b58
leaq 0x9648(%rip), %rsi      # 0x16b0c
leaq 0x9658(%rip), %rcx      # 0x16b23
movl $0x69, %edx
callq 0x3200
callq 0x3060
movl (%rax), %edi
leaq 0x972c(%rip), %rsi      # 0x16c0f
jmp 0xd525
callq 0x3060
movl (%rax), %edi
leaq 0x9855(%rip), %rsi      # 0x16d48
jmp 0xd525
callq 0x3060
movl (%rax), %edi
leaq 0x986f(%rip), %rsi      # 0x16d72
jmp 0xd525
callq 0x3060
movl (%rax), %edi
leaq 0x974f(%rip), %rsi      # 0x16c62
movl %ebx, %edx
jmp 0xd52a
callq 0x3060
movl (%rax), %edi
leaq 0x9712(%rip), %rsi      # 0x16c37
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x3330
nopl (%rax)