// File: /workspace/github_c_makefile_star2_O3/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 0x9eff(%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 0x4f4e(%rip), %rsi      # 0x83e8
movl %edx, 0x8(%rsp)
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
movq 0x9eb8(%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 0x4f08(%rip), %rsi      # 0x83e8
movl %r13d, 0xc(%rsp)
movl %r13d, %edx
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
movl 0x4(%rbx,%r15), %eax
testl %eax, %eax
jle 0x3680
movq 0x8(%rbx,%r15), %rcx
movq %rcx, 0x10(%rsp)
xorl %esi, %esi
movl $0x0, 0x4(%rsp)
movq %r15, 0x28(%rsp)
movl 0x4(%rsp), %ecx
movq 0x10(%rsp), %rdx
movl (%rdx), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq 0x10(%rbx,%r15), %rdx
movzwl (%rdx,%rsi,2), %edx
addl %ecx, %edx
movl %edx, 0x4(%rsp)
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq 0x38(%rcx), %rcx
movb (%rcx,%r12), %cl
andb $0x3, %cl
cmpb $0x1, %cl
jne 0x3671
movl 0x4(%rbx,%rbp), %ecx
testl %ecx, %ecx
jle 0x3671
movq %rsi, 0x30(%rsp)
movq 0x8(%rbx,%rbp), %rax
movq %rax, 0x20(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %r13d, %edx
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %eax
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq 0x10(%rbx,%rbp), %rdi
movzwl (%rdi), %r13d
addl %edx, %r13d
cmpl %esi, %r12d
jne 0x3656
movq 0x9dc0(%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 0x4e45(%rip), %rsi      # 0x8426
movl %r12d, %edx
xorl %eax, %eax
callq 0x1130
cmpl $0x0, (%rbp)
movq %rbx, %rbp
movq %r15, %rbx
movq 0x9d74(%rip), %rdi      # 0xd370
movl $0x46, %r8d
movl $0x52, %r15d
cmovnsl %r15d, %r8d
leaq 0x4e22(%rip), %rsi      # 0x8435
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
xorl %eax, %eax
callq 0x1130
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax,%r14,4)
movq 0x9d3d(%rip), %rdi      # 0xd370
movl $0x46, %r8d
cmovnsl %r15d, %r8d
leaq 0x4dfb(%rip), %rsi      # 0x843f
movl 0xc(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x1130
movl 0x4(%rbx,%rbp), %ecx
incq %r14
cmpl %ecx, %r14d
jl 0x3580
movq 0x28(%rsp), %r15
movl 0x4(%rbx,%r15), %eax
movq 0x30(%rsp), %rsi
incq %rsi
movslq %eax, %rcx
cmpq %rcx, %rsi
jl 0x3521
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq