// File: ChaohuiYu[P]BPlusTree/commands.cpp
// Function: rangeQueryRecords(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void rangeQueryRecords(const string& relationName, const string& key1, const string& key2) {
    if (!isRelationExist(relationName)) {
        cout << "Error: Relation " << relationName << " doesn't exist.\n";
        return;
    }

    if (isRelationInRelationInt(relationName)) {
        if (!is_number(key1)) {
            cout << "Error: Key1 " << key1 << " is not a number.\n";
            return;
        }
        if (!is_number(key2)) {
            cout << "Error: Key2 " << key2 << " is not a number.\n";
            return;
        }
        relationNameToRelationInt[relationName]->rangeQueryRid(stoi(key1), stoi(key2));
    }
    else if (isRelationInRelationStr(relationName)) {
        relationNameToRelationStr[relationName]->rangeQueryRid(key1.substr(1, 10), key2.substr(1, 10));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6940
testb $0x1, %al
jne 0x7067
movq 0x18f8d(%rip), %rdi     # 0x1ffc8
leaq 0xf2bf(%rip), %rsi      # 0x16301
callq 0x3280
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x3250
movq %rax, %rdi
leaq 0xf40d(%rip), %rsi      # 0x1646a
callq 0x3280
jmp 0x7206
movq -0x8(%rbp), %rdi
callq 0x6b80
testb $0x1, %al
jne 0x7079
jmp 0x714a
movq -0x10(%rbp), %rdi
callq 0x6bd0
testb $0x1, %al
jne 0x70b9
movq 0x18f3b(%rip), %rdi     # 0x1ffc8
leaq 0xf31a(%rip), %rsi      # 0x163ae
callq 0x3280
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x3250
movq %rax, %rdi
leaq 0xf2ec(%rip), %rsi      # 0x1639b
callq 0x3280
jmp 0x7206
movq -0x18(%rbp), %rdi
callq 0x6bd0
testb $0x1, %al
jne 0x70f9
movq 0x18efb(%rip), %rdi     # 0x1ffc8
leaq 0xf2e7(%rip), %rsi      # 0x163bb
callq 0x3280
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x3250
movq %rax, %rdi
leaq 0xf2ac(%rip), %rsi      # 0x1639b
callq 0x3280
jmp 0x7206
movq -0x8(%rbp), %rsi
leaq 0x1916c(%rip), %rdi     # 0x20270
callq 0x7770
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x5570
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x5570
movq -0x70(%rbp), %rdi
movl -0x68(%rbp), %esi
movl %eax, %edx
callq 0xa780
jmp 0x7206
movq -0x8(%rbp), %rdi
callq 0x6c50
testb $0x1, %al
jne 0x715c
jmp 0x7204
movq -0x8(%rbp), %rsi
leaq 0x19139(%rip), %rdi     # 0x202a0
callq 0x7850
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movl $0x1, %edx
movq %rdx, -0x80(%rbp)
movl $0xa, %ecx
movq %rcx, -0x78(%rbp)
callq 0x32b0
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x18(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x32b0
jmp 0x71ac
movq -0x88(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xb3a0
jmp 0x71c2
leaq -0x58(%rbp), %rdi
callq 0x3190
leaq -0x38(%rbp), %rdi
callq 0x3190
jmp 0x7204
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x71f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3190
leaq -0x38(%rbp), %rdi
callq 0x3190
jmp 0x720f
jmp 0x7206
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3410
nopl (%rax,%rax)