// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/region.c
// Function: kh_resize_reg
static int compare_hts_pair_pos_t (const void *av, const void *bv)
{
    hts_pair_pos_t *a = (hts_pair_pos_t *) av;
    hts_pair_pos_t *b = (hts_pair_pos_t *) bv;
    if (a->beg < b->beg) return -1;
    if (a->beg > b->beg) return  1;
    if (a->end < b->end) return -1;
    if (a->end > b->end) return  1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
xorl %ebx, %ebx
movl $0x0, %eax
testl %esi, %esi
je 0x21e1e
leal -0x1(%rsi), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x10, %ecx
orl %eax, %ecx
negl %esi
shrl $0x1f, %esi
addl %ecx, %esi
movl %esi, %eax
cmpl $0x5, %eax
movl $0x4, %ecx
movl $0x4, %r13d
cmovael %eax, %r13d
cvtsi2sd %r13, %xmm0
mulsd 0x711db(%rip), %xmm0    # 0x93018
addsd 0x711db(%rip), %xmm0    # 0x93020
cvttsd2si %xmm0, %rbp
cmpl %ebp, 0x4(%r14)
jae 0x2209e
movl %r13d, %r12d
shrl $0x2, %r12d
andl $-0x4, %r12d
cmpl $0x10, %eax
cmovbl %ecx, %r12d
movq %r12, %rdi
callq 0x4680
testq %rax, %rax
je 0x22099
movq %rax, %r15
movq %rax, %rdi
movl $0xaa, %esi
movq %r12, %rdx
callq 0x4260
movl (%r14), %edi
cmpl %r13d, %edi
jae 0x21edc
movq 0x18(%r14), %rdi
movl %r13d, %r12d
leaq (,%r12,4), %rsi
callq 0x4840
testq %rax, %rax
je 0x22091
movq %rax, 0x18(%r14)
movq 0x20(%r14), %rdi
shlq $0x3, %r12
leaq (%r12,%r12,2), %rsi
callq 0x4840
testq %rax, %rax
je 0x22091
movq %rax, 0x20(%r14)
movl (%r14), %edi
testl %edi, %edi
je 0x22073
leal -0x1(%r13), %eax
xorl %edx, %edx
movq 0x10(%r14), %rsi
movl %edx, %r8d
shrl $0x4, %r8d
movl (%rsi,%r8,4), %r9d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %r9d, %r10d
shrl %cl, %r10d
testb $0x3, %r10b
jne 0x22037
movq 0x18(%r14), %rdi
movl %edx, %r10d
movl (%rdi,%r10,4), %edi
movq 0x20(%r14), %r11
leaq (%r10,%r10,2), %r10
movq 0x10(%r11,%r10,8), %r12
movq %r12, 0x10(%rsp)
movupd (%r11,%r10,8), %xmm0
movapd %xmm0, (%rsp)
btsl %ecx, %r9d
movl %r9d, (%rsi,%r8,4)
movl %edi, %r9d
andl %eax, %r9d
movl %r9d, %r8d
shrl $0x4, %r8d
movl (%r15,%r8,4), %r10d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r11d
shll %cl, %r11d
testl %r10d, %r11d
jne 0x21f8c
movl $0x1, %r12d
addl %r12d, %r9d
andl %eax, %r9d
movl %r9d, %r8d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r11d
shll %cl, %r11d
shrl $0x4, %r8d
movl (%r15,%r8,4), %r10d
incl %r12d
testl %r10d, %r11d
je 0x21f63
notl %r11d
andl %r10d, %r11d
movl %r11d, (%r15,%r8,4)
movl %r9d, %r10d
cmpl (%r14), %r9d
jae 0x22010
movl (%rsi,%r8,4), %r9d
shrl %cl, %r9d
movq 0x18(%r14), %rsi
testb $0x3, %r9b
jne 0x22014
movl (%rsi,%r10,4), %r9d
movl %edi, (%rsi,%r10,4)
movq 0x20(%r14), %rsi
leaq (%r10,%r10,2), %rdi
movq 0x10(%rsi,%rdi,8), %r10
movq %r10, 0x30(%rsp)
movups (%rsi,%rdi,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%rsp), %r10
movq %r10, 0x10(%rsi,%rdi,8)
movaps (%rsp), %xmm0
movups %xmm0, (%rsi,%rdi,8)
movq 0x30(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movapd 0x20(%rsp), %xmm0
movapd %xmm0, (%rsp)
movl $0x1, %edi
shll %cl, %edi
movq 0x10(%r14), %rsi
orl %edi, (%rsi,%r8,4)
movl %r9d, %edi
jmp 0x21f37
movq 0x18(%r14), %rsi
movl %edi, (%rsi,%r10,4)
movq 0x20(%r14), %rcx
leaq (%r10,%r10,2), %rsi
movq 0x10(%rsp), %rdi
movq %rdi, 0x10(%rcx,%rsi,8)
movapd (%rsp), %xmm0
movupd %xmm0, (%rcx,%rsi,8)
movl (%r14), %edi
incl %edx
cmpl %edi, %edx
jne 0x21ee2
cmpl %r13d, %edi
jbe 0x22073
movq 0x18(%r14), %rdi
movl %r13d, %r12d
leaq (,%r12,4), %rsi
callq 0x4840
movq %rax, 0x18(%r14)
movq 0x20(%r14), %rdi
shlq $0x3, %r12
leaq (%r12,%r12,2), %rsi
callq 0x4840
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rdi
callq 0x45c0
movq %r15, 0x10(%r14)
movl %r13d, (%r14)
movl 0x4(%r14), %eax
movl %eax, 0x8(%r14)
movl %ebp, 0xc(%r14)
jmp 0x2209e
movq %r15, %rdi
callq 0x45c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq