// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movl %ecx, -0x34(%rbp)
movq %rdi, -0x30(%rbp)
testq %rdx, %rdx
jle 0x672b
movq %rsi, %r15
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x6646
leaq 0x8(%r15), %rcx
movq %rcx, %rsi
xorl %edi, %edi
cmpq %rdx, 0x20(%rax)
setl %dil
cmovgeq %rax, %rsi
movq 0x10(%rax,%rdi,8), %rax
testq %rax, %rax
jne 0x65fc
cmpq %rcx, %rsi
je 0x6646
xorps %xmm0, %xmm0
cmpq %rdx, 0x20(%rsi)
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
jg 0x6650
movq 0x28(%rsi), %rax
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
leaq 0x8(%rcx), %rdi
addq $0x30, %rsi
callq 0x4f9a
jmp 0x670f
xorps %xmm0, %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x67a6
movq -0x48(%rbp), %r12
movq -0x40(%rbp), %rbx
movq -0x30(%rbp), %rax
movq %r12, (%rax)
movq %rbx, 0x8(%rax)
cmpq 0x5b7a(%rip), %r12      # 0xc1f0
je 0x674a
movq 0x18(%r12), %r14
testq %r14, %r14
jle 0x66c3
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x67a6
movq -0x48(%rbp), %r14
movq 0x28(%r14), %rsi
movl 0x30(%r14), %edx
movq %r12, %rdi
callq 0x73d2
movq 0x18(%r14), %r14
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x66be
callq 0x277e
testq %r14, %r14
jg 0x668a
cmpb $0x2, 0x8(%r12)
jne 0x670f
movq %r12, %rdi
callq 0x7504
movq %r12, -0x58(%rbp)
movq %rbx, -0x50(%rbp)
testq %rbx, %rbx
je 0x66f5
movq 0x58e9(%rip), %rax      # 0xbfd0
cmpb $0x0, (%rax)
je 0x66f1
incl 0x8(%rbx)
jmp 0x66f5
lock
incl 0x8(%rbx)
leaq -0x58(%rbp), %rsi
movq %r15, %rdi
callq 0x6980
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x670f
callq 0x277e
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movl -0x34(%rbp), %edx
orb %dl, 0x78(%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d0a(%rip), %rdi      # 0x843c
leaq 0x1c73(%rip), %rsi      # 0x83ac
leaq 0x1d08(%rip), %rcx      # 0x8448
movl $0x66, %edx
callq 0x2140
leaq 0x19d7(%rip), %rdi      # 0x8128
leaq 0x1c54(%rip), %rsi      # 0x83ac
leaq 0x1ce9(%rip), %rcx      # 0x8448
movl $0x71, %edx
callq 0x2140
movq %rax, %r14
movq -0x50(%rbp), %rdi
jmp 0x6782
jmp 0x6776
jmp 0x6776
movq %rax, %r14
jmp 0x678c
movq %rax, %r14
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x678c
callq 0x277e
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x679e
callq 0x277e
movq %r14, %rdi
callq 0x2300