// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: getArgs
void getArgs(int argc, char** argv) {

  // default parameters/filenames
  char* outFile = NULL, *inFile = NULL, *ctrlFile = NULL,
    *logFile = NULL, *pileFile = NULL, *bedFile = NULL,
    *xFile = NULL, *dupsFile = NULL;
  char* xchrom = NULL;
  uint64_t genomeLen = 0;
  int extend = 0, minMapQ = 0, minLen = DEFMINLEN,
    maxGap = DEFMAXGAP, atacLen5 = DEFATAC, atacLen3 = 0;
  float asDiff = 0.0f, pqvalue = DEFPVAL, minAUC = DEFAUC;
  bool singleOpt = false, extendOpt = false,
    avgExtOpt = false, atacOpt = false, atacAdj = true,
    gzOut = false, qvalOpt = false, dupsOpt = false,
    peaksOpt = true, peaksOnly = false, sortOpt = true;
  bool verbose = false;

  // parse argv
  int c;
  while ( (c = getopt_long(argc, argv, OPTIONS, long_options, NULL)) != -1 )
    switch (c) {
      case INFILE: inFile = optarg; break;
      case CTRLFILE: ctrlFile = optarg; break;
      case OUTFILE: outFile = optarg; break;
      case LOGFILE: logFile = optarg; break;
      case PILEFILE: pileFile = optarg; break;
      case BEDFILE: bedFile = optarg; break;
      case GZOPT: gzOut = true; break;
      case UNPAIROPT: singleOpt = true; break;
      case EXTENDOPT: extend = getInt(optarg); extendOpt = true; break;
      case AVGEXTOPT: avgExtOpt = true; break;
      case ATACOPT: atacOpt = true; break;
      case ATACLEN: atacLen5 = getInt(optarg); break;
      case DNASEOPT: atacAdj = false; break;
      case XCHROM: xchrom = optarg; break;
      case XFILE: xFile = optarg; break;
      case MINMAPQ: minMapQ = getInt(optarg); break;
      case ASDIFF: asDiff = getFloat(optarg); break;
      case PVALUE: pqvalue = getFloat(optarg); break;
      case QVALUE: pqvalue = getFloat(optarg); qvalOpt = true; break;
      case MINAUC: minAUC = getFloat(optarg); break;
      case MINLEN: minLen = getInt(optarg); break;
      case MAXGAP: maxGap = getInt(optarg); break;
      case DUPSOPT: dupsOpt = true; break;
      case DUPSFILE: dupsFile = optarg; break;
      case NOPEAKS: peaksOpt = false; break;
      case PEAKSONLY: peaksOnly = true; break;
      case SORTOPT: sortOpt = false; break;
      case GENOMELEN: genomeLen = getLong(optarg); break;
      case VERBOSE: verbose = true; break;
      case VERSOPT: printVersion(); break;
      case HELP: usage(); break;
      default: exit(EXIT_FAILURE);
    }
  if (optind < argc)
    exit(error(argv[optind], ERRPARAM));

  // check for argument errors
  if ((peaksOpt && outFile == NULL)
      || (peaksOnly && logFile == NULL)
      || (!peaksOnly && inFile == NULL)) {
    error("", ERRFILE);
    usage();
  }
  if (avgExtOpt) {
    singleOpt = true;
    extendOpt = false; // avgExtOpt takes precedence
  }
  if (extendOpt) {
    singleOpt = true;
    if (extend <= 0)
      exit(error("", ERREXTEND));
  }
  if (atacOpt) {
    avgExtOpt = extendOpt = false;  // no unpaired extensions in ATAC-seq mode
    if (atacLen5 <= 0)
      exit(error("", ERRATAC));
    // split atacLen into atacLen5 and atacLen3
    atacLen3 = (int) (atacLen5 / 2.0f + 0.5f);  // round up for 3' end
    atacLen5 /= 2;
  }
  if (minLen < 0)
    exit(error("", ERRMINLEN));
  if (minAUC < 0.0f)
    exit(error("", ERRMINAUC));
  if (asDiff < 0.0f)
    exit(error("", ERRASDIFF));
  if (genomeLen < 0)
    exit(error("", ERRGENLEN));

  // save list of chromosomes to exclude
  int xcount = 0;
  char** xchrList = NULL;
  if (xchrom != NULL)
    xcount = saveXChrom(xchrom, &xchrList);

  // adjust significance level to -log scale
  if (pqvalue <= 0.0f || pqvalue > 1.0f)
    exit(error("", ERRPQVAL));
  pqvalue = -log10f(pqvalue);

  // send arguments to runProgram()
  runProgram(inFile, ctrlFile, outFile, logFile, pileFile,
    bedFile, gzOut, singleOpt, extendOpt, extend,
    avgExtOpt, minMapQ, xcount, xchrList, xFile, pqvalue,
    qvalOpt, minLen, maxGap, minAUC, asDiff,
    atacOpt, atacLen5, atacLen3, atacAdj, dupsOpt,
    dupsFile, peaksOpt, peaksOnly, sortOpt, genomeLen,
    verbose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r12
movl %edi, %ebp
movb $0x1, %al
movl %eax, 0x38(%rsp)
movss 0xca2(%rip), %xmm0      # 0x10194
movss %xmm0, 0x4(%rsp)
movss 0xc98(%rip), %xmm0      # 0x10198
movss %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
pushq $0x64
popq %rax
movq $0x0, 0x70(%rsp)
leaq 0x2977(%rip), %r15      # 0x11e98
leaq 0x7dd8(%rip), %r13      # 0x17300
leaq 0xdd5(%rip), %r14       # 0x10304
movq $0x0, 0xb0(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0x58(%rsp)
movq %rax, 0xd0(%rsp)
movq %rax, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x8(%rsp)
movq $0x0, 0x48(%rsp)
xorl %eax, %eax
movq $0x0, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movb $0x1, %cl
movl %ecx, 0x3c(%rsp)
movq $0x0, 0xd8(%rsp)
movb $0x1, %cl
movl %ecx, 0x34(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x60(%rsp)
movl %eax, %ebx
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x2100
leal -0x44(%rax), %ecx
cmpl $0x36, %ecx
ja 0xf8c7
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
movb $0x1, %al
jmpq *%rcx
movl $0x0, 0x38(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x797b(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x279a
movss %xmm0, (%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7963(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x279a
movss %xmm0, 0x28(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movq %rax, 0x80(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x793c(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7926(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x27cf
movq %rax, 0x58(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movq %rax, 0x48(%rsp)
movl %ebx, %eax
jmp 0xf61e
movl $0x0, 0x3c(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x78ee(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x27cf
movq %rax, 0x20(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movq %rax, 0xd8(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x78c2(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0x60(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x78ac(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0xa0(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7893(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x279a
movss %xmm0, 0x4(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7877(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0xb8(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x785e(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x2807
movq %rax, 0xa8(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7840(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0xb0(%rsp)
movl %ebx, %eax
jmp 0xf61e
movl $0x0, 0x34(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7818(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movq %rax, 0x18(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x77f1(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0x98(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x77d8(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x77c2(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x27cf
movq %rax, 0xc0(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x77a4(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x27cf
movq %rax, 0xd0(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7786(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x27cf
movq %rax, 0x50(%rsp)
movb $0x1, %al
movq %rax, 0x40(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x7764(%rip), %rax      # 0x16fd8
movq (%rax), %rdi
callq 0x279a
movss %xmm0, 0x28(%rsp)
movb $0x1, %al
movq %rax, 0x90(%rsp)
movl %ebx, %eax
jmp 0xf61e
movq 0x773e(%rip), %rax      # 0x16fd8
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movl %eax, 0x8(%rsp)
movl %ebx, %eax
jmp 0xf61e
movb $0x1, %al
movq %rax, 0x88(%rsp)
movl %ebx, %eax
jmp 0xf61e
cmpl $-0x1, %eax
jne 0xfbc1
movq 0x76f9(%rip), %rax      # 0x16fd0
movslq (%rax), %rax
cmpl %ebp, %eax
jl 0xfb6b
cmpq $0x0, 0x60(%rsp)
sete %cl
movq 0xd8(%rsp), %r15
testb $0x1, %r15b
movq 0x70(%rsp), %rax
cmovneq 0x68(%rsp), %rax
movl 0x3c(%rsp), %ebp
testb %cl, %bpl
movq 0x48(%rsp), %r14
jne 0xfb73
testq %rax, %rax
je 0xfb73
movzbl 0x40(%rsp), %esi
xorl %edx, %edx
movl 0x8(%rsp), %ecx
testb $0x1, %cl
cmovnel %edx, %esi
testb $0x1, %sil
je 0xf955
movb $0x1, %al
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x50(%rsp)
movq 0x20(%rsp), %rax
jg 0xf966
leaq 0x21c1(%rip), %rdi      # 0x11b0f
pushq $0x8
jmp 0xfbbb
movq 0x18(%rsp), %rax
orb %cl, %al
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
testb $0x1, %r14b
je 0xf992
testl %eax, %eax
jle 0xfbb2
cvtsi2ss %eax, %xmm0
movss 0x7f0(%rip), %xmm1      # 0x10170
mulss %xmm1, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
shrl %eax
xorl %esi, %esi
xorl %ecx, %ecx
cmpl $0x0, 0x58(%rsp)
js 0xfb86
xorps %xmm0, %xmm0
ucomiss 0x4(%rsp), %xmm0
ja 0xfb91
ucomiss (%rsp), %xmm0
ja 0xfb9c
movl %esi, 0x7c(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x8(%rsp)
movq %rax, 0x20(%rsp)
andq $0x0, 0xe0(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xf9ee
leaq 0xe0(%rsp), %rsi
callq 0xf44b
movq %rax, 0x10(%rsp)
jmp 0xf9f7
movq $0x0, 0x10(%rsp)
xorps %xmm0, %xmm0
movss 0x28(%rsp), %xmm1
ucomiss %xmm1, %xmm0
jae 0xfba7
movaps %xmm1, %xmm0
ucomiss 0x76d(%rip), %xmm1      # 0x10180
ja 0xfba7
callq 0x21d0
xorps 0x83b(%rip), %xmm0      # 0x10260
subq $0x8, %rsp
movzbl 0x88(%rsp), %r12d
andl $0x1, %r12d
movzbl 0x3c(%rsp), %r10d
andl $0x1, %r10d
movzbl %r15b, %r11d
andl $0x1, %r11d
movzbl %bpl, %ebp
andl $0x1, %ebp
movzbl 0x90(%rsp), %r15d
andl $0x1, %r15d
movzbl 0x40(%rsp), %eax
andl $0x1, %eax
movzbl %r14b, %r14d
andl $0x1, %r14d
movzbl 0x98(%rsp), %r13d
andl $0x1, %r13d
movzbl 0x10(%rsp), %ecx
andl $0x1, %ecx
movq %rcx, 0x50(%rsp)
movzbl 0x84(%rsp), %ecx
andl $0x1, %ecx
movq %rcx, 0x30(%rsp)
movzbl 0x20(%rsp), %ecx
andl $0x1, %ecx
movq %rcx, 0x10(%rsp)
movzbl %bl, %ebx
andl $0x1, %ebx
movq 0xa8(%rsp), %r8
movq 0xa0(%rsp), %r9
movq 0x78(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rcx
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm2
pushq %r12
pushq 0xb8(%rsp)
pushq %r10
pushq %r11
pushq %rbp
pushq 0xe8(%rsp)
pushq %r15
pushq %rax
pushq 0x88(%rsp)
pushq 0x70(%rsp)
pushq %r14
pushq 0x130(%rsp)
pushq 0xc0(%rsp)
pushq %r13
pushq 0x140(%rsp)
pushq 0x160(%rsp)
pushq 0x98(%rsp)
pushq 0x150(%rsp)
pushq 0xe0(%rsp)
pushq 0xf0(%rsp)
pushq 0xd0(%rsp)
pushq 0xb8(%rsp)
pushq %rbx
callq 0xe1a7
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x23dc
callq 0x2419
movq (%r12,%rax,8), %rdi
pushq $0x7
jmp 0xfbbb
leaq 0x1f95(%rip), %rdi      # 0x11b0f
xorl %esi, %esi
callq 0x2724
callq 0x2419
leaq 0x1f82(%rip), %rdi      # 0x11b0f
pushq $0xd
jmp 0xfbbb
leaq 0x1f77(%rip), %rdi      # 0x11b0f
pushq $0xc
jmp 0xfbbb
leaq 0x1f6c(%rip), %rdi      # 0x11b0f
pushq $0xb
jmp 0xfbbb
leaq 0x1f61(%rip), %rdi      # 0x11b0f
pushq $0xa
jmp 0xfbbb
leaq 0x1f56(%rip), %rdi      # 0x11b0f
pushq $0x9
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0