// File: /workspace/github_cpp_makefile_star2_O3/Ahhgust[P]STRaitRazor/str8.cpp
// Function: main
int
main(int argc, char **argv) {

  if (argc < 3) {
    fprintf(stderr, "Not enough arguments!\n");
    usage(argv[0]);
  }

  unsigned i;

#ifdef OSX // for the named semaphores required by OSX
  char buff[100];
  sprintf(buff, "%ld", (long)getpid() );
#endif


  int start = parseArgs(argc, argv, opt);

  if ( opt.useQuality) {
    initQvalLUT( opt.useQuality );
    USE_QVALS=opt.useQuality; // working with pthreads is much easier if we just use globals... 
  }
  
  if (opt.numThreads == 0)
    opt.numThreads=1;
  
  int *ids;
  
  ids = new int [ opt.numThreads];
  matches = new Matches[ opt.numThreads ]; // each thread records the records it found

  
  
  for (i=0; i < (unsigned) opt.numThreads; ++i)
    ids[i] = i;
  
  std::ios::sync_with_stdio(false);
  
  // parse the config file
  c = parseConfig(opt.config, &numStrs, opt.type);

  biasCounts = new unsigned* [ opt.numThreads]; // and counts for partial allelic dropout  
  totalCounts = new unsigned* [ opt.numThreads]; // and counts for partial allelic dropout  

  leftFlankPosSum = new unsigned long* [ opt.numThreads]; // and counts for partial allelic dropout  
  rightFlankPosSum = new unsigned long* [ opt.numThreads]; // and counts for partial allelic dropout  

  for (i=0; i < (unsigned) opt.numThreads; ++i) {
    biasCounts[i] = new unsigned[ numStrs ](); // () initializes the bias counts to 0
    totalCounts[i] = new unsigned[ numStrs ](); // () initializes the total counts to 0

    leftFlankPosSum[i] = new unsigned long [ numStrs ](); 
    rightFlankPosSum[i] = new unsigned long [ numStrs ](); 
  }
  

  if (numStrs==0) {
    fprintf(stderr, "No markers found in file: %s\n", opt.config);
    return 1;
  }


  // compute minima and maxima for the STRs we're looking for
  minLen = min((*c)[0].forwardLength,  (*c)[0].reverseLength);
  maxLen = max(  (*c)[0].forwardLength,
                 max( (*c)[0].reverseLength, (*c)[0].motifLength));
  // assumes that the motif nomenclature cannot be negative
  minFrag =   (*c)[0].forwardLength +   (*c)[0].reverseLength + (*c)[0].motifOffset;
  for (i=1; i < numStrs; ++i) {

    if ((int)  (*c)[i].forwardLength < minLen)
      minLen =   (*c)[i].forwardLength;

    if ((int)  (*c)[i].reverseLength < minLen)
      minLen =   (*c)[i].reverseLength;

    if ((int)  (*c)[i].forwardLength > maxLen)
      maxLen =   (*c)[i].forwardLength;

    if ((int)  (*c)[i].reverseLength > maxLen)
      maxLen =   (*c)[i].reverseLength;

    if ((int)  (*c)[i].motifLength > maxLen)
      maxLen =   (*c)[i].motifLength;


    int fragLen =   (*c)[i].forwardLength +   (*c)[i].reverseLength + (*c)[i].motifOffset;
    if (fragLen < minFrag)
      minFrag = fragLen;
  }


  trie = new Trie;
  trie->makeTrieFromConfig(c, numStrs, opt.distance, opt.motifDistance);
    

#ifndef NOTHREADS
  if (opt.numThreads > 1) {
    if (pthread_mutex_init(&ioLock, 0)) {
      cerr << "Failed to init mutex..." << endl;
    }
    /* unnamed semaphore. not supported on OSX! */
#ifdef OSX
    writersLock = sem_open( buff , O_CREAT, 0600, 0);
#else
    if (sem_init(&writersLock, 0, 0)) {
      cerr << "Failed to init semaphore..." << endl;
      return 1;
    }
#endif

    

  }
#endif

  
  for (i=start ; i < (unsigned)argc; ++i) {
    ifstream in;
    in.open(argv[i], ios::in);
    if (! in.is_open() ) {
      cerr << "Failed to open " << argv[i] << " for reading\n";
      continue;
    }
    currentInputStream = &in;


    if (opt.numThreads < 2) 
      findMatchesOneThread(  );
    else {
#ifndef NOTHREADS
      int err;
      pthread_t t;
      list <pthread_t> threads;
            
      err = pthread_create(&t, NULL, writerThread, NULL ); 
      if (err) {
        cerr << "Error creating writer thread" << endl;
        exit(EXIT_FAILURE);
      }
      threads.push_back(t);

      for (int j=0; j < opt.numThreads; ++j) {
        err = pthread_create(&t, NULL, workerThread, (void*) &(ids[j]) ); 
        if (err) {
          cerr << "Error creating thread number: " << j << endl;
          exit(EXIT_FAILURE);
        }
        threads.push_back(t);
      }
      for (list<pthread_t>::iterator itr = threads.begin(); itr != threads.end(); ++itr) { // collect the threads when we're done
        t = *itr;
        pthread_join(t, NULL);
      }

      threads.clear();
      std::ios::sync_with_stdio(true);
      printReportsMT(opt.out);
      std::ios::sync_with_stdio(false);
#endif

    }
    in.close();
  }

  // if no fastq files are given then check stdin
  if (argc == start)  {

    currentInputStream = &cin;
    if (opt.numThreads < 2) 
      findMatchesOneThread(  );

    else {
#ifndef NOTHREADS
      int err;
      pthread_t t;
      list <pthread_t> threads;
            
      err = pthread_create(&t, NULL, writerThread, NULL ); 
      if (err) {
        cerr << "Error creating writer thread" << endl;
        exit(EXIT_FAILURE);
      }
      threads.push_back(t);
      
      for (int j=0; j < opt.numThreads; ++j) {
        err = pthread_create(&t, NULL, workerThread, (void*) &ids[j] ); 
        if (err) {
          cerr << "Error creating thread number: " << j << endl;
          exit(EXIT_FAILURE);
        }
        threads.push_back(t);
      }
      for (list<pthread_t>::iterator itr = threads.begin(); itr != threads.end(); ++itr) { // collect the threads when we're done
        t = *itr;
        pthread_join(t, NULL);
      }

      threads.clear();
      std::ios::sync_with_stdio(true);
      printReportsMT(opt.out);
      std::ios::sync_with_stdio(false);
#endif

    }

  }


#ifndef NOTHREADS
  if (opt.numThreads > 1) {
    pthread_mutex_destroy(&ioLock);

#ifdef OSX
    sem_unlink(buff);
#else
    sem_destroy(&writersLock);
#endif

  }
#endif

  // let's close our file handles, shall we?
  fclose(opt.out);

  // optionally can free memory here...
  // delete ids;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rsi, %rbx
cmpl $0x2, %edi
jle 0x6c2c
leaq 0x8fe2(%rip), %rdx      # 0xf2c8
movl %edi, 0x4(%rsp)
movq %rbx, %rsi
callq 0x57a5
movl %eax, (%rsp)
movb 0x8fd7(%rip), %al       # 0xf2d2
testb %al, %al
je 0x6313
movsbl %al, %edi
callq 0x399c
movb 0x8fc5(%rip), %al       # 0xf2d2
movb %al, 0x62405d(%rip)     # 0x62a370
movq %rbx, 0x30(%rsp)
movl 0x8fca(%rip), %eax      # 0xf2e8
testl %eax, %eax
je 0x633f
movslq %eax, %r14
leaq (,%r14,4), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
movl %eax, %r15d
jmp 0x635a
movl $0x1, 0x8f9f(%rip)      # 0xf2e8
movl $0x4, %edi
movl $0x1, %r14d
movl $0x1, %r15d
movl $0x30, %ecx
movq %r14, %rax
mulq %rcx
seto %cl
orq $0x8, %rax
movq $-0x1, %rbx
testb %cl, %cl
cmoveq %rax, %rbx
callq 0x3030
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
callq 0x3030
movq %r14, (%rax)
leaq 0x8(%rax), %rcx
addq $0x10, %rax
shlq $0x4, %r14
leaq (%r14,%r14,2), %rdx
xorl %esi, %esi
movl $0x0, (%rax)
movq %rsi, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rsi, 0x20(%rax)
addq $0x30, %rax
addq $-0x30, %rdx
jne 0x63a0
movq %rcx, 0x623ff9(%rip)    # 0x62a3c0
leaq 0x1(%r15), %rax
andq $-0x2, %rax
decq %r15
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x4c7c(%rip), %xmm1     # 0xb060
xorl %ecx, %ecx
movdqa 0x4c82(%rip), %xmm2     # 0xb070
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x4c82(%rip), %xmm4     # 0xb080
movq 0x20(%rsp), %rsi
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x6437
movl %ecx, (%rsi,%rcx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x644c
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rsi,%rcx,4)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %rax
jne 0x6403
xorl %edi, %edi
callq 0x3120
movq 0x8e79(%rip), %rdi      # 0xf2e0
movq 0x8e82(%rip), %rdx      # 0xf2f0
leaq 0x623f0b(%rip), %rsi    # 0x62a380
callq 0x8654
movq %rax, 0x623ef7(%rip)    # 0x62a378
movslq 0x8e60(%rip), %r14      # 0xf2e8
leaq (,%r14,8), %rax
testq %r14, %r14
movq $-0x1, %rbx
cmovnsq %rax, %rbx
movq %rbx, %rdi
callq 0x3030
movq %rax, 0x623ef3(%rip)    # 0x62a3a0
movq %rbx, %rdi
callq 0x3030
movq %rax, 0x623eec(%rip)    # 0x62a3a8
movq %rbx, %rdi
callq 0x3030
movq %rax, 0x623ee5(%rip)    # 0x62a3b0
movq %rbx, %rdi
callq 0x3030
movq %rax, 0x623ede(%rip)    # 0x62a3b8
movl 0x623e9f(%rip), %r12d   # 0x62a380
testq %r14, %r14
je 0x6597
movl %r14d, %r13d
leaq (,%r12,4), %r14
leaq (,%r12,8), %r15
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x3030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3180
movq 0x623e82(%rip), %rax    # 0x62a3a0
movq %rbx, (%rax,%rbp,8)
movq %r14, %rdi
callq 0x3030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3180
movq 0x623e67(%rip), %rax    # 0x62a3a8
movq %rbx, (%rax,%rbp,8)
movq %r15, %rdi
callq 0x3030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3180
movq 0x623e4c(%rip), %rax    # 0x62a3b0
movq %rbx, (%rax,%rbp,8)
movq %r15, %rdi
callq 0x3030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3180
movq 0x623e31(%rip), %rax    # 0x62a3b8
movq %rbx, (%rax,%rbp,8)
incq %rbp
cmpq %rbp, %r13
jne 0x64ff
testq %r12, %r12
je 0x6b92
movq 0x623dd1(%rip), %rax    # 0x62a378
movq (%rax), %rax
movl 0xa0(%rax), %edi
movl 0xa4(%rax), %esi
cmpl %edi, %esi
movl %edi, %ecx
cmovbl %esi, %ecx
movl %ecx, 0x623dc5(%rip)    # 0x62a388
movl 0xa8(%rax), %edx
cmpl %edx, %esi
cmoval %esi, %edx
cmpl %edx, %edi
cmoval %edi, %edx
movl %edx, 0x623db3(%rip)    # 0x62a38c
addl %esi, %edi
movzwl 0xae(%rax), %esi
addl %edi, %esi
movl %esi, 0x623d9a(%rip)    # 0x62a384
cmpl $0x1, %r12d
je 0x6667
addq $0x158, %rax            # imm = 0x158
decq %r12
movl (%rax), %edi
cmpl %ecx, %edi
jge 0x6607
movl %edi, 0x623d83(%rip)    # 0x62a388
movl %edi, %ecx
movl 0x4(%rax), %edi
cmpl %ecx, %edi
jge 0x6616
movl %edi, 0x623d74(%rip)    # 0x62a388
movl %edi, %ecx
movl (%rax), %edi
cmpl %edx, %edi
jle 0x6624
movl %edi, 0x623d6a(%rip)    # 0x62a38c
movl %edi, %edx
movl 0x4(%rax), %edi
cmpl %edx, %edi
jle 0x6633
movl %edi, 0x623d5b(%rip)    # 0x62a38c
movl %edi, %edx
movl 0x8(%rax), %edi
cmpl %edx, %edi
jle 0x6642
movl %edi, 0x623d4c(%rip)    # 0x62a38c
movl %edi, %edx
movl 0x4(%rax), %r8d
addl (%rax), %r8d
movzwl 0xe(%rax), %edi
addl %r8d, %edi
cmpl %esi, %edi
jge 0x665c
movl %edi, 0x623d2a(%rip)    # 0x62a384
movl %edi, %esi
addq $0xb8, %rax
decq %r12
jne 0x65f9
movl $0x18, %edi
callq 0x32c0
movq %rax, %r14
movq %rax, %rdi
callq 0x9834
movq %r14, 0x623d0d(%rip)    # 0x62a390
movq 0x623cee(%rip), %rsi    # 0x62a378
movl 0x623cf0(%rip), %edx    # 0x62a380
movzbl 0x8c56(%rip), %ecx      # 0xf2ed
movzbl 0x8c4f(%rip), %r8d      # 0xf2ee
movq %r14, %rdi
callq 0xa252
cmpl $0x2, 0x8c3a(%rip)      # 0xf2e8
movq 0x30(%rsp), %r14
jl 0x676d
leaq 0x623458(%rip), %rdi    # 0x629b18
xorl %esi, %esi
callq 0x33c0
testl %eax, %eax
je 0x670d
movq 0x891e(%rip), %rbx      # 0xeff0
leaq 0x5627(%rip), %rsi      # 0xbd00
movl $0x17, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
leaq 0x62342c(%rip), %rdi    # 0x629b40
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
testl %eax, %eax
je 0x676d
movq 0x88c8(%rip), %rbx      # 0xeff0
leaq 0x55e9(%rip), %rsi      # 0xbd18
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movl $0x1, %eax
jmp 0x6b80
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jae 0x69ca
movl (%rsp), %r13d
movl 0x4(%rsp), %eax
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rbx
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %rbp
leaq -0x71f(%rip), %r12      # 0x607e
movq %rbx, %rdi
callq 0x3300
movq (%r14,%r13,8), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x31a0
leaq 0xb8(%rsp), %rdi
callq 0x30a0
testb %al, %al
je 0x67e1
movq %rbx, 0x623342(%rip)    # 0x629b10
cmpl $0x1, 0x8b13(%rip)      # 0xf2e8
jg 0x682a
callq 0x54e9
jmp 0x696f
movl $0xf, %edx
movq 0x8803(%rip), %rdi      # 0xeff0
leaq 0x5540(%rip), %rsi      # 0xbd34
callq 0x3310
movq (%r14,%r13,8), %rbx
testq %rbx, %rbx
je 0x6979
movq %rbx, %rdi
callq 0x3130
movq 0x87db(%rip), %rdi      # 0xeff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3310
leaq 0x40(%rsp), %rbx
jmp 0x699c
movq %r15, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
leaq -0x653(%rip), %rdx      # 0x61f6
xorl %ecx, %ecx
callq 0x34b0
testl %eax, %eax
jne 0x6c06
movl $0x18, %edi
callq 0x32c0
movq 0x28(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x3060
incq 0x18(%rsp)
cmpl $0x0, 0x8a66(%rip)      # 0xf2e8
jle 0x68da
movq 0x20(%rsp), %rbx
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x34b0
testl %eax, %eax
jne 0x6b9c
movl $0x18, %edi
callq 0x32c0
movq 0x28(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x3060
incq 0x18(%rsp)
incq %r14
movslq 0x8a17(%rip), %rax      # 0xf2e8
addq $0x4, %rbx
cmpq %rax, %r14
jl 0x688c
movq %r15, %rbx
movq (%rbx), %rbx
cmpq %r15, %rbx
je 0x68f7
movq 0x10(%rbx), %rdi
movq %rdi, 0x28(%rsp)
xorl %esi, %esi
callq 0x3280
jmp 0x68dd
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6916
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x32d0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x6901
movq %r15, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x1, %edi
callq 0x3120
movq 0x30(%rsp), %r14
movq 0x8999(%rip), %rdi      # 0xf2d8
callq 0x41bd
xorl %edi, %edi
callq 0x3120
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x696a
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x32d0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x6955
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x3090
jmp 0x69b4
movq 0x8670(%rip), %rcx      # 0xeff0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x3450
leaq 0x40(%rsp), %rbx
movl $0xd, %edx
movq 0x8648(%rip), %rdi      # 0xeff0
leaq 0x5395(%rip), %rsi      # 0xbd44
callq 0x3310
movq %rbx, %rdi
callq 0x30b0
incq %r13
cmpq 0x38(%rsp), %r13
jne 0x679d
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jne 0x6b51
movq 0x85fa(%rip), %rax      # 0xefd8
movq %rax, 0x62312b(%rip)    # 0x629b10
cmpl $0x1, 0x88fc(%rip)      # 0xf2e8
jg 0x69f8
callq 0x54e9
jmp 0x6b51
leaq 0x40(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
leaq -0x81d(%rip), %rdx      # 0x61f6
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x34b0
testl %eax, %eax
jne 0x6c34
movl $0x18, %edi
callq 0x32c0
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x40(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3060
incq 0x10(%r14)
cmpl $0x0, 0x8891(%rip)      # 0xf2e8
movq 0x20(%rsp), %rcx
jle 0x6ac3
xorl %r15d, %r15d
leaq -0x9ea(%rip), %r12      # 0x607e
leaq 0x8(%rsp), %rbx
leaq 0x40(%rsp), %rbp
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rcx, %r13
callq 0x34b0
testl %eax, %eax
jne 0x6bd5
movl $0x18, %edi
callq 0x32c0
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3060
incq 0x50(%rsp)
incq %r15
movslq 0x8831(%rip), %rax      # 0xf2e8
movq %r13, %rcx
addq $0x4, %rcx
cmpq %rax, %r15
jl 0x6a72
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x6ae0
movq 0x10(%rbx), %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
callq 0x3280
jmp 0x6ac6
leaq 0x40(%rsp), %rbx
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x6b02
movq (%rdi), %r14
movl $0x18, %esi
callq 0x32d0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x6aed
movq %rbx, 0x48(%rsp)
movq %rbx, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x1, %edi
callq 0x3120
movq 0x87b2(%rip), %rdi      # 0xf2d8
callq 0x41bd
xorl %edi, %edi
callq 0x3120
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6b51
movq (%rdi), %r14
movl $0x18, %esi
callq 0x32d0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x6b3c
cmpl $0x2, 0x8790(%rip)      # 0xf2e8
jl 0x6b72
leaq 0x622fb7(%rip), %rdi    # 0x629b18
callq 0x3320
leaq 0x622fd3(%rip), %rdi    # 0x629b40
callq 0x34f0
movq 0x875f(%rip), %rdi      # 0xf2d8
callq 0x32b0
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3545
jmp 0x6763
movq 0x844d(%rip), %rdi      # 0xeff0
leaq 0x51c5(%rip), %rsi      # 0xbd6f
movl $0x1e, %edx
callq 0x3310
movq 0x8435(%rip), %rdi      # 0xeff0
movl %r14d, %esi
callq 0x3460
movq %rax, %rdi
callq 0x3140
movl $0x1, %edi
callq 0x3340
movq 0x8414(%rip), %rdi      # 0xeff0
leaq 0x518c(%rip), %rsi      # 0xbd6f
movl $0x1e, %edx
callq 0x3310
movq 0x83fc(%rip), %rdi      # 0xeff0
movl %r15d, %esi
callq 0x3460
movq %rax, %rdi
callq 0x3140
jmp 0x6bcb
movq 0x83e3(%rip), %rdi      # 0xeff0
leaq 0x513e(%rip), %rsi      # 0xbd52
movl $0x1c, %edx
callq 0x3310
movq 0x83cb(%rip), %rdi      # 0xeff0
callq 0x3140
jmp 0x6bcb
movq %rbx, %rdi
callq 0x3564
movq 0x83b5(%rip), %rdi      # 0xeff0
leaq 0x5110(%rip), %rsi      # 0xbd52
movl $0x1c, %edx
callq 0x3310
movq 0x839d(%rip), %rdi      # 0xeff0
callq 0x3140
jmp 0x6bcb
jmp 0x6c77
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
callq 0x32d0
jmp 0x6cda
jmp 0x6cab
jmp 0x6c77
jmp 0x6c77
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x40(%rsp), %r15
cmpq %r15, %rdi
je 0x6cda
movq (%rdi), %r14
movl $0x18, %esi
callq 0x32d0
movq %r14, %rdi
cmpq %r15, %r14
jne 0x6c89
jmp 0x6cda
jmp 0x6cab
movq %rax, %rbx
jmp 0x6cd0
jmp 0x6cab
jmp 0x6cab
movq %rax, %rbx
leaq 0x8(%rsp), %r14
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x6cd0
movq (%rdi), %r15
movl $0x18, %esi
callq 0x32d0
movq %r15, %rdi
cmpq %r14, %r15
jne 0x6cbb
leaq 0x40(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x3480