// File: /workspace/github_cpp_makefile_star2_O3/AutomataLab[P]JSONSki/src/QueryProcessor.cpp
// Function: QueryProcessor::goToPrimAttr(long&, bitmap&)
__attribute__((always_inline)) int QueryProcessor::goToPrimAttr(long& pos, bitmap& bm) {
    long word_id = pos / 64;
    bool first_interval = false;
    bool new_word = false;
    while (true) {
        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_colon(bm);
            IntervalInfo interval;
            if (first_interval == false) {
                if (new_word == true) {
                    interval = get_interval_new_word(bm.colonbit);
                    new_word = false;
                } else {
                    interval = get_interval(pos, bm.colonbit);
                }
                first_interval = true;
            } else {
                interval = next_interval(bm.colonbit);
            }
            get_bitmap_rbrace(bm);
            unsigned long bitmap_rbrace = bm.rbracebit & interval.intervalbit;
            if (bitmap_rbrace > 0) {
                // object ends
                pos = get_position(bitmap_rbrace, 1);
                return OBJECT_END;
            }
            if (interval.is_complete) {
                pos = interval_end(interval.intervalbit) + 1;
                int type = getAttributeType(pos);
                if (type == OBJECT) {
                    goOverObj(pos, bm);
                    word_id = pos / 64;  // update word id 
                    first_interval = false;
                }
                else if (type == ARRAY) {
                    goOverAry(pos, bm);
                    word_id = pos / 64; // update word id 
                    first_interval = false;
                }
                else {
                    return SUCCESS;
                }
                break;
            }
            ++word_id;
            first_interval = false;
            new_word = true;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rax
leaq 0x3f(%rax), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
sarq $0x6, %rbx
leaq 0x30(%rdx), %r11
movq 0x2c8(%rdi), %rax
movq %rax, -0x8(%rsp)
addq $0x20, %rax
movq %rax, -0x10(%rsp)
xorl %ecx, %ecx
vpcmpeqd %xmm0, %xmm0, %xmm0
movq %rsi, -0x20(%rsp)
movq %r11, -0x18(%rsp)
movq 0x2e0(%rdi), %rax
cmpq %rax, %rbx
jge 0x1a462
movq 0x2c8(%rdi), %rax
leaq (%rbx,%rbx), %r14
movq %rbx, %r9
shlq $0x6, %r9
leaq (%rax,%r9), %r15
addq $0x20, %r15
cmpq 0x270(%rdi), %rbx
jle 0x1a596
movw $0x0, 0x4(%r11)
movl $0x0, (%r11)
movq %r14, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
vmovdqu -0x20(%r15), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r9d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r11d
leaq 0x1(%r14), %rax
movq %rax, 0x88(%rdi)
vmovdqu (%r15), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %rax
orq %r9, %rax
shlq $0x20, %r10
orq %r11, %r10
leaq (%r10,%r10), %r9
notq %r9
andq %r10, %r9
movq 0x250(%rdi), %r12
movq 0x240(%rdi), %r13
movq %r13, %r11
xorq %r12, %r11
movq %r9, %rbp
andq %r11, %rbp
notq %r11
andq %r9, %r11
addq %r10, %rbp
xorl %r9d, %r9d
addq %r10, %r11
setb %r9b
movq %r9, 0x240(%rdi)
andq 0x258(%rdi), %rbp
orq %r13, %r11
andq %r12, %r11
orq %rbp, %r11
notq %r11
orq %r10, %r11
andq %rax, %r11
movq %r11, 0xe0(%rdi)
vmovq %r11, %xmm1
movq -0x18(%rsp), %r11
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %rax
xorq 0x248(%rdi), %rax
movq %rax, (%rdi)
sarq $0x3f, %rax
movq %rax, 0x248(%rdi)
cmpb $0x0, (%r11)
jne 0x1a5d3
vmovdqa 0x160(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r9d
shlq $0x20, %r9
orq %rax, %r9
movq (%rdi), %rax
notq %rax
andq %r9, %rax
movq %rax, (%rdx)
movb $0x1, 0x30(%rdx)
testb $0x1, %cl
je 0x1a5f1
movq (%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %bpl
andq %rax, %rcx
leaq -0x1(%rcx), %rax
orq %rcx, %rax
jmp 0x1a64d
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, %rax
negq %rax
movq %rax, %r10
btcq %rcx, %r10
movq (%rdx), %rcx
andq %r10, %rcx
movq %rcx, (%rdx)
setne %bpl
je 0x1a63d
movq %rcx, %r9
negq %r9
andq %rcx, %r9
movq %r9, %rax
subq %r12, %rax
orq %r9, %rax
jmp 0x1a64a
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rax
andq %r10, %rax
cmpb $0x0, 0x33(%rdx)
je 0x1a659
movq 0x18(%rdx), %rcx
jmp 0x1a691
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r9d
shlq $0x20, %r9
orq %rcx, %r9
movq (%rdi), %rcx
notq %rcx
andq %r9, %rcx
movq %rcx, 0x18(%rdx)
movb $0x1, 0x33(%rdx)
andq %rax, %rcx
jne 0x1ad6e
testb %bpl, %bpl
jne 0x1a6be
incq %rbx
addq $0x2, %r14
addq $0x40, %r15
movb $0x1, %cl
cmpq 0x2e0(%rdi), %rbx
jl 0x1a481
jmp 0x1ad63
movq 0x270(%rdi), %rcx
shlq $0x6, %rcx
bsrq %rax, %rax
xorq $0x3f, %rax
orq %rcx, %rax
xorq $0x3f, %rax
movq -0x8(%rsp), %r8
movq %rax, %rcx
incq %rax
movq %rax, (%rsi)
movzbl 0x1(%r8,%rcx), %ecx
cmpl $0x20, %ecx
je 0x1a6dd
cmpl $0x5b, %ecx
je 0x1aa22
cmpl $0x7b, %ecx
jne 0x1ad8a
movb %bpl, -0x21(%rsp)
leaq 0x3f(%rax), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
sarq $0x6, %rbx
movl $0x1, %eax
xorl %ebp, %ebp
xorl %ecx, %ecx
movq 0x2e0(%rdi), %r9
cmpq %r9, %rbx
jge 0x1a727
leaq (%rbx,%rbx), %r15
movq %rbx, %r12
shlq $0x6, %r12
addq -0x10(%rsp), %r12
movl %eax, %r14d
cmpq 0x270(%rdi), %rbx
jle 0x1a85b
movw $0x0, 0x4(%r11)
movl $0x0, (%r11)
movq %r15, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
vmovdqu -0x20(%r12), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r9d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r13d
leaq 0x1(%r15), %rax
movq %rax, 0x88(%rdi)
vmovdqu (%r12), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %rax
orq %r9, %rax
shlq $0x20, %r10
orq %r13, %r10
leaq (%r10,%r10), %r9
notq %r9
andq %r10, %r9
movq 0x250(%rdi), %r11
movq 0x240(%rdi), %rsi
movq %rsi, %r13
xorq %r11, %r13
movq %r9, %r8
andq %r13, %r8
notq %r13
andq %r9, %r13
addq %r10, %r8
xorl %r9d, %r9d
addq %r10, %r13
setb %r9b
movq %r9, 0x240(%rdi)
andq 0x258(%rdi), %r8
orq %rsi, %r13
andq %r11, %r13
movq -0x18(%rsp), %r11
orq %r8, %r13
movq -0x20(%rsp), %rsi
notq %r13
orq %r10, %r13
andq %rax, %r13
movq %r13, 0xe0(%rdi)
vmovq %r13, %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, 0x32(%rdx)
jne 0x1a899
vmovdqa 0x1a0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r8d
shlq $0x20, %r8
orq %rax, %r8
movq (%rdi), %rax
notq %rax
andq %r8, %rax
movq %rax, 0x10(%rdx)
movb $0x1, 0x32(%rdx)
testb $0x1, %cl
jne 0x1a8c1
testb $0x1, %bpl
je 0x1a8f2
movq 0x10(%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %r10b
andq %rax, %rcx
leaq -0x1(%rcx), %rax
orq %rcx, %rax
jmp 0x1a968
movq 0x10(%rdx), %r8
movq %r8, %r13
negq %r13
andq %r8, %r13
leaq -0x1(%r8), %rax
andq %r8, %rax
movq %rax, 0x10(%rdx)
je 0x1a940
movq %rax, %r8
negq %r8
andq %rax, %r8
movq %r8, %rax
subq %r13, %rax
orq %r8, %rax
movb $0x1, %r10b
jmp 0x1a96a
movq (%rsi), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
andl $0xc0, %eax
subl %eax, %ecx
movl $0x1, %r9d
shlq %cl, %r9
movq %r9, %rax
negq %rax
movq %rax, %r13
btcq %rcx, %r13
movq 0x10(%rdx), %rcx
andq %r13, %rcx
movq %rcx, 0x10(%rdx)
setne %r10b
je 0x1a958
movq %rcx, %r8
negq %r8
andq %rcx, %r8
movq %r8, %rax
subq %r9, %rax
orq %r8, %rax
jmp 0x1a965
negq %r13
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r13
xorl %r10d, %r10d
movq %r13, %rax
jmp 0x1a96a
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rax
andq %r13, %rax
movb $0x1, %cl
cmpb $0x0, 0x33(%rdx)
je 0x1a976
movq 0x18(%rdx), %r13
jmp 0x1a9b3
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %esi
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r8d
shlq $0x20, %r8
orq %rsi, %r8
movq (%rdi), %r13
notq %r13
andq %r8, %r13
movq -0x20(%rsp), %rsi
movq %r13, 0x18(%rdx)
movb $0x1, 0x33(%rdx)
andq %rax, %r13
popcntq %r13, %r9
movl %r14d, %eax
subl %r9d, %eax
jle 0x1a9fb
testb %r10b, %r10b
jne 0x1a9ed
incq %rbx
addq $0x2, %r15
addq $0x40, %r12
movb $0x1, %bpl
xorl %ecx, %ecx
movl %eax, %r14d
cmpq 0x2e0(%rdi), %rbx
jl 0x1a73f
jmp 0x1a720
subl %r9d, %r14d
incl %r14d
movl %r14d, %eax
jmp 0x1a720
cmpl $0x2, %r14d
jl 0x1ad39
incl %r14d
movb -0x21(%rsp), %bpl
leaq -0x1(%r13), %rax
andq %rax, %r13
decl %r14d
cmpl $0x2, %r14d
ja 0x1aa0d
jmp 0x1ad3e
movb %bpl, -0x21(%rsp)
leaq 0x3f(%rax), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
sarq $0x6, %rbx
movl $0x1, %eax
xorl %ebp, %ebp
xorl %ecx, %ecx
movq 0x2e0(%rdi), %r9
cmpq %r9, %rbx
jge 0x1aa46
leaq (%rbx,%rbx), %r15
movq %rbx, %r12
shlq $0x6, %r12
addq -0x10(%rsp), %r12
movl %eax, %r14d
cmpq 0x270(%rdi), %rbx
jle 0x1ab79
movw $0x0, 0x4(%r11)
movl $0x0, (%r11)
movq %r15, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
vmovdqu -0x20(%r12), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %esi
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r8d
leaq 0x1(%r15), %rax
movq %rax, 0x88(%rdi)
vmovdqu (%r12), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %rax
orq %rsi, %rax
shlq $0x20, %r10
orq %r8, %r10
leaq (%r10,%r10), %rsi
notq %rsi
andq %r10, %rsi
movq 0x250(%rdi), %r8
movq 0x240(%rdi), %r9
movq %r9, %r13
xorq %r8, %r13
movq %rsi, %r11
andq %r13, %r11
notq %r13
andq %rsi, %r13
addq %r10, %r11
xorl %esi, %esi
addq %r10, %r13
setb %sil
movq %rsi, 0x240(%rdi)
andq 0x258(%rdi), %r11
orq %r9, %r13
andq %r8, %r13
movq -0x20(%rsp), %rsi
orq %r11, %r13
movq -0x18(%rsp), %r11
notq %r13
orq %r10, %r13
andq %rax, %r13
movq %r13, 0xe0(%rdi)
vmovq %r13, %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, 0x34(%rdx)
jne 0x1abb7
vmovdqa 0x200(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r8d
shlq $0x20, %r8
orq %rax, %r8
movq (%rdi), %rax
notq %rax
andq %r8, %rax
movq %rax, 0x20(%rdx)
movb $0x1, 0x34(%rdx)
testb $0x1, %cl
jne 0x1abdf
testb $0x1, %bpl
je 0x1ac10
movq 0x20(%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %r10b
andq %rax, %rcx
leaq -0x1(%rcx), %rax
orq %rcx, %rax
jmp 0x1ac86
movq 0x20(%rdx), %r8
movq %r8, %r13
negq %r13
andq %r8, %r13
leaq -0x1(%r8), %rax
andq %r8, %rax
movq %rax, 0x20(%rdx)
je 0x1ac5e
movq %rax, %r8
negq %r8
andq %rax, %r8
movq %r8, %rax
subq %r13, %rax
orq %r8, %rax
movb $0x1, %r10b
jmp 0x1ac88
movq (%rsi), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
andl $0xc0, %eax
subl %eax, %ecx
movl $0x1, %r9d
shlq %cl, %r9
movq %r9, %rax
negq %rax
movq %rax, %r13
btcq %rcx, %r13
movq 0x20(%rdx), %rcx
andq %r13, %rcx
movq %rcx, 0x20(%rdx)
setne %r10b
je 0x1ac76
movq %rcx, %r8
negq %r8
andq %rcx, %r8
movq %r8, %rax
subq %r9, %rax
orq %r8, %rax
jmp 0x1ac83
negq %r13
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r13
xorl %r10d, %r10d
movq %r13, %rax
jmp 0x1ac88
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rax
andq %r13, %rax
movb $0x1, %cl
cmpb $0x0, 0x35(%rdx)
je 0x1ac94
movq 0x28(%rdx), %r13
jmp 0x1acd1
vmovdqa 0x220(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %esi
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r8d
shlq $0x20, %r8
orq %rsi, %r8
movq (%rdi), %r13
notq %r13
andq %r8, %r13
movq -0x20(%rsp), %rsi
movq %r13, 0x28(%rdx)
movb $0x1, 0x35(%rdx)
andq %rax, %r13
popcntq %r13, %r9
movl %r14d, %eax
subl %r9d, %eax
jle 0x1ad19
testb %r10b, %r10b
jne 0x1ad0b
incq %rbx
addq $0x2, %r15
addq $0x40, %r12
movb $0x1, %bpl
xorl %ecx, %ecx
movl %eax, %r14d
cmpq 0x2e0(%rdi), %rbx
jl 0x1aa5e
jmp 0x1aa3f
subl %r9d, %r14d
incl %r14d
movl %r14d, %eax
jmp 0x1aa3f
cmpl $0x2, %r14d
jl 0x1ad39
incl %r14d
movb -0x21(%rsp), %bpl
leaq -0x1(%r13), %rax
andq %rax, %r13
decl %r14d
cmpl $0x2, %r14d
ja 0x1ad27
jmp 0x1ad3e
movb -0x21(%rsp), %bpl
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %r13, %rcx
leaq (%rax,%rcx), %rbx
addq $0x3f, %rbx
orq %rcx, %rax
movq %rax, (%rsi)
cmovnsq %rax, %rbx
sarq $0x6, %rbx
xorb $0x1, %bpl
movl %ebp, %ecx
jmp 0x1a45b
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %rcx, %rcx
orq %rax, %rcx
movq %rcx, (%rsi)
movl $0x3eb, %eax            # imm = 0x3EB
jmp 0x1ad8f
movl $0x3e9, %eax            # imm = 0x3E9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
nop