// File: /workspace/github_c_makefile_star2_O1/thegenemyers[P]DAMASKER/tandem.c
// Function: report_thread
static void *report_thread(void *arg)
{ Report_Arg  *data   = (Report_Arg *) arg;

  DAZZ_READ   *aread  = MR_ablock->reads;
  KmerPos     *asort  = MG_alist;

  int         *score  = data->score;
  int         *scorp  = data->score + 1;
  int         *scorm  = data->score - 1;
  int         *lastp  = data->lastp;
  int         *lasta  = data->lasta;
  int          maxdiag = ( MR_ablock->maxlen >> Binshift);
  int          mindiag = (-MR_ablock->maxlen >> Binshift);

  FILE        *ofile  = data->ofile;

  char        *aseq   = (char *) (MR_ablock->bases);
  Work_Data   *work   = data->work;
  int          afirst = MR_ablock->tfirst;

  Overlap     _ovla, *ovla = &_ovla;
  Alignment   _align, *align = &_align;
  Path        *apath = &(ovla->path);
  int64        nfilt = 0;
  int64        ahits = 0;
  int          small, tbytes;

  int    novla;
  int    AOmax;
  Path  *amatch;

  Trace_Buffer _tbuf, *tbuf = &_tbuf;

  int      ar, aend;
  KmerPos *aoff;

  align->flags = ovla->flags = 0;
  align->path  = apath;

  if (MR_tspace <= TRACE_XOVR)
    { small  = 1;
      tbytes = sizeof(uint8);
    }
  else
    { small  = 0;
      tbytes = sizeof(uint16);
    }

  AOmax  = MATCH_CHUNK;
  amatch = Malloc(sizeof(Path)*AOmax,"Allocating match vector");

  tbuf->max   = 2*TRACE_CHUNK;
  tbuf->trace = Malloc(sizeof(short)*tbuf->max,"Allocating trace vector");

  if (amatch == NULL || tbuf->trace == NULL)
    Clean_Exit(1);

  fwrite(&ahits,sizeof(int64),1,ofile);
  fwrite(&MR_tspace,sizeof(int),1,ofile);

#ifdef TEST_GATHER
  printf("\nNEW THREAD %5d(%5lld)-%5d(%5lld)\n",asort[data->beg].read,data->beg,
                                                asort[data->end-1].read,data->end);
  fflush(stdout);
#endif

  aoff = asort + (data->beg - Kmer);
  aend = asort[data->end-1].read;
  for (ar = asort[data->beg].read; ar <= aend; ar++)
    { int alen, amarkb, amarke;
      int apos, diag;
      int setaln;

#ifdef TEST_GATHER
      printf("Read %5d\n",ar);
      fflush(stdout);
#endif
      setaln = 1;
      novla  = 0;
      tbuf->top = 0;

      alen   = aread[ar].rlen;
      amarkb = Kmer;
      amarke = PANEL_SIZE;
      if (amarke >= alen)
        amarke = alen+1;
      while (1)
        {
          // Accumulate diagonal scores

          for (apos = amarkb; apos < amarke; apos++)
            { diag = aoff[apos].code;
              if (diag == 0) continue;
              diag >>= Binshift;
              if (apos - lastp[diag] >= Kmer)
                score[diag] += Kmer;
              else
                score[diag] += apos - lastp[diag];
              lastp[diag] = apos;
            }

          // Examine diagonal scores for hits to check out

          for (apos = amarkb; apos < amarke; apos++)
            { diag = aoff[apos].code;
              if (diag == 0) continue;
              diag >>= Binshift;
              if (apos > lasta[diag] &&
                  (score[diag] + scorp[diag] >= Hitmin || score[diag] + scorm[diag] >= Hitmin))
                { int bpos;

                  bpos = apos - aoff[apos].code;
                  if (setaln)
                    { setaln = 0;
                      align->aseq = align->bseq = aseq + aread[ar].boff;
                      align->alen = align->blen = alen;
                      ovla->aread = ovla->bread = ar + afirst;
                    }
#ifdef TEST_GATHER
                  if (scorm[diag] > scorp[diag])
                    printf("  %5d.. x %5d.. %5d (%3d)",
                           bpos,apos,apos-bpos,score[diag]+scorm[diag]);
                  else
                    printf("  %5d.. x %5d.. %5d (%3d)",
                           bpos,apos,apos-bpos,score[diag]+scorp[diag]);
                  fflush(stdout);
#endif

                  nfilt += 1;

                  Local_Alignment(align,work,MR_spec,apos-bpos,apos-bpos,apos+bpos,-1,-1);

                  { int low, hgh, ae;

                    Diagonal_Span(apath,&low,&hgh);
                    if (diag < low)
                      low = diag;
                    else if (diag > hgh)
                      hgh = diag;
                    ae = apath->aepos;
                    for (diag = low; diag <= hgh; diag++)
                      if (ae > lasta[diag])
                        lasta[diag] = ae;
#ifdef TEST_GATHER
                    printf(" %d - %d @ %d",low,hgh,apath->aepos);
#endif
                  }

                  if ((apath->aepos-apath->abpos) + (apath->bepos-apath->bbpos) >= MINOVER)
                    { if (novla >= AOmax)
                        { AOmax = 1.2*novla + MATCH_CHUNK;
                          amatch = Realloc(amatch,sizeof(Path)*AOmax,
                                           "Reallocating match vector");
                          if (amatch == NULL)
                            Clean_Exit(1);
                        }
                      if (tbuf->top + apath->tlen > tbuf->max)
                        { tbuf->max = 1.2*(tbuf->top+apath->tlen) + TRACE_CHUNK;
                          tbuf->trace = Realloc(tbuf->trace,sizeof(short)*tbuf->max,
                                                "Reallocating trace vector");
                          if (tbuf->trace == NULL)
                            Clean_Exit(1);
                        }
                      amatch[novla] = *apath;
                      amatch[novla].trace = (void *) (tbuf->top);
                      memmove(tbuf->trace+tbuf->top,apath->trace,sizeof(short)*apath->tlen);
                      novla += 1;
                      tbuf->top += apath->tlen;

#ifdef TEST_GATHER
                      printf("  [%5d,%5d] x [%5d,%5d] = %4d",
                             apath->abpos,apath->aepos,apath->bbpos,apath->bepos,apath->diffs);
#endif
#ifdef SHOW_OVERLAP
                      printf("\n\n                    %d(%d) vs %d(%d)\n\n",
                             ovla->aread,ovla->alen,ovla->bread,ovla->blen);
                      Print_ACartoon(stdout,align,ALIGN_INDENT);
#ifdef SHOW_ALIGNMENT
                      Compute_Trace_ALL(align,work);
                      printf("\n                      Diff = %d\n",align->path->diffs);
                      Print_Alignment(stdout,align,work,
                                      ALIGN_INDENT,ALIGN_WIDTH,ALIGN_BORDER,0,5);
#endif
#endif // SHOW_OVERLAP
                    }
#ifdef TEST_GATHER
                  else
                    printf("  No alignment %d",
                            ((apath->aepos-apath->abpos) + (apath->bepos-apath->bbpos))/2);
                  printf("\n");
#endif
                }
            }

          // Clear diagonal scores

          for (apos = amarkb; apos < amarke; apos++)
            { diag = aoff[apos].code;
              if (diag == 0) continue;
              diag >>= Binshift;
              score[diag] = lastp[diag] = 0;
            }

          if (amarke > alen) break;

          amarkb = amarke - PANEL_OVERLAP;
          amarke = amarkb + PANEL_SIZE;
          if (amarke > alen)
            amarke = alen+1;
        }

      // Clear diagonal last positions

      for (apos = Kmer; apos <= alen; apos++)
        { int d;

          diag = aoff[apos].code;
          if (diag == 0) continue;
          diag >>= Binshift;
          for (d = diag; d <= maxdiag; d++)
            if (lasta[d] == 0)
              break;
            else
              lasta[d] = 0;
          for (d = diag-1; d >= mindiag; d--)
            if (lasta[d] == 0)
              break;
            else
              lasta[d] = 0;
        }

      // Merge overlapping alignments and remove redundant ones

      { int i;

#ifdef TEST_CONTAIN
        if (novla > 1)
          printf("\n%5d vs %5d:\n",ar,ar);
#endif

        if (novla > 1)
          novla = Handle_Redundancies(amatch,novla,tbuf);

        for (i = 0; i < novla; i++)
          { ovla->path = amatch[i];
            ovla->path.trace = tbuf->trace + (uint64) (ovla->path.trace);
            if (small)
              Compress_TraceTo8(ovla,1);
            Write_Overlap(ofile,ovla,tbytes);
          }
        ahits += novla;
      }

      aoff += alen - (Kmer-1);
    }

  free(tbuf->trace);
  free(amatch);

  data->nfilt  = nfilt;
  data->ncheck = ahits;

  rewind(ofile);
  fwrite(&ahits,sizeof(int64),1,ofile);
  fclose(ofile);

  return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %r14
movq 0x1f01a(%rip), %rax     # 0x24210
movq 0x60(%rax), %rcx
movq %rcx, 0xf0(%rsp)
movq 0x1efff(%rip), %r12     # 0x24208
movq 0x10(%rdi), %rcx
movq %rcx, 0x68(%rsp)
movq 0x18(%rdi), %rcx
movq %rcx, 0xc0(%rsp)
movb 0x1efc0(%rip), %cl      # 0x241e4
movl 0x20(%rax), %ebp
movl %ebp, %r13d
sarl %cl, %r13d
movq 0x20(%rdi), %rdx
movq %rdx, 0x20(%rsp)
movl 0x40(%rax), %edx
movq %rdx, 0xe8(%rsp)
negl %ebp
sarl %cl, %ebp
movq 0x30(%rdi), %rcx
movq %rcx, 0x48(%rsp)
movq 0x58(%rax), %rax
movq %rax, 0x100(%rsp)
movq 0x28(%rdi), %rax
movq %rax, 0x108(%rsp)
movq $0x0, 0x70(%rsp)
xorl %eax, %eax
leaq 0x90(%rsp), %rcx
movl %eax, 0x20(%rcx)
movl %eax, 0x118(%rsp)
movq %rcx, 0x110(%rsp)
movl 0x1ef6f(%rip), %eax     # 0x24200
movl %eax, 0x88(%rsp)
cmpl $0x7e, %eax
setge %bl
leaq 0x18468(%rip), %rsi     # 0x1d70d
movl $0xc80, %edi            # imm = 0xC80
callq 0x14d79
movq %rax, %r15
movq $0x9c40, 0x30(%rsp)     # imm = 0x9C40
leaq 0x18463(%rip), %rsi     # 0x1d725
movl $0x13880, %edi          # imm = 0x13880
callq 0x14d79
movq %rax, 0x40(%rsp)
movq %r15, 0x8(%rsp)
testq %r15, %r15
sete %cl
testq %rax, %rax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x52f2
movl $0x1, %edi
callq 0x359c
leaq 0x70(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq 0x48(%rsp), %r15
movq %r15, %rcx
callq 0x22f0
leaq 0x1eeeb(%rip), %rdi     # 0x24200
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x22f0
movq (%r14), %rax
movq %r14, 0xd0(%rsp)
movq 0x8(%r14), %rcx
shlq $0x4, %rcx
movl -0x4(%r12,%rcx), %edx
movq %rax, %rcx
shlq $0x4, %rcx
movslq 0xc(%r12,%rcx), %rsi
cmpl %edx, %esi
jle 0x535d
movq $0x0, 0x60(%rsp)
jmp 0x5aef
movq %r12, %r14
xorl %ecx, %ecx
movb %bl, %cl
incl %ecx
movl %ecx, 0x84(%rsp)
movl 0x1ee6d(%rip), %ecx     # 0x241e0
subq %rcx, %rax
shlq $0x4, %rax
addq %rax, %r14
movl %ebp, 0x80(%rsp)
movslq %ebp, %rax
movq %rax, 0xd8(%rsp)
incl %edx
movq %r13, 0xe0(%rsp)
leal 0x1(%r13), %eax
movl %eax, 0x78(%rsp)
movl $0x64, 0x2c(%rsp)
movq $0x0, 0x60(%rsp)
movl %edx, 0x7c(%rsp)
movq $0x0, 0x38(%rsp)
leaq (%rsi,%rsi,4), %rax
movq 0xf0(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rax, 0x18(%rsp)
movl 0x4(%rax), %r15d
leal 0x1(%r15), %eax
cmpl $0xc351, %r15d          # imm = 0xC351
movl %eax, 0x8c(%rsp)
movl %eax, %r13d
movl $0xc350, %eax           # imm = 0xC350
cmovgel %eax, %r13d
movl 0x1ede4(%rip), %ebx     # 0x241e0
movq 0xe8(%rsp), %rax
movq %rsi, 0xf8(%rsp)
addl %esi, %eax
movl %eax, 0x58(%rsp)
xorl %r12d, %r12d
movl $0x1, %ebp
movq 0x68(%rsp), %r10
movq 0xc0(%rsp), %r11
movq %r15, 0xc8(%rsp)
cmpl %r13d, %ebx
jge 0x5482
movl 0x1edaa(%rip), %ecx     # 0x241e4
movl 0x1eda0(%rip), %eax     # 0x241e0
movslq %ebx, %rdx
movslq %r13d, %rsi
subq %rdx, %rsi
shlq $0x4, %rdx
addq %r14, %rdx
movl %ebx, %edi
movl (%rdx), %r8d
testl %r8d, %r8d
je 0x5477
sarl %cl, %r8d
movslq %r8d, %r8
movl %edi, %r9d
subl (%r11,%r8,4), %r9d
cmpl %eax, %r9d
jl 0x546f
movl %eax, %r9d
addl %r9d, (%r10,%r8,4)
movl %edi, (%r11,%r8,4)
incl %edi
addq $0x10, %rdx
decq %rsi
jne 0x5452
cmpl %r13d, %ebx
movl %ebx, 0x50(%rsp)
jge 0x5781
movslq %ebx, %rbx
movq 0x20(%rsp), %rdi
movl %ebp, %r9d
movq %rbx, %rax
shlq $0x4, %rax
movl (%r14,%rax), %r8d
testl %r8d, %r8d
je 0x5773
movb 0x1ed30(%rip), %cl      # 0x241e4
movl %r8d, %ebp
sarl %cl, %ebp
movslq %ebp, %rax
movslq (%rdi,%rax,4), %rcx
cmpq %rcx, %rbx
jle 0x5773
movl (%r10,%rax,4), %ecx
movl 0x4(%r10,%rax,4), %esi
addl %ecx, %esi
movl 0x1ed0e(%rip), %edx     # 0x241e8
cmpl %edx, %esi
jge 0x54eb
addl -0x4(%r10,%rax,4), %ecx
cmpl %edx, %ecx
jl 0x5773
testl %r9d, %r9d
je 0x5533
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
addq 0x100(%rsp), %rax
movq %rax, 0x128(%rsp)
movq %rax, 0x120(%rsp)
movl %r15d, 0x134(%rsp)
movl %r15d, 0x130(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
movq 0x1ecde(%rip), %rdx     # 0x24218
leal (%rbx,%rbx), %r9d
subl %r8d, %r9d
leaq 0x110(%rsp), %rdi
movq 0x108(%rsp), %rsi
movl %r8d, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
pushq %rax
pushq %rax
callq 0x6675
addq $0x10, %rsp
leaq 0x90(%rsp), %rdi
leaq 0x4(%rsp), %rsi
leaq 0x14(%rsp), %rdx
callq 0x4181
cmpl 0x4(%rsp), %ebp
jge 0x5587
movl %ebp, 0x4(%rsp)
jmp 0x5594
movl 0x14(%rsp), %eax
cmpl %eax, %ebp
cmovgl %ebp, %eax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movslq 0x4(%rsp), %rsi
movl 0x14(%rsp), %eax
cmpl %eax, %esi
movq 0x68(%rsp), %r10
jg 0x55cb
movl 0xa8(%rsp), %ecx
leaq (%rdi,%rsi,4), %rdx
subl %esi, %eax
incl %eax
xorl %esi, %esi
cmpl (%rdx,%rsi,4), %ecx
jle 0x55c4
movl %ecx, (%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0x55bc
incq 0x60(%rsp)
movl 0xa0(%rsp), %eax
movl 0xa8(%rsp), %ecx
addl 0xac(%rsp), %ecx
addl 0xa4(%rsp), %eax
subl %eax, %ecx
xorl %r9d, %r9d
leaq 0x1ebd8(%rip), %rax     # 0x241d0
cmpl (%rax), %ecx
jl 0x5773
cmpl 0x2c(%rsp), %r12d
jge 0x560e
movq 0x8(%rsp), %r8
jmp 0x565a
cvtsi2sd %r12d, %xmm0
mulsd 0x179ed(%rip), %xmm0    # 0x1d008
addsd 0x17fbd(%rip), %xmm0    # 0x1d5e0
cvttsd2si %xmm0, %eax
movl %eax, 0x2c(%rsp)
movslq %eax, %rsi
shlq $0x5, %rsi
movq 0x8(%rsp), %rdi
leaq 0x180ff(%rip), %rdx     # 0x1d73d
callq 0x14dd1
testq %rax, %rax
je 0x564d
movq %rax, %r8
jmp 0x565a
movl $0x1, %edi
callq 0x359c
xorl %r8d, %r8d
movq 0x38(%rsp), %rbp
movslq 0x98(%rsp), %rax
addq %rbp, %rax
cmpq 0x30(%rsp), %rax
jbe 0x56fb
movq %rax, %xmm0
punpckldq 0x17f7e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x17f86(%rip), %xmm0    # 0x1d610
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x1796a(%rip), %xmm1    # 0x1d008
addsd 0x17f42(%rip), %xmm1    # 0x1d5e8
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x17f36(%rip), %xmm1    # 0x1d5f0
cvttsd2si %xmm1, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %rsi, 0x30(%rsp)
movq 0x40(%rsp), %rdi
addq %rsi, %rsi
leaq 0x1807e(%rip), %rdx     # 0x1d757
movq %r8, %r15
callq 0x14dd1
movq %r15, %r8
movq %rax, 0x40(%rsp)
testq %rax, %rax
jne 0x56fb
movl $0x1, %edi
callq 0x359c
movq %r15, %r8
movslq %r12d, %rax
shlq $0x5, %rax
movups 0x90(%rsp), %xmm0
movups 0xa0(%rsp), %xmm1
movups %xmm0, (%r8,%rax)
movups %xmm1, 0x10(%r8,%rax)
movq %r8, 0x8(%rsp)
movq %rbp, (%r8,%rax)
leaq (,%rbp,2), %rdi
addq 0x40(%rsp), %rdi
movq 0x90(%rsp), %rsi
movslq 0x98(%rsp), %rdx
addq %rdx, %rdx
callq 0x2290
incl %r12d
movslq 0x98(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %r10
movq 0x20(%rsp), %rdi
movq 0xc8(%rsp), %r15
xorl %r9d, %r9d
incq %rbx
cmpl %ebx, %r13d
jne 0x549a
jmp 0x5784
movl %ebp, %r9d
movl %r9d, %ebp
movl 0x50(%rsp), %eax
cmpl %r13d, %eax
movq 0xc0(%rsp), %r11
movl $0x0, %edi
jge 0x57ce
movl 0x1ea41(%rip), %ecx     # 0x241e4
cltq
movslq %r13d, %rdx
subq %rax, %rdx
shlq $0x4, %rax
addq %r14, %rax
movl (%rax), %esi
testl %esi, %esi
je 0x57c5
sarl %cl, %esi
movslq %esi, %rsi
movl %edi, (%r11,%rsi,4)
movl %edi, (%r10,%rsi,4)
addq $0x10, %rax
decq %rdx
jne 0x57b2
cmpl %r15d, %r13d
jg 0x57f2
leal -0x2710(%r13), %ebx
addl $0x9c40, %r13d          # imm = 0x9C40
cmpl %r15d, %r13d
cmovgl 0x8c(%rsp), %r13d
jmp 0x542f
movl 0x1e9e8(%rip), %eax     # 0x241e0
cmpl %r15d, %eax
movl 0x80(%rsp), %r9d
movq 0xe0(%rsp), %r10
movq 0x20(%rsp), %r11
movq 0xd8(%rsp), %rbx
movl 0x78(%rsp), %ebp
jg 0x588c
movl 0x1e9c0(%rip), %ecx     # 0x241e4
movq %rax, %rdx
shlq $0x4, %rdx
movl (%r14,%rdx), %edx
testl %edx, %edx
je 0x5880
sarl %cl, %edx
cmpl %r10d, %edx
jg 0x585f
movslq %edx, %rsi
leaq (%r11,%rsi,4), %rsi
movl %ebp, %edi
subl %edx, %edi
xorl %r8d, %r8d
cmpl $0x0, (%rsi,%r8,4)
je 0x585f
movl $0x0, (%rsi,%r8,4)
incq %r8
cmpl %r8d, %edi
jne 0x5848
cmpl %r9d, %edx
jle 0x5880
movslq %edx, %rdx
cmpl $0x0, -0x4(%r11,%rdx,4)
je 0x5880
movl $0x0, -0x4(%r11,%rdx,4)
decq %rdx
cmpq %rbx, %rdx
jg 0x5867
leaq 0x1(%rax), %rdx
cmpl %eax, %r15d
movq %rdx, %rax
jg 0x5824
movq %r14, 0x50(%rsp)
cmpl $0x2, %r12d
jl 0x5a28
movl $0x0, 0x4(%rsp)
movl %r12d, %r8d
movl $0x1, %ebx
movq 0x8(%rsp), %rdi
movq %r8, 0x58(%rsp)
movq %rbx, %r13
shlq $0x5, %r13
addq %rdi, %r13
movq %rbx, 0x18(%rsp)
decl %ebx
movq %rbx, %rbp
shlq $0x5, %rbp
movl 0x10(%rdi,%rbp), %r15d
testl %r15d, %r15d
js 0x59cc
addq %rdi, %rbp
movl 0x10(%r13), %r12d
cmpl %r15d, %r12d
jge 0x5949
movl 0x18(%r13), %r14d
cmpl %r14d, %r15d
jg 0x59cc
movl 0x14(%rbp), %eax
cmpl 0x1c(%r13), %eax
jg 0x59cc
movq %r13, %rdi
movq %rbp, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0x6015
testl %eax, %eax
jne 0x5974
cmpl %r14d, 0x18(%rbp)
movq 0x8(%rsp), %rdi
jle 0x59c5
movl 0x4(%rsp), %esi
movq %r13, %rdi
movq %rbp, %rdx
leaq 0x30(%rsp), %rcx
callq 0x61d7
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rbx
jmp 0x59c5
movl 0x18(%rbp), %r14d
cmpl %r14d, %r12d
jg 0x59cc
movl 0x14(%r13), %eax
cmpl 0x1c(%rbp), %eax
jg 0x59cc
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0x6015
testl %eax, %eax
je 0x597b
movq 0x8(%rsp), %rdi
jmp 0x59cc
movl 0x18(%r13), %eax
cmpl %r12d, %r15d
movq 0x8(%rsp), %rdi
jne 0x5990
cmpl %eax, %r14d
jg 0x59b3
jmp 0x59c5
cmpl %r14d, %eax
jle 0x59b3
movl 0x4(%rsp), %esi
movq %rbp, %rdi
movq %r13, %rdx
leaq 0x30(%rsp), %rcx
callq 0x61d7
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rbx
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
movl $0xffffffff, 0x10(%rbp) # imm = 0xFFFFFFFF
testl %ebx, %ebx
jg 0x58c4
movq 0x18(%rsp), %rbx
incq %rbx
movq 0x58(%rsp), %r8
cmpq %r8, %rbx
jne 0x58b5
shlq $0x5, %r8
leaq 0x10(%rdi), %rax
xorl %ecx, %ecx
xorl %r12d, %r12d
cmpl $0x0, (%rax,%rcx)
js 0x5a1f
leaq (%rax,%rcx), %rdx
addq $-0x10, %rdx
movslq %r12d, %rsi
incl %r12d
shlq $0x5, %rsi
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rdi,%rsi)
movups %xmm0, (%rdi,%rsi)
addq $0x20, %rcx
cmpq %rcx, %r8
jne 0x59f7
testl %r12d, %r12d
jle 0x5ab2
movq 0x40(%rsp), %rbx
movl %r12d, %r13d
shlq $0x5, %r13
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movups (%rax,%r15), %xmm0
movups 0x10(%rax,%r15), %xmm1
movaps %xmm0, 0x90(%rsp)
movaps %xmm1, 0xa0(%rsp)
movq 0x90(%rsp), %rax
leaq (%rbx,%rax,2), %rax
movq %rax, 0x90(%rsp)
cmpl $0x7d, 0x88(%rsp)
jg 0x5a90
leaq 0x90(%rsp), %rdi
movl $0x1, %esi
callq 0xc298
movq 0x48(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0x84(%rsp), %edx
callq 0xc238
addq $0x20, %r15
cmpq %r15, %r13
jne 0x5a40
movslq %r12d, %rax
addq %rax, 0x70(%rsp)
movq 0xc8(%rsp), %rax
subl 0x1e718(%rip), %eax     # 0x241e0
incl %eax
cltq
shlq $0x4, %rax
movq 0x50(%rsp), %r14
addq %rax, %r14
movq 0xf8(%rsp), %rsi
incq %rsi
movl 0x7c(%rsp), %edx
cmpl %esi, %edx
jne 0x53b6
movq 0x40(%rsp), %rdi
callq 0x2030
movq 0x8(%rsp), %rdi
callq 0x2030
movq 0xd0(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rax, 0x38(%rcx)
leaq 0x70(%rsp), %rbx
movq (%rbx), %rax
movq %rax, 0x40(%rcx)
movq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x2160
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x22f0
movq %r14, %rdi
callq 0x2100
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq