// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/dnautil.c
// Function: trimRefAlt
void trimRefAlt(char *ref, char *alt, uint *pStart, uint *pEnd, int *pRefLen, int *pAltLen)
/* If ref and alt have identical bases at beginning and/or end, trim those & update all params. */
{
int trimStart = 0;
while (ref[trimStart] != '\0' && alt[trimStart] != '\0' && ref[trimStart] == alt[trimStart])
    trimStart++;
int refLen = strlen(ref);
int altLen = strlen(alt);
int iR = refLen - 1, iA = altLen - 1, trimEnd = 0;
while (iR >= trimStart && iA >= trimStart && ref[iR] == alt[iA])
    {
    iR--;
    iA--;
    trimEnd++;
    }
if (trimEnd)
    {
    *pEnd -= trimEnd;
    refLen -= trimEnd;
    altLen -= trimEnd;
    ref[refLen] = '\0';
    alt[altLen] = '\0';
    }
if (trimStart)
    {
    *pStart += trimStart;
    refLen -= trimStart;
    altLen -= trimStart;
    memmove(ref, ref+trimStart, refLen+1);
    memmove(alt, alt+trimStart, altLen+1);
    }
*pRefLen = refLen;
*pAltLen = altLen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
je 0x34793
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
je 0x34793
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x3479c
jmp 0x347a7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x34747
movq -0x8(%rbp), %rdi
callq 0x62c0
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x62c0
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x40(%rbp), %ecx
xorl %eax, %eax
cmpl -0x34(%rbp), %ecx
movb %al, -0x4a(%rbp)
jl 0x34812
movl -0x44(%rbp), %ecx
xorl %eax, %eax
cmpl -0x34(%rbp), %ecx
movb %al, -0x4a(%rbp)
jl 0x34812
movq -0x8(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movslq -0x44(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x3481b
jmp 0x34838
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x347d8
cmpl $0x0, -0x48(%rbp)
je 0x34879
movl -0x48(%rbp), %edx
movq -0x20(%rbp), %rax
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
movl -0x48(%rbp), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x48(%rbp), %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, -0x34(%rbp)
je 0x348da
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %ecx
movl -0x38(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movslq -0x34(%rbp), %rax
addq %rax, %rsi
movl -0x38(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x6c60
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x34(%rbp), %rax
addq %rax, %rsi
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x6c60
movl -0x38(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)