// File: /workspace/github_cpp_makefile_star2_O1/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 0x4893
testb %al, %al
je 0x4d71
leaq 0xb4e6(%rip), %rdi      # 0x101b8
movq %r14, %rsi
callq 0x5ff2
leaq 0xb4df(%rip), %rcx      # 0x101c0
cmpq %rcx, %rax
je 0x4dac
movq %rbx, %rdi
callq 0x4bbb
testb %al, %al
je 0x4e26
leaq 0xb4b7(%rip), %rdi      # 0x101b8
movq %r14, %rsi
callq 0x575e
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 0x4e70
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x4e7c
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x4e7c
testl %ecx, %ecx
jne 0x4d5b
movl %ebp, (%rbx)
movq %r14, %rdi
movl %eax, %esi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6362
movq 0xb258(%rip), %rbx      # 0xffd0
leaq 0x658e(%rip), %rsi      # 0xb30d
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2220
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2220
leaq 0x66d4(%rip), %rsi      # 0xb476
movl $0x10, %edx
jmp 0x4e5c
leaq 0xb435(%rip), %rdi      # 0x101e8
movq %r14, %rsi
callq 0x6038
leaq 0xb42e(%rip), %rcx      # 0x101f0
cmpq %rcx, %rax
je 0x4e19
leaq 0xb41a(%rip), %rdi      # 0x101e8
movq %r14, %rsi
callq 0x57da
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 0x6bf8
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e19
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21e0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xb1a3(%rip), %r14      # 0xffd0
leaq 0x6567(%rip), %rsi      # 0xb39b
movl $0xb, %edx
movq %r14, %rdi
callq 0x2220
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x2220
leaq 0x6550(%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 0x6456(%rip), %rdi      # 0xb2cd
callq 0x2120
leaq 0x644a(%rip), %rdi      # 0xb2cd
callq 0x2250
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4eb2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x4eb2
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x4eb2
movl %ebp, (%rbx)
movq %r14, %rdi
callq 0x22e0