// File: /workspace/github_c_makefile_star2_O2/thegenemyers[P]DASCRUBBER/DASrealign.c
// Function: EXTENDER
static void EXTENDER(int aread, Overlap *ovls, int novl)
{ Finger      _afinger, *afinger = &_afinger;
  Finger      _bfinger, *bfinger = &_bfinger;

  static Overlap     _ovla, *ovla = &_ovla;
  static Path        *ipath = &_ovla.path;

  static Path         rpath, fpath;
  static Alignment   _ralign, *ralign = &_ralign;
  static Alignment   _falign, *falign = &_falign;

  static Work_Data  *work = NULL;
  static Align_Spec *spec;

  int ap, alast;

  if (aread < ADB_ofirst || aread >= ADB_olast)
    return;

  if (work == NULL)
    { spec = New_Align_Spec(.70,100,ADB->freq,1);
      work = New_Work_Data();
      ralign->path = &rpath;
      falign->path = &fpath;
    }

  alast = IAMAP[aread+1];
  for (ap = IAMAP[aread]; ap < alast; ap++)
    { int mb, me;
      int aend, abeg, alen;

      mb = AMAP_IDX[ap]+2;
      me = AMAP_IDX[ap+1];

      abeg = AMAP[mb];
      aend = AMAP[me-1];
      if (aend - abeg < MIN_LEN)
        continue;

      ralign->aseq = falign->aseq = ((char *) ADB->bases) + ADB->reads[ap].boff;
      ralign->alen = falign->alen = alen = ADB->reads[ap].rlen;

#ifdef OUTLINE
      printf("AREAD %d -> %d [%d,%d]\n",aread,ap,abeg,aend);
      fflush(stdout);
#endif
#ifdef SHOW_MAP
      print_map(AMAP,mb,me,0);
#endif

      { int   o, ob, oe;
        Path *path;
        int   bread;
        int   bp, blast;

        for (ob = 0; ob < novl; ob = oe)
          { bread = ovls[ob].bread;
            for (oe = ob+1; oe < novl && ovls[oe].bread == bread; oe += 1)
              ;
            if (bread < BDB_ofirst || bread >= BDB_olast)
              continue;

            blast = IBMAP[bread+1];
            for (bp = IBMAP[bread]; bp < blast; bp++)
              { int hb, he;
                int bend, bbeg, blen;
                int alpos, clen;

                hb = BMAP_IDX[bp]+2;
                he = BMAP_IDX[bp+1];

                bbeg = BMAP[hb];
                bend = BMAP[he-1];
                if (bend - bbeg < MIN_LEN)
                  continue;

#ifdef OUTLINE
		printf("  BREAD %d->%d [%d,%d]\n",bread,bp,bbeg,bend);
                fflush(stdout);
#endif
#ifdef SHOW_MAP
		print_map(BMAP,hb,he,0);
#endif

                alpos = -1;
                for (o = ob; o < oe; o++)
                  { int bbreal, bereal;

                    path = &(ovls[o].path);
                    if (COMP(ovls[o].flags))
                      { clen = BMAP[hb-1];
                        bbreal = clen-path->bepos;
                        bereal = clen-path->bbpos;
                      }
                    else
                      { clen = 0;
                        bbreal = path->bbpos;
                        bereal = path->bepos;
                      }
  
#ifdef OUTLINE
                    printf("    OVL %d: [%d,%d] %c [%d,%d]\n",o,
                           path->abpos,path->aepos,(clen==0)?'n':'c',bbreal,bereal);
                    fflush(stdout);
#endif

                    if (path->abpos <= aend-MIN_LEN && path->aepos >= abeg+MIN_LEN &&
                             bbreal <= bend-MIN_LEN &&      bereal >= bbeg+MIN_LEN)

                      { ralign->bseq  = falign->bseq  = ((char *) BDB->bases) + BDB->reads[bp].boff;
                        ralign->blen  = falign->blen  = blen = BDB->reads[bp].rlen;
                        ralign->flags = falign->flags = ovls[o].flags;

                        if (COMP(ralign->flags))
                          Complement_Seq(ralign->bseq,blen);

#ifdef SHOW_MAP
                        print_map(BMAP,hb,he,clen);
#endif

                        init_finger(afinger,AMAP,mb,me,0);
                        init_finger(bfinger,BMAP,hb,he,clen);
                        if ( ! recon(ipath,path,afinger,bfinger))
                          { int apos, bpos, acc, len, diag;

                            init_finger(afinger,AMAP,mb,me,0);
                            init_finger(bfinger,BMAP,hb,he,clen);
                            if (estimate(path,afinger,bfinger,&apos,&bpos,&acc))
                              if (apos > alpos)
                                { diag = apos-bpos;

                                  acc /= 2;
                                  if (apos + acc > alen)
                                    acc = alen-apos;
                                  if (bpos + acc > blen)
                                    acc = blen-bpos;
                                  if (apos < acc)
                                    acc = apos;
                                  if (bpos < acc)
                                    acc = bpos;
                                  if (acc > 500)
                                    acc = 500;
                                  acc *= 2;

#ifdef OUTLINE
                                  printf("      Trying: %d,%d + %d\n",apos,bpos,acc);
                                  fflush(stdout);
#endif
                                  Local_Alignment(ralign,work,spec,
                                                  diag-acc,diag+acc,apos+bpos,-1,-1);
#ifdef OUTLINE
                                  printf("      Local: <%d,%d> -> <%d,%d>\n",
                                         ralign->path->abpos,ralign->path->bbpos,
                                         ralign->path->aepos,ralign->path->bepos);
                                  fflush(stdout);
#endif
                                  len = ralign->path->aepos - ralign->path->abpos;
                                  if (len >= MIN_LEN && ralign->path->diffs <= .35*len)
                                    { ovla->aread = ap;
                                      ovla->bread = bp;
                                      ovla->flags = ralign->flags;
                                      _ovla.path  = *(ralign->path);
                                      convert_trace(ralign->path);
#ifdef OUTLINE
                                      printf("      Final: %d[%d..%d] vs %d[%d..%d] %c d=%d\n",
                                             ovla->aread,ovla->path.abpos,ovla->path.aepos,
                                             ovla->bread,ovla->path.bbpos,ovla->path.bepos,
                                             (COMP(ovla->flags) ? 'c' : 'n'), ovla->path.diffs);
                                      fflush(stdout);
#endif
#ifdef SHOW_FINAL
                                      show_overlap(ovla);
#endif
#ifdef SHOW_ALIGNMENTS
                                      Compute_Trace_IRR(ralign,work,GREEDIEST);
                                      Print_Alignment(stdout,ralign,work,4,80,10,0,6);
#else
                                      Write_Overlap(OUTPUT,ovla,sizeof(uint16));
                                      WOVLS += 1;
#endif

                                      alpos  = ralign->path->aepos;
#ifdef OUTLINE
                                      printf("        ACCEPT\n");
#endif
                                    }
#ifdef OUTLINE
                                  else
                                    printf("        REJECT\n");
#endif
                                }
#ifdef OUTLINE
                              else
                                printf("        SKIP\n");
                            else
                              printf("        NO OVERLAP\n");
                            fflush(stdout);
#endif
                          }

                        else if (ipath->aepos > alpos)
                          { int ab, bb;
                            int ae, be;
                            int ar, br;
                            int af, bf;

                            ab = ipath->abpos;
                            bb = ipath->bbpos;
                            ae = ipath->aepos;
                            be = ipath->bepos;

                            ar = ab;
                            br = bb;
                            if (ab > 0 && bb > 0)
                              { Find_Extension(ralign,work,spec,ab-bb,ab+bb,-1,-1,1);
                                ar = ralign->path->abpos;
                                br = ralign->path->bbpos;
#ifdef OUTLINE
                                printf("      Rev: (%d,%d)",ab,bb);
                                printf(" -> (%d,%d)",ar,br);
                                printf(" %d",ralign->path->diffs);
                                fflush(stdout);
#endif
                                if (ar == 0 || br == 0 || ralign->path->diffs <= .35*(ab-ar))
                                  {
#ifdef OUTLINE
                                    printf(" OK\n");
                                    fflush(stdout);
#endif
                                    if (ab - 10 < ar)
                                      { uint16 *trace = (uint16 *) ipath->trace;
                                        int     tlen  = ipath->tlen;

                                        if (tlen > 0)
                                          { trace[0] += ab - ar;
                                            trace[1] += bb - br;
                                          }
                                        ipath->abpos = ar;
                                        ipath->bbpos = br;
                                      }
                                    else
                                      { convert_trace(ralign->path);
                                        fusion(ralign->path,ipath,2);
                                      }
                                  }
                                else
                                  { ar = ab;
                                    br = bb;
#ifdef OUTLINE
                                    printf(" NOTOK\n");
                                    fflush(stdout);
#endif
                                  }
                              }

                            af = ae;
                            bf = be;
                            if (ae < alen && be < blen)
                              { Find_Extension(falign,work,spec,ae-be,ae+be,-1,-1,0);
                                af = falign->path->aepos;
                                bf = falign->path->bepos;
#ifdef OUTLINE
                                printf("      Fow: (%d,%d)",ae,be);
                                printf(" -> (%d,%d)",af,bf);
                                printf(" %d",falign->path->diffs);
                                fflush(stdout);
#endif
                                if (af == alen || bf == blen || falign->path->diffs <= .35*(af-ae))
                                  {
#ifdef OUTLINE
                                    printf(" OK\n");
                                    fflush(stdout);
#endif
                                    if (ae + 10 > af)
                                      { uint16 *trace = (uint16 *) ipath->trace;
                                        int     tlen  = ipath->tlen;

                                        if (tlen > 0)
                                          { trace[tlen-2] += af-ae;
                                            trace[tlen-1] += bf-be;
                                          }
                                        ipath->aepos = af;
                                        ipath->bepos = bf;
                                      }
                                    else
                                      { convert_trace(falign->path);
                                        fusion(ipath,falign->path,1);
                                      }
                                  }
                                else
                                  { af = ae;
                                    bf = be;
#ifdef OUTLINE
                                    printf(" NOTOK\n");
                                    fflush(stdout);
#endif
                                  }
                              }

                            alpos = af;
                            if (af-ar >= MIN_LEN) 
                              { ovla->aread = AFIRST + ap;
                                ovla->bread = BFIRST + bp;
                                ovla->flags = ralign->flags;
#ifdef OUTLINE
                                printf("      Final: %d[%d..%d] vs %d[%d..%d] %c d=%d\n",
                                       ovla->aread,ovla->path.abpos,ovla->path.aepos,
                                       ovla->bread,ovla->path.bbpos,ovla->path.bepos,
                                       (COMP(ovla->flags) ? 'c' : 'n'), ovla->path.diffs);
                                fflush(stdout);
#endif
#ifdef SHOW_FINAL
                                show_overlap(ovla);
#endif
#ifdef SHOW_ALIGNMENTS
				fpath = *ipath;
                                Compute_Trace_IRR(falign,work,GREEDIEST);
                                Print_Alignment(stdout,falign,work,4,80,10,0,6);
#else
                                Write_Overlap(OUTPUT,ovla,sizeof(uint16));
                                WOVLS += 1;
#endif
                              }
#ifdef OUTLINE
                            else
                              printf("        NO OVERLAP\n");
#endif
                            fusion(NULL,NULL,0);
                          }

#ifdef OUTLINE
                        else
                          printf("     SKIP\n");
                        fflush(stdout);
#endif

                        if (COMP(ralign->flags))
                          Complement_Seq(ralign->bseq,blen);
                      }
                  }
              }
          }
      }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %edx, 0x20(%rsp)
cmpl %edi, 0x1d2b7(%rip)     # 0x1f1b8
jg 0x2b89
movl %edi, %ebx
cmpl %edi, 0x1d2ad(%rip)     # 0x1f1bc
jle 0x2b89
movq %rsi, %r13
cmpq $0x0, 0x1d490(%rip)     # 0x1f3b0
jne 0x1f6d
leaq 0x1d2df(%rip), %rsi     # 0x1f208
movsd 0x170ef(%rip), %xmm0    # 0x19020
pushq $0x64
popq %rdi
pushq $0x1
popq %rdx
callq 0x305d
movq %rax, 0x1d475(%rip)     # 0x1f3b8
xorl %eax, %eax
callq 0x2fd8
movq %rax, 0x1d45f(%rip)     # 0x1f3b0
leaq 0x1d3c8(%rip), %rax     # 0x1f320
movq %rax, 0x1d401(%rip)     # 0x1f360
leaq 0x1d3da(%rip), %rax     # 0x1f340
movq %rax, 0x1d41b(%rip)     # 0x1f388
movq 0x1d24c(%rip), %rax     # 0x1f1c0
movslq %ebx, %rcx
movslq 0x4(%rax,%rcx,4), %rdx
movq %rdx, 0x120(%rsp)
movslq (%rax,%rcx,4), %r8
movslq 0x20(%rsp), %rax
movq %rax, 0x148(%rsp)
decl %eax
movl %eax, 0xc4(%rsp)
leaq 0x58(%r13), %rax
movq %rax, 0x138(%rsp)
movq %r13, 0x88(%rsp)
cmpq 0x120(%rsp), %r8
jge 0x2b89
movq %r8, %rcx
movq 0x1d1de(%rip), %rax     # 0x1f1a8
movq (%rax,%r8,8), %rbx
movq 0x8(%rax,%r8,8), %rdx
incq %r8
movq 0x1d1d3(%rip), %rax     # 0x1f1b0
movq %rbx, %r14
shlq $0x20, %r14
movq %rcx, %rsi
movabsq $0x200000000, %rcx      # imm = 0x200000000
addq %rcx, %r14
movq %r14, %rcx
sarq $0x1e, %rcx
movl (%rax,%rcx), %edi
movq %rdx, %rcx
movq %rdx, 0x108(%rsp)
shlq $0x20, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
addq %rdx, %rcx
sarq $0x1e, %rcx
movl (%rax,%rcx), %ebp
movl %ebp, %eax
movq %rdi, 0x158(%rsp)
subl %edi, %eax
cmpl 0x1d169(%rip), %eax     # 0x1f19c
jl 0x1fb2
movq 0x1d210(%rip), %rax     # 0x1f250
movq 0x1d211(%rip), %rcx     # 0x1f258
movq %rsi, 0xd0(%rsp)
imulq $0x28, %rsi, %rdx
addq 0x10(%rcx,%rdx), %rax
sarq $0x20, %r14
movq %rax, 0x1d335(%rip)     # 0x1f398
movq %rax, 0x1d306(%rip)     # 0x1f370
movl 0x4(%rcx,%rdx), %eax
movl %eax, 0x1d334(%rip)     # 0x1f3a8
movl %eax, 0x24(%rsp)
movl %eax, 0x1d302(%rip)     # 0x1f380
addl $0x5, %ebx
xorl %edx, %edx
movq %r8, 0x128(%rsp)
movq %rbx, 0x98(%rsp)
movq %r14, 0x90(%rsp)
movl %ebp, 0x18(%rsp)
cmpl 0x20(%rsp), %edx
jge 0x1fb2
movq %rdx, %rdi
movslq %edx, %rdx
imulq $0x30, %rdx, %rcx
movslq 0x28(%r13,%rcx), %rax
movq %rdx, 0x140(%rsp)
incq %rdx
addq 0x138(%rsp), %rcx
cmpq 0x148(%rsp), %rdx
jge 0x20ed
incl %edi
incq %rdx
leaq 0x30(%rcx), %rsi
cmpl %eax, (%rcx)
movq %rsi, %rcx
je 0x20cb
movq %rdi, %rdx
leal -0x1(%rdi), %ecx
jmp 0x20f8
movl 0xc4(%rsp), %ecx
movl 0x20(%rsp), %edx
cmpl 0x1d0da(%rip), %eax     # 0x1f1d8
jl 0x209f
cmpl 0x1d0d6(%rip), %eax     # 0x1f1dc
jge 0x209f
movq %rdx, 0x130(%rsp)
movq 0x1d0c9(%rip), %rdx     # 0x1f1e0
movslq 0x4(%rdx,%rax,4), %rsi
movq %rsi, 0x150(%rsp)
movslq (%rdx,%rax,4), %r9
movslq %ecx, %r15
movq %r15, 0x50(%rsp)
cmpq 0x150(%rsp), %r9
jge 0x2b74
movq %r9, %r12
movq 0x1d080(%rip), %rax     # 0x1f1c8
movq (%rax,%r9,8), %rdx
movq 0x8(%rax,%r9,8), %rsi
incq %r9
movq 0x1d075(%rip), %rax     # 0x1f1d0
movq %rdx, %r10
shlq $0x20, %r10
movabsq $0x200000000, %rcx      # imm = 0x200000000
leaq (%r10,%rcx), %rdi
movq %rdi, %rcx
sarq $0x1e, %rcx
movl (%rax,%rcx), %r11d
movq %rsi, %r8
shlq $0x20, %r8
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %r8, %rcx
sarq $0x1e, %rcx
movl (%rax,%rcx), %eax
movl %eax, 0xcc(%rsp)
movl %r11d, 0xc8(%rsp)
subl %r11d, %eax
cmpl 0x1cfee(%rip), %eax     # 0x1f19c
jl 0x2130
sarq $0x20, %rdi
movq %rdi, 0xd8(%rsp)
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r10
sarq $0x1e, %r10
movq %rsi, 0xe0(%rsp)
leal -0x4(%rsi), %eax
movl %eax, 0x48(%rsp)
leal 0x1(%rdx), %eax
movl %eax, 0x44(%rsp)
sarq $0x1e, %r8
movq %r8, 0xf0(%rsp)
addl $0x5, %edx
movq %rdx, 0xe8(%rsp)
movq 0x140(%rsp), %r8
pushq $-0x1
popq %rax
movl %eax, 0x1c(%rsp)
movq %r12, 0x58(%rsp)
movq %r9, 0x100(%rsp)
movq %r10, 0xf8(%rsp)
cmpq %r15, %r8
jg 0x2130
imulq $0x30, %r8, %rax
leaq (%rax,%r13), %r11
movl 0x20(%r13,%rax), %eax
testb $0x1, %al
jne 0x224a
movl 0x14(%r11), %edx
movl 0x1c(%r11), %ecx
movl $0x0, 0x28(%rsp)
jmp 0x2263
movq 0x1cf7f(%rip), %rcx     # 0x1f1d0
movl (%rcx,%r10), %ecx
movl %ecx, %edx
subl 0x1c(%r11), %edx
movl %ecx, 0x28(%rsp)
subl 0x14(%r11), %ecx
movl 0x1cf33(%rip), %esi     # 0x1f19c
movl %ebp, %edi
subl %esi, %edi
cmpl %edi, 0x10(%r11)
jg 0x2b6c
movq 0x158(%rsp), %rdi
addl %esi, %edi
cmpl %edi, 0x18(%r11)
jl 0x2b6c
movl 0xcc(%rsp), %edi
subl %esi, %edi
cmpl %edi, %edx
jg 0x2b6c
addl 0xc8(%rsp), %esi
cmpl %esi, %ecx
jl 0x2b6c
movq 0x1ceb6(%rip), %rcx     # 0x1f168
movq 0x58(%rcx), %rdi
movq 0x60(%rcx), %rcx
imulq $0x28, %r12, %rdx
addq 0x10(%rcx,%rdx), %rdi
movq %rdi, 0x1d0d6(%rip)     # 0x1f3a0
movq %rdi, 0x1d0a7(%rip)     # 0x1f378
movl 0x4(%rcx,%rdx), %ecx
movl %ecx, 0x1d0d1(%rip)     # 0x1f3ac
movl %ecx, 0x4(%rsp)
movl %ecx, 0x1d09f(%rip)     # 0x1f384
movl %eax, 0x1d0a5(%rip)     # 0x1f390
movl %eax, 0x1d077(%rip)     # 0x1f368
testb $0x1, %al
movq %r8, 0x110(%rsp)
movq %r11, 0x8(%rsp)
je 0x2310
movl 0x4(%rsp), %esi
callq 0x900c
movq 0x8(%rsp), %r11
movq 0x1ce99(%rip), %rax     # 0x1f1b0
movl %ebx, 0xa0(%rsp)
movq 0x108(%rsp), %rcx
movl %ecx, 0xa4(%rsp)
movl (%rax,%r14,4), %ecx
movl %ecx, 0xac(%rsp)
andl $0x0, 0xa8(%rsp)
andl $0x0, 0xb0(%rsp)
movq %rax, 0xb8(%rsp)
movq 0x1ce79(%rip), %rax     # 0x1f1d0
movl 0x28(%rsp), %esi
testl %esi, %esi
je 0x237f
movl 0x48(%rsp), %ecx
movl %ecx, 0x68(%rsp)
movl 0x44(%rsp), %ecx
movl %ecx, 0x6c(%rsp)
movl %esi, %ecx
movq 0xf0(%rsp), %rdx
subl -0x4(%rax,%rdx), %ecx
jmp 0x23a2
movq 0xe8(%rsp), %rcx
movl %ecx, 0x68(%rsp)
movq 0xe0(%rsp), %rcx
movl %ecx, 0x6c(%rsp)
movq 0xd8(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, 0x74(%rsp)
andl $0x0, 0x70(%rsp)
movl %esi, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq (%r11), %rax
movq %rax, 0x118(%rsp)
movl 0x8(%r11), %eax
movq 0x1cff3(%rip), %rdi     # 0x1f3c0
cmpl 0x1cda5(%rip), %eax     # 0x1f178
jle 0x2414
cvtsi2sd %eax, %xmm0
mulsd 0x16c27(%rip), %xmm0    # 0x19008
addsd 0x16c2f(%rip), %xmm0    # 0x19018
cvttsd2si %xmm0, %eax
movl %eax, 0x1cd85(%rip)     # 0x1f178
movslq %eax, %rsi
addq %rsi, %rsi
leaq 0x16ed8(%rip), %rdx     # 0x192d8
callq 0x11521
movq 0x8(%rsp), %r11
movq %rax, %rdi
movq %rax, 0x1cfac(%rip)     # 0x1f3c0
movq %rdi, 0x160(%rsp)
movq %rdi, 0x1cecd(%rip)     # 0x1f2f0
movl 0x1cd6f(%rip), %ecx     # 0x1f198
movl 0x10(%r11), %ebx
movl 0x14(%r11), %r13d
movl %ebx, %eax
cltd
movl %ecx, 0x2c(%rsp)
idivl %ecx
movl %edx, %ebp
leaq 0xa0(%rsp), %rdi
movl %ebx, %esi
callq 0x2d44
movl $0x0, 0x4c(%rsp)
movl $0x0, %edx
movl $0x0, %ecx
pushq $-0x1
popq %r15
testl %eax, %eax
js 0x249c
movl %eax, %r14d
leaq 0x68(%rsp), %rdi
movl %r13d, %esi
callq 0x2d44
movl $0x0, %edx
movl $0x0, %ecx
pushq $-0x1
popq %r15
testl %eax, %eax
js 0x249c
movl %r14d, 0x1ce72(%rip)    # 0x1f300
movl %eax, 0x1ce70(%rip)     # 0x1f304
xorl %r15d, %r15d
movl %r14d, %edx
movl %eax, %ecx
movl %r13d, 0x10(%rsp)
subl %ebp, %ebx
movq 0x8(%rsp), %rsi
movslq 0x8(%rsi), %rax
movq %rax, 0x60(%rsp)
pushq $0x1
popq %r13
cmpq 0x60(%rsp), %r13
jge 0x259e
movl %edx, %ebp
movl %ecx, 0x38(%rsp)
addl 0x2c(%rsp), %ebx
movl 0x18(%rsi), %eax
cmpl %eax, %ebx
cmovgel %eax, %ebx
testl %r15d, %r15d
js 0x24eb
movq 0x118(%rsp), %rcx
movzwl -0x2(%rcx,%r13,2), %eax
addl %eax, 0x4c(%rsp)
jmp 0x24f3
movq 0x118(%rsp), %rcx
movzwl (%rcx,%r13,2), %eax
movl 0x10(%rsp), %r12d
addl %eax, %r12d
leaq 0xa0(%rsp), %rdi
movl %ebx, %esi
callq 0x2d44
testl %eax, %eax
movl %r12d, 0x10(%rsp)
js 0x255b
movl %eax, %r14d
leaq 0x68(%rsp), %rdi
movl %r12d, %esi
callq 0x2d44
testl %eax, %eax
js 0x255b
testl %r15d, %r15d
movq 0x8(%rsp), %rsi
js 0x2569
movl %r14d, %ecx
subl %ebp, %ecx
movl %r15d, %edx
movq 0x160(%rsp), %rdi
movw %cx, (%rdi,%rdx,2)
movl %eax, %ecx
subl 0x38(%rsp), %ecx
movw %cx, 0x2(%rdi,%rdx,2)
addl $0x2, %r15d
jmp 0x2579
movl %ebp, %r14d
movl 0x38(%rsp), %eax
movq 0x8(%rsp), %rsi
jmp 0x2590
movl %r14d, 0x1cd90(%rip)    # 0x1f300
movl %eax, 0x1cd8e(%rip)     # 0x1f304
xorl %r15d, %r15d
movl %r14d, 0x1cd88(%rip)    # 0x1f308
movl %eax, 0x1cd86(%rip)     # 0x1f30c
movl 0x4c(%rsp), %ecx
movl %ecx, 0x1cd6c(%rip)     # 0x1f2fc
addq $0x2, %r13
movl %r14d, %edx
movl %eax, %ecx
jmp 0x24b5
movl %r15d, 0x1cd53(%rip)    # 0x1f2f8
testl %r15d, %r15d
jle 0x2671
movl 0x1cd54(%rip), %ebx     # 0x1f308
cmpl 0x1c(%rsp), %ebx
movq 0x88(%rsp), %r13
movl 0x18(%rsp), %ebp
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %r12
jle 0x2b2b
movl 0x1cd25(%rip), %r12d    # 0x1f300
movl 0x1cd22(%rip), %r15d    # 0x1f304
movl 0x1cd23(%rip), %r14d    # 0x1f30c
testl %r12d, %r12d
setg %al
testl %r15d, %r15d
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2669
movq 0x1cdad(%rip), %rsi     # 0x1f3b0
movq 0x1cdae(%rip), %rdx     # 0x1f3b8
movl %r12d, %ecx
subl %r15d, %ecx
leal (%r15,%r12), %r8d
leaq 0x1cd45(%rip), %rdi     # 0x1f360
pushq $-0x1
popq %r9
pushq $0x1
pushq $-0x1
callq 0x678a
popq %rcx
popq %rdx
movq 0x1cd2f(%rip), %rdi     # 0x1f360
movl 0x10(%rdi), %ebp
movl 0x14(%rdi), %eax
testl %ebp, %ebp
sete %cl
testl %eax, %eax
sete %dl
orb %cl, %dl
jne 0x2975
cvtsi2sdl 0xc(%rdi), %xmm0
movl %r12d, %ecx
subl %ebp, %ecx
cvtsi2sd %ecx, %xmm1
mulsd 0x169c9(%rip), %xmm1    # 0x19028
ucomisd %xmm0, %xmm1
jae 0x2975
movl %r12d, %ebp
jmp 0x29e1
movq 0x1cb38(%rip), %rax     # 0x1f1b0
movq 0x98(%rsp), %rcx
movl %ecx, 0xa0(%rsp)
movq 0x108(%rsp), %rcx
movl %ecx, 0xa4(%rsp)
movq 0x90(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
andl $0x0, 0xa8(%rsp)
andl $0x0, 0xb0(%rsp)
movl %ecx, 0xac(%rsp)
movq %rax, 0xb8(%rsp)
movq 0x1cb09(%rip), %rax     # 0x1f1d0
movl 0x28(%rsp), %edi
testl %edi, %edi
je 0x26ef
movl 0x48(%rsp), %ecx
movl %ecx, 0x68(%rsp)
movl 0x44(%rsp), %ecx
movl %ecx, 0x6c(%rsp)
movl %edi, %ecx
movq 0xf0(%rsp), %rdx
subl -0x4(%rax,%rdx), %ecx
jmp 0x2712
movq 0xe8(%rsp), %rcx
movl %ecx, 0x68(%rsp)
movq 0xe0(%rsp), %rcx
movl %ecx, 0x6c(%rsp)
movq 0xd8(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, 0x74(%rsp)
andl $0x0, 0x70(%rsp)
movl %edi, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq (%rsi), %rbx
movl 0x10(%rsi), %ebp
movl %ebp, %eax
cltd
idivl 0x2c(%rsp)
movl %edx, %r14d
movl 0x14(%rsi), %r15d
leaq 0xa0(%rsp), %rdi
movl %ebp, %esi
leaq 0x34(%rsp), %rdx
callq 0x2e29
movl $0x7fffffff, 0x10(%rsp) # imm = 0x7FFFFFFF
testl %eax, %eax
js 0x278a
movl %eax, %r13d
leaq 0x68(%rsp), %rdi
movl %r15d, %esi
leaq 0x30(%rsp), %rdx
callq 0x2e29
pushq $-0x1
popq %rcx
movl %ecx, %edx
testl %eax, %eax
js 0x2791
movl 0x30(%rsp), %ecx
addl 0x34(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl %r13d, %edx
jmp 0x278f
pushq $-0x1
popq %rax
movl %eax, %edx
movl %eax, %ecx
movq %rdx, 0x38(%rsp)
movq %rcx, 0x60(%rsp)
subl %r14d, %ebp
movq 0x8(%rsp), %rdx
movslq 0x8(%rdx), %r12
pushq $0x1
popq %r14
cmpq %r12, %r14
jge 0x2826
addl 0x2c(%rsp), %ebp
movzwl (%rbx,%r14,2), %eax
addl %eax, %r15d
movl 0x18(%rdx), %eax
cmpl %eax, %ebp
cmovgel %eax, %ebp
leaq 0xa0(%rsp), %rdi
movl %ebp, %esi
leaq 0x34(%rsp), %rdx
callq 0x2e29
testl %eax, %eax
js 0x281b
movl %eax, %r13d
leaq 0x68(%rsp), %rdi
movl %r15d, %esi
leaq 0x30(%rsp), %rdx
callq 0x2e29
testl %eax, %eax
js 0x281b
movl 0x30(%rsp), %ecx
addl 0x34(%rsp), %ecx
cmpl 0x10(%rsp), %ecx
movq 0x8(%rsp), %rdx
jge 0x2820
movl %r13d, %esi
movq %rsi, 0x38(%rsp)
movq %rax, 0x60(%rsp)
movl %ecx, 0x10(%rsp)
jmp 0x2820
movq 0x8(%rsp), %rdx
addq $0x2, %r14
jmp 0x27ab
movq 0x38(%rsp), %r10
testl %r10d, %r10d
js 0x29ab
cmpl 0x1c(%rsp), %r10d
movq 0x88(%rsp), %r13
movl 0x18(%rsp), %ebp
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %r12
jle 0x2b2b
movl %r10d, %ecx
movq 0x60(%rsp), %r9
subl %r9d, %ecx
movl 0x10(%rsp), %eax
cltd
pushq $0x2
popq %rsi
idivl %esi
leal (%rax,%r10), %edx
movl 0x24(%rsp), %edi
movl %edi, %esi
subl %r10d, %esi
cmpl %edi, %edx
cmovlel %eax, %esi
leal (%rsi,%r9), %eax
movl 0x4(%rsp), %edx
movl %edx, %edi
subl %r9d, %edi
cmpl %edx, %eax
cmovlel %esi, %edi
cmpl %edi, %r10d
cmovll %r10d, %edi
cmpl %edi, %r9d
cmovll %r9d, %edi
movl $0x1f4, %eax            # imm = 0x1F4
cmpl %eax, %edi
cmovgel %eax, %edi
leal (%rdi,%rdi), %eax
movq 0x1cb00(%rip), %rsi     # 0x1f3b0
movq 0x1cb01(%rip), %rdx     # 0x1f3b8
leal (%rcx,%rdi,2), %r8d
subl %eax, %ecx
addl %r10d, %r9d
leaq 0x1ca99(%rip), %rdi     # 0x1f360
pushq $-0x1
pushq $-0x1
callq 0x32bd
popq %rcx
popq %rdx
movq 0x1ca87(%rip), %rdi     # 0x1f360
movl 0x18(%rdi), %eax
subl 0x10(%rdi), %eax
cmpl 0x1c8b7(%rip), %eax     # 0x1f19c
jl 0x2b2b
cvtsi2sdl 0xc(%rdi), %xmm0
cvtsi2sd %eax, %xmm1
mulsd 0x1672c(%rip), %xmm1    # 0x19028
ucomisd %xmm0, %xmm1
jb 0x2b2b
movq 0xd0(%rsp), %rax
movl %eax, 0x1ca00(%rip)     # 0x1f314
movl %r12d, 0x1c9fd(%rip)    # 0x1f318
movl 0x1ca47(%rip), %eax     # 0x1f368
movl %eax, 0x1c9e9(%rip)     # 0x1f310
movupd (%rdi), %xmm0
movupd 0x10(%rdi), %xmm1
movupd %xmm0, 0x1c9b8(%rip)    # 0x1f2f0
movupd %xmm1, 0x1c9c0(%rip)    # 0x1f300
callq 0x2b9b
movq 0x1c89c(%rip), %rdi     # 0x1f1e8
leaq 0x1c99d(%rip), %rsi     # 0x1f2f0
pushq $0x2
popq %rdx
callq 0x8b27
incq 0x1c88e(%rip)           # 0x1f1f0
movq 0x1c9f7(%rip), %rax     # 0x1f360
movl 0x18(%rax), %eax
movl %eax, 0x1c(%rsp)
jmp 0x2b2b
leal -0xa(%r12), %ecx
cmpl %ebp, %ecx
jge 0x29c6
cmpl $0x0, 0x1c973(%rip)     # 0x1f2f8
jle 0x299d
movq 0x1c962(%rip), %rcx     # 0x1f2f0
subl %ebp, %r12d
addw %r12w, (%rcx)
subl %eax, %r15d
addw %r15w, 0x2(%rcx)
movl %ebp, 0x1c95d(%rip)     # 0x1f300
movl %eax, 0x1c95b(%rip)     # 0x1f304
jmp 0x29e1
movq 0x88(%rsp), %r13
movl 0x18(%rsp), %ebp
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %r12
jmp 0x2b2b
callq 0x2b9b
movq 0x1c98e(%rip), %rdi     # 0x1f360
leaq 0x1c917(%rip), %rsi     # 0x1f2f0
pushq $0x2
popq %rdx
callq 0x2be0
cmpl 0x24(%rsp), %ebx
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %r12
jge 0x2a62
cmpl 0x4(%rsp), %r14d
jge 0x2a62
movq 0x1c9b1(%rip), %rsi     # 0x1f3b0
movq 0x1c9b2(%rip), %rdx     # 0x1f3b8
movl %ebx, %ecx
subl %r14d, %ecx
movq %r14, 0x10(%rsp)
leal (%r14,%rbx), %r8d
leaq 0x1c96d(%rip), %rdi     # 0x1f388
pushq $-0x1
popq %r9
pushq $0x0
pushq $-0x1
callq 0x678a
popq %rcx
popq %rdx
movq 0x1c957(%rip), %rdi     # 0x1f388
movl 0x18(%rdi), %ecx
movl 0x1c(%rdi), %eax
movl %ecx, %r14d
cmpl 0x24(%rsp), %ecx
je 0x2a66
cmpl 0x4(%rsp), %eax
je 0x2a66
cvtsi2sdl 0xc(%rdi), %xmm0
movl %r14d, %ecx
subl %ebx, %ecx
cvtsi2sd %ecx, %xmm1
mulsd 0x165cc(%rip), %xmm1    # 0x19028
ucomisd %xmm0, %xmm1
jae 0x2a66
movl %ebx, %eax
jmp 0x2ac3
leal 0xa(%rbx), %ecx
cmpl %r14d, %ecx
jle 0x2aa5
movslq 0x1c883(%rip), %rcx     # 0x1f2f8
testq %rcx, %rcx
jle 0x2a96
movq 0x1c86f(%rip), %rdx     # 0x1f2f0
movl %r14d, %esi
subl %ebx, %esi
addw %si, -0x4(%rdx,%rcx,2)
movl %eax, %esi
subl 0x10(%rsp), %esi
addw %si, -0x2(%rdx,%rcx,2)
movl %r14d, 0x1c86b(%rip)    # 0x1f308
movl %eax, 0x1c869(%rip)     # 0x1f30c
jmp 0x2ac0
callq 0x2b9b
movq 0x1c8d7(%rip), %rsi     # 0x1f388
leaq 0x1c838(%rip), %rdi     # 0x1f2f0
pushq $0x1
popq %rdx
callq 0x2be0
movl %r14d, %eax
movl %eax, 0x1c(%rsp)
subl %ebp, %eax
cmpl 0x1c6cd(%rip), %eax     # 0x1f19c
jl 0x2b1c
movl 0x1c6c9(%rip), %eax     # 0x1f1a0
addl 0xd0(%rsp), %eax
movl %eax, 0x1c830(%rip)     # 0x1f314
movl 0x1c6ba(%rip), %eax     # 0x1f1a4
addl %r12d, %eax
movl %eax, 0x1c825(%rip)     # 0x1f318
movl 0x1c86f(%rip), %eax     # 0x1f368
movl %eax, 0x1c811(%rip)     # 0x1f310
movq 0x1c6e2(%rip), %rdi     # 0x1f1e8
leaq 0x1c7e3(%rip), %rsi     # 0x1f2f0
pushq $0x2
popq %rdx
callq 0x8b27
incq 0x1c6d4(%rip)           # 0x1f1f0
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2be0
movl 0x18(%rsp), %ebp
testb $0x1, 0x1c836(%rip)     # 0x1f368
je 0x2b44
movq 0x1c83d(%rip), %rdi     # 0x1f378
movl 0x4(%rsp), %esi
callq 0x900c
movq 0x98(%rsp), %rbx
movq 0x90(%rsp), %r14
movq 0x100(%rsp), %r9
movq 0xf8(%rsp), %r10
movq 0x110(%rsp), %r8
incq %r8
jmp 0x221e
movq 0x130(%rsp), %rdx
movq 0x128(%rsp), %r8
jmp 0x209f
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq