// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/moshasm.c
// Function: findOverlaps
Array findOverlaps (Readset *rs, Read *x, int reportLevel) /* returns array of Overlap */
/* reportLevel 0 for none, 1 for per read (RR lines), 2 for per overlap (RR and RH lines) */
{
  int nRepeat = 0 ; /* number of repeat moshes */
  Array olap = arrayCreate (256, Overlap) ;
  arrayp(olap,0,Overlap)->nHit = 0 ; /* burn the 0 position */
  int *omap = new0 (arrayMax(rs->reads), int) ; /* map from read2 id to index in olap */
  U16 *hmap = new0 (rs->ms->max+1, U16) ; /* map from hashes to index in read1 hits */
  int j, k ;	/* j is index in list of read hits, k is index over reads containing hxx */
  Overlap *o ;
  U32 *hx = x->hit ; U16 *dx = x->dx ;
  U32 *xPos = new(x->nHit+1,U32) ; xPos[0] = 0 ; /* convert dx into absolute position NB +1 */
  for (j = 0 ; j < x->nHit ; ++j, ++hx, ++dx)
    { U32 hxx = *hx & TOPMASK ;
      xPos[j+1] = xPos[j] + *dx ; /* j+1 not j because hmap[] below is j+1 */
      if (msIsCopy1 (rs->ms, hxx))
	{ if (hmap[hxx]) { ++nRepeat ; x->badRepeat = 1 ; continue ; }
	  hmap[hxx] = j+1 ; /* note the +1 : needed to distinguish from missing */
	  U32 *r2 = rs->inv[hxx] ;
	  for (k = 0 ; k < rs->ms->depth[hxx] ; ++k, ++r2)
	    { if (!omap[*r2])
		{ o = arrayp(olap, omap[*r2] = arrayMax(olap), Overlap) ;
		  o->iy = *r2 ;
		}
	      else o = arrp(olap, omap[*r2], Overlap) ;
	      ++o->nHit ;
	    }
	}
    }
  free (omap) ;

  /* now consider overlap for each read with at least 3 hits */
  int nGood = 0, nBad = 0 ;
  hx = x->hit ;
  arraySort (olap, compareOverlap) ;
  o = arrp(olap, 0, Overlap) ;
  for (k = 1 ; k < arrayMax(olap) ; ++k, ++o) /* NB drop out of loop before reach end */
    { if (o->nHit < 3) break ;
      Read *y = arrp(rs->reads,o->iy,Read) ;
      if (y->bad) continue ;
      int nPlus = 0, nMinus = 0 ;
      double d = 0.0, d2 = 0.0 ;
      U16 ihx ;
      U32 *hy = y->hit ;
      for (j = 0 ; j < y->nHit ; ++j, ++hy) /* run through once to find direction */
	if ((ihx = hmap[*hy & TOPMASK]))
	  { if ((*hy & TOPBIT) == (hx[--ihx] & TOPBIT)) ++nPlus ; else ++nMinus ; }
      o->isBad = FALSE ;
      hy = y->hit ; /* reset hy for loop to come */
      U16 *dy = y->dx ; double yPos = *dy ;
      if (nPlus && !nMinus)
	{ o->isPlus = TRUE ;
	  int last = 0 ;
	  for (j = 0 ; j < y->nHit ; ++j, ++hy, yPos += *++dy)
	    if ((ihx = hmap[*hy & TOPMASK]))
	      { if (ihx < last) { o->isBad = TRUE ; --nPlus ; } last = ihx ;
		double z = xPos[ihx] - yPos ; d += z ; d2 += z*z ;
	      }
	}
      else if (nMinus && !nPlus)
	{ o->isPlus = FALSE ;
	  int last = x->nHit ;
	  for (j = 0 ; j < y->nHit ; ++j, ++hy, yPos += *++dy)
	    if ((ihx = hmap[*hy & TOPMASK]))
	      { if (ihx > last) { o->isBad = TRUE ; --nMinus ; } last = ihx ;
		double z = xPos[ihx] + yPos ; d += z ; d2 += z*z ;
	      }
	}
      if (nPlus && nMinus) o->isBad = TRUE ;
      d /= o->nHit ; d2 = sqrt (d2 / o->nHit - d*d) ;
      o->offset = d ;
      if (o->isBad) ++nBad ; else ++nGood ;
      
      if (reportLevel > 1)
	{ fprintf (outFile, "RH\t%u\tlen %d\t%s\tnPlus %d\tnMinus %d\t",
		   o->iy, y->len, o->isBad ? "BAD" : "GOOD", nPlus, nMinus) ;
	  fprintf (outFile, "offset %.1f\tsd %.1f\n", d, d2) ;
	}
    }
  arrayMax(olap) = k ;
  
  if (!nGood && !nBad)
    { x->badNoMatch = 1 ;
      if (x->nHit < 10) x->badLowHit = 1 ;
      else if (x->nCopy[1] < 10) x->badLowCopy1 = 1 ;
    }

  if (reportLevel > 0)
    { I64 iix = x - arrp(rs->reads,0,Read) ;
      if (iix < 0 || iix > arrayMax(rs->reads)) iix = 0 ; /* read not in readset */
      U32 ix = iix ;
      fprintf (outFile, "RR %6u\tlen %d\tnHit %3d\tnMiss %3d\t", ix, x->len, x->nHit, x->nMiss) ;
      fprintf (outFile, "nCpy %d %d %d %d\t", x->nCopy[0], x->nCopy[1], x->nCopy[2], x->nCopy[3]);
      fprintf (outFile, "nRepeatMosh %d\tnGood %4d\tnBad %4d\n", nRepeat, nGood, nBad) ;
    }

  free (hmap) ;
  return olap ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x100, %edi            # imm = 0x100
movl $0x10, %esi
callq 0x9220
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x9680
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0xa230
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x40(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x2, %esi
callq 0xa230
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0xa1e0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2985
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movzwl (%rax), %eax
addl %eax, %edx
movq -0x58(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x5c(%rbp), %esi
callq 0x30b0
cmpb $0x0, %al
je 0x295d
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
cmpw $0x0, (%rax,%rcx,2)
je 0x2883
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x18(%rax)
jmp 0x295f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movw %ax, %dx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
movw %dx, (%rax,%rcx,2)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
movl -0x5c(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x295b
movq -0x28(%rbp), %rax
movq -0x68(%rbp), %rcx
movl (%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x290d
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %esi
movq -0x28(%rbp), %rax
movq -0x68(%rbp), %rcx
movl (%rcx), %ecx
movl %esi, (%rax,%rcx,4)
callq 0x9680
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
jmp 0x2934
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq -0x68(%rbp), %rdx
movl (%rdx), %edx
movl (%rcx,%rdx,4), %ecx
movq -0x20(%rbp), %rdx
imull 0x14(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x68(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
jmp 0x28b1
jmp 0x295d
jmp 0x295f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x48(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x50(%rbp)
jmp 0x27fe
movq -0x28(%rbp), %rdi
callq 0x1040
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rax
movslq 0x18(%rax), %rsi
movq -0x20(%rbp), %rax
movslq 0x14(%rax), %rdx
leaq 0x719(%rip), %rcx       # 0x30e0
callq 0x1060
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
imull $0x0, 0x14(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x2f30
movq -0x40(%rbp), %rax
cmpl $0x3, 0x4(%rax)
jge 0x2a0c
jmp 0x2f30
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
imull 0x14(%rdx), %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0x2a42
jmp 0x2f16
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2b1e
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x92(%rbp)
cmpw $0x0, %ax
je 0x2afc
movq -0xa0(%rbp), %rax
movl (%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
movq -0x48(%rbp), %rcx
movw -0x92(%rbp), %dx
addw $-0x1, %dx
movw %dx, -0x92(%rbp)
movzwl %dx, %edx
movl (%rcx,%rdx,4), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
cmpl %ecx, %eax
jne 0x2af1
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2afa
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x2afc
jmp 0x2afe
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0xa0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa0(%rbp)
jmp 0x2a7c
movq -0x40(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movzwl (%rax), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xb0(%rbp)
cmpl $0x0, -0x7c(%rbp)
je 0x2ca5
cmpl $0x0, -0x80(%rbp)
jne 0x2ca5
movq -0x40(%rbp), %rax
movb $0x1, 0xc(%rax)
movl $0x0, -0xb4(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2ca0
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x92(%rbp)
cmpw $0x0, %ax
je 0x2c51
movzwl -0x92(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jge 0x2be1
movq -0x40(%rbp), %rax
movb $0x1, 0xd(%rax)
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
movzwl -0x92(%rbp), %eax
movl %eax, -0xb4(%rbp)
movq -0x58(%rbp), %rax
movzwl -0x92(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cvtsi2sd %rax, %xmm0
subsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
addsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd -0xc0(%rbp), %xmm2
movsd -0x90(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0x2c53
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0xa0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0xa8(%rbp)
movzwl 0x2(%rax), %eax
cvtsi2sd %eax, %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
jmp 0x2b87
jmp 0x2df2
cmpl $0x0, -0x80(%rbp)
je 0x2df0
cmpl $0x0, -0x7c(%rbp)
jne 0x2df0
movq -0x40(%rbp), %rax
movb $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xc4(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2dee
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x92(%rbp)
cmpw $0x0, %ax
je 0x2d9f
movzwl -0x92(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jle 0x2d2f
movq -0x40(%rbp), %rax
movb $0x1, 0xd(%rax)
movl -0x80(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x80(%rbp)
movzwl -0x92(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x58(%rbp), %rax
movzwl -0x92(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cvtsi2sd %rax, %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0xd0(%rbp), %xmm0
addsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm2
movsd -0x90(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0x2da1
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0xa0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0xa8(%rbp)
movzwl 0x2(%rax), %eax
cvtsi2sd %eax, %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
jmp 0x2cd5
jmp 0x2df0
jmp 0x2df2
cmpl $0x0, -0x7c(%rbp)
je 0x2e06
cmpl $0x0, -0x80(%rbp)
je 0x2e06
movq -0x40(%rbp), %rax
movb $0x1, 0xd(%rax)
movq -0x40(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm1
movsd -0x88(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x90(%rbp), %xmm1
movq -0x40(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm0
divsd %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
movsd -0x88(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x1230
movsd %xmm0, -0x90(%rbp)
cvttsd2si -0x88(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rax
cmpb $0x0, 0xd(%rax)
je 0x2e98
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x2ea1
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0x2f14
movq 0xd4ba(%rip), %rdi      # 0x10368
movq -0x40(%rbp), %rax
movl (%rax), %edx
movq -0x78(%rbp), %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movsbl 0xd(%rax), %esi
leaq 0x84a4(%rip), %r8       # 0xb36d
leaq 0x8499(%rip), %rax      # 0xb369
cmpl $0x0, %esi
cmovneq %rax, %r8
movl -0x7c(%rbp), %r9d
movl -0x80(%rbp), %eax
leaq 0x8460(%rip), %rsi      # 0xb345
movl %eax, (%rsp)
movb $0x0, %al
callq 0x1120
movq 0xd472(%rip), %rdi      # 0x10368
movsd -0x88(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
leaq 0x8465(%rip), %rsi      # 0xb372
movb $0x2, %al
callq 0x1120
jmp 0x2f16
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
jmp 0x29ed
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
cmpl $0x0, -0x6c(%rbp)
jne 0x2f90
cmpl $0x0, -0x70(%rbp)
jne 0x2f90
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpl $0xa, 0x4(%rax)
jge 0x2f72
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x11, %cl
orb $0x10, %cl
movb %cl, 0x18(%rax)
jmp 0x2f8e
movq -0x10(%rbp), %rax
cmpl $0xa, 0x28(%rax)
jge 0x2f8c
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x21, %cl
orb $0x20, %cl
movb %cl, 0x18(%rax)
jmp 0x2f8e
jmp 0x2f90
cmpl $0x0, -0x14(%rbp)
jle 0x308d
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rdx
imull $0x0, 0x14(%rdx), %edx
movslq %edx, %rdx
addq %rdx, %rcx
subq %rcx, %rax
movl $0x48, %ecx
cqto
idivq %rcx
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
jl 0x2ff2
movq -0xd8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jle 0x2ffd
movq $0x0, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl %eax, -0xdc(%rbp)
movq 0xd357(%rip), %rdi      # 0x10368
movl -0xdc(%rbp), %edx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %r9d
leaq 0x8353(%rip), %rsi      # 0xb387
movb $0x0, %al
callq 0x1120
movq 0xd326(%rip), %rdi      # 0x10368
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edx
movq -0x10(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x30(%rax), %r9d
leaq 0x8342(%rip), %rsi      # 0xb3a9
movb $0x0, %al
callq 0x1120
movq 0xd2f3(%rip), %rdi      # 0x10368
movl -0x18(%rbp), %edx
movl -0x6c(%rbp), %ecx
movl -0x70(%rbp), %r8d
leaq 0x8335(%rip), %rsi      # 0xb3bb
movb $0x0, %al
callq 0x1120
movq -0x30(%rbp), %rdi
callq 0x1040
movq -0x20(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)