// File: /workspace/github_c_makefile_star2_O1/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 0x38f48
leaq 0x5b4f4(%rip), %r8      # 0x94405
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 0x38df1
addq $0x20, %rsp
movl 0x68(%rsp), %eax
cmpl %eax, %r14d
jbe 0x38f8c
leaq 0x5b4c9(%rip), %r8      # 0x94421
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 0x38df1
addq $0x20, %rsp
movl 0x88(%rsp), %ebx
movl 0x70(%rsp), %eax
movl %eax, 0x24(%rsp)
movl %r14d, 0x20(%rsp)
cmpb $0x2b, 0x60(%rsp)
je 0x38fba
leaq 0x24(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl 0x68(%rsp), %edx
callq 0x25150
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 0x24(%rsp), %r10d
movl (%rcx), %r12d
movl 0x20(%rsp), %r14d
cmpl %r12d, %r10d
jne 0x38fea
cmpl %ebx, %r14d
je 0x39030
movsbl 0x60(%rsp), %r11d
subq $0x8, %rsp
leaq 0x5b441(%rip), %r8      # 0x9443c
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 %r14
pushq %r10
movq 0x38(%rsp), %r10
pushq %r10
pushq %r10
pushq %r11
callq 0x38df1
addq $0x40, %rsp
cmpl $0x0, 0x5c(%r15)
je 0x3923f
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 0x390bb
testb %al, %al
je 0x390bb
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b3ec(%rip), %r8      # 0x94485
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x70(%rsp), %r11d
pushq %r11
pushq 0x20(%rsp)
pushq %r10
pushq %rbp
pushq 0x40(%rsp)
callq 0x38df1
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r12d
jae 0x39104
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b3c7(%rip), %r8      # 0x944a9
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x38df1
addq $0x30, %rsp
movl 0x78(%rsp), %eax
cmpl %eax, %r12d
jb 0x39150
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b3a5(%rip), %r8      # 0x944d0
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x80(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r12
pushq %rbp
pushq 0x40(%rsp)
callq 0x38df1
addq $0x30, %rsp
movl 0x70(%rsp), %eax
cmpl %eax, %r14d
jae 0x39199
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b37f(%rip), %r8      # 0x944f6
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl 0x78(%rsp), %r10d
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x38df1
addq $0x30, %rsp
movl 0x78(%rsp), %r10d
cmpl %r10d, %r14d
jbe 0x391de
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq 0x98(%rsp), %rcx
leaq 0x5b35a(%rip), %r8      # 0x9451b
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq 0x20(%rsp)
pushq %r14
pushq %rbp
pushq 0x40(%rsp)
callq 0x38df1
addq $0x30, %rsp
testq %rbp, %rbp
je 0x3922f
movq 0x60(%r15), %rax
movl -0x4(%rax,%rbp,4), %r10d
movq 0x80(%rsp), %rax
addl -0x4(%rax,%rbp,4), %r10d
cmpl %r10d, %ebx
jae 0x3922f
movq %r13, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movq 0x90(%rsp), %rcx
leaq 0x5b327(%rip), %r8      # 0x9453e
movq 0x8(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq %rbx
pushq %rbp
pushq 0x30(%rsp)
callq 0x38df1
addq $0x20, %rsp
incq %rbp
movl 0x5c(%r15), %eax
cmpq %rax, %rbp
jb 0x3903d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq