// File: jansucan[P]diff-dd/src/create.cpp
// Function: Diff::getData() const
std::vector<FormatV2::RecordData> getData() const
    {
        std::vector<FormatV2::RecordData> data{};

        if (!m_pages[0].isEmpty() && m_pages[1].isEmpty()) {
            // Only the first page
            assert((m_start >= m_pages[0].getStart()) &&
                   (m_start <= m_pages[0].getEnd()) &&
                   (m_end >= m_pages[0].getStart()) &&
                   (m_end <= m_pages[0].getEnd()));

            const uint64_t offset{m_start - m_pages[0].getStart()};
            auto data_first{std::shared_ptr<char[]>{
                m_pages[0].getData(),
                static_cast<char *>(m_pages[0].getData().get()) + offset}};
            data.push_back(FormatV2::RecordData{getSize(), data_first});
        } else if (!m_pages[0].isEmpty() && !m_pages[1].isEmpty()) {
            // Both pages
            assert((m_start >= m_pages[0].getStart()) &&
                   (m_start <= m_pages[0].getEnd()) &&
                   (m_end >= m_pages[1].getStart()) &&
                   (m_end <= m_pages[1].getEnd()));

            size_t size{m_pages[0].getEnd() - m_start};
            const uint64_t offset{m_start - m_pages[0].getStart()};
            auto data_first{std::shared_ptr<char[]>{
                m_pages[0].getData(),
                static_cast<char *>(m_pages[0].getData().get()) + offset}};
            data.push_back(FormatV2::RecordData{size, data_first});

            size = m_end - m_pages[1].getStart();
            data.push_back(FormatV2::RecordData{size, m_pages[1].getData()});
        }

        return data;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0xf8(%rbp)
movq %rdi, %rax
movq %rax, -0x100(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movb $0x0, -0x11(%rbp)
xorl %esi, %esi
movl $0x18, %edx
callq 0x31a0
movq -0xf8(%rbp), %rdi
callq 0x98a0
movq -0xf0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x8fa0
testb $0x1, %al
jne 0x83dd
movq -0xf0(%rbp), %rdi
movl $0x1, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x8fa0
testb $0x1, %al
jne 0x818d
jmp 0x83dd
movq -0xf0(%rbp), %rdi
movq 0x40(%rdi), %rax
movq %rax, -0x110(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0x110(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x101(%rbp)
jb 0x8278
movq -0xf0(%rbp), %rdi
movq 0x40(%rdi), %rax
movq %rax, -0x118(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7730
movq -0x118(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x101(%rbp)
ja 0x8278
movq -0xf0(%rbp), %rdi
movq 0x48(%rdi), %rax
movq %rax, -0x120(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0x120(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x101(%rbp)
jb 0x8278
movq -0xf0(%rbp), %rdi
movq 0x48(%rdi), %rax
movq %rax, -0x128(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7730
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
setbe %al
movb %al, -0x101(%rbp)
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0x8284
jmp 0x8286
jmp 0x82a5
leaq 0x6367(%rip), %rdi      # 0xe5f4
leaq 0x60bd(%rip), %rsi      # 0xe351
movl $0x7f, %edx
leaq 0x63e1(%rip), %rcx      # 0xe681
callq 0x31c0
movq -0xf0(%rbp), %rdi
movq 0x40(%rdi), %rax
movq %rax, -0x150(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x148(%rbp)
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0x148(%rbp), %rsi
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movq -0x150(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
callq 0x98c0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x76e0
movq -0x148(%rbp), %rsi
movq -0xf0(%rbp), %rdi
callq 0x98c0
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x76e0
movq -0x140(%rbp), %rdi
callq 0x4970
movq -0x138(%rbp), %rsi
movq %rax, %rdx
movq -0x20(%rbp), %rax
addq %rax, %rdx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x4a20
movq -0x140(%rbp), %rdi
callq 0x47d0
movq -0x138(%rbp), %rdi
callq 0x47d0
movq -0xf0(%rbp), %rdi
callq 0x75c0
movq -0x130(%rbp), %rsi
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x49f0
movq -0xf8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x98f0
jmp 0x83a3
leaq -0x68(%rbp), %rdi
callq 0x9830
leaq -0x30(%rbp), %rdi
callq 0x47d0
jmp 0x8760
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x9830
leaq -0x30(%rbp), %rdi
callq 0x47d0
jmp 0x8786
movq -0xf0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x8fa0
testb $0x1, %al
jne 0x875e
movq -0xf0(%rbp), %rdi
movl $0x1, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x8fa0
testb $0x1, %al
jne 0x875e
movq -0xf0(%rbp), %rdi
movq 0x40(%rdi), %rax
movq %rax, -0x160(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0x160(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x151(%rbp)
jb 0x850b
movq -0xf0(%rbp), %rdi
movq 0x40(%rdi), %rax
movq %rax, -0x168(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7730
movq -0x168(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x151(%rbp)
ja 0x850b
movq -0xf0(%rbp), %rdi
movq 0x48(%rdi), %rax
movq %rax, -0x170(%rbp)
movl $0x1, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0x170(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x151(%rbp)
jb 0x850b
movq -0xf0(%rbp), %rdi
movq 0x48(%rdi), %rax
movq %rax, -0x178(%rbp)
movl $0x1, %esi
callq 0x98c0
movq %rax, %rdi
callq 0x7730
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
setbe %al
movb %al, -0x151(%rbp)
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x8517
jmp 0x8519
jmp 0x8538
leaq 0x6199(%rip), %rdi      # 0xe6b9
leaq 0x5e2a(%rip), %rsi      # 0xe351
movl $0x8b, %edx
leaq 0x614e(%rip), %rcx      # 0xe681
callq 0x31c0
movq -0xf0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x198(%rbp)
callq 0x98c0
movq %rax, %rdi
callq 0x7730
movq -0xf0(%rbp), %rdi
movq -0x198(%rbp), %rsi
movq 0x40(%rdi), %rcx
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq 0x40(%rdi), %rax
movq %rax, -0x1a0(%rbp)
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0xf0(%rbp), %rdi
movq -0x198(%rbp), %rsi
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x88(%rbp)
callq 0x98c0
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x76e0
movq -0xf0(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0x98c0
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x76e0
movq -0x190(%rbp), %rdi
callq 0x4970
movq -0x188(%rbp), %rsi
movq %rax, %rdx
movq -0x88(%rbp), %rax
addq %rax, %rdx
leaq -0x98(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x4a20
movq -0x190(%rbp), %rdi
callq 0x47d0
movq -0x188(%rbp), %rdi
callq 0x47d0
movq -0x180(%rbp), %rsi
movq -0x80(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x49f0
movq -0xf8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x98f0
jmp 0x866c
leaq -0xd0(%rbp), %rdi
callq 0x9830
movq -0xf0(%rbp), %rdi
movq 0x48(%rdi), %rax
movq %rax, -0x1b0(%rbp)
movl $0x1, %esi
movq %rsi, -0x1b8(%rbp)
callq 0x98c0
movq %rax, %rdi
callq 0x7710
movq -0xf0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
callq 0x98c0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
callq 0x76e0
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x98f0
jmp 0x8704
leaq -0xe8(%rbp), %rdi
callq 0x9830
leaq -0x98(%rbp), %rdi
callq 0x47d0
jmp 0x875e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x9830
jmp 0x8750
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x9830
leaq -0x98(%rbp), %rdi
callq 0x47d0
jmp 0x8786
jmp 0x8760
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x8776
movq -0xf8(%rbp), %rdi
callq 0x87a0
movq -0x100(%rbp), %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0xf8(%rbp), %rdi
callq 0x87a0
movq -0x70(%rbp), %rdi
callq 0x3490
nopl (%rax,%rax)