// File: /workspace/github_cpp_makefile_star2_O3/AutomataLab[P]JSONSki/src/QueryProcessor.cpp
// Function: QueryProcessor::goOverPriElems(long&, bitmap&)
__attribute__((always_inline)) int QueryProcessor::goOverPriElems(long& pos, bitmap& bm) {
    long word_id = pos / 64;
    bool new_word = false;
    while (word_id < mNumWords) {
        if (word_id > top_word) {
            // build basic bitmaps for the next word
            resetBitmap(bm);
            start_id = word_id * 2;
            build_bitmap_basic();
        }
        get_bitmap_lbrace(bm);
        get_bitmap_lbracket(bm);
        unsigned long bitmap_bracket = bm.lbracebit | bm.lbracketbit;
        IntervalInfo interval;
        if (new_word == true) {
            interval = get_interval_new_word(bitmap_bracket);
        } else {
            interval = get_interval(pos, bitmap_bracket);
        }
        get_bitmap_rbracket(bm);
        unsigned long bitmap_rbracket = bm.rbracketbit & interval.intervalbit;
        if (bitmap_rbracket) {
            pos = get_position(bitmap_rbracket, 1);
            return ARRAY_END;
        }
        if (interval.is_complete) {
            pos = interval_end(interval.intervalbit);
            return SUCCESS;
        }
        ++word_id;
        new_word = true;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rax
leaq 0x3f(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
movq %rcx, %rax
sarq $0x6, %rax
leaq 0x30(%rdx), %r8
movq 0x2c8(%rdi), %r10
movq 0x250(%rdi), %r9
movq 0x258(%rdi), %r11
movq %r11, -0x8(%rsp)
movq 0x270(%rdi), %r14
andq $-0x40, %rcx
leaq (%rcx,%r10), %r11
addq $0x20, %r11
leaq (%rax,%rax), %rbx
xorl %ecx, %ecx
vpcmpeqd %xmm0, %xmm0, %xmm0
cmpq %r14, %rax
jle 0x18318
movw $0x0, 0x4(%r8)
movl $0x0, (%r8)
movq %rbx, 0x88(%rdi)
movq %rax, 0x270(%rdi)
vmovdqu -0x20(%r11), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r10d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
leaq 0x1(%rbx), %r14
movq %r14, 0x88(%rdi)
vmovdqu (%r11), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %r14d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r15d
shlq $0x20, %r14
orq %r10, %r14
shlq $0x20, %r15
orq %r12, %r15
leaq (%r15,%r15), %r10
notq %r10
andq %r15, %r10
movq 0x240(%rdi), %r13
movq %r13, %r12
xorq %r9, %r12
movq %r10, %rbp
andq %r12, %rbp
notq %r12
andq %r10, %r12
addq %r15, %rbp
xorl %r10d, %r10d
addq %r15, %r12
setb %r10b
orq %r13, %r12
movq %r10, 0x240(%rdi)
andq -0x8(%rsp), %rbp
andq %r9, %r12
orq %rbp, %r12
notq %r12
orq %r15, %r12
andq %r14, %r12
movq %r12, 0xe0(%rdi)
vmovq %r12, %xmm1
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %r10
xorq 0x248(%rdi), %r10
movq %r10, (%rdi)
sarq $0x3f, %r10
movq %r10, 0x248(%rdi)
movq %rax, %r14
cmpb $0x0, 0x32(%rdx)
jne 0x18356
vmovdqa 0x1a0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %r10d
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r15d
shlq $0x20, %r15
orq %r10, %r15
movq (%rdi), %r10
notq %r10
andq %r15, %r10
movq %r10, 0x10(%rdx)
movb $0x1, 0x32(%rdx)
cmpb $0x0, 0x34(%rdx)
je 0x18362
movq 0x20(%rdx), %r12
jmp 0x1839a
vmovdqa 0x200(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %r10d
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r15d
shlq $0x20, %r15
orq %r10, %r15
movq (%rdi), %r12
notq %r12
andq %r15, %r12
movq %r12, 0x20(%rdx)
movb $0x1, 0x34(%rdx)
orq 0x10(%rdx), %r12
testb $0x1, %cl
je 0x183b9
movq %r12, %rcx
negq %rcx
setb %bpl
andq %r12, %rcx
leaq -0x1(%rcx), %r15
orq %rcx, %r15
jmp 0x1840c
movq (%rsi), %rcx
leal 0x3f(%rcx), %r10d
testq %rcx, %rcx
cmovnsl %ecx, %r10d
andl $0xc0, %r10d
subl %r10d, %ecx
movl $0x1, %r10d
shlq %cl, %r10
movq %r10, %r15
negq %r15
movq %r15, %r13
btcq %rcx, %r13
andq %r13, %r12
setne %bpl
je 0x18404
movq %r12, %rcx
negq %rcx
andq %r12, %rcx
movq %rcx, %r15
subq %r10, %r15
orq %rcx, %r15
jmp 0x18409
btsq $0x3f, %r15
andq %r13, %r15
cmpb $0x0, 0x35(%rdx)
je 0x18418
movq 0x28(%rdx), %rcx
jmp 0x18450
vmovdqa 0x220(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %r10
orq %rcx, %r10
movq (%rdi), %rcx
notq %rcx
andq %r10, %rcx
movq %rcx, 0x28(%rdx)
movb $0x1, 0x35(%rdx)
andq %r15, %rcx
jne 0x18485
incq %rax
addq $0x40, %r11
addq $0x2, %rbx
movb $0x1, %cl
testb %bpl, %bpl
je 0x18212
shlq $0x6, %r14
bsrq %r15, %rcx
xorq $0x3f, %rcx
orq %r14, %rcx
xorq $0x3f, %rcx
movl $0x3e9, %eax            # imm = 0x3E9
jmp 0x18495
shlq $0x6, %r14
bsfq %rcx, %rcx
orq %r14, %rcx
movl $0x3ea, %eax            # imm = 0x3EA
movq %rcx, (%rsi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq