// File: /workspace/github_cpp_makefile_star2_O1/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, -0x10(%rsp)
movq (%rsi), %rax
leaq 0x3f(%rax), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
sarq $0x6, %rbx
leaq 0x30(%rdx), %r9
movl $0x0, -0x8(%rsp)
vpcmpeqd %xmm0, %xmm0, %xmm0
xorl %ecx, %ecx
movq 0x2c8(%rdi), %r11
cmpq 0x2e0(%rdi), %rbx
jge 0x1a4bd
cmpq 0x270(%rdi), %rbx
jle 0x1a5f1
leaq (%rbx,%rbx), %r10
movw $0x0, 0x4(%r9)
movl $0x0, (%r9)
movq %r10, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
movq %rbx, %r10
shlq $0x6, %r10
vmovdqu (%r11,%r10), %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,2), %r14
movq %r14, 0x88(%rdi)
shlq $0x5, %r14
vmovdqu (%r11,%r14), %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 0x250(%rdi), %r13
movq 0x240(%rdi), %rbp
movq %rbp, %r12
xorq %r13, %r12
movq %r10, %rax
andq %r12, %rax
notq %r12
andq %r10, %r12
addq %r15, %rax
xorl %r10d, %r10d
addq %r15, %r12
setb %r10b
movq %r10, 0x240(%rdi)
andq 0x258(%rdi), %rax
orq %rbp, %r12
andq %r13, %r12
orq %rax, %r12
notq %r12
orq %r15, %r12
andq %r14, %r12
movq %r12, 0xe0(%rdi)
vmovq %r12, %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, (%r9)
jne 0x1a631
vmovdqa 0x160(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %r10
orq %rax, %r10
movq %r10, (%rdx)
movq (%rdi), %rax
notq %rax
andq %r10, %rax
movq %rax, (%rdx)
movb $0x1, 0x30(%rdx)
testb $0x1, %cl
jne 0x1a663
testb $0x1, -0x8(%rsp)
je 0x1a693
movq (%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %bpl
andq %rax, %rcx
leaq -0x1(%rcx), %r14
orq %rcx, %r14
movb $0x1, %cl
movl $0x0, -0x8(%rsp)
jmp 0x1a708
movq (%rdx), %rax
movq %rax, %r15
negq %r15
andq %rax, %r15
leaq -0x1(%rax), %r10
andq %rax, %r10
movq %r10, (%rdx)
setne %bpl
je 0x1a6e1
movq %r10, %rax
negq %rax
andq %r10, %rax
movq %rax, %r14
subq %r15, %r14
orq %rax, %r14
jmp 0x1a708
movq -0x10(%rsp), %rax
movq (%rax), %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 (%rdx), %rcx
andq %r15, %rcx
movq %rcx, (%rdx)
setne %bpl
je 0x1a6f6
movq %rcx, %rax
negq %rax
andq %rcx, %rax
movq %rax, %r14
subq %r12, %r14
jmp 0x1a700
negq %r15
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r15
movq %r15, %r14
jmp 0x1a708
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r14
andq %r15, %r14
movb $0x1, %cl
cmpb $0x0, 0x33(%rdx)
jne 0x1a74a
vmovdqa 0x1c0(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %r10d
shlq $0x20, %r10
orq %rax, %r10
movq %r10, 0x18(%rdx)
movq (%rdi), %rax
notq %rax
andq %r10, %rax
movq %rax, 0x18(%rdx)
movb $0x1, 0x33(%rdx)
movq 0x18(%rdx), %r10
andq %r14, %r10
je 0x1a77c
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %r10, %r10
orq %rax, %r10
movq -0x10(%rsp), %rax
movq %r10, (%rax)
movl $0x3eb, %esi            # imm = 0x3EB
movl $0x1, %ebp
jmp 0x1ae59
testb %bpl, %bpl
je 0x1a7cd
movl %esi, -0x4(%rsp)
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsrq %r14, %r14
xorq $0x3f, %r14
orq %rax, %r14
xorq $0x3f, %r14
movq -0x10(%rsp), %rsi
movq %r14, %rax
incq %r14
movq %r14, (%rsi)
movzbl 0x1(%r11,%rax), %r10d
cmpl $0x20, %r10d
je 0x1a7a4
cmpl $0x5b, %r10d
je 0x1a7df
cmpl $0x7b, %r10d
jne 0x1a7e7
movl $0x65, %r10d
jmp 0x1a7ed
incq %rbx
xorl %ecx, %ecx
movb $0x1, %al
movl %eax, -0x8(%rsp)
xorl %ebp, %ebp
jmp 0x1ae59
movl $0x66, %r10d
jmp 0x1a7ed
movl $0x67, %r10d
cmpl $0x66, %r10d
je 0x1ab1d
cmpl $0x65, %r10d
jne 0x1ae63
leaq 0x3f(%r14), %rbx
testq %r14, %r14
cmovnsq %r14, %rbx
sarq $0x6, %rbx
movl $0x1, %r14d
xorl %esi, %esi
xorl %ecx, %ecx
cmpq 0x2e0(%rdi), %rbx
jge 0x1a81a
cmpq 0x270(%rdi), %rbx
jle 0x1a945
leaq (%rbx,%rbx), %rax
movw $0x0, 0x4(%r9)
movl $0x0, (%r9)
movq %rax, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
movq %rbx, %rax
shlq $0x6, %rax
vmovdqu (%r11,%rax), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %eax
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r10d
leaq 0x1(,%rbx,2), %r15
movq %r15, 0x88(%rdi)
shlq $0x5, %r15
vmovdqu (%r11,%r15), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %r15d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
shlq $0x20, %r15
orq %rax, %r15
shlq $0x20, %r12
orq %r10, %r12
leaq (%r12,%r12), %rax
notq %rax
andq %r12, %rax
movq 0x250(%rdi), %r10
movq 0x240(%rdi), %r8
movq %r8, %r13
xorq %r10, %r13
movq %rax, %rbp
andq %r13, %rbp
notq %r13
andq %rax, %r13
addq %r12, %rbp
xorl %eax, %eax
addq %r12, %r13
setb %al
movq %rax, 0x240(%rdi)
andq 0x258(%rdi), %rbp
orq %r8, %r13
andq %r10, %r13
orq %rbp, %r13
notq %r13
orq %r12, %r13
andq %r15, %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 0x1a987
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 %r8, 0x10(%rdx)
movq (%rdi), %rax
notq %rax
andq %r8, %rax
movq %rax, 0x10(%rdx)
movb $0x1, 0x32(%rdx)
testb $0x1, %cl
movq -0x10(%rsp), %rbp
jne 0x1a9b4
testb $0x1, %sil
je 0x1a9e6
movq 0x10(%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %r12b
andq %rax, %rcx
leaq -0x1(%rcx), %r15
orq %rcx, %r15
jmp 0x1aa57
movq 0x10(%rdx), %rax
movq %rax, %r13
negq %r13
andq %rax, %r13
leaq -0x1(%rax), %r10
andq %rax, %r10
movq %r10, 0x10(%rdx)
setne %r12b
je 0x1aa32
movq %r10, %rax
negq %rax
andq %r10, %rax
movq %rax, %r15
subq %r13, %r15
orq %rax, %r15
jmp 0x1aa59
movq (%rbp), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
andl $0xc0, %eax
subl %eax, %ecx
movl $0x1, %r10d
shlq %cl, %r10
movq %r10, %r15
negq %r15
movq %r15, %r13
btcq %rcx, %r13
movq 0x10(%rdx), %rcx
andq %r13, %rcx
movq %rcx, 0x10(%rdx)
setne %r12b
je 0x1aa47
movq %rcx, %rax
negq %rax
andq %rcx, %rax
movq %rax, %r15
subq %r10, %r15
jmp 0x1aa51
negq %r13
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r13
movq %r13, %r15
jmp 0x1aa59
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r15
andq %r13, %r15
movb $0x1, %cl
cmpb $0x0, 0x33(%rdx)
jne 0x1aa9b
vmovdqa 0x1c0(%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 %r8, 0x18(%rdx)
movq (%rdi), %rax
notq %rax
andq %r8, %rax
movq %rax, 0x18(%rdx)
movb $0x1, 0x33(%rdx)
andq 0x18(%rdx), %r15
popcntq %r15, %r13
movl %r14d, %r10d
subl %r13d, %r10d
jle 0x1aabf
testb %r12b, %r12b
je 0x1aaf7
subl %r13d, %r14d
incl %r14d
movl $0x5, %r15d
jmp 0x1ab05
cmpl $0x2, %r14d
jl 0x1aad9
leal 0x1(%r14), %r10d
leaq -0x1(%r15), %rax
andq %rax, %r15
decl %r10d
cmpl $0x2, %r10d
jg 0x1aac9
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %r15, %r8
orq %rax, %r8
movq %r8, (%rbp)
movl $0x1, %r15d
jmp 0x1ab05
incq %rbx
xorl %ecx, %ecx
movb $0x1, %sil
movl %r10d, %r14d
xorl %r15d, %r15d
testl %r15d, %r15d
je 0x1a81a
cmpl $0x5, %r15d
je 0x1a81a
jmp 0x1ae37
leaq 0x3f(%r14), %rbx
testq %r14, %r14
cmovnsq %r14, %rbx
sarq $0x6, %rbx
movl $0x1, %r14d
xorl %ebp, %ebp
xorl %ecx, %ecx
cmpq 0x2e0(%rdi), %rbx
jge 0x1ab36
cmpq 0x270(%rdi), %rbx
jle 0x1ac61
leaq (%rbx,%rbx), %rax
movw $0x0, 0x4(%r9)
movl $0x0, (%r9)
movq %rax, 0x88(%rdi)
movq %rbx, 0x270(%rdi)
movq %rbx, %rax
shlq $0x6, %rax
vmovdqu (%r11,%rax), %ymm1
vmovdqa %ymm1, 0xa0(%rdi)
vmovdqa 0x140(%rdi), %ymm2
vmovdqa 0x180(%rdi), %ymm3
vpcmpeqb %ymm1, %ymm2, %ymm4
vpmovmskb %ymm4, %eax
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %esi
leaq 0x1(,%rbx,2), %r8
movq %r8, 0x88(%rdi)
shlq $0x5, %r8
vmovdqu (%r11,%r8), %ymm1
vmovdqa %ymm1, 0xc0(%rdi)
vpcmpeqb %ymm1, %ymm2, %ymm2
vpmovmskb %ymm2, %r15d
vpcmpeqb %ymm1, %ymm3, %ymm1
vpmovmskb %ymm1, %r12d
shlq $0x20, %r15
orq %rax, %r15
shlq $0x20, %r12
orq %rsi, %r12
leaq (%r12,%r12), %rax
notq %rax
andq %r12, %rax
movq 0x250(%rdi), %rsi
movq 0x240(%rdi), %r8
movq %r8, %r13
xorq %rsi, %r13
movq %rax, %r10
andq %r13, %r10
notq %r13
andq %rax, %r13
addq %r12, %r10
xorl %eax, %eax
addq %r12, %r13
setb %al
movq %rax, 0x240(%rdi)
andq 0x258(%rdi), %r10
orq %r8, %r13
andq %rsi, %r13
orq %r10, %r13
notq %r13
orq %r12, %r13
andq %r15, %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 0x1aca3
vmovdqa 0x200(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %esi
shlq $0x20, %rsi
orq %rax, %rsi
movq %rsi, 0x20(%rdx)
movq (%rdi), %rax
notq %rax
andq %rsi, %rax
movq %rax, 0x20(%rdx)
movb $0x1, 0x34(%rdx)
testb $0x1, %cl
jne 0x1accb
testb $0x1, %bpl
je 0x1acfd
movq 0x20(%rdx), %rax
movq %rax, %rcx
negq %rcx
setb %r12b
andq %rax, %rcx
leaq -0x1(%rcx), %r15
orq %rcx, %r15
jmp 0x1ad72
movq 0x20(%rdx), %rax
movq %rax, %r13
negq %r13
andq %rax, %r13
leaq -0x1(%rax), %r10
andq %rax, %r10
movq %r10, 0x20(%rdx)
setne %r12b
je 0x1ad4d
movq %r10, %rax
negq %rax
andq %r10, %rax
movq %rax, %r15
subq %r13, %r15
orq %rax, %r15
jmp 0x1ad74
movq -0x10(%rsp), %rax
movq (%rax), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
andl $0xc0, %eax
subl %eax, %ecx
movl $0x1, %r10d
shlq %cl, %r10
movq %r10, %r15
negq %r15
movq %r15, %r13
btcq %rcx, %r13
movq 0x20(%rdx), %rcx
andq %r13, %rcx
movq %rcx, 0x20(%rdx)
setne %r12b
je 0x1ad62
movq %rcx, %rax
negq %rax
andq %rcx, %rax
movq %rax, %r15
subq %r10, %r15
jmp 0x1ad6c
negq %r13
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r13
movq %r13, %r15
jmp 0x1ad74
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
orq %rax, %r15
andq %r13, %r15
movb $0x1, %cl
cmpb $0x0, 0x35(%rdx)
jne 0x1adb6
vmovdqa 0x220(%rdi), %ymm1
vpcmpeqb 0xa0(%rdi), %ymm1, %ymm2
vpmovmskb %ymm2, %eax
vpcmpeqb 0xc0(%rdi), %ymm1, %ymm1
vpmovmskb %ymm1, %esi
shlq $0x20, %rsi
orq %rax, %rsi
movq %rsi, 0x28(%rdx)
movq (%rdi), %rax
notq %rax
andq %rsi, %rax
movq %rax, 0x28(%rdx)
movb $0x1, 0x35(%rdx)
andq 0x28(%rdx), %r15
popcntq %r15, %r13
movl %r14d, %r10d
subl %r13d, %r10d
jle 0x1adda
testb %r12b, %r12b
je 0x1ae16
subl %r13d, %r14d
incl %r14d
movl $0x5, %r15d
jmp 0x1ae24
cmpl $0x2, %r14d
jl 0x1adf4
leal 0x1(%r14), %r10d
leaq -0x1(%r15), %rax
andq %rax, %r15
decl %r10d
cmpl $0x2, %r10d
jg 0x1ade4
movq 0x270(%rdi), %rax
shlq $0x6, %rax
bsfq %r15, %rsi
orq %rax, %rsi
movq -0x10(%rsp), %rax
movq %rsi, (%rax)
movl $0x1, %r15d
jmp 0x1ae24
incq %rbx
xorl %ecx, %ecx
movb $0x1, %bpl
movl %r10d, %r14d
xorl %r15d, %r15d
testl %r15d, %r15d
je 0x1ab36
cmpl $0x5, %r15d
je 0x1ab36
movq -0x10(%rsp), %rax
movq (%rax), %rax
leaq 0x3f(%rax), %rbx
testq %rax, %rax
cmovnsq %rax, %rbx
sarq $0x6, %rbx
movl $0x5, %ebp
xorl %ecx, %ecx
movl -0x4(%rsp), %esi
testl %ebp, %ebp
je 0x1a4c4
jmp 0x1ae6d
movl $0x3e9, %esi            # imm = 0x3E9
jmp 0x1a772
cmpl $0x5, %ebp
je 0x1a4bd
movl %esi, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq