// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/lib/axt.c
// Function: axtGetSubsetOnT
boolean axtGetSubsetOnT(struct axt *axt, struct axt *axtOut,
            int newStart, int newEnd, struct axtScoreScheme *ss,
            boolean includeEdgeGaps)
/* Return FALSE if axt is not in the new range.  Otherwise, set axtOut to
 * a subset that goes from newStart to newEnd in target coordinates. 
 * If includeEdgeGaps, don't trim target gaps before or after the range. */
{
if (axt == NULL)
    return FALSE;
if (newStart < axt->tStart)
    newStart = axt->tStart;
if (newEnd > axt->tEnd)
    newEnd = axt->tEnd;
if (includeEdgeGaps ? (newEnd < newStart) : (newEnd <= newStart)) 
    return FALSE;
if (newStart == axt->tStart && newEnd == axt->tEnd)
    {
    axt->score = axtScore(axt, ss);
    *axtOut = *axt;
    return TRUE;
    }
else
    {
    struct axt a = *axt;
    char *tSymStart = skipIgnoringDash(a.tSym, newStart - a.tStart, TRUE);
    char *tSymEnd = skipIgnoringDash(tSymStart, newEnd - newStart, FALSE);
    if (includeEdgeGaps)
    {
    while (tSymStart > a.tSym)
        if (*(--tSymStart) != '-')
        {
        tSymStart++;
        break;
        }
    while (tSymEnd < a.tSym + a.symCount)
        if (*(++tSymEnd) != '-')
        {
        tSymEnd--;
        break;
        }
    if (newEnd == newStart && tSymEnd > tSymStart)
        {
        if (*tSymStart != '-')
        tSymStart++;
        if (*(tSymEnd-1) != '-')
        tSymEnd--;
        }
    }
    int symCount = tSymEnd - tSymStart;
    char *qSymStart = a.qSym + (tSymStart - a.tSym);
    a.qStart += countNonDash(a.qSym, qSymStart - a.qSym);
    a.qEnd = a.qStart + countNonDash(qSymStart, symCount);
    a.tStart = newStart;
    a.tEnd = newEnd;
    a.symCount = symCount;
    a.qSym = qSymStart;
    a.tSym = tSymStart;
    a.score = axtScore(&a, ss);
    if ((a.qStart < a.qEnd && a.tStart < a.tEnd) ||
    (includeEdgeGaps && (a.qStart < a.qEnd || a.tStart < a.tEnd)))
    {
    *axtOut = a;
    return TRUE;
    }
    return FALSE;
    }
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x1a231
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl 0x28(%rdi), %edi
movl 0x2c(%r15), %esi
cmpl %edx, %edi
movl %edx, %ebp
cmovgl %edi, %ebp
cmpl %ecx, %esi
movl %ecx, %ebx
cmovll %esi, %ebx
testl %r9d, %r9d
je 0x1a044
cmpl %ebp, %ebx
jge 0x1a04c
jmp 0x1a223
cmpl %ebp, %ebx
jle 0x1a223
cmpl %edx, %edi
setge %al
cmpl %ecx, %esi
setle %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1a088
movl 0x38(%r15), %esi
movq 0x40(%r15), %rdx
movq 0x48(%r15), %rcx
movq %r8, %rdi
callq 0x19db1
movl %eax, 0x34(%r15)
movl $0xb, %ecx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
jmp 0x1a21e
movq %r8, 0x18(%rsp)
movq %r14, 0x38(%rsp)
movups (%r15), %xmm0
movaps %xmm0, 0x50(%rsp)
movl 0x10(%r15), %eax
movl %eax, 0x24(%rsp)
movups 0x18(%r15), %xmm0
movaps %xmm0, 0x40(%rsp)
movslq 0x38(%r15), %r14
movl 0x30(%r15), %eax
movl %eax, 0x28(%rsp)
movl 0x3c(%r15), %eax
movl %eax, 0x2c(%rsp)
movq 0x40(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%r15), %r13
movq 0x50(%r15), %rax
movq %rax, 0x30(%rsp)
movl %ebp, %esi
subl %edi, %esi
movq %r13, %rdi
movl $0x1, %edx
movl %r9d, 0xc(%rsp)
callq 0x25363
movq %rax, %r15
movl %ebx, %esi
subl %ebp, %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x25363
movq %rax, %r12
cmpl $0x0, 0xc(%rsp)
je 0x1a159
movq %r15, %rax
cmpq %r13, %r15
jbe 0x1a11a
leaq -0x1(%rax), %r15
cmpb $0x2d, -0x1(%rax)
je 0x1a108
addq %r13, %r14
movq %r12, %rcx
cmpq %r14, %r12
jae 0x1a12f
leaq 0x1(%rcx), %r12
cmpb $0x2d, 0x1(%rcx)
je 0x1a11d
cmpl %ebp, %ebx
jne 0x1a153
cmpq %rax, %rcx
jbe 0x1a153
xorl %r15d, %r15d
cmpb $0x2d, (%rax)
setne %r15b
addq %rax, %r15
leaq -0x1(%rcx), %r12
cmpb $0x2d, -0x1(%rcx)
cmoveq %rcx, %r12
jmp 0x1a159
movq %rax, %r15
movq %rcx, %r12
subl %r15d, %r12d
movq %r15, %rsi
subq %r13, %rsi
movq 0x10(%rsp), %rdi
leaq (%rdi,%rsi), %r13
callq 0x25399
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movl %r12d, %esi
callq 0x25399
movl %eax, %r14d
movq 0x18(%rsp), %rdi
movl %r12d, %esi
movq %r13, 0x18(%rsp)
movq %r13, %rdx
movq %r15, %rcx
callq 0x19db1
movl %eax, %ecx
testl %r14d, %r14d
setg %al
cmpl %ebp, %ebx
setg %dl
testb %dl, %al
jne 0x1a1c5
testl %r14d, %r14d
setg %dl
cmpl %ebp, %ebx
setg %sil
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
je 0x1a223
orb %sil, %dl
je 0x1a223
movl 0x10(%rsp), %edx
addl 0x24(%rsp), %edx
addl %edx, %r14d
movaps 0x50(%rsp), %xmm0
movq 0x38(%rsp), %rax
movups %xmm0, (%rax)
movl %edx, 0x10(%rax)
movl %r14d, 0x14(%rax)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x18(%rax)
movl %ebp, 0x28(%rax)
movl %ebx, 0x2c(%rax)
movl 0x28(%rsp), %edx
movl %edx, 0x30(%rax)
movl %ecx, 0x34(%rax)
movl %r12d, 0x38(%rax)
movl 0x2c(%rsp), %ecx
movl %ecx, 0x3c(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x40(%rax)
movq %r15, 0x48(%rax)
movq 0x30(%rsp), %rcx
movq %rcx, 0x50(%rax)
movl $0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq