// File: /workspace/github_c_makefile_star2_O1/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 0xd1de
cmpq $0x0, (%rax)
je 0xd1fd
movq %rsi, %rbx
cmpl $0x14c, %edi            # imm = 0x14C
jle 0xce49
cmpl $0x377, %edi            # imm = 0x377
jle 0xce71
cmpl $0x1000001, %edi        # imm = 0x1000001
jg 0xcea1
cmpl $0x378, %edi            # imm = 0x378
je 0xcf04
cmpl $0x3e7, %edi            # imm = 0x3E7
jne 0xcf8e
movb $0x1, 0xfde9(%rip)      # 0x1cc2d
jmp 0xd14f
leal -0x66(%rdi), %eax
cmpl $0xf, %eax
ja 0xcedc
leaq 0x97ac(%rip), %rcx      # 0x16608
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xfedf(%rip), %rdi      # 0x1cd4b
jmp 0xd147
cmpl $0x14d, %edi            # imm = 0x14D
je 0xcf6c
cmpl $0x22b, %edi            # imm = 0x22B
je 0xcf82
cmpl $0x309, %edi            # imm = 0x309
jne 0xcf8e
movb $0x1, 0xffaf(%rip)      # 0x1ce4b
jmp 0xd14f
movq %rdx, %r14
cmpl $0x1000002, %edi        # imm = 0x1000002
je 0xcf10
cmpl $0x1000006, %edi        # imm = 0x1000006
jne 0xcf8e
movl 0x8(%r14), %eax
movslq 0x18(%r14), %rcx
subl %ecx, %eax
movl %eax, 0xff88(%rip)      # 0x1ce50
shlq $0x3, %rcx
addq 0x10(%r14), %rcx
movq %rcx, 0xff81(%rip)      # 0x1ce58
jmp 0xd14f
addl $-0x41, %edi
cmpl $0x10, %edi
ja 0xcf8e
leaq 0x96d5(%rip), %rax      # 0x165c4
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb $0x1, 0xfd4a(%rip)      # 0x1cc49
jmp 0xd14f
movb $0x1, 0xfd21(%rip)      # 0x1cc2c
jmp 0xd14f
movl $0x16, %ebx
cmpl $0x1, 0x8(%r14)
jg 0xd151
movl $0xb, %edi
callq 0x3050
movq 0xf0a7(%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 0xfccb(%rip)            # 0x1cc48
jmp 0xd14f
movb $0x1, 0xfec3(%rip)      # 0x1ce4c
jmp 0xd14f
movl $0x7, %ebx
cmpl $0x0, 0xf86a(%rip)      # 0x1c804
jne 0xd151
movl $0x1, 0xf85a(%rip)      # 0x1c804
jmp 0xd151
movq %rbx, %rdi
callq 0x3410
leaq 0x9b57(%rip), %rdi      # 0x16b15
jmp 0xd1ce
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd22c
leaq 0xfb44(%rip), %rdi      # 0x1cb22
jmp 0xd147
callq 0x110fc
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x3410
cvtsi2sd %eax, %xmm1
movsd (%rsp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0xd01b
movapd %xmm2, %xmm0
leaq 0x9b6e(%rip), %rdi      # 0x16b7d
movb $0x2, %al
callq 0x3180
movsd (%rsp), %xmm1
movsd %xmm1, 0xf8ed(%rip)     # 0x1c910
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xf7ca(%rip)      # 0x1c800
jmp 0xd14f
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd21c
leaq 0xf8cc(%rip), %rdi      # 0x1c922
jmp 0xd147
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd21c
leaq 0xf9ac(%rip), %rdi      # 0x1ca22
jmp 0xd147
movb $0x1, 0xfbc8(%rip)      # 0x1cc4a
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
cmpl $0x8, %eax
jl 0xd1a9
movl $0x7, 0xfb82(%rip)      # 0x1cc24
movq %rbx, %rdi
callq 0x3410
leaq 0x9bba(%rip), %rdi      # 0x16c6b
jmp 0xd1ce
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x32e0
testl %eax, %eax
js 0xd180
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xd180
movq %rbx, %rdi
callq 0x3130
cmpq $0xff, %rax
ja 0xd25e
leaq 0xf712(%rip), %rdi      # 0x1c80c
jmp 0xd147
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xfb3a(%rip)      # 0x1cc44
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xfb26(%rip)      # 0x1cc40
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xfb06(%rip)      # 0x1cc30
jmp 0xd14f
movq %rbx, %rdi
callq 0x3130
cmpq $0x101, %rax            # imm = 0x101
jae 0xd23c
leaq 0xfb04(%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, 0xfaca(%rip)     # 0x1cc38
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
movl %eax, 0xfaaa(%rip)      # 0x1cc28
jmp 0xd14f
movq %rbx, %rdi
callq 0x3410
movl 0xf672(%rip), %ebx      # 0x1c800
addl $-0x2, %ebx
testl %eax, %eax
js 0xd24c
cmpl %ebx, %eax
jge 0xd24c
movl %eax, 0xf661(%rip)      # 0x1c808
jmp 0xd14f
testl %eax, %eax
jle 0xd1b5
movl %eax, 0xfa71(%rip)      # 0x1cc24
jmp 0xd14f
movl $0x1, 0xfa65(%rip)      # 0x1cc24
movq %rbx, %rdi
callq 0x3410
leaq 0x9ae3(%rip), %rdi      # 0x16cb1
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x3180
jmp 0xd151
leaq 0x9470(%rip), %rdi      # 0x16655
leaq 0x98d0(%rip), %rsi      # 0x16abc
leaq 0x98e0(%rip), %rcx      # 0x16ad3
movl $0x68, %edx
callq 0x3200
leaq 0x9904(%rip), %rdi      # 0x16b08
leaq 0x98b1(%rip), %rsi      # 0x16abc
leaq 0x98c1(%rip), %rcx      # 0x16ad3
movl $0x69, %edx
callq 0x3200
callq 0x3060
movl (%rax), %edi
leaq 0x9995(%rip), %rsi      # 0x16bbf
jmp 0xd26c
callq 0x3060
movl (%rax), %edi
leaq 0x9abe(%rip), %rsi      # 0x16cf8
jmp 0xd26c
callq 0x3060
movl (%rax), %edi
leaq 0x9ad8(%rip), %rsi      # 0x16d22
jmp 0xd26c
callq 0x3060
movl (%rax), %edi
leaq 0x99b8(%rip), %rsi      # 0x16c12
movl %ebx, %edx
jmp 0xd271
callq 0x3060
movl (%rax), %edi
leaq 0x997b(%rip), %rsi      # 0x16be7
movl $0x100, %edx            # imm = 0x100
xorl %eax, %eax
callq 0x3330