// File: /workspace/github_cpp_makefile_star2_O2/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 %rdx, %r8
movq (%rsi), %rax
movabsq $0x40, %rcx
cqto
idivq %rcx
movq %rax, %r9
leaq 0x30(%r8), %rbx
movq 0x2c8(%rdi), %rcx
xorl %eax, %eax
vpcmpeqd %xmm0, %xmm0, %xmm0
movq %rcx, -0x8(%rsp)
movq %r9, %rdx
shlq $0x6, %rdx
leaq (%rcx,%rdx), %r10
addq $0x20, %r10
leaq (%r9,%r9), %r11
cmpq 0x2e0(%rdi), %r9
jge 0x1abba
cmpq 0x270(%rdi), %r9
jle 0x1a41e
andw $0x0, 0x4(%rbx)
andl $0x0, (%rbx)
movq %r11, 0x88(%rdi)
movq %r9, 0x270(%rdi)
vmovdqu -0x20(%r10), %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(%r11), %rcx
movq %rcx, 0x88(%rdi)
vmovdqu (%r10), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rcx
orq %r15, %rcx
shlq $0x20, %rdx
orq %r12, %rdx
leaq (%rdx,%rdx), %r12
notq %r12
andq %rdx, %r12
movq 0x250(%rdi), %r13
movq 0x240(%rdi), %rbp
movq %rbp, %r15
xorq %r13, %r15
movq %r12, %r14
andq %r15, %r14
notq %r15
andq %r12, %r15
addq %rdx, %r14
xorl %r12d, %r12d
addq %rdx, %r15
setb %r12b
movq %r12, 0x240(%rdi)
andq 0x258(%rdi), %r14
orq %rbp, %r15
andq %r13, %r15
orq %r14, %r15
notq %r15
orq %rdx, %r15
andq %rcx, %r15
movq %r15, 0xe0(%rdi)
vmovq %r15, %xmm1
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %rcx
xorq 0x248(%rdi), %rcx
movq %rcx, (%rdi)
sarq $0x3f, %rcx
movq %rcx, 0x248(%rdi)
cmpb $0x0, (%rbx)
jne 0x1a45b
vmovdqa 0x160(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rdx
orq %rcx, %rdx
movq (%rdi), %rcx
notq %rcx
andq %rdx, %rcx
movq %rcx, (%r8)
movb $0x1, 0x30(%r8)
testb $0x1, %al
je 0x1a477
movq (%r8), %rax
movq %rax, %rdx
negq %rdx
setb %cl
andq %rax, %rdx
leaq -0x1(%rdx), %rax
orq %rdx, %rax
jmp 0x1a4d5
movq (%rsi), %rax
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rdx, %rcx
movabsq $0x1, %r15
shlq %cl, %r15
movq %r15, %rax
negq %rax
movq %rax, %rdx
btcq %rcx, %rdx
movq (%r8), %r12
andq %rdx, %r12
movq %r12, (%r8)
setne %cl
je 0x1a4c5
movq %r12, %r14
negq %r14
andq %r12, %r14
movq %r14, %rax
subq %r15, %rax
jmp 0x1a4cf
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
orq %r14, %rax
andq %rdx, %rax
cmpb $0x0, 0x33(%r8)
je 0x1a4e2
movq 0x18(%r8), %rdx
jmp 0x1a51b
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %edx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r14d
shlq $0x20, %r14
orq %rdx, %r14
movq (%rdi), %rdx
notq %rdx
andq %r14, %rdx
movq %rdx, 0x18(%r8)
movb $0x1, 0x33(%r8)
andq %rax, %rdx
jne 0x1abc6
testb %cl, %cl
jne 0x1a53a
incq %r9
addq $0x40, %r10
addq $0x2, %r11
movb $0x1, %al
jmp 0x1a307
movq 0x270(%rdi), %rcx
shlq $0x6, %rcx
bsrq %rax, %rax
xorq $0x3f, %rax
orq %rcx, %rax
xorq $0x3f, %rax
movq -0x8(%rsp), %rdx
movq %rax, %rcx
incq %rax
movq %rax, (%rsi)
movzbl 0x1(%rdx,%rcx), %ecx
cmpl $0x20, %ecx
je 0x1a559
cmpl $0x5b, %ecx
je 0x1a88a
cmpl $0x7b, %ecx
jne 0x1abe2
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rax, %r9
movl $0x0, -0x24(%rsp)
movl $0x1, %r12d
leaq (%r9,%r9), %rax
movq %rax, -0x10(%rsp)
movq %r9, %rax
shlq $0x6, %rax
movq %rax, -0x18(%rsp)
leaq 0x1(,%r9,2), %r15
movq %r15, -0x20(%rsp)
shlq $0x5, %r15
xorl %eax, %eax
movl %r12d, %r13d
movq 0x2e0(%rdi), %rcx
cmpq %rcx, %r9
jge 0x1a5d0
cmpq 0x270(%rdi), %r9
jle 0x1a6ef
andw $0x0, 0x4(%rbx)
andl $0x0, (%rbx)
movq -0x10(%rsp), %rcx
movq %rcx, 0x88(%rdi)
movq %r9, 0x270(%rdi)
movq -0x8(%rsp), %rcx
movq -0x18(%rsp), %rdx
vmovdqu (%rcx,%rdx), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r14d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
movq -0x20(%rsp), %rdx
movq %rdx, 0x88(%rdi)
vmovdqu (%rcx,%r15), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rcx
orq %r14, %rcx
shlq $0x20, %rdx
orq %r12, %rdx
leaq (%rdx,%rdx), %r14
notq %r14
andq %rdx, %r14
movq 0x250(%rdi), %rbp
movq 0x240(%rdi), %r11
movq %r11, %r12
xorq %rbp, %r12
movq %r14, %r10
andq %r12, %r10
notq %r12
andq %r14, %r12
addq %rdx, %r10
xorl %r14d, %r14d
addq %rdx, %r12
setb %r14b
movq %r14, 0x240(%rdi)
andq 0x258(%rdi), %r10
orq %r11, %r12
andq %rbp, %r12
orq %r10, %r12
notq %r12
orq %rdx, %r12
andq %rcx, %r12
movq %r12, 0xe0(%rdi)
vmovq %r12, %xmm1
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %rcx
xorq 0x248(%rdi), %rcx
movq %rcx, (%rdi)
sarq $0x3f, %rcx
movq %rcx, 0x248(%rdi)
cmpb $0x0, 0x32(%r8)
jne 0x1a72f
vmovdqa 0x1a0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rdx
orq %rcx, %rdx
movq (%rdi), %rcx
notq %rcx
andq %rdx, %rcx
movq %rcx, 0x10(%r8)
movb $0x1, 0x32(%r8)
testb $0x1, %al
jne 0x1a756
testb $0x1, -0x24(%rsp)
je 0x1a786
movq 0x10(%r8), %rax
movq %rax, %rdx
negq %rdx
setb %cl
andq %rax, %rdx
leaq -0x1(%rdx), %r12
orq %rdx, %r12
jmp 0x1a800
movq 0x10(%r8), %r10
movq %r10, %rdx
negq %rdx
andq %r10, %rdx
leaq -0x1(%r10), %rcx
andq %r10, %rcx
movq %rcx, 0x10(%r8)
je 0x1a7d9
movq %rcx, %r10
negq %r10
andq %rcx, %r10
movq %r10, %r12
subq %rdx, %r12
orq %r10, %r12
movb $0x1, %cl
jmp 0x1a802
movq (%rsi), %rax
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rdx, %rcx
movabsq $0x1, %rdx
shlq %cl, %rdx
movq %rdx, %r12
negq %r12
movq %r12, %rax
btcq %rcx, %rax
movq 0x10(%r8), %rbp
andq %rax, %rbp
movq %rbp, 0x10(%r8)
setne %cl
je 0x1a7f0
movq %rbp, %r10
negq %r10
andq %rbp, %r10
movq %r10, %r12
subq %rdx, %r12
orq %r10, %r12
jmp 0x1a7fd
negq %rdx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rdx
xorl %ecx, %ecx
movq %rdx, %r12
jmp 0x1a802
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %r12
andq %rax, %r12
movb $0x1, %al
cmpb $0x0, 0x33(%r8)
je 0x1a80f
movq 0x18(%r8), %rdx
jmp 0x1a848
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %edx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %r10
orq %rdx, %r10
movq (%rdi), %rdx
notq %rdx
andq %r10, %rdx
movq %rdx, 0x18(%r8)
movb $0x1, 0x33(%r8)
andq %r12, %rdx
popcntq %rdx, %rbp
movl %r13d, %r12d
subl %ebp, %r12d
jle 0x1a87f
testb %cl, %cl
je 0x1a867
subl %ebp, %r13d
incl %r13d
jmp 0x1a5c9
incq %r9
movb $0x1, %al
movl %eax, -0x24(%rsp)
jmp 0x1a59e
leaq -0x1(%rdx), %rax
andq %rax, %rdx
decl %r13d
cmpl $0x2, %r13d
jge 0x1a875
jmp 0x1ab91
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rax, %r9
movl $0x0, -0x24(%rsp)
movl $0x1, %r12d
leaq (%r9,%r9), %rax
movq %rax, -0x10(%rsp)
movq %r9, %rax
shlq $0x6, %rax
movq %rax, -0x18(%rsp)
leaq 0x1(,%r9,2), %r11
movq %r11, -0x20(%rsp)
shlq $0x5, %r11
xorl %eax, %eax
movl %r12d, %r13d
movq 0x2e0(%rdi), %rcx
cmpq %rcx, %r9
jge 0x1a8dc
cmpq 0x270(%rdi), %r9
jle 0x1a9fb
andw $0x0, 0x4(%rbx)
andl $0x0, (%rbx)
movq -0x10(%rsp), %rcx
movq %rcx, 0x88(%rdi)
movq %r9, 0x270(%rdi)
movq -0x8(%rsp), %rcx
movq -0x18(%rsp), %rdx
vmovdqu (%rcx,%rdx), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %r14d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
movq -0x20(%rsp), %rdx
movq %rdx, 0x88(%rdi)
vmovdqu (%rcx,%r11), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rcx
orq %r14, %rcx
shlq $0x20, %rdx
orq %r12, %rdx
leaq (%rdx,%rdx), %r14
notq %r14
andq %rdx, %r14
movq 0x250(%rdi), %rbp
movq 0x240(%rdi), %r15
movq %r15, %r12
xorq %rbp, %r12
movq %r14, %r10
andq %r12, %r10
notq %r12
andq %r14, %r12
addq %rdx, %r10
xorl %r14d, %r14d
addq %rdx, %r12
setb %r14b
movq %r14, 0x240(%rdi)
andq 0x258(%rdi), %r10
orq %r15, %r12
andq %rbp, %r12
orq %r10, %r12
notq %r12
orq %rdx, %r12
andq %rcx, %r12
movq %r12, 0xe0(%rdi)
vmovq %r12, %xmm1
vpclmulqdq $0x0, %xmm0, %xmm1, %xmm1
vmovq %xmm1, %rcx
xorq 0x248(%rdi), %rcx
movq %rcx, (%rdi)
sarq $0x3f, %rcx
movq %rcx, 0x248(%rdi)
cmpb $0x0, 0x34(%r8)
jne 0x1aa3b
vmovdqa 0x200(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %ecx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %edx
shlq $0x20, %rdx
orq %rcx, %rdx
movq (%rdi), %rcx
notq %rcx
andq %rdx, %rcx
movq %rcx, 0x20(%r8)
movb $0x1, 0x34(%r8)
testb $0x1, %al
jne 0x1aa62
testb $0x1, -0x24(%rsp)
je 0x1aa92
movq 0x20(%r8), %rax
movq %rax, %rdx
negq %rdx
setb %cl
andq %rax, %rdx
leaq -0x1(%rdx), %r12
orq %rdx, %r12
jmp 0x1ab0c
movq 0x20(%r8), %r10
movq %r10, %rdx
negq %rdx
andq %r10, %rdx
leaq -0x1(%r10), %rcx
andq %r10, %rcx
movq %rcx, 0x20(%r8)
je 0x1aae5
movq %rcx, %r10
negq %r10
andq %rcx, %r10
movq %r10, %r12
subq %rdx, %r12
orq %r10, %r12
movb $0x1, %cl
jmp 0x1ab0e
movq (%rsi), %rax
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rdx, %rcx
movabsq $0x1, %rdx
shlq %cl, %rdx
movq %rdx, %r12
negq %r12
movq %r12, %rax
btcq %rcx, %rax
movq 0x20(%r8), %rbp
andq %rax, %rbp
movq %rbp, 0x20(%r8)
setne %cl
je 0x1aafc
movq %rbp, %r10
negq %r10
andq %rbp, %r10
movq %r10, %r12
subq %rdx, %r12
orq %r10, %r12
jmp 0x1ab09
negq %rdx
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rdx
xorl %ecx, %ecx
movq %rdx, %r12
jmp 0x1ab0e
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %r12
andq %rax, %r12
movb $0x1, %al
cmpb $0x0, 0x35(%r8)
je 0x1ab1b
movq 0x28(%r8), %rdx
jmp 0x1ab54
vmovdqa 0x220(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %edx
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %r10
orq %rdx, %r10
movq (%rdi), %rdx
notq %rdx
andq %r10, %rdx
movq %rdx, 0x28(%r8)
movb $0x1, 0x35(%r8)
andq %r12, %rdx
popcntq %rdx, %rbp
movl %r13d, %r12d
subl %ebp, %r12d
jle 0x1ab8b
testb %cl, %cl
je 0x1ab73
subl %ebp, %r13d
incl %r13d
jmp 0x1a8d5
incq %r9
movb $0x1, %al
movl %eax, -0x24(%rsp)
jmp 0x1a8aa
leaq -0x1(%rdx), %rax
andq %rax, %rdx
decl %r13d
cmpl $0x2, %r13d
jge 0x1ab81
movq 0x270(%rdi), %rcx
shlq $0x6, %rcx
bsfq %rdx, %rax
orq %rcx, %rax
movq %rax, (%rsi)
cqto
movabsq $0x40, %rcx
idivq %rcx
movq %rax, %r9
xorl %eax, %eax
movq 0x2c8(%rdi), %rcx
jmp 0x1a2f4
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %rdx, %rcx
orq %rax, %rcx
movq %rcx, (%rsi)
movl $0x3eb, %eax            # imm = 0x3EB
jmp 0x1abe7
movl $0x3e9, %eax            # imm = 0x3E9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
nop