// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/psl.c
// Function: trimAlignment
static void trimAlignment(struct psl* psl, char** qStrPtr, char** tStrPtr,
                          int* aliSizePtr)
/* remove leading or trailing indels from alignment */
{
char* qStr = *qStrPtr;
char* tStr = *tStrPtr;
int aliSize = *aliSizePtr;

// skip lending indels
while ((aliSize > 0) && (isDelChar(*qStr) || isDelChar(*tStr)))
    {
    if (!isDelChar(*qStr))
        psl->qStart++;
    else if (!isDelChar(*tStr))
        psl->tStart++;
    qStr++;
    tStr++;
    aliSize--;
    }

// skip trailing indels
while ((aliSize > 0) && (isDelChar(qStr[aliSize-1]) || isDelChar(tStr[aliSize-1])))
    {
    if (!isDelChar(qStr[aliSize-1]))
        psl->qEnd--;
    else if (!isDelChar(tStr[aliSize-1]))
        psl->tEnd--;
    aliSize--;
    }
*qStrPtr = qStr;
*tStrPtr = tStr;
*aliSizePtr = aliSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x35(%rbp)
jle 0x52045
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
callq 0x521a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x36(%rbp)
jne 0x5203f
movq -0x30(%rbp), %rax
movsbl (%rax), %edi
callq 0x521a0
cmpl $0x0, %eax
setne %al
movb %al, -0x36(%rbp)
movb -0x36(%rbp), %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x5204e
jmp 0x520b4
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
callq 0x521a0
cmpl $0x0, %eax
jne 0x5206e
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x3c(%rax)
jmp 0x5208e
movq -0x30(%rbp), %rax
movsbl (%rax), %edi
callq 0x521a0
cmpl $0x0, %eax
jne 0x5208c
movq -0x8(%rbp), %rax
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
jmp 0x5208e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x52007
jmp 0x520b6
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x37(%rbp)
jle 0x52108
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x521a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x38(%rbp)
jne 0x52102
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x521a0
cmpl $0x0, %eax
setne %al
movb %al, -0x38(%rbp)
movb -0x38(%rbp), %al
movb %al, -0x37(%rbp)
movb -0x37(%rbp), %al
testb $0x1, %al
jne 0x52111
jmp 0x52173
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x521a0
cmpl $0x0, %eax
jne 0x5213b
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0x52165
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x521a0
cmpl $0x0, %eax
jne 0x52163
movq -0x8(%rbp), %rax
movl 0x58(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x58(%rax)
jmp 0x52165
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x520b6
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)