// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/checkpoint.cpp
// Function: load_checkpoint()
void load_checkpoint()
{
    size_t loaded = 0;
    std::string line;
    std::ifstream checkpoint_file(global_filename);
    std::cout << "CoralDB: Attempting to load checkpoint file " << global_filename << std::endl;
    std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
    while (std::getline(checkpoint_file, line))
    {
        if (execute_command(line, 0) == 0)
        {
            ++loaded;
        }
        else
        {
            err_malformed_command_load(line);
        }
    }
    std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
    std::cout << "CoralDB: Executed " << loaded << " startup commands in " << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count() << " ms" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x5bcd(%rip), %rsi      # 0xa370
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x3450
movq 0x5812(%rip), %rdi      # 0x9fd0
leaq 0x2a26(%rip), %rsi      # 0x71eb
movl $0x2c, %edx
callq 0x3330
movq 0x5b9a(%rip), %rsi      # 0xa370
movq 0x5b9b(%rip), %rdx      # 0xa378
movq 0x57ec(%rip), %rdi      # 0x9fd0
callq 0x3330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
xorl %r15d, %r15d
callq 0x33a0
movq %rax, %r14
leaq -0x48(%rbp), %r12
movq -0x250(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x34c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4873
movq %r12, %rdi
xorl %esi, %esi
callq 0x3c5b
testl %eax, %eax
je 0x486e
movq %r12, %rdi
callq 0x3a9d
jmp 0x4822
incq %r15
jmp 0x4822
callq 0x33a0
movq %rax, %rbx
movq 0x574e(%rip), %rdi      # 0x9fd0
leaq 0x298f(%rip), %rsi      # 0x7218
movl $0x12, %edx
callq 0x3330
movq 0x5736(%rip), %rdi      # 0x9fd0
movq %r15, %rsi
callq 0x31f0
movq %rax, %r15
leaq 0x297f(%rip), %rsi      # 0x722b
movl $0x15, %edx
movq %rax, %rdi
callq 0x3330
subq %r14, %rbx
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rbx, %rax
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq %r15, %rdi
callq 0x32d0
movq %rax, %rbx
leaq 0x2955(%rip), %rsi      # 0x7241
movl $0x3, %edx
movq %rax, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq -0x250(%rbp), %rdi
callq 0x3090
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x493a
callq 0x32c0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4966
jmp 0x4957
jmp 0x4957
jmp 0x4957
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x3090
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4974
callq 0x32c0
movq %rbx, %rdi
callq 0x34a0