// File: /workspace/github_cpp_makefile_star2_O1/AutomataLab[P]JSONSki/src/QueryProcessor.cpp
// Function: QueryProcessor::goOverPriAttr(long&, bitmap&)
__attribute__((always_inline)) void QueryProcessor::goOverPriAttr(long& pos, bitmap& bm) {
    long word_id = pos / 64;
    bool first_interval = false;
    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_comma(bm);
        IntervalInfo interval;
        if (first_interval == false) {
            if (new_word == true) {
                interval = get_interval_new_word(bm.commabit);
            } else {
                interval = get_interval(pos, bm.commabit);
            }
            first_interval = true;
        } else {
            interval = next_interval(bm.commabit);
        }
        get_bitmap_rbrace(bm);
        unsigned long bitmap_rbrace = bm.rbracebit & interval.intervalbit;
        if (bitmap_rbrace) {
            // end of object
            pos = get_position(bitmap_rbrace, 1) - 1;
            return;
        }
        if (interval.is_complete) {
            // position before comma
            pos = interval_end(interval.intervalbit) - 1;
            return;
        } 
        // interval is incomplete in the current word
        ++word_id;
        first_interval = false;
        new_word = true;
    }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rcx
leaq 0x3f(%rcx), %r8
testq %rcx, %rcx
cmovnsq %rcx, %r8
sarq $0x6, %r8
leaq 0x30(%rdx), %r9
movq 0x2c8(%rdi), %r10
xorl %r11d, %r11d
vpcmpeqd %xmm0, %xmm0, %xmm0
xorl %ecx, %ecx
cmpq 0x2e0(%rdi), %r8
jge 0x17e21
cmpq 0x270(%rdi), %r8
jle 0x17c7b
leaq (%r8,%r8), %rbx
movw $0x0, 0x4(%r9)
movl $0x0, (%r9)
movq %rbx, 0x88(%rdi)
movq %r8, 0x270(%rdi)
movq %r8, %rbx
shlq $0x6, %rbx
vmovdqu (%r10,%rbx), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r15d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
leaq 0x1(,%r8,2), %rbx
movq %rbx, 0x88(%rdi)
shlq $0x5, %rbx
vmovdqu (%r10,%rbx), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %ebx
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r14d
shlq $0x20, %rbx
orq %r15, %rbx
shlq $0x20, %r14
orq %r12, %r14
leaq (%r14,%r14), %r12
notq %r12
andq %r14, %r12
movq 0x250(%rdi), %r13
movq 0x240(%rdi), %rbp
movq %rbp, %r15
xorq %r13, %r15
movq %r12, %rax
andq %r15, %rax
notq %r15
andq %r12, %r15
addq %r14, %rax
xorl %r12d, %r12d
addq %r14, %r15
setb %r12b
movq %r12, 0x240(%rdi)
andq 0x258(%rdi), %rax
orq %rbp, %r15
andq %r13, %r15
orq %rax, %r15
notq %r15
orq %r14, %r15
andq %rbx, %r15
movq %r15, 0xe0(%rdi)
vmovq %r15, %xmm1
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %rax
xorq 0x248(%rdi), %rax
movq %rax, (%rdi)
sarq $0x3f, %rax
movq %rax, 0x248(%rdi)
cmpb $0x0, 0x31(%rdx)
jne 0x17cbd
vmovdqa 0x1e0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %ebx
shlq $0x20, %rbx
orq %rax, %rbx
movq %rbx, 0x8(%rdx)
movq (%rdi), %rax
notq %rax
andq %rbx, %rax
movq %rax, 0x8(%rdx)
movb $0x1, 0x31(%rdx)
testb $0x1, %cl
jne 0x17ce4
testb $0x1, %r11b
je 0x17d15
movq 0x8(%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %bl
andq %rax, %rcx
leaq -0x1(%rcx), %r14
orq %rcx, %r14
jmp 0x17d84
movq 0x8(%rdx), %rax
movq %rax, %r15
negq %r15
andq %rax, %r15
leaq -0x1(%rax), %r14
andq %rax, %r14
movq %r14, 0x8(%rdx)
setne %bl
je 0x17d5f
movq %r14, %rax
negq %rax
andq %r14, %rax
movq %rax, %r14
subq %r15, %r14
orq %rax, %r14
jmp 0x17d86
movq (%rsi), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
andl $0xc0, %eax
subl %eax, %ecx
movl $0x1, %r12d
shlq %cl, %r12
movq %r12, %r14
negq %r14
movq %r14, %r15
btcq %rcx, %r15
movq 0x8(%rdx), %rcx
andq %r15, %rcx
movq %rcx, 0x8(%rdx)
setne %bl
je 0x17d74
movq %rcx, %rax
negq %rax
andq %rcx, %rax
movq %rax, %r14
subq %r12, %r14
jmp 0x17d7e
negq %r15
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r15
movq %r15, %r14
jmp 0x17d86
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r14
andq %r15, %r14
movb $0x1, %cl
cmpb $0x0, 0x33(%rdx)
jne 0x17dc8
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r15d
shlq $0x20, %r15
orq %rax, %r15
movq %r15, 0x18(%rdx)
movq (%rdi), %rax
notq %rax
andq %r15, %rax
movq %rax, 0x18(%rdx)
movb $0x1, 0x33(%rdx)
movq 0x18(%rdx), %r15
andq %r14, %r15
je 0x17de8
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %r15, %rbx
addq %rbx, %rax
decq %rax
jmp 0x17e06
testb %bl, %bl
je 0x17e15
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsrq %r14, %rbx
xorq $0x3f, %rbx
subq %rbx, %rax
addq $0x3e, %rax
movq %rax, (%rsi)
xorl %ebx, %ebx
testb %bl, %bl
jne 0x17b4a
jmp 0x17e21
incq %r8
movb $0x1, %r11b
xorl %ecx, %ecx
movb $0x1, %bl
jmp 0x17e0b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
nop