// File: /workspace/github_cpp_makefile_star2_O3/ChaohuiYu[P]BPlusTree/commands.cpp
// Function: deleteRecord(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 deleteRecord(const string& relationName, const string& key) {
    // need to check if key should be integer
    // need to check if key exists

    if (!isRelationExist(relationName)) {
        cout << "Error: Relation " << relationName << " doesn't exist.\n";
        return;
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4853
testb %al, %al
je 0x4d31
leaq 0xb526(%rip), %rdi      # 0x101b8
movq %r14, %rsi
callq 0x5fae
leaq 0xb51f(%rip), %rcx      # 0x101c0
cmpq %rcx, %rax
je 0x4d6c
movq %rbx, %rdi
callq 0x4b7b
testb %al, %al
je 0x4de6
leaq 0xb4f7(%rip), %rdi      # 0x101b8
movq %r14, %rsi
callq 0x571a
movq (%rax), %r14
movq (%rbx), %r15
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2240
cmpq %r15, (%r12)
je 0x4e30
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x4e3c
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x4e3c
testl %ecx, %ecx
jne 0x4d1b
movl %ebp, (%rbx)
movq %r14, %rdi
movl %eax, %esi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x631e
movq 0xb298(%rip), %rbx      # 0xffd0
leaq 0x65ce(%rip), %rsi      # 0xb30d
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2220
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2220
leaq 0x6714(%rip), %rsi      # 0xb476
movl $0x10, %edx
jmp 0x4e1c
leaq 0xb475(%rip), %rdi      # 0x101e8
movq %r14, %rsi
callq 0x5ff4
leaq 0xb46e(%rip), %rcx      # 0x101f0
cmpq %rcx, %rax
je 0x4dd9
leaq 0xb45a(%rip), %rdi      # 0x101e8
movq %r14, %rsi
callq 0x5796
movq (%rax), %r14
leaq 0x8(%rsp), %r15
movl $0x1, %edx
movl $0xa, %ecx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2200
movq %r14, %rdi
movq %r15, %rsi
callq 0x6bb6
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4dd9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21e0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xb1e3(%rip), %r14      # 0xffd0
leaq 0x65a7(%rip), %rsi      # 0xb39b
movl $0xb, %edx
movq %r14, %rdi
callq 0x2220
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2220
leaq 0x6590(%rip), %rsi      # 0xb3a7
movl $0x12, %edx
movq %rax, %rdi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2220
leaq 0x6496(%rip), %rdi      # 0xb2cd
callq 0x2120
leaq 0x648a(%rip), %rdi      # 0xb2cd
callq 0x2250
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e72
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x4e72
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x4e72
movl %ebp, (%rbx)
movq %r14, %rdi
callq 0x22e0