// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movl %edx, %ecx
movl %edx, 0xc(%rsp)
movl %esi, %edx
movq %rdi, 0x20(%rsp)
movq 0x8(%rdi), %rax
movq 0x8(%rax), %r13
movl 0x14(%rax), %ebp
movl %ebp, %r15d
imull %esi, %r15d
imull %ecx, %ebp
movq 0x9c66(%rip), %rdi      # 0xc370
movl (%r13,%r15), %ecx
movl 0x4(%r13,%r15), %r8d
movl 0x1c(%r13,%r15), %r9d
movl 0x24(%r13,%r15), %r10d
movl 0x28(%r13,%r15), %r11d
movl 0x2c(%r13,%r15), %r14d
movl 0x30(%r13,%r15), %r12d
leaq 0x4cb4(%rip), %rsi      # 0x73e8
movl %edx, 0x14(%rsp)
xorl %eax, %eax
pushq %r12
pushq %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
movq 0x9c1e(%rip), %rdi      # 0xc370
movl (%r13,%rbp), %ecx
movl 0x4(%r13,%rbp), %r8d
movl 0x1c(%r13,%rbp), %r9d
movl 0x24(%r13,%rbp), %r10d
movl 0x28(%r13,%rbp), %r11d
movl 0x2c(%r13,%rbp), %r14d
movq %rbp, %rbx
movl 0x30(%r13,%rbp), %r12d
leaq 0x4c69(%rip), %rsi      # 0x73e8
movl 0xc(%rsp), %edx
xorl %eax, %eax
pushq %r12
pushq %r14
movq %r15, %r14
pushq %r11
pushq %r10
callq 0x1130
addq $0x20, %rsp
movq %r13, %r15
movq 0x8(%r13,%r14), %rax
movq %rax, 0x18(%rsp)
xorl %ecx, %ecx
movl $0x0, 0x10(%rsp)
movq %r14, 0x30(%rsp)
pushq $0x52
popq %r12
movslq 0x4(%r15,%r14), %rax
cmpq %rax, %rcx
jge 0x28f2
movq 0x18(%rsp), %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x10(%r15,%r14), %rax
movq %rcx, 0x38(%rsp)
movzwl (%rax,%rcx,2), %eax
addl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rax
movb (%rax,%rdx), %al
andb $0x3, %al
cmpb $0x1, %al
jne 0x28e0
movq 0x8(%r15,%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %rdx, 0x40(%rsp)
cmpl 0x4(%r15,%rbx), %r14d
jge 0x28e0
movq 0x28(%rsp), %rax
movl (%rax,%r14,4), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq 0x10(%r15,%rbx), %rsi
movzwl (%rsi), %esi
addl %esi, %r13d
cmpl %ecx, %edx
jne 0x28d8
movq 0x9b26(%rip), %rdi      # 0xc370
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movq 0x30(%rcx), %rcx
movzwl (%rcx,%rdx,2), %ecx
movq 0x18(%rsp), %rbp
xorl (%rbp), %eax
shrl $0x1f, %eax
leal 0x2b(,%rax,2), %r8d
leaq 0x4bb2(%rip), %rsi      # 0x7426
xorl %eax, %eax
callq 0x1130
cmpl $0x0, (%rbp)
movq 0x9aea(%rip), %rdi      # 0xc370
pushq $0x46
popq %rbp
movl %ebp, %r8d
cmovnsl %r12d, %r8d
leaq 0x4b9e(%rip), %rsi      # 0x7435
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
xorl %eax, %eax
callq 0x1130
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax,%r14,4)
movq 0x9ab9(%rip), %rdi      # 0xc370
cmovnsl %r12d, %ebp
leaq 0x4b7d(%rip), %rsi      # 0x743f
movl 0xc(%rsp), %edx
movl %r13d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1130
movq 0x40(%rsp), %rdx
incq %r14
jmp 0x2814
movq 0x38(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %r14
jmp 0x27b9
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq