// File: /workspace/github_c_makefile_star2_O1/richarddurbin[P]hash10x/moshasm.c
// Function: printOverlap
void printOverlap (Readset *rs, U32 ix, U32 iy)
{
  Read *x = arrp(rs->reads, ix, Read), *y = arrp(rs->reads, iy, Read) ;
  fprintf (outFile, "RR overlaps_for %u\tlen %d\tnHit %d\tnMiss %d\tnCopy %d %d %d %d\n",
	   ix, x->len, x->nHit, x->nMiss, x->nCopy[0], x->nCopy[1], x->nCopy[2], x->nCopy[3]) ;
  fprintf (outFile, "RR overlaps_for %u\tlen %d\tnHit %d\tnMiss %d\tnCopy %d %d %d %d\n",
	   iy, y->len, y->nHit, y->nMiss, y->nCopy[0], y->nCopy[1], y->nCopy[2], y->nCopy[3]) ;
  int j, k ;	/* j is index in list of read 1 hits, k is index in list of read 2 hits */
  int xPos = 0 ;
  U32 *hx = x->hit ;
  for (j = 0 ; j < x->nHit ; ++j)
    { U32 hxx = *hx & TOPMASK ;
      xPos += x->dx[j] ;
      if (msIsCopy1 (rs->ms, hxx))
	{ U32 *hy = y->hit ;
	  int yPos = 0 ;
	  for (k = 0 ; k < y->nHit ; ++k, ++hy)
	    { U32 hyy = *hy & TOPMASK ;
	      yPos += y->dx[0] ;
	      if (hxx == hyy)
		{ fprintf (outFile, "RO\t%8x %5d %c\t",
			   hxx, rs->ms->depth[hxx], (*hx&TOPBIT) == (*hy&TOPBIT) ? '+' : '-') ;
		  fprintf (outFile, "%u %u %c\t",
			   ix, xPos, (*hx & TOPBIT) ? 'F' : 'R') ;
		  fprintf (outFile, "%u %u %c\n",
			   iy, yPos, (*hy & TOPBIT) ? 'F' : 'R') ;
		}
	    }
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r13d
movl %esi, %edx
movq %rdi, 0x18(%rsp)
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rbx
movl 0x14(%rax), %ebp
movl %ebp, %r15d
imull %esi, %r15d
imull %r13d, %ebp
movq 0xa0bc(%rip), %rdi      # 0xd370
movl (%rbx,%r15), %ecx
movl 0x4(%rbx,%r15), %r8d
movl 0x1c(%rbx,%r15), %r9d
movl 0x24(%rbx,%r15), %r10d
movl 0x28(%rbx,%r15), %r11d
movl 0x2c(%rbx,%r15), %r14d
movl 0x30(%rbx,%r15), %r12d
leaq 0x5109(%rip), %rsi      # 0x83e6
movl %edx, 0x8(%rsp)
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
movq 0xa075(%rip), %rdi      # 0xd370
movl (%rbx,%rbp), %ecx
movl 0x4(%rbx,%rbp), %r8d
movl 0x1c(%rbx,%rbp), %r9d
movl 0x24(%rbx,%rbp), %r10d
movl 0x28(%rbx,%rbp), %r11d
movl 0x2c(%rbx,%rbp), %r14d
movl 0x30(%rbx,%rbp), %r12d
leaq 0x50c3(%rip), %rsi      # 0x83e6
movl %r13d, 0xc(%rsp)
movl %r13d, %edx
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
cmpl $0x0, 0x4(%rbx,%r15)
jle 0x34ba
movq 0x8(%rbx,%r15), %rax
movq %rax, 0x10(%rsp)
xorl %edx, %edx
movl $0x0, 0x4(%rsp)
movq %r15, 0x28(%rsp)
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movl (%rcx), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq 0x10(%rbx,%r15), %rcx
movq %rdx, 0x30(%rsp)
movzwl (%rcx,%rdx,2), %ecx
addl %eax, %ecx
movl %ecx, 0x4(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rax
movb (%rax,%r12), %al
andb $0x3, %al
cmpb $0x1, %al
jne 0x349f
cmpl $0x0, 0x4(%rbx,%rbp)
jle 0x349f
movq 0x8(%rbx,%rbp), %rax
movq %rax, 0x20(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %r13d, %ecx
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %eax
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x10(%rbx,%rbp), %rsi
movzwl (%rsi), %r13d
addl %ecx, %r13d
cmpl %edx, %r12d
jne 0x3491
movq 0x9f81(%rip), %rdi      # 0xd370
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
movzwl (%rcx,%r12,2), %ecx
movq %rbx, %r15
movq %rbp, %rbx
movq 0x10(%rsp), %rbp
xorl (%rbp), %eax
shrl $0x1f, %eax
leal 0x2b(,%rax,2), %r8d
leaq 0x5004(%rip), %rsi      # 0x8424
movl %r12d, %edx
xorl %eax, %eax
callq 0x1130
cmpl $0x0, (%rbp)
movq %rbx, %rbp
movq %r15, %rbx
movq 0x9f35(%rip), %rdi      # 0xd370
movl $0x46, %r8d
movl $0x52, %r15d
cmovnsl %r15d, %r8d
leaq 0x4fe1(%rip), %rsi      # 0x8433
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
xorl %eax, %eax
callq 0x1130
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax,%r14,4)
movq 0x9efe(%rip), %rdi      # 0xd370
movl $0x46, %r8d
cmovnsl %r15d, %r8d
leaq 0x4fba(%rip), %rsi      # 0x843d
movl 0xc(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x1130
incq %r14
cmpl 0x4(%rbx,%rbp), %r14d
jl 0x33bf
movq 0x30(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %r15
movslq 0x4(%rbx,%r15), %rax
cmpq %rax, %rdx
jl 0x3363
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq