// File: /workspace/github_c_makefile_star2_O3/thegenemyers[P]DAMASKER/tandem.c
// Function: Match_Self
void Match_Self(char *aname, DAZZ_DB *ablock, Align_Spec *aspec)
{ THREAD     threads[NTHREADS];
  Merge_Arg  parmm[NTHREADS];
  Lex_Arg    parmx[NTHREADS];
  Report_Arg parmr[NTHREADS];
  int        pairsort[16];

  int64     nfilt, ncheck;

  KmerPos  *asort, *osort;
  int       alen;
  int64     atot;

  //  Setup 

  atot = ablock->totlen;

  nfilt = ncheck = 0;

  { int64 powr;
    int   i, nbyte;

    for (i = 0; i < NTHREADS; i++)
      parmx[i].sptr = (int64 *) alloca(NTHREADS*BPOWR*sizeof(int64));

    for (i = 0; i < 16; i++)
      pairsort[i] = 0;

    powr = 1;
    for (nbyte = 0; powr < ablock->maxlen; nbyte += 1)
      powr <<= 8;
    for (i = 8; i < 8+nbyte; i++)
      pairsort[i] = 1;

    powr = 1;
    for (nbyte = 0; powr < ablock->nreads; nbyte += 1)
      powr <<= 8;
    for (i = 12; i < 12+nbyte; i++)
      pairsort[i] = 1;
  }

  //  Build K-mer sorted index of ablock

  if (VERBOSE)
    printf("\nIndexing %s\n",aname);

  osort = NULL;   //  Just to shut up dumb compilers
  asort = Sort_Kmers(ablock,&alen,&osort);

  if (VERBOSE)
    printf("\nComparing %s to itself\n",aname);

  if (alen == 0)
    goto zerowork;

  //  Determine equal K-mer links

  { int    i, p;
    uint64 c;

    parmm[0].abeg = 0;
    for (i = 1; i < NTHREADS; i++)
      { p = (int) ((((int64) alen) * i) >> NSHIFT);
        if (p > 0)
          { c = asort[p-1].code;
            while (asort[p].code == c)
              p += 1;
          }
        parmm[i].abeg = parmm[i-1].aend = p;
      }
    parmm[NTHREADS-1].aend = alen;

    for (i = 0; i < NTHREADS; i++)
      { parmm[i].kptr = parmx[i].tptr;
        for (p = 0; p < BPOWR; p++)
          parmm[i].kptr[p] = 0;
      }

    MG_alist = asort;

    for (i = 0; i < NTHREADS; i++)
      pthread_create(threads+i,NULL,count_thread,parmm+i);

    for (i = 0; i < NTHREADS; i++)
      pthread_join(threads[i],NULL);

#ifdef TEST_PAIRS
    printf("\nCROSS SORT %d:\n",alen);
    for (i = 0; i < HOW_MANY && i <= alen; i++)
      { KmerPos *c = asort+i;
        printf(" %5d / %5d / %10lld\n",c->read,c->rpos,c->code);
        fflush(stdout);
      }
#endif
  }

  //  Resort the list on read,rpos

  { int      i;
    KmerPos *rez;

    for (i = 0; i < NTHREADS; i++)
      { parmx[i].beg = parmm[i].abeg;
        parmx[i].end = parmm[i].aend;
      }

    rez = (KmerPos *) lex_sort(pairsort,(Double *) asort,(Double *) osort,parmx);
    if (rez != asort)
      { osort = asort;
        asort = rez;
      }

#ifdef TEST_CSORT
    printf("\nCROSS SORT %d:\n",alen);
    for (i = 0; i < HOW_MANY && i <= alen; i++)
      { KmerPos *c = asort+i;
        printf(" %5d / %5d / %10lld\n",c->read,c->rpos,c->code);
        fflush(stdout);
      }
#endif
  }

  //  Apply the diagonal filter and find local alignments about seed hits

  { int    i, w;
    int64  p;
    int    ar;
    int   *counters;

    MG_alist  = asort;
    MR_ablock = ablock;
    MR_spec   = aspec;
    MR_tspace = Trace_Spacing(aspec);

    asort[alen].read = ablock->nreads;
    parmr[0].beg = 0;
    for (i = 1; i < NTHREADS; i++)
      { p = (int) ((((int64) alen) * i) >> NSHIFT);
        if (p > 0)
          { ar = asort[p-1].read;
            while ((asort[p].read) == ar)
              p += 1;
          }
        parmr[i].beg = parmr[i-1].end = p;
      }
    parmr[NTHREADS-1].end = alen;

    w = ((ablock->maxlen >> Binshift) - ((-ablock->maxlen) >> Binshift)) + 1;
    counters = (int *) Malloc(NTHREADS*3*w*sizeof(int),"Allocating diagonal buckets");
    if (counters == NULL)
      Clean_Exit(1);

    for (i = 0; i < 3*w*NTHREADS; i++)
      counters[i] = 0;
    for (i = 0; i < NTHREADS; i++)
      { if (i == 0)
          parmr[i].score = counters - ((-ablock->maxlen) >> Binshift);
        else
          parmr[i].score = parmr[i-1].lasta + w;
        parmr[i].lastp = parmr[i].score + w;
        parmr[i].lasta = parmr[i].lastp + w;
        parmr[i].work  = New_Work_Data();

        parmr[i].ofile =
             Fopen(Catenate(SORT_PATH,"/",aname,Numbered_Suffix(".T",i+1,".las")),"w");
        if (parmr[i].ofile == NULL)
          Clean_Exit(1);
      }

#ifdef NOTHREAD

    for (i = 0; i < NTHREADS; i++)
      report_thread(parmr+i);

#else

    for (i = 0; i < NTHREADS; i++)
      pthread_create(threads+i,NULL,report_thread,parmr+i);

    for (i = 0; i < NTHREADS; i++)
      pthread_join(threads[i],NULL);

#endif

    if (VERBOSE)
      for (i = 0; i < NTHREADS; i++)
        { nfilt  += parmr[i].nfilt;
          ncheck += parmr[i].ncheck;
        }

    for (i = 0; i < NTHREADS; i++)
      Free_Work_Data(parmr[i].work);
    free(counters);
  }

  //  Finish up

  goto epilogue;

zerowork:
  { FILE *ofile;
    int   i;

    nfilt  = 0;
    for (i = 0; i < NTHREADS; i++)
      { ofile = Fopen(Catenate(SORT_PATH,"/",aname,Numbered_Suffix(".T",i+1,".las")),"w");
        fwrite(&nfilt,sizeof(int64),1,ofile);
        fwrite(&MR_tspace,sizeof(int),1,ofile);
        fclose(ofile);
      }
  }

epilogue:

  free(asort);
  free(osort);

  if (VERBOSE)
    { int width;

      if (nfilt <= 0)
        width = 1;
      else
        width = ((int) log10((double) nfilt)) + 1;
      width += (width-1)/3;

      printf("\n     ");
      Print_Number(nfilt,width,stdout);
      printf(" seed hits (%e of matrix)\n     ",(1.*nfilt/atot)/atot);
      Print_Number(ncheck,width,stdout);
      printf(" confirmed hits (%e of matrix)\n",(1.*ncheck/atot)/atot);
      fflush(stdout);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, -0x78(%rbp)
movq %rdi, %rbx
movl 0x200a6(%rip), %ecx     # 0x241f8
movq %rsp, %r14
leaq 0xf(,%rcx,8), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %rsp, %rdi
movq %rcx, %rax
shlq $0x4, %rax
subq %rax, %rdi
movq %rdi, %rsp
movq %rsp, %r8
imulq $0x818, %rcx, %rax      # imm = 0x818
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r8
movq %r8, %rsp
movq %rsp, %r12
leaq (%rcx,%rcx,8), %rax
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %rsi, -0x48(%rbp)
movq 0x28(%rsi), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x58(%rbp)
testl %ecx, %ecx
jle 0x4283
movl %ecx, %eax
shll $0x8, %eax
shlq $0x3, %rax
leal 0x1(%rcx), %edx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %edx
imulq $0x1030, %rdx, %rcx     # imm = 0x1030
movdqa 0x193e2(%rip), %xmm1    # 0x1d5d0
xorl %edx, %edx
movdqa 0x193e8(%rip), %xmm2    # 0x1d5e0
pxor %xmm2, %xmm0
addq $0xf, %rax
andq $-0x10, %rax
pcmpeqd %xmm3, %xmm3
movdqa 0x193e0(%rip), %xmm4    # 0x1d5f0
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, %esi
notl %esi
testb $0x1, %sil
je 0x4253
movq %rsp, %rsi
subq %rax, %rsi
movq %rsi, %rsp
movq %rsi, 0x810(%r8,%rdx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x4273
movq %rsp, %rsi
subq %rax, %rsi
movq %rsi, %rsp
movq %rsi, 0x1028(%r8,%rdx)
paddq %xmm4, %xmm1
addq $0x1030, %rdx           # imm = 0x1030
cmpq %rdx, %rcx
jne 0x4210
pxor %xmm0, %xmm0
movdqa %xmm0, -0xa0(%rbp)
movdqa %xmm0, -0xb0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa %xmm0, -0xd0(%rbp)
movq -0x48(%rbp), %rax
movslq 0x20(%rax), %rcx
cmpq $0x2, %rcx
jl 0x43cc
movl $0x1, %edx
movq $-0x1, %rax
shlq $0x8, %rdx
incq %rax
cmpq %rcx, %rdx
jl 0x42c5
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
andq $-0x4, %rax
addq $0x4, %rax
xorl %ecx, %ecx
movdqa 0x19313(%rip), %xmm1    # 0x1d600
movdqa 0x192db(%rip), %xmm2    # 0x1d5d0
movdqa 0x192e3(%rip), %xmm3    # 0x1d5e0
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x4352
movl $0x1, -0xb0(%rbp,%rcx,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x436b
movl $0x1, -0xac(%rbp,%rcx,4)
por %xmm1, %xmm5
pxor %xmm3, %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
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edx
testb $0x1, %dl
je 0x43aa
movl $0x1, -0xa8(%rbp,%rcx,4)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x43bf
movl $0x1, -0xa4(%rbp,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x4305
movq -0x48(%rbp), %rax
movslq 0x30(%rax), %rcx
cmpq $0x2, %rcx
jl 0x44f1
movl $0x1, %edx
movq $-0x1, %rax
shlq $0x8, %rdx
incq %rax
cmpq %rcx, %rdx
jl 0x43ea
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
andq $-0x4, %rax
addq $0x4, %rax
xorl %ecx, %ecx
movdqa 0x191ee(%rip), %xmm1    # 0x1d600
movdqa 0x191b6(%rip), %xmm2    # 0x1d5d0
movdqa 0x191be(%rip), %xmm3    # 0x1d5e0
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x4477
movl $0x1, -0xa0(%rbp,%rcx,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x4490
movl $0x1, -0x9c(%rbp,%rcx,4)
por %xmm1, %xmm5
pxor %xmm3, %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
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edx
testb $0x1, %dl
je 0x44cf
movl $0x1, -0x98(%rbp,%rcx,4)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x44e4
movl $0x1, -0x94(%rbp,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x442a
movq %r8, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
leaq 0x1fcd4(%rip), %r15     # 0x241d4
cmpl $0x0, (%r15)
je 0x4517
leaq 0x19153(%rip), %rdi     # 0x1d660
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2150
leaq -0x60(%rbp), %rdx
movq $0x0, (%rdx)
leaq -0x64(%rbp), %rsi
movq -0x48(%rbp), %rdi
callq 0x4bad
movq %rax, %r13
cmpl $0x0, (%r15)
je 0x4549
leaq 0x1912f(%rip), %rdi     # 0x1d66e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2150
movslq -0x64(%rbp), %r10
testq %r10, %r10
je 0x46e4
movq %r14, -0x50(%rbp)
movq -0x38(%rbp), %r9
movl $0x0, (%r9)
movslq 0x1fc8c(%rip), %r14     # 0x241f8
cmpq $0x2, %r14
jl 0x45d6
movl 0x1fc84(%rip), %ecx     # 0x241fc
movl $0x1, %eax
movq %rax, %rdx
imulq %r10, %rdx
sarq %cl, %rdx
testl %edx, %edx
jle 0x45be
leal -0x1(%rdx), %esi
shlq $0x4, %rsi
movq (%r13,%rsi), %rsi
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl %edx, %r8d
decl %r8d
shlq $0x4, %rdx
addq %r13, %rdx
movq %rdx, %rdi
movl %r8d, %edx
incl %edx
leaq 0x10(%rdi), %r8
cmpq %rsi, (%rdi)
movq %r8, %rdi
je 0x45b0
movq %rax, %rsi
shlq $0x4, %rsi
movl %edx, -0xc(%r9,%rsi)
movl %edx, (%r9,%rsi)
incq %rax
cmpq %r14, %rax
jne 0x457d
movq %rbx, -0x88(%rbp)
movq %r14, %r15
shlq $0x4, %r15
movq %r10, -0x70(%rbp)
movl %r10d, -0xc(%r9,%r15)
testl %r14d, %r14d
jle 0x47a0
movq %r13, -0x40(%rbp)
movq -0x30(%rbp), %rax
leaq 0x10(%rax), %rbx
xorl %r13d, %r13d
movq %rbx, 0x8(%r9,%r13)
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2180
movq -0x38(%rbp), %r9
addq $0x818, %rbx            # imm = 0x818
addq $0x10, %r13
cmpq %r13, %r15
jne 0x4605
movq -0x40(%rbp), %r13
movq %r13, 0x1fbd0(%rip)     # 0x24208
testl %r14d, %r14d
movq -0x50(%rbp), %r14
jle 0x47a7
xorl %r13d, %r13d
leaq 0xaa6(%rip), %rbx       # 0x50f5
movq %r9, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x2280
incq %r13
movslq 0x1fb8c(%rip), %rax     # 0x241f8
addq $0x10, %r15
addq $0x8, %r14
cmpq %rax, %r13
jl 0x4652
testl %eax, %eax
movq -0x50(%rbp), %r14
movq -0x40(%rbp), %r13
jle 0x47a7
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
xorl %esi, %esi
callq 0x2300
incq %rbx
movslq 0x1fb58(%rip), %rax     # 0x241f8
cmpq %rax, %rbx
jl 0x468b
testl %eax, %eax
movq -0x38(%rbp), %rdi
jle 0x47a7
movq -0x30(%rbp), %rcx
addq $0x8, %rcx
shlq $0x4, %rax
xorl %edx, %edx
movslq (%rdi,%rdx), %rsi
movq %rsi, -0x8(%rcx)
movslq 0x4(%rdi,%rdx), %rsi
movq %rsi, (%rcx)
addq $0x818, %rcx            # imm = 0x818
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0x46bf
jmp 0x47a7
movq $0x0, -0x58(%rbp)
xorl %r14d, %r14d
cmpl $0x0, 0x1fb02(%rip)     # 0x241f8
jle 0x4aba
movq %r13, -0x40(%rbp)
leaq 0x1faf9(%rip), %r15     # 0x24200
xorl %r12d, %r12d
leaq 0x1fab7(%rip), %rax     # 0x241c8
movq (%rax), %r13
incl %r12d
leaq 0x18f87(%rip), %rdi     # 0x1d6a5
movl %r12d, %esi
leaq 0x18d98(%rip), %rdx     # 0x1d4c0
callq 0x154d6
movq %r13, %rdi
leaq 0x18f6c(%rip), %rsi     # 0x1d6a3
movq %rbx, %rdx
movq %rax, %rcx
callq 0x153cf
movq %rax, %rdi
leaq 0x19999(%rip), %rsi     # 0x1e0e5
callq 0x1524d
movq %rax, %r13
movl $0x8, %esi
movl $0x1, %edx
leaq -0x58(%rbp), %rdi
movq %rax, %rcx
callq 0x22f0
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r13, %rcx
callq 0x22f0
movq %r13, %rdi
callq 0x2100
cmpl 0x1fa6a(%rip), %r12d    # 0x241f8
jl 0x470a
leaq 0x1fa39(%rip), %r15     # 0x241d4
jmp 0x4ab6
movq %r13, 0x1fa61(%rip)     # 0x24208
movq -0x60(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
movq %r13, %rsi
movq -0x30(%rbp), %rcx
callq 0x5190
cmpq %r13, %rax
je 0x47ca
movq %r13, -0x60(%rbp)
movq %rax, %r13
leaq 0x1fa03(%rip), %r15     # 0x241d4
movq %r13, 0x1fa30(%rip)     # 0x24208
movq -0x48(%rbp), %rbx
movq %rbx, 0x1fa2d(%rip)     # 0x24210
movq -0x78(%rbp), %rdi
movq %rdi, 0x1fa2a(%rip)     # 0x24218
callq 0x69dc
movl %eax, 0x1fa07(%rip)     # 0x24200
movl 0x30(%rbx), %eax
movq -0x70(%rbp), %r11
movq %r11, %rcx
shlq $0x4, %rcx
movl %eax, 0xc(%r13,%rcx)
movq $0x0, (%r12)
movslq 0x1f9dd(%rip), %rax     # 0x241f8
cmpq $0x2, %rax
jl 0x4880
movl 0x1f9d5(%rip), %ecx     # 0x241fc
leaq 0xc(%r13), %rdx
movl $0x1, %esi
movq %rsi, %rdi
imulq %r11, %rdi
sarq %cl, %rdi
movslq %edi, %rdi
testq %rdi, %rdi
jle 0x486b
leaq -0x1(%rdi), %r9
shlq $0x4, %rdi
addq %rdx, %rdi
movq %rdi, %r8
movq %r9, %rdi
shlq $0x4, %r9
movl 0xc(%r13,%r9), %r9d
incq %rdi
leaq 0x10(%r8), %r10
cmpl %r9d, (%r8)
movq %r10, %r8
je 0x485c
leaq (%rsi,%rsi,8), %r8
movq %rdi, -0x40(%r12,%r8,8)
movq %rdi, (%r12,%r8,8)
incq %rsi
cmpq %rax, %rsi
jne 0x4830
movq %r13, -0x40(%rbp)
leaq (%rax,%rax,8), %rcx
movq %r11, -0x40(%r12,%rcx,8)
movq -0x48(%rbp), %rcx
movl 0x20(%rcx), %edx
movb 0x1f94a(%rip), %cl      # 0x241e4
movl %edx, %ebx
sarl %cl, %ebx
negl %edx
sarl %cl, %edx
subl %edx, %ebx
incl %ebx
imull %ebx, %eax
leal (%rax,%rax,2), %eax
movslq %eax, %rdi
shlq $0x2, %rdi
leaq 0x18dcd(%rip), %rsi     # 0x1d687
callq 0x1512d
movq %rax, -0x30(%rbp)
testq %rax, %rax
jne 0x48d2
movl $0x1, %edi
callq 0x351c
movl 0x1f91f(%rip), %r13d    # 0x241f8
movl %ebx, %eax
imull %r13d, %eax
leal (%rax,%rax,2), %eax
testl %eax, %eax
jle 0x48f7
movl %eax, %edx
shlq $0x2, %rdx
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x2180
testl %r13d, %r13d
jle 0x4a46
movslq %ebx, %r14
leaq 0x30(%r12), %rbx
leaq (,%r14,4), %rax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
testq %r15, %r15
je 0x492a
movq -0x58(%rbx), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x20(%rbx)
jmp 0x494e
xorl %eax, %eax
movq -0x48(%rbp), %rcx
subl 0x20(%rcx), %eax
movb 0x1f8ab(%rip), %cl      # 0x241e4
sarl %cl, %eax
movslq %eax, %rcx
shlq $0x2, %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, 0x10(%r12)
leaq (%rax,%r14,4), %rax
movq %rax, -0x18(%rbx)
leaq (%rax,%r14,4), %rax
movq %rax, -0x10(%rbx)
xorl %eax, %eax
callq 0x6708
movq %rax, -0x8(%rbx)
leaq 0x1f858(%rip), %rax     # 0x241c8
movq (%rax), %r13
incq %r15
leaq 0x18d28(%rip), %rdi     # 0x1d6a5
movl %r15d, %esi
leaq 0x18b39(%rip), %rdx     # 0x1d4c0
callq 0x154d6
movq %r13, %rdi
leaq 0x18d0d(%rip), %rsi     # 0x1d6a3
movq -0x88(%rbp), %rdx
movq %rax, %rcx
callq 0x153cf
movq %rax, %rdi
leaq 0x19736(%rip), %rsi     # 0x1e0e5
callq 0x1524d
movq %rax, (%rbx)
testq %rax, %rax
jne 0x49c6
movl $0x1, %edi
callq 0x351c
movslq 0x1f82b(%rip), %r13     # 0x241f8
addq $0x48, %rbx
cmpq %r13, %r15
jl 0x4917
testl %r13d, %r13d
leaq 0x1f7f0(%rip), %r15     # 0x241d4
jle 0x4a46
xorl %ebx, %ebx
movq -0x50(%rbp), %r14
movq %r12, %r15
movq %r14, %rdi
xorl %esi, %esi
leaq 0xafa(%rip), %rdx       # 0x54f5
movq %r15, %rcx
callq 0x2280
incq %rbx
movslq 0x1f7eb(%rip), %r13     # 0x241f8
addq $0x48, %r15
addq $0x8, %r14
cmpq %r13, %rbx
jl 0x49ef
testl %r13d, %r13d
leaq 0x1f7b0(%rip), %r15     # 0x241d4
jle 0x4a46
xorl %ebx, %ebx
movq -0x50(%rbp), %r14
movq (%r14,%rbx,8), %rdi
xorl %esi, %esi
callq 0x2300
incq %rbx
movslq 0x1f7b7(%rip), %r13     # 0x241f8
cmpq %r13, %rbx
jl 0x4a2c
cmpl $0x0, (%r15)
je 0x4a78
testl %r13d, %r13d
jle 0x4a7d
movl %r13d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,8), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
xorl %eax, %eax
addq 0x38(%r12,%rdx), %rax
addq 0x40(%r12,%rdx), %r14
addq $0x48, %rdx
cmpq %rdx, %rcx
jne 0x4a63
jmp 0x4a82
xorl %r14d, %r14d
jmp 0x4a86
xorl %eax, %eax
xorl %r14d, %r14d
movq %rax, -0x58(%rbp)
testl %r13d, %r13d
jle 0x4aad
addq $0x28, %r12
xorl %ebx, %ebx
movq (%r12), %rdi
callq 0x674f
incq %rbx
movslq 0x1f754(%rip), %rax     # 0x241f8
addq $0x48, %r12
cmpq %rax, %rbx
jl 0x4a91
movq -0x30(%rbp), %rdi
callq 0x2030
movq -0x40(%rbp), %r13
movq %r13, %rdi
callq 0x2030
movq -0x60(%rbp), %rdi
callq 0x2030
cmpl $0x0, (%r15)
je 0x4b9e
movq -0x58(%rbp), %rbx
testq %rbx, %rbx
jle 0x4af3
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
callq 0x21f0
cvttsd2si %xmm0, %eax
incl %eax
jmp 0x4af8
movl $0x1, %eax
leal -0x1(%rax), %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %r15 # imm = 0x55555556
movq %r15, %rcx
shrq $0x3f, %rcx
shrq $0x20, %r15
addl %ecx, %r15d
addl %eax, %r15d
leaq 0x18ba4(%rip), %rdi     # 0x1d6c1
xorl %eax, %eax
callq 0x2150
movq 0x1f4ad(%rip), %r12     # 0x23fd8
movq (%r12), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15585
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
cvtsi2sdq -0x80(%rbp), %xmm1
movsd %xmm1, -0x38(%rbp)
divsd %xmm1, %xmm0
divsd %xmm1, %xmm0
leaq 0x18b4c(%rip), %rdi     # 0x1d6a8
movb $0x1, %al
callq 0x2150
movq (%r12), %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x15585
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd -0x38(%rbp), %xmm1
divsd %xmm1, %xmm0
divsd %xmm1, %xmm0
leaq 0x18b3a(%rip), %rdi     # 0x1d6c8
movb $0x1, %al
callq 0x2150
movq (%r12), %rdi
callq 0x2250
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq