// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/jkOwnLib/ffAliHelp.c
// Function: ffMergeClose
struct ffAli *ffMergeClose(struct ffAli *aliList, 
	DNA *needleStart, DNA *hayStart)
/* Remove overlapping areas needle in alignment. Assumes ali is sorted on
 * ascending nStart field. Also merge perfectly abutting neighbors or
 * ones that could be merged at the expense of just a few mismatches.*/
{
struct ffAli *mid, *ali;
int closeEnough = -3;

if (aliList == NULL)
    return NULL;
for (mid = aliList->right; mid != NULL; mid = mid->right)
    {
    for (ali = aliList; ali != mid; ali = ali->right)
	{
	char *nStart, *nEnd;
	int nOverlap;
	nStart = max(ali->nStart, mid->nStart);
	nEnd = min(ali->nEnd, mid->nStart);
	nOverlap = nEnd - nStart;
	/* Overlap or perfectly abut in needle, and needle/hay
	 * offset the same. */
	if (nOverlap >= closeEnough)
	    {
	    int aliDiag = (ali->nStart - needleStart) - (ali->hStart - hayStart);
	    int midDiag = (mid->nStart - needleStart) - (mid->hStart - hayStart);
	    if (aliDiag == midDiag)
		{
		/* Make mid encompass both, and make ali empty. */
		mid->nStart = min(ali->nStart, mid->nStart);
		mid->nEnd = max(ali->nEnd, mid->nEnd);
		mid->hStart = min(ali->hStart, mid->hStart);
		mid->hEnd = max(ali->hEnd, mid->hEnd);
		ali->hStart = ali->hEnd = mid->hStart;
		ali->nEnd = ali->nStart = mid->nStart;;
		}
	    }
	}
    }
aliList = ffRemoveEmptyAlis(aliList, TRUE);
return aliList;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0xfffffffd, -0x34(%rbp) # imm = 0xFFFFFFFD
cmpq $0x0, -0x10(%rbp)
jne 0x1abc2
movq $0x0, -0x8(%rbp)
jmp 0x1ae20
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1ae06
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x1adf3
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x1ac0f
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x1ac1b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1ac43
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x1ac4f
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jl 0x1ade0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movq -0x30(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x20(%rbp), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movq -0x28(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x20(%rbp), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x54(%rbp), %eax
jne 0x1adde
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1ace5
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x1acf1
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jbe 0x1ad1d
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x1ad29
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x1ad55
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x1ad61
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jbe 0x1ad90
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x1ad9f
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ade0
jmp 0x1ade2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1abe1
jmp 0x1adf5
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1abce
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x1ae30
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)