// File: /workspace/github_c_makefile_star2_O3/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 0x39275
leaq 0x5b29a(%rip), %r8      # 0x944d8
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 0x3911e
addq $0x20, %rsp
movl 0x68(%rsp), %eax
cmpl %eax, %r14d
jbe 0x392b9
leaq 0x5b26f(%rip), %r8      # 0x944f4
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 0x3911e
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 0x392f9
leaq 0x24(%rsp), %r14
leaq 0x20(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movl 0x68(%rsp), %edx
callq 0x2547d
movl (%r14), %r10d
movl (%r12), %r11d
movl 0x5c(%r15), %eax
leal -0x1(%rax), %ecx
movq 0x60(%r15), %rdx
imull (%rdx,%rcx,4), %ebx
movq 0x80(%rsp), %rdx
addl (%rdx,%rcx,4), %ebx
movl (%rdx), %r12d
cmpl %r12d, %r10d
jne 0x39320
cmpl %ebx, %r11d
je 0x3936a
movsbl 0x60(%rsp), %r14d
subq $0x8, %rsp
leaq 0x5b1de(%rip), %r8      # 0x9450f
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 0x3911e
addq $0x40, %rsp
movl 0x5c(%r15), %eax
testl %eax, %eax
je 0x39576
xorl %ebp, %ebp
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 0x393f2
testb %al, %al
je 0x393f2
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b188(%rip), %r8      # 0x94558
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x70(%rsp), %r11d
pushq %r11
pushq 0x20(%rsp)
pushq %r10
pushq %rbp
pushq 0x40(%rsp)
callq 0x3911e
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r12d
jae 0x3943b
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b163(%rip), %r8      # 0x9457c
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x3911e
addq $0x30, %rsp
movl 0x78(%rsp), %eax
cmpl %eax, %r12d
jb 0x39487
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b141(%rip), %r8      # 0x945a3
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x80(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x3911e
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r14d
jae 0x394d0
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b11b(%rip), %r8      # 0x945c9
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x3911e
addq $0x30, %rsp
movl 0x78(%rsp), %r10d
cmpl %r10d, %r14d
jbe 0x39515
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b0f6(%rip), %r8      # 0x945ee
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x3911e
addq $0x30, %rsp
testq %rbp, %rbp
je 0x39566
movq 0x60(%r15), %rax
movl -0x4(%rax,%rbp,4), %r10d
movq 0x80(%rsp), %rax
addl -0x4(%rax,%rbp,4), %r10d
cmpl %r10d, %ebx
jae 0x39566
movq %r13, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq 0x90(%rsp), %rcx
leaq 0x5b0c3(%rip), %r8      # 0x94611
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %rbp
pushq 0x30(%rsp)
callq 0x3911e
addq $0x20, %rsp
incq %rbp
movl 0x5c(%r15), %eax
cmpq %rax, %rbp
jb 0x39374
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq