// File: /workspace/github_cpp_makefile_star2_O3/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: parseArgs(int, char* const*, Args&)
void parseArgs(int argc, char *const argv[], Args &arg)
{
  int c;
  extern char *optarg;
  extern int optind;

  std::string usage("usage: " + std::string(argv[0]) + " infile [-k ksize] [-d dsize] [-f tf] [-l tl] [-r rev] [-o output]\n\n" +
                    "Computes the bi-labelled de Bruijn graph of the error-corrected rmaps in [infile].\n" +
                    "  ksize: [integer] - k-mer size (def. 6)\n" +
                    "  dsize: [integer] - minimum distance between two k-mers in a bi-label. (def. 15000)\n" +
                    "     tf: [integer] - fragment proximal error tollerance. (def. 500)\n" +
                    "     tl: [integer] - length proximal error tollerance. (def. 2000)\n" +
                    "    rev: [boolean] - include reverse rmaps. (def. false)\n" +
                    " output: [string]  - output directory that must exists. (def. .)\n");

  std::string sarg;
  while ((c = getopt(argc, argv, "k:d:f:l:ro:")) != -1)
  {
    switch (c)
    {
    case 'k':
      sarg.assign(optarg);
      arg.k = stoi(sarg);
      break;
    case 'd':
      sarg.assign(optarg);
      arg.d = stoi(sarg);
      break;
    case 'f':
      sarg.assign(optarg);
      arg.tf = stoi(sarg);
      break;
    case 'l':
      sarg.assign(optarg);
      arg.tl = stoi(sarg);
      break;
    case 'r':
      arg.rev = true;
      break;
    case 'o':
      arg.output.assign(optarg);
      break;
    case 'h':
      cerr << usage;
      exit(1);
    case '?':
      cerr << "Unknown option.\n" << usage;
      exit(1);
    }
  }
  // the only input parameter is the file name
  if (argc == optind + 1)
  {
    arg.filename.assign(argv[optind]);
  }
  else
  {
    cerr << "Invalid number of arguments\n" << usage;
    exit(1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, -0x38(%rbp)
movl %edi, -0x64(%rbp)
movq %rsi, -0x30(%rbp)
movq (%rsi), %rsi
leaq -0x190(%rbp), %rdi
leaq -0x39(%rbp), %rdx
callq 0x30d0
leaq 0xc5f5(%rip), %rcx      # 0x13200
leaq -0x190(%rbp), %rdi
movl $0x7, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3280
leaq -0x100(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6c4f
movq %rdx, -0x110(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x100(%rbp)
jmp 0x6c57
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x110(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc58c(%rip), %rsi      # 0x13208
callq 0x3400
leaq -0x120(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6cae
movq %rdx, -0x130(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x120(%rbp)
jmp 0x6cb5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x130(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc573(%rip), %rsi      # 0x1324d
callq 0x3400
leaq -0xc0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d0c
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0x6d12
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xd0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc56a(%rip), %rsi      # 0x132a1
callq 0x3400
leaq -0xe0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6d69
movq %rdx, -0xf0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe0(%rbp)
jmp 0x6d6f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xf0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc537(%rip), %rsi      # 0x132cb
callq 0x3400
leaq -0x140(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6dc9
movq %rsi, %r14
movq %rdx, -0x150(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x140(%rbp)
jmp 0x6dd2
movups (%rcx), %xmm0
movq %rsi, %r14
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x150(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc52a(%rip), %rsi      # 0x13321
callq 0x3400
leaq -0x160(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6e29
movq %rdx, -0x170(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x160(%rbp)
jmp 0x6e31
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x170(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc510(%rip), %rsi      # 0x13366
callq 0x3400
leaq -0x78(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6e82
movq %rdx, -0x88(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x78(%rbp)
jmp 0x6e88
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq -0x88(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc4fd(%rip), %rsi      # 0x133aa
callq 0x3400
leaq -0x50(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6ed6
movq %rdx, -0x60(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x50(%rbp)
jmp 0x6edc
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x60(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc4e6(%rip), %rsi      # 0x133e4
callq 0x3400
leaq -0x98(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6f30
movq %rdx, -0xa8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x98(%rbp)
jmp 0x6f36
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0xa0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x6f62
callq 0x3230
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0x6f73
callq 0x3230
movq -0x170(%rbp), %rdi
cmpq %r13, %rdi
je 0x6f84
callq 0x3230
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x6f95
callq 0x3230
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %rbx
je 0x6fb1
callq 0x3230
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x6fc9
callq 0x3230
movq -0x130(%rbp), %rdi
cmpq %r15, %rdi
je 0x6fda
callq 0x3230
movq -0x110(%rbp), %rdi
cmpq %r12, %rdi
je 0x6feb
callq 0x3230
leaq -0x180(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7000
callq 0x3230
leaq -0x60(%rbp), %rax
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
addq $0x48, %rax
movq %rax, -0xb0(%rbp)
leaq 0xc3fd(%rip), %r13      # 0x13426
leaq 0xc180(%rip), %r14      # 0x131b0
movl -0x64(%rbp), %edi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0x3080
leal -0x64(%rax), %ecx
cmpl $0xe, %ecx
ja 0x7307
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x11f45(%rip), %rax     # 0x18fa0
movq (%rax), %rbx
movq -0x58(%rbp), %r12
movq %rbx, %rdi
callq 0x30f0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x3350
movq -0x60(%rbp), %rbx
callq 0x3050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %rbx, -0x88(%rbp)
je 0x73ce
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x73c2
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x73c2
testl %ecx, %ecx
jne 0x70e3
movl %r15d, (%r12)
movq -0x38(%rbp), %rcx
movq %rax, 0x28(%rcx)
jmp 0x7030
movq 0x11ea9(%rip), %rax     # 0x18fa0
movq (%rax), %rbx
movq -0x38(%rbp), %rax
movq 0x50(%rax), %r12
movq %rbx, %rdi
callq 0x30f0
movq -0xb0(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x3350
jmp 0x7030
movq 0x11e73(%rip), %rax     # 0x18fa0
movq (%rax), %rbx
movq -0x58(%rbp), %r12
movq %rbx, %rdi
callq 0x30f0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x3350
movq -0x60(%rbp), %rbx
callq 0x3050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %rbx, -0x88(%rbp)
je 0x7416
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x740a
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x740a
testl %ecx, %ecx
jne 0x71b5
movl %r15d, (%r12)
movq -0x38(%rbp), %rcx
movq %rax, 0x30(%rcx)
jmp 0x7030
movq 0x11dd7(%rip), %rax     # 0x18fa0
movq (%rax), %rbx
movq -0x58(%rbp), %r12
movq %rbx, %rdi
callq 0x30f0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x3350
movq -0x60(%rbp), %rbx
callq 0x3050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %rbx, -0x88(%rbp)
je 0x73e6
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x73da
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x73da
testl %ecx, %ecx
jne 0x7251
movl %r15d, (%r12)
movq -0x38(%rbp), %rcx
movq %rax, 0x38(%rcx)
jmp 0x7030
movq 0x11d3b(%rip), %rax     # 0x18fa0
movq (%rax), %r12
movq -0x58(%rbp), %rbx
movq %r12, %rdi
callq 0x30f0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x3350
movq -0x60(%rbp), %rbx
callq 0x3050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
movl $0xa, %edx
callq 0x32e0
cmpq %rbx, -0x88(%rbp)
je 0x73fe
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x73f2
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x73f2
testl %ecx, %ecx
jne 0x72ed
movl %r15d, (%r12)
movq -0x38(%rbp), %rcx
movq %rax, 0x20(%rcx)
jmp 0x7030
movq -0x38(%rbp), %rax
movb $0x1, 0x40(%rax)
jmp 0x7030
cmpl $-0x1, %eax
je 0x7345
cmpl $0x3f, %eax
jne 0x7030
movq 0x11cd4(%rip), %rdi     # 0x18ff0
leaq 0xc10f(%rip), %rsi      # 0x13432
movl $0x10, %edx
callq 0x3290
movq 0x11cbc(%rip), %rdi     # 0x18ff0
leaq -0xa8(%rbp), %rsi
callq 0x3220
jmp 0x7435
movq 0x11c84(%rip), %rax     # 0x18fd0
movslq (%rax), %rax
leal 0x1(%rax), %ecx
cmpl -0x64(%rbp), %ecx
jne 0x743f
movq -0x30(%rbp), %rcx
movq (%rcx,%rax,8), %rbx
movq -0x38(%rbp), %r15
movq 0x8(%r15), %r14
movq %rbx, %rdi
callq 0x30f0
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
callq 0x3350
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x7398
callq 0x3230
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x73b0
callq 0x3230
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc285(%rip), %rdi      # 0x1364e
callq 0x3300
leaq 0xc279(%rip), %rdi      # 0x1364e
callq 0x3130
leaq 0xc26d(%rip), %rdi      # 0x1364e
callq 0x3300
leaq 0xc261(%rip), %rdi      # 0x1364e
callq 0x3130
leaq 0xc255(%rip), %rdi      # 0x1364e
callq 0x3300
leaq 0xc249(%rip), %rdi      # 0x1364e
callq 0x3130
leaq 0xc23d(%rip), %rdi      # 0x1364e
callq 0x3300
leaq 0xc231(%rip), %rdi      # 0x1364e
callq 0x3130
movq 0x11bc7(%rip), %rdi     # 0x18ff0
leaq -0xa8(%rbp), %rsi
callq 0x3220
movl $0x1, %edi
callq 0x32a0
movq 0x11baa(%rip), %rdi     # 0x18ff0
leaq 0xbff6(%rip), %rsi      # 0x13443
movl $0x1c, %edx
callq 0x3290
movq 0x11b92(%rip), %rdi     # 0x18ff0
leaq -0xa8(%rbp), %rsi
callq 0x3220
jmp 0x7435
movq %rax, -0x30(%rbp)
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x7488
callq 0x3230
jmp 0x7488
movq %rax, -0x30(%rbp)
movq -0x88(%rbp), %rdi
cmpq %rbx, %rdi
je 0x749f
callq 0x3230
jmp 0x749f
movq %rax, -0x30(%rbp)
movq -0x170(%rbp), %rdi
cmpq %r13, %rdi
je 0x74b6
callq 0x3230
jmp 0x74b6
movq %rax, -0x30(%rbp)
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x74cd
callq 0x3230
jmp 0x74cd
movq %rax, -0x30(%rbp)
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x74eb
callq 0x3230
jmp 0x74eb
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x7509
callq 0x3230
jmp 0x7509
movq %rax, -0x30(%rbp)
movq -0x130(%rbp), %rdi
cmpq %r15, %rdi
je 0x7520
callq 0x3230
jmp 0x7520
movq %rax, -0x30(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r12, %rdi
je 0x7537
callq 0x3230
jmp 0x7537
movq %rax, -0x30(%rbp)
leaq -0x180(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x754c
callq 0x3230
movq -0x30(%rbp), %rbx
jmp 0x759d
movq %rax, -0x30(%rbp)
jmp 0x754c
jmp 0x7570
jmp 0x7560
jmp 0x7560
jmp 0x7560
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x7573
movl %r15d, (%r12)
jmp 0x7573
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x60(%rbp), %rdi
cmpq %rax, %rdi
je 0x7585
callq 0x3230
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x759d
callq 0x3230
movq %rbx, %rdi
callq 0x33d0