// File: /workspace/github_cpp_makefile_star2_O1/rocket323[P]fishdb/./pager.cpp
// Function: fishdb::Pager::GetPage(long, bool)
std::shared_ptr<MemPage> Pager::GetPage(int64_t page_no, bool stick)
{
    assert(page_no > 0);
    auto iter = m_pages.find(page_no);
    std::shared_ptr<MemPage> mp;
    if (iter != m_pages.end())
    {
        mp = iter->second;
    }
    else
    {
        // read page(s) from file
        mp = ReadPage(page_no);
        assert(mp != nil);
        int64_t of_page_no = mp->header.of_page_no;
        while (of_page_no > 0)
        {
            auto of_mp = ReadPage(of_page_no);
            mp->Feed(of_mp->data.c_str(), of_mp->data.size());
            of_page_no = of_mp->header.of_page_no;
        }
        if (mp->header.type == TREE_PAGE)
        {
            mp->Parse();
            CachePage(mp);
        }
    }
    mp->stick |= stick;
    return mp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdx, %rdx
jle 0x6741
movl %ecx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rsi), %rsi
leaq 0x8(%r15), %rax
movq %rax, %rcx
testq %rsi, %rsi
je 0x6614
movq %rax, %rcx
xorl %edi, %edi
cmpq %rdx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rcx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x65fc
movq %rax, %rsi
cmpq %rax, %rcx
je 0x6627
cmpq %rdx, 0x20(%rcx)
cmovgq %rax, %rcx
movq %rcx, %rsi
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
cmpq %rax, %rsi
je 0x664b
movq 0x28(%rsi), %rax
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
addq $0x30, %rsi
callq 0x4f50
jmp 0x6728
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x67b8
movaps -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x6673
callq 0x277e
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x6681
callq 0x277e
movq (%rbx), %rax
cmpq 0x5b65(%rip), %rax      # 0xc1f0
je 0x6760
movq 0x18(%rax), %r13
testq %r13, %r13
jle 0x66d7
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x67b8
movq (%rbx), %rdi
movq -0x40(%rbp), %r13
movq 0x28(%r13), %rsi
movl 0x30(%r13), %edx
callq 0x741a
movq 0x18(%r13), %r13
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x66d2
callq 0x277e
testq %r13, %r13
jg 0x669e
movq (%rbx), %rdi
cmpb $0x2, 0x8(%rdi)
jne 0x6728
callq 0x754c
movq (%rbx), %rax
movq %rax, -0x50(%rbp)
movq 0x8(%rbx), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x670e
movq 0x58d0(%rip), %rcx      # 0xbfd0
cmpb $0x0, (%rcx)
je 0x670a
incl 0x8(%rax)
jmp 0x670e
lock
incl 0x8(%rax)
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0x69bc
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x6728
callq 0x277e
movq (%rbx), %rax
orb %r14b, 0x78(%rax)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cf8(%rip), %rdi      # 0x8440
leaq 0x1c61(%rip), %rsi      # 0x83b0
leaq 0x1cf6(%rip), %rcx      # 0x844c
movl $0x66, %edx
callq 0x2140
leaq 0x19c1(%rip), %rdi      # 0x8128
leaq 0x1c42(%rip), %rsi      # 0x83b0
leaq 0x1cd7(%rip), %rcx      # 0x844c
movl $0x71, %edx
callq 0x2140
movq %rax, %r14
movq -0x48(%rbp), %rdi
jmp 0x6798
jmp 0x678c
jmp 0x678c
movq %rax, %r14
jmp 0x67a2
movq %rax, %r14
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x67a2
callq 0x277e
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x67b0
callq 0x277e
movq %r14, %rdi
callq 0x2300