// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Index.cpp
// Function: Index::queryRecordsNum(enumOp, Anys&, int)
uint Index::queryRecordsNum(enumOp op, Anys& data, int now_index){
    BtreeNode* now = Index::convert_buf_to_BtreeNode(now_index);

    uint ans = 0;
    std::vector<uint> temp;

    int i;
    for (i = 0; i < now->record_cnt; i++) {
        bool flag = false;
        switch(op){
            case OP_EQ:{
                if(now->record[i].key == data){
                    ans++;
                    temp.push_back(i);
                }
                else if(now->record[i].key > data){
                    flag = true;
                }
                break;
            }
            case OP_NEQ:{
                if(now->record[i].key != data){
                    ans++;
                    temp.push_back(i);
                }
                break;
            }
            case OP_LE:{
                if(now->record[i].key <= data){
                    ans++;
                    temp.push_back(i);
                }
                else if(now->record[i].key > data){
                    flag = true;
                }
                break;
            }
            case OP_GE:{
                if(now->record[i].key >= data){
                    ans++;
                    temp.push_back(i);
                }
                break;
            }
            case OP_LS:{
                if(now->record[i].key < data){
                    ans++;
                    temp.push_back(i);
                }
                else if(now->record[i].key >= data){
                    flag = true;
                }
                break;
            }
            case OP_GT:{
                if(now->record[i].key > data){
                    ans++;
                    temp.push_back(i);
                }
                break;
            }
            case OP_NL:{
                bool ok = true;
                for(uint j = 0;j < now->record[i].key.size();j ++){
                    if(!now->record[i].key[j].isNull()){
                        ok = false;
                        break;
                    }
                }
                if(ok){
                    ans ++;
                    temp.push_back(i);
                }
                break;
            }
            case OP_NNL:{
                bool ok = false;
                for(uint j = 0;j < now->record[i].key.size();j ++){
                    if(!now->record[i].key[j].isNull()){
                        ok = true;
                        break;
                    }
                }
                if(ok){
                    ans ++;
                    temp.push_back(i);
                }
                break;
            }
            case OP_IN:{
                //UnReachable
                break;
            }
        }
        if(flag)break;
    }

    switch(op){
        case OP_EQ:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_NEQ:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
                if(i < temp.size() - 1 && temp[i] != temp[i + 1] - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_LE:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_GE:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_LS:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_GT:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_NL:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_NNL:{
            for(uint i = 0;i < temp.size();i ++){
                if(now->child[temp[i]] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i]]);
                }
                if(i == temp.size() - 1 && now->child[temp[i] + 1] != -1){
                    ans += queryRecordsNum(op,data,now->child[temp[i] + 1]);
                }
            }
            break;
        }
        case OP_IN:{
            //UnReachable
            break;
        }
    }

    return ans;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, 0x30(%rsp)
movl %ecx, %esi
callq 0x1586c
movq %rax, %r12
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %ebx, %ebx
movl %ebp, %r13d
leaq 0x2114e(%rip), %r14     # 0x37bc0
movl $0x0, (%rsp)
movslq 0x1c(%r12), %rax
cmpq %rax, %rbx
jge 0x16ce5
cmpl $0x7, %ebp
ja 0x16cdd
movslq (%r14,%r13,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x85ea
testb %al, %al
je 0x16c8a
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rax
movq %rbx, %r15
shlq $0x5, %r15
leaq (%rax,%r15), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x866e
testb %al, %al
je 0x16cc2
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x865a
testb %al, %al
je 0x16c8a
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x8664
testb %al, %al
je 0x16cdd
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rcx
movq %rbx, %rdx
shlq $0x5, %rdx
movq 0x8(%rcx,%rdx), %rax
movq 0x10(%rcx,%rdx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movl %ecx, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x16cdd
cmpq $0x0, (%rax,%rdx,8)
leaq 0x1(%rdx), %rdx
je 0x16bb2
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x8650
testb %al, %al
je 0x16cdd
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x8700
testb %al, %al
je 0x16cdd
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
jmp 0x16cbd
movq 0x50(%r12), %rcx
movq %rbx, %rdx
shlq $0x5, %rdx
movq 0x8(%rcx,%rdx), %rax
movq 0x10(%rcx,%rdx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movl %ecx, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x16caa
cmpq $0x0, (%rax,%rdx,8)
leaq 0x1(%rdx), %rdx
je 0x16c78
jmp 0x16cdd
movq 0x50(%r12), %rax
movq %rbx, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x8700
jmp 0x16cd9
movl %ebx, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x185ce
incl (%rsp)
jmp 0x16cdd
movq 0x50(%r12), %rax
leaq (%rax,%r15), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x8664
testb %al, %al
jne 0x16ce5
incq %rbx
jmp 0x16a79
cmpl $0x7, %ebp
ja 0x171cf
leaq 0x20eeb(%rip), %rax     # 0x37be0
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %r14d, %r14d
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16d5c
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x16d86
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x16d86
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x16d0e
xorl %r14d, %r14d
pushq $0x4
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16dec
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x16e16
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x16e16
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x16d9e
xorl %r14d, %r14d
pushq $0x2
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16e7c
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x16ea6
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x16ea6
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x16e2e
xorl %r14d, %r14d
pushq $0x3
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16f0c
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x16f36
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x16f36
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x16ebe
xorl %r14d, %r14d
pushq $0x7
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16f9c
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x16fc6
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x16fc6
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x16f4e
xorl %r14d, %r14d
pushq $0x1
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x1702c
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x1706a
movl (%rax,%r14,4), %ecx
incl %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x1706a
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jbe 0x170ab
movl (%rax,%r14,4), %ecx
incl %r14d
movl (%rax,%r14,4), %eax
decl %eax
cmpl %eax, %ecx
je 0x16fde
incl %ecx
movq 0x20(%r12), %rax
movl (%rax,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x16fde
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
jmp 0x16fde
incl %r14d
jmp 0x16fde
xorl %r14d, %r14d
pushq $0x5
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x17114
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x1713e
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x1713e
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x170c6
xorl %r14d, %r14d
pushq $0x6
popq %rbp
movl (%rsp), %ebx
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r13
movl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x171d2
movl (%rax,%r14,4), %ecx
movq 0x20(%r12), %rsi
movl (%rsi,%rcx,4), %ecx
cmpl $-0x1, %ecx
je 0x171a0
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %r14, %rdx
jne 0x171ca
movl (%rax,%r14,4), %eax
incl %eax
movq 0x20(%r12), %rcx
movl (%rcx,%rax,4), %ecx
cmpl $-0x1, %ecx
je 0x171ca
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x16a32
addl %eax, %ebx
incl %r14d
jmp 0x17156
movl (%rsp), %ebx
leaq 0x10(%rsp), %rdi
callq 0x18566
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
jmp 0x1720d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x18566
movq %rbx, %rdi
callq 0x56f0