// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/lib/psl.c
// Function: chkRanges
static void chkRanges(char* pslDesc, FILE* out, struct psl* psl,
                      char* pName, char* pLabel, char pCLabel, char pStrand,
                      unsigned pSize, unsigned pStart, unsigned pEnd,
                      unsigned* pBlockStarts, int blockSizeMult, int* errCount)
/* check the target or query ranges in a PSL, increment errorCnt */
{
unsigned iBlk;
if (pStart >= pEnd)
    chkError(pslDesc, out, psl, errCount,
             "\t%s %cStart %u >= %cEnd %u\n",
             pName, pCLabel, pStart, pCLabel, pEnd);
if (pEnd > pSize)
    chkError(pslDesc, out, psl, errCount,
             "\t%s %cEnd %u >= %cSize %u\n",
             pName, pCLabel, pEnd, pCLabel, pSize);
// check that block start/end matches overall start end
unsigned pStartStrand = pStart, pEndStrand = pEnd;
if (pStrand != '+')
    reverseUnsignedRange(&pStartStrand, &pEndStrand, pSize);
unsigned lastBlkEnd = pBlockStarts[psl->blockCount-1] + (blockSizeMult * psl->blockSizes[psl->blockCount-1]);
if ((pStartStrand != pBlockStarts[0]) || (pEndStrand != lastBlkEnd))
    chkError(pslDesc, out, psl, errCount,
             "\t%s strand \"%c\" adjusted %cStart-%cEnd range %u-%u != block range %u-%u\n",
             pName, pStrand, pCLabel, pCLabel, pStartStrand, pEndStrand, pBlockStarts[0], lastBlkEnd);

for (iBlk = 0; iBlk < psl->blockCount; iBlk++)
    chkBlkRanges(pslDesc, out, psl, pName, pLabel, pCLabel, pStrand,
                 pSize, pStart, pEnd, iBlk, pBlockStarts, errCount);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, (%rsp)
movq %rdi, %r13
movl 0x78(%rsp), %r14d
movl 0x70(%rsp), %eax
movzbl %r9b, %ecx
movq %rcx, 0x10(%rsp)
cmpl %r14d, %eax
jb 0x335f3
leaq 0x4fe1c(%rip), %r8      # 0x833d8
movq %r13, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq 0x90(%rsp), %rcx
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %r14
movq 0x18(%rsp), %r11
pushq %r11
movl 0x80(%rsp), %r10d
pushq %r10
pushq %r11
callq 0x3349c
addq $0x20, %rsp
movl 0x68(%rsp), %eax
cmpl %eax, %r14d
jbe 0x33637
leaq 0x4fdf1(%rip), %r8      # 0x833f4
movq %r13, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq 0x90(%rsp), %rcx
movq 0x8(%rsp), %r9
xorl %eax, %eax
movl 0x68(%rsp), %r10d
pushq %r10
movq 0x18(%rsp), %r10
pushq %r10
pushq %r14
pushq %r10
callq 0x3349c
addq $0x20, %rsp
movl 0x88(%rsp), %ebx
movl 0x70(%rsp), %r10d
movl %r10d, 0x24(%rsp)
movl %r14d, 0x20(%rsp)
movl %r14d, %r11d
cmpb $0x2b, 0x60(%rsp)
je 0x33677
leaq 0x24(%rsp), %r14
leaq 0x20(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl 0x68(%rsp), %edx
callq 0x20d6c
movl (%r14), %r10d
movl (%r12), %r11d
movl 0x5c(%r15), %eax
decl %eax
movq 0x60(%r15), %rcx
imull (%rcx,%rax,4), %ebx
movq 0x80(%rsp), %rcx
addl (%rcx,%rax,4), %ebx
movl (%rcx), %r12d
cmpl %r12d, %r10d
jne 0x3369d
cmpl %ebx, %r11d
je 0x336e3
movsbl 0x60(%rsp), %r14d
subq $0x8, %rsp
leaq 0x4fd61(%rip), %r8      # 0x8340f
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %rbx
pushq %r12
pushq %r11
pushq %r10
movq 0x38(%rsp), %r10
pushq %r10
pushq %r10
pushq %r14
callq 0x3349c
addq $0x40, %rsp
xorl %ebp, %ebp
movl 0x5c(%r15), %eax
cmpq %rax, %rbp
jae 0x338ec
movq 0x80(%rsp), %rax
movl (%rax,%rbp,4), %ebx
movq 0x60(%r15), %rax
movl (%rax,%rbp,4), %r10d
addl %ebx, %r10d
movl 0x68(%rsp), %ecx
movl %ecx, %r12d
subl %r10d, %r12d
setb %al
movl %ecx, %r14d
subl %ebx, %r14d
cmpb $0x2b, 0x60(%rsp)
cmovel %ebx, %r12d
cmovel %r10d, %r14d
testl %ecx, %ecx
je 0x33770
testb %al, %al
je 0x33770
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x4fd0a(%rip), %r8      # 0x83458
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x70(%rsp), %r11d
pushq %r11
pushq 0x20(%rsp)
pushq %r10
pushq %rbp
pushq 0x40(%rsp)
callq 0x3349c
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r12d
jae 0x337b9
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x4fce5(%rip), %r8      # 0x8347c
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x3349c
addq $0x30, %rsp
movl 0x78(%rsp), %eax
cmpl %eax, %r12d
jb 0x33805
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x4fcc3(%rip), %r8      # 0x834a3
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x80(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x3349c
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r14d
jae 0x3384e
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x4fc9d(%rip), %r8      # 0x834c9
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x3349c
addq $0x30, %rsp
movl 0x78(%rsp), %r10d
cmpl %r10d, %r14d
jbe 0x33893
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x4fc78(%rip), %r8      # 0x834ee
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x3349c
addq $0x30, %rsp
testq %rbp, %rbp
je 0x338e4
movq 0x60(%r15), %rax
movl -0x4(%rax,%rbp,4), %r10d
movq 0x80(%rsp), %rax
addl -0x4(%rax,%rbp,4), %r10d
cmpl %r10d, %ebx
jae 0x338e4
movq %r13, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq 0x90(%rsp), %rcx
leaq 0x4fc45(%rip), %r8      # 0x83511
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %rbp
pushq 0x30(%rsp)
callq 0x3349c
addq $0x20, %rsp
incq %rbp
jmp 0x336e5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq