// File: /workspace/github_c_makefile_star2_O3/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 0x1a48f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r12
movq %rdi, %r15
movl 0x28(%rdi), %edi
movl 0x2c(%r15), %esi
cmpl %edx, %edi
movl %edx, %r14d
cmovgl %edi, %r14d
cmpl %ecx, %esi
movl %ecx, %ebx
cmovll %esi, %ebx
testl %r9d, %r9d
je 0x1a2a2
cmpl %r14d, %ebx
jge 0x1a2ab
jmp 0x1a481
cmpl %r14d, %ebx
jle 0x1a481
cmpl %edx, %edi
setge %al
cmpl %ecx, %esi
setle %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1a2e7
movl 0x38(%r15), %esi
movq 0x40(%r15), %rdx
movq 0x48(%r15), %rcx
movq %r8, %rdi
callq 0x1a010
movl %eax, 0x34(%r15)
movl $0xb, %ecx
movq %r12, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
jmp 0x1a463
movq %r8, 0x38(%rsp)
movq %r12, 0x30(%rsp)
movups (%r15), %xmm0
movaps %xmm0, 0x50(%rsp)
movl 0x10(%r15), %eax
movl %eax, 0x1c(%rsp)
movups 0x18(%r15), %xmm0
movaps %xmm0, 0x40(%rsp)
movslq 0x38(%r15), %rbp
movl 0x30(%r15), %eax
movl %eax, 0x20(%rsp)
movl 0x3c(%r15), %eax
movl %eax, 0x24(%rsp)
movq 0x40(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%r15), %r13
movq 0x50(%r15), %rax
movq %rax, 0x28(%rsp)
movl %r14d, %esi
subl %edi, %esi
movq %r13, %rdi
movl $0x1, %edx
movl %r9d, 0xc(%rsp)
callq 0x25672
movq %rax, %r15
movl %ebx, %esi
subl %r14d, %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x25672
movq %rax, %r12
cmpl $0x0, 0xc(%rsp)
je 0x1a3bb
movq %r15, %rax
cmpq %r13, %r15
jbe 0x1a37b
leaq -0x1(%rax), %r15
cmpb $0x2d, -0x1(%rax)
je 0x1a369
addq %r13, %rbp
movq %r12, %rcx
cmpq %rbp, %r12
jae 0x1a390
leaq 0x1(%rcx), %r12
cmpb $0x2d, 0x1(%rcx)
je 0x1a37e
cmpl %r14d, %ebx
jne 0x1a3b5
cmpq %rax, %rcx
jbe 0x1a3b5
xorl %r15d, %r15d
cmpb $0x2d, (%rax)
setne %r15b
addq %rax, %r15
leaq -0x1(%rcx), %r12
cmpb $0x2d, -0x1(%rcx)
cmoveq %rcx, %r12
jmp 0x1a3bb
movq %rax, %r15
movq %rcx, %r12
subl %r15d, %r12d
movq %r15, %rsi
subq %r13, %rsi
movq 0x10(%rsp), %rdi
leaq (%rdi,%rsi), %rbp
callq 0x256a6
movl %eax, 0x10(%rsp)
movq %rbp, %rdi
movl %r12d, %esi
callq 0x256a6
movl %eax, %r13d
movq 0x38(%rsp), %rdi
movl %r12d, %esi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x1a010
testl %r13d, %r13d
jle 0x1a46a
cmpl %r14d, %ebx
setg %cl
cmpl $0x0, 0xc(%rsp)
setne %dl
orb %cl, %dl
je 0x1a47f
movl 0x10(%rsp), %edx
addl 0x1c(%rsp), %edx
addl %edx, %r13d
movaps 0x50(%rsp), %xmm0
movq 0x30(%rsp), %rcx
movups %xmm0, (%rcx)
movl %edx, 0x10(%rcx)
movl %r13d, 0x14(%rcx)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x18(%rcx)
movl %r14d, 0x28(%rcx)
movl %ebx, 0x2c(%rcx)
movl 0x20(%rsp), %edx
movl %edx, 0x30(%rcx)
movl %eax, 0x34(%rcx)
movl %r12d, 0x38(%rcx)
movl 0x24(%rsp), %eax
movl %eax, 0x3c(%rcx)
movq %rbp, 0x40(%rcx)
movq %r15, 0x48(%rcx)
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rcx)
movl $0x1, %eax
jmp 0x1a481
cmpl %r14d, %ebx
setg %cl
cmpl $0x0, 0xc(%rsp)
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x1a40e
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq