// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrharvest_stream.c
// Function: gt_searchforLTRs
static int gt_searchforLTRs(GtLTRharvestStream *lo,
                            GtArrayLTRboundaries *arrayLTRboundaries,
                            GT_UNUSED GtMutex *rmutex,
                            GT_UNUSED GtMutex *wmutex,
                            GtUword *cur_seed,
                            GtError *err)
{
  GtUword my_seed;
  GtXdropresources *xdropresources;
  GtXdropbest xdropbest_left, xdropbest_right;
#undef GT_GREEDY_BUFFER
#ifdef GT_GREEDY_BUFFER
  GtUword maxulen = 0, maxvlen = 0;
  GtUchar *useq = NULL,
          *vseq = NULL;
#endif
  GtSeqabstract *sa_useq = gt_seqabstract_new_empty(),
                *sa_vseq = gt_seqabstract_new_empty();
  GtUword edist,
                alilen = 0;
  Repeat *repeatptr;
  LTRboundaries boundaries, *boundaries_ptr;
  GtFrontResource *frontresource = gt_frontresource_new(100UL);
  bool haserr = false;

  gt_error_check(err);
  xdropresources = gt_xdrop_resources_new(&lo->arbitscores);

  /* XXX: do thread-synchronized error checking */
  while (true) {
    GtUword ulen,
                  vlen,
                  seqend,
                  seqstart;
    gt_mutex_lock(rmutex);
    if (*cur_seed < lo->repeatinfo.repeats.nextfreeRepeat)
      my_seed = (*cur_seed)++;
    else {
      gt_mutex_unlock(rmutex);
      break;
    }
    gt_mutex_unlock(rmutex);
    repeatptr = &(lo->repeatinfo.repeats.spaceRepeat[my_seed]);

    /* check whether max LTR length is exceeded by seed alone */
    if (lo->repeatinfo.lmax < repeatptr->len)
      continue;

    seqstart = gt_encseq_seqstartpos(lo->encseq, repeatptr->contignumber);
    seqend = seqstart + gt_encseq_seqlength(lo->encseq,repeatptr->contignumber)
               - 1;
    gt_assert(lo->repeatinfo.lmax >= repeatptr->len);
    alilen = lo->repeatinfo.lmax - repeatptr->len;

    /**** left (reverse) xdrop alignment
          ============================== ****/
    /* perform no left extension if seed starts at beginning of sequence */
    if (alilen != 0 && seqstart < repeatptr->pos1) {
      GtUword substrstart_u, substrstart_v;
      /* trim maximal alignment length if we are too close to sequence start */
      if (alilen > repeatptr->pos1 - seqstart) {
        alilen = repeatptr->pos1 - seqstart;
        substrstart_u = seqstart;
        substrstart_v = (repeatptr->pos1 + repeatptr->offset) - alilen;
      } else {
        substrstart_u = repeatptr->pos1 - alilen;
        substrstart_v = (repeatptr->pos1 + repeatptr->offset) - alilen;
      }
      gt_assert(substrstart_u >= seqstart);
      gt_assert(substrstart_v >= seqstart && substrstart_v >= substrstart_u);

      gt_seqabstract_reinit_encseq(false,GT_READMODE_FORWARD,
                                   sa_useq,
                                   lo->encseq,
                                   alilen,
                                   substrstart_u);
      gt_seqabstract_reinit_encseq(false,GT_READMODE_FORWARD,
                                   sa_vseq,
                                   lo->encseq,
                                   alilen,
                                   substrstart_v);

      gt_evalxdroparbitscoresextend(false,
                                    &xdropbest_left,
                                    xdropresources,
                                    sa_useq,
                                    sa_vseq,
                                    (GtXdropscore) lo->xdropbelowscore);
    } else {
      xdropbest_left.ivalue = 0;
      xdropbest_left.jvalue = 0;
      xdropbest_left.score = 0;
    }

    /* re-initialize maximal alignment length to the left */
    alilen = lo->repeatinfo.lmax - repeatptr->len;

    /**** right (forward) xdrop alignment
          =============================== ****/
    /* perform no right extension if seed ends at end of sequence */
    if (alilen != 0 &&
                repeatptr->pos1 + repeatptr->offset + repeatptr->len < seqend) {
      GtUword substrstart_u, substrstart_v;

      /* trim maximal alignment length if we are too close to sequence end */
      if (alilen > seqend - (repeatptr->pos1 + repeatptr->offset
            + repeatptr->len)) {
        alilen = seqend - (repeatptr->pos1 + repeatptr->offset
            + repeatptr->len);
      }
      substrstart_u = repeatptr->pos1 + repeatptr->len;
      substrstart_v = repeatptr->pos1 + repeatptr->offset + repeatptr->len;

      gt_seqabstract_reinit_encseq(true,GT_READMODE_FORWARD,
                                   sa_useq,
                                   lo->encseq,
                                   alilen,
                                   substrstart_u);
      gt_seqabstract_reinit_encseq(true,GT_READMODE_FORWARD,
                                   sa_vseq,
                                   lo->encseq,
                                   alilen,
                                   substrstart_v);

      gt_evalxdroparbitscoresextend(true,
                                    &xdropbest_right,
                                    xdropresources,
                                    sa_useq,
                                    sa_vseq,
                                    (GtXdropscore) lo->xdropbelowscore);
    } else {
      xdropbest_right.ivalue = 0;
      xdropbest_right.jvalue = 0;
      xdropbest_right.score = 0;
    }

    boundaries.contignumber = repeatptr->contignumber;
    boundaries.leftLTR_5 = (GtUword) 0;
    boundaries.leftLTR_3 = (GtUword) 0;
    boundaries.rightLTR_5 = (GtUword) 0;
    boundaries.rightLTR_3 = (GtUword) 0;
    boundaries.lenleftTSD = (GtUword) 0;
    boundaries.lenrightTSD = (GtUword) 0;
    boundaries.tsd = false;
    boundaries.motif_near_tsd = false;
    boundaries.motif_far_tsd = false;
    boundaries.skipped = false;
    boundaries.similarity = 0.0;

    /* store new boundaries-positions in boundaries */
    adjustboundariesfromXdropextension(
                   xdropbest_left,
                   xdropbest_right,
                   repeatptr->pos1,  /*seed1 startpos*/
                   repeatptr->pos1 + repeatptr->offset, /*seed2 startpos*/
                   repeatptr->pos1 + repeatptr->len - 1, /*seed1 endpos*/
                   repeatptr->pos1 + repeatptr->offset + repeatptr->len - 1,
                                                           /*seed2 endpos*/
                   &boundaries);

    /* if search for motif and/or TSD */
    if (lo->motif->allowedmismatches < 4U || lo->minlengthTSD > 1U)
    {
      if (gt_findcorrectboundaries(lo, &boundaries, err) != 0)
      {
        haserr = true;
        break;
      }

      /* if search for TSDs and (not) motif */
      if (boundaries.tsd &&
          (lo->motif->allowedmismatches >= 4U ||
          (boundaries.motif_near_tsd && boundaries.motif_far_tsd)))
      {
        /* predicted as full LTR-pair, keep it */
      } else
      {
        /* if search for motif only (and not TSD) */
        if (lo->minlengthTSD <= 1U &&
            boundaries.motif_near_tsd &&
            boundaries.motif_far_tsd)
        {
          /* predicted as full LTR-pair, keep it */
        } else
        {
          continue;
        }
      }
    }

    /* check length and distance constraints again */
    if (!checklengthanddistanceconstraints(&boundaries, &lo->repeatinfo))
    {
      continue;
    }

    /* check similarity from candidate pair
       copy LTR sequences for greedyunitedist function */
    ulen = boundaries.leftLTR_3 - boundaries.leftLTR_5 + 1;
    vlen = boundaries.rightLTR_3 - boundaries.rightLTR_5 + 1;
#ifdef GT_GREEDY_BUFFER
    if (ulen > maxulen)
    {
      maxulen = ulen;
      useq = gt_realloc(useq, sizeof (*useq) * maxulen);
    }
    if (vlen > maxvlen)
    {
      maxvlen = vlen;
      vseq = gt_realloc(vseq, sizeof (*vseq) * maxvlen);
    }
    gt_encseq_extract_encoded(encseq, useq, boundaries.leftLTR_5,
                                            boundaries.leftLTR_3);
    gt_encseq_extract_encoded(encseq, vseq, boundaries.rightLTR_5,
                                            boundaries.rightLTR_3);
    gt_seqabstract_reinit_gtuchar(true,GT_READMODE_FORWARD,
                                  sa_useq, useq, ulen, 0);
    gt_seqabstract_reinit_gtuchar(true,GT_READMODE_FORWARD,
                                  sa_vseq, vseq, vlen, 0);
#else
    gt_seqabstract_reinit_encseq(true,GT_READMODE_FORWARD,
                                 sa_useq, lo->encseq, ulen,
                                 boundaries.leftLTR_5);
    gt_seqabstract_reinit_encseq(true,GT_READMODE_FORWARD,
                                 sa_vseq, lo->encseq, vlen,
                                 boundaries.rightLTR_5);
#endif
    edist = greedyunitedist(frontresource,sa_useq,sa_vseq);

    /* determine similarity */
    boundaries.similarity = 100.0 * (1.0 - (double) edist/GT_MAX(ulen,vlen));

    if (!gt_double_smaller_double(boundaries.similarity,
                                  lo->similaritythreshold))
    {
      gt_mutex_lock(wmutex);
      GT_GETNEXTFREEINARRAY(boundaries_ptr,arrayLTRboundaries,LTRboundaries,5);
      *boundaries_ptr = boundaries;
      gt_mutex_unlock(wmutex);
    }
  }
#ifdef GT_GREEDY_BUFFER
  FREESPACE(useq);
  FREESPACE(vseq);
#endif
  gt_xdrop_resources_delete(xdropresources);
  gt_seqabstract_delete(sa_useq);
  gt_seqabstract_delete(sa_vseq);
  gt_frontresource_delete(frontresource);
  return haserr ? -1 : 0;
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movq %rdx, 0x1c0(%rsp)
movq %rcx, 0x1b8(%rsp)
movq %r8, 0x1b0(%rsp)
movq %r9, 0x1a8(%rsp)
callq 0x2b0770
movq %rax, 0x140(%rsp)
callq 0x2b0770
movq %rax, 0x138(%rsp)
movq $0x0, 0x128(%rsp)
movl $0x64, %edi
callq 0x253810
movq %rax, 0xc8(%rsp)
movb $0x0, 0xc7(%rsp)
cmpq $0x0, 0x1a8(%rsp)
je 0x3106cd
movq 0x1a8(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x310695
jmp 0x3106cd
movq 0x32b904(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20596d(%rip), %rsi    # 0x516013
leaq 0x205b12(%rip), %rdx    # 0x5161bf
leaq 0x283d5b(%rip), %rcx    # 0x59440f
leaq 0x283bc7(%rip), %r8     # 0x594282
movl $0x397, %r9d            # imm = 0x397
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3106cf
movq 0x1d0(%rsp), %rdi
addq $0x74, %rdi
callq 0x2f8350
movq %rax, 0x198(%rsp)
movq 0x1c0(%rsp), %rdi
callq 0x1211d0
movq 0x1b0(%rsp), %rax
movq (%rax), %rax
movq 0x1d0(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x31072d
movq 0x1b0(%rsp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movq %rax, 0x1a0(%rsp)
jmp 0x31073f
movq 0x1c0(%rsp), %rdi
callq 0x121270
jmp 0x3111ce
movq 0x1c0(%rsp), %rdi
callq 0x121270
movq 0x1d0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x1a0(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x120(%rsp)
movq 0x1d0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x120(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x31078e
jmp 0x3106e8
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rdi
movq 0x120(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0xb0530
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rdi
movq 0x120(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0xb09f0
movq %rax, %rcx
movq 0x70(%rsp), %rax
addq %rcx, %rax
subq $0x1, %rax
movq %rax, 0xa8(%rsp)
movq 0x1d0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x120(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x31084c
movq 0x32b785(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2057ee(%rip), %rsi    # 0x516013
leaq 0x283bf4(%rip), %rdx    # 0x594420
leaq 0x283bdc(%rip), %rcx    # 0x59440f
leaq 0x283a48(%rip), %r8     # 0x594282
movl $0x3b1, %r9d            # imm = 0x3B1
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x31084e
movq 0x1d0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x120(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x128(%rsp)
cmpq $0x0, 0x128(%rsp)
je 0x310a8f
movq 0xa0(%rsp), %rax
movq 0x120(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x310a8f
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rcx
movq (%rcx), %rcx
subq 0xa0(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x31090a
movq 0x120(%rsp), %rax
movq (%rax), %rax
subq 0xa0(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x120(%rsp), %rcx
addq 0x8(%rcx), %rax
subq 0x128(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x31094c
movq 0x120(%rsp), %rax
movq (%rax), %rax
subq 0x128(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x120(%rsp), %rcx
addq 0x8(%rcx), %rax
subq 0x128(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x31094e
movq 0x98(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jae 0x310998
movq 0x32b639(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2056a2(%rip), %rsi    # 0x516013
leaq 0x283ace(%rip), %rdx    # 0x594446
leaq 0x283a90(%rip), %rcx    # 0x59440f
leaq 0x2838fc(%rip), %r8     # 0x594282
movl $0x3c2, %r9d            # imm = 0x3C2
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x31099a
jmp 0x31099c
movq 0x90(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jb 0x3109c0
movq 0x90(%rsp), %rax
cmpq 0x98(%rsp), %rax
jae 0x3109f8
movq 0x32b5d9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x205642(%rip), %rsi    # 0x516013
leaq 0x283a88(%rip), %rdx    # 0x594460
leaq 0x283a30(%rip), %rcx    # 0x59440f
leaq 0x28389c(%rip), %r8     # 0x594282
movl $0x3c3, %r9d            # imm = 0x3C3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3109fa
movq 0x140(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0x128(%rsp), %r8
movq 0x98(%rsp), %r9
xorl %esi, %esi
movl %esi, %edi
callq 0x2b0bc0
movq 0x138(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0x128(%rsp), %r8
movq 0x90(%rsp), %r9
xorl %esi, %esi
movl %esi, %edi
callq 0x2b0bc0
movq 0x198(%rsp), %rdx
movq 0x140(%rsp), %rcx
movq 0x138(%rsp), %r8
movq 0x1d0(%rsp), %rax
movslq 0x70(%rax), %r9
xorl %edi, %edi
leaq 0x170(%rsp), %rsi
callq 0x2f8690
jmp 0x310ab3
movq $0x0, 0x170(%rsp)
movq $0x0, 0x178(%rsp)
movq $0x0, 0x180(%rsp)
movq 0x1d0(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x120(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x128(%rsp)
cmpq $0x0, 0x128(%rsp)
je 0x310c6c
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x120(%rsp), %rcx
addq 0x8(%rcx), %rax
movq 0x120(%rsp), %rcx
addq 0x10(%rcx), %rax
cmpq 0xa8(%rsp), %rax
jae 0x310c6c
movq 0x128(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x120(%rsp), %rdx
movq (%rdx), %rdx
movq 0x120(%rsp), %rsi
addq 0x8(%rsi), %rdx
movq 0x120(%rsp), %rsi
addq 0x10(%rsi), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jbe 0x310b84
movq 0xa8(%rsp), %rax
movq 0x120(%rsp), %rcx
movq (%rcx), %rcx
movq 0x120(%rsp), %rdx
addq 0x8(%rdx), %rcx
movq 0x120(%rsp), %rdx
addq 0x10(%rdx), %rcx
subq %rcx, %rax
movq %rax, 0x128(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x120(%rsp), %rcx
addq 0x10(%rcx), %rax
movq %rax, 0x88(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x120(%rsp), %rcx
addq 0x8(%rcx), %rax
movq 0x120(%rsp), %rcx
addq 0x10(%rcx), %rax
movq %rax, 0x80(%rsp)
movq 0x140(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0x128(%rsp), %r8
movq 0x88(%rsp), %r9
movl $0x1, %edi
xorl %esi, %esi
callq 0x2b0bc0
movq 0x138(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0x128(%rsp), %r8
movq 0x80(%rsp), %r9
movl $0x1, %edi
xorl %esi, %esi
callq 0x2b0bc0
movq 0x198(%rsp), %rdx
movq 0x140(%rsp), %rcx
movq 0x138(%rsp), %r8
movq 0x1d0(%rsp), %rax
movslq 0x70(%rax), %r9
movl $0x1, %edi
leaq 0x148(%rsp), %rsi
callq 0x2f8690
jmp 0x310c90
movq $0x0, 0x148(%rsp)
movq $0x0, 0x150(%rsp)
movq $0x0, 0x158(%rsp)
movq 0x120(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0xd8(%rsp)
movq $0x0, 0xe0(%rsp)
movq $0x0, 0xe8(%rsp)
movq $0x0, 0xf0(%rsp)
movq $0x0, 0xf8(%rsp)
movq $0x0, 0x100(%rsp)
movq $0x0, 0x108(%rsp)
movb $0x0, 0x110(%rsp)
movb $0x0, 0x111(%rsp)
movb $0x0, 0x112(%rsp)
movb $0x0, 0x114(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x118(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rdi
movq 0x120(%rsp), %rax
movq (%rax), %rsi
movq 0x120(%rsp), %rax
addq 0x8(%rax), %rsi
movq 0x120(%rsp), %rax
movq (%rax), %rdx
movq 0x120(%rsp), %rax
addq 0x10(%rax), %rdx
subq $0x1, %rdx
movq 0x120(%rsp), %rax
movq (%rax), %rcx
movq 0x120(%rsp), %rax
addq 0x8(%rax), %rcx
movq 0x120(%rsp), %rax
addq 0x10(%rax), %rcx
subq $0x1, %rcx
movq 0x168(%rsp), %r8
movq %rsp, %rax
movq %r8, 0x48(%rax)
movups 0x148(%rsp), %xmm0
movups 0x158(%rsp), %xmm1
movups %xmm1, 0x38(%rax)
movups %xmm0, 0x28(%rax)
movq 0x190(%rsp), %r8
movq %r8, 0x20(%rax)
movups 0x170(%rsp), %xmm0
movups 0x180(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0xd8(%rsp), %r8
callq 0x311220
movq 0x1d0(%rsp), %rax
movq 0x88(%rax), %rax
cmpl $0x4, 0xc(%rax)
jb 0x310dfd
movq 0x1d0(%rsp), %rax
cmpl $0x1, 0x98(%rax)
jbe 0x310e91
movq 0x1d0(%rsp), %rdi
movq 0x1a8(%rsp), %rdx
leaq 0xd8(%rsp), %rsi
callq 0x3112c0
cmpl $0x0, %eax
je 0x310e2c
movb $0x1, 0xc7(%rsp)
jmp 0x3111ce
testb $0x1, 0x110(%rsp)
je 0x310e61
movq 0x1d0(%rsp), %rax
movq 0x88(%rax), %rax
cmpl $0x4, 0xc(%rax)
jae 0x310e5f
testb $0x1, 0x111(%rsp)
je 0x310e61
testb $0x1, 0x112(%rsp)
je 0x310e61
jmp 0x310e8f
movq 0x1d0(%rsp), %rax
cmpl $0x1, 0x98(%rax)
ja 0x310e88
testb $0x1, 0x111(%rsp)
je 0x310e88
testb $0x1, 0x112(%rsp)
je 0x310e88
jmp 0x310e8d
jmp 0x3106e8
jmp 0x310e8f
jmp 0x310e91
movq 0x1d0(%rsp), %rsi
addq $0x10, %rsi
leaq 0xd8(%rsp), %rdi
callq 0x311390
testb $0x1, %al
jne 0x310eb3
jmp 0x3106e8
movq 0xe0(%rsp), %rcx
movq 0xe8(%rsp), %rax
subq %rcx, %rax
incq %rax
movq %rax, 0xb8(%rsp)
movq 0xf0(%rsp), %rcx
movq 0xf8(%rsp), %rax
subq %rcx, %rax
incq %rax
movq %rax, 0xb0(%rsp)
movq 0x140(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0xb8(%rsp), %r8
movq 0xe0(%rsp), %r9
movl $0x1, %edi
movl %edi, 0x60(%rsp)
xorl %esi, %esi
movl %esi, 0x64(%rsp)
callq 0x2b0bc0
movl 0x60(%rsp), %edi
movl 0x64(%rsp), %esi
movq 0x138(%rsp), %rdx
movq 0x1d0(%rsp), %rax
movq 0xd8(%rax), %rcx
movq 0xb0(%rsp), %r8
movq 0xf0(%rsp), %r9
callq 0x2b0bc0
movq 0xc8(%rsp), %rdi
movq 0x140(%rsp), %rsi
movq 0x138(%rsp), %rdx
callq 0x2538e0
movq %rax, 0x130(%rsp)
movaps 0x2079a6(%rip), %xmm1   # 0x518930
movq 0x130(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2079a1(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0xb8(%rsp), %rax
cmpq 0xb0(%rsp), %rax
jbe 0x310fd5
movq 0xb8(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x310fe2
movq 0xb0(%rsp), %rax
movq %rax, 0x58(%rsp)
movsd 0x68(%rsp), %xmm0
movq 0x58(%rsp), %rax
movq %rax, %xmm1
movaps 0x207937(%rip), %xmm2   # 0x518930
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x20793b(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x206220(%rip), %xmm1   # 0x517240
subsd %xmm0, %xmm1
movsd 0x20980c(%rip), %xmm0   # 0x51a838
mulsd %xmm1, %xmm0
movsd %xmm0, 0x118(%rsp)
movsd 0x118(%rsp), %xmm0
movq 0x1d0(%rsp), %rax
movsd 0x68(%rax), %xmm1
callq 0xec2f0
testb $0x1, %al
jne 0x3111c9
movq 0x1b8(%rsp), %rdi
callq 0x1211d0
jmp 0x31106b
movq 0x1c8(%rsp), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x1c8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x311125
movq $0x5, 0x78(%rsp)
xorl %eax, %eax
cmpq 0x78(%rsp), %rax
jbe 0x3110d7
movq 0x32aefa(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x204f63(%rip), %rsi    # 0x516013
leaq 0x2080f0(%rip), %rdx    # 0x5191a7
leaq 0x283351(%rip), %rcx    # 0x59440f
leaq 0x2831bd(%rip), %r8     # 0x594282
movl $0x46a, %r9d            # imm = 0x46A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3110d9
movq 0x78(%rsp), %rcx
movq 0x1c8(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x1c8(%rsp), %rax
movq (%rax), %rdi
movq 0x1c8(%rsp), %rax
imulq $0x48, 0x8(%rax), %rsi
leaq 0x283175(%rip), %rdx    # 0x594282
movl $0x46a, %ecx            # imm = 0x46A
callq 0xe8540
movq %rax, %rcx
movq 0x1c8(%rsp), %rax
movq %rcx, (%rax)
jmp 0x311127
movq 0x1c8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x31116d
movq 0x32ae64(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x204ecd(%rip), %rsi    # 0x516013
leaq 0x28334f(%rip), %rdx    # 0x59449c
leaq 0x2832bb(%rip), %rcx    # 0x59440f
leaq 0x283127(%rip), %r8     # 0x594282
movl $0x46a, %r9d            # imm = 0x46A
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x31116f
jmp 0x311171
movq 0x1c8(%rsp), %rax
movq (%rax), %rax
movq 0x1c8(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
movl $0x48, %edx
callq 0x19610
movq 0x1b8(%rsp), %rdi
callq 0x121270
jmp 0x3106e8
movq 0x198(%rsp), %rdi
callq 0x2f85d0
movq 0x140(%rsp), %rdi
callq 0x2b0d20
movq 0x138(%rsp), %rdi
callq 0x2b0d20
movq 0xc8(%rsp), %rdi
callq 0x2538a0
movb 0xc7(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
retq
nop