// File: juli9797[P]ssf/src/console_page.hpp
// Function: ssf::ConsolePage::str[abi:cxx11]() const
auto str() const
    {
        std::ostringstream p;
        p << c_cmd::clear;
        p << c_cmd::hide_cursor;

        // iterate over columns
        for (auto col_index = 0u; col_index < entries.size(); col_index++)
        {
            std::vector<std::filesystem::directory_entry> col = entries.at(col_index);
            // Calculate entry offset in case there are more entries
            // than rows available
            unsigned entry_offset = 0;
            if (col_index == _active_col-1 && col.size() > _row_count && !_parent_selection.empty())
            {
                entry_offset = std::floor(find_pos(col, *_parent_selection.begin()) / _row_count) * _row_count;
            }
	    else if (col_index == _active_col && col.size() > _row_count && !_selection.empty())
            {
                entry_offset = std::floor(find_pos(col, *_selection.begin()) / _row_count) * _row_count;
            }
            // Handle last folder in middle column
            int current_width = _col_widths.at(col_index);
            if (col_index == 1)
            {
                if (entries.at(2).size() == 0)
                {
                    current_width += _col_widths[2];
                }
            }
            int current_cursor_col = 0;
            for (unsigned i = 0; i < col_index; i++)
            {
                current_cursor_col += _col_widths.at(i);
                current_cursor_col += _spacing;
            }
            // Only iterate to either row_count or size of the col
            unsigned limit = std::min((int)(col.size() - entry_offset),
                                      (int)_row_count);
            for (auto index = 0u; index < limit; index++)
            {
                // Calculate the actual index for the entry
                auto entry_index = index + entry_offset;
                auto dir_entry = col.at(entry_index);
                auto full_entry = col.at(entry_index).path().filename().string();
                auto entry = shortened_string(full_entry,
                                              current_width - 4);
                p << c_cmd::set_cursor(index, current_cursor_col);
                p << get_icon(full_entry) << " ";

                if (!_selection.empty() && (col.at(entry_index) == _selection.at(0) && col_index == _active_col) ||
                    (!_parent_selection.empty() && col.at(entry_index) == _parent_selection.at(0) && col_index == _active_col - 1))
                {
                    p << ((col_index == 0) ? c_cmd::color::background::bright_black: c_cmd::color::background::cyan)
                      << entry
                      << c_cmd::color::reset;
                }
                else
                {
                    if (dir_entry.is_directory())
                    {
                        p << c_cmd::color::foreground::bright_cyan
                          << entry
                          << c_cmd::color::reset;
                    }
                    else
                    {
                        p << entry;
                    }
                }
            }
        }
        return p.str();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x380(%rbp)
movq %rdi, %rax
movq %rax, -0x378(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x370(%rbp)
leaq -0x188(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x4430
movq -0x368(%rbp), %rdi
leaq 0xc2d4(%rip), %rsi      # 0x17334
callq 0x42f0
jmp 0xb067
leaq 0xc2bf(%rip), %rsi      # 0x1732d
leaq -0x188(%rbp), %rdi
callq 0x42f0
jmp 0xb07c
movl $0x0, -0x198(%rbp)
movq -0x370(%rbp), %rdi
movl -0x198(%rbp), %eax
movq %rax, -0x388(%rbp)
addq $0x50, %rdi
callq 0xc5a0
movq %rax, %rcx
movq -0x388(%rbp), %rax
cmpq %rcx, %rax
jae 0xb9f6
movq -0x370(%rbp), %rdi
addq $0x50, %rdi
movl -0x198(%rbp), %eax
movl %eax, %esi
callq 0x131d0
movq %rax, -0x390(%rbp)
jmp 0xb0d7
movq -0x390(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
callq 0xd5a0
jmp 0xb0ec
movq -0x370(%rbp), %rcx
movl $0x0, -0x1b4(%rbp)
movl -0x198(%rbp), %eax
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb24f
leaq -0x1b0(%rbp), %rdi
callq 0xd690
movq -0x370(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jbe 0xb24f
movq -0x370(%rbp), %rdi
addq $0x28, %rdi
callq 0xe130
testb $0x1, %al
jne 0xb24f
movq -0x370(%rbp), %rdi
addq $0x28, %rdi
callq 0xd7c0
movq %rax, -0x1f0(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xdc10
movq %rax, %rsi
leaq -0x1e8(%rbp), %rdi
callq 0xdc90
jmp 0xb17c
movq -0x370(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x1e8(%rbp), %rdx
callq 0x13250
movq %rax, -0x398(%rbp)
jmp 0xb19f
movq -0x398(%rbp), %rax
movq -0x370(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rdi
callq 0x13210
movsd %xmm0, -0x3a0(%rbp)
jmp 0xb1c7
movsd -0x3a0(%rbp), %xmm0
movq -0x370(%rbp), %rax
movl 0x8(%rax), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x1b4(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0xdd90
jmp 0xb374
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xba27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xb9e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0xdd90
jmp 0xb9e8
movq -0x370(%rbp), %rcx
movl -0x198(%rbp), %eax
cmpl 0x40(%rcx), %eax
jne 0xb372
leaq -0x1b0(%rbp), %rdi
callq 0xd690
movq -0x370(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jbe 0xb372
movq -0x370(%rbp), %rdi
addq $0x10, %rdi
callq 0xe130
testb $0x1, %al
jne 0xb372
movq -0x370(%rbp), %rdi
addq $0x10, %rdi
callq 0xd7c0
movq %rax, -0x228(%rbp)
leaq -0x228(%rbp), %rdi
callq 0xdc10
movq %rax, %rsi
leaq -0x220(%rbp), %rdi
callq 0xdc90
jmp 0xb2d0
movq -0x370(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x13250
movq %rax, -0x3a8(%rbp)
jmp 0xb2f3
movq -0x3a8(%rbp), %rax
movq -0x370(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rdi
callq 0x13210
movsd %xmm0, -0x3b0(%rbp)
jmp 0xb31b
movsd -0x3b0(%rbp), %xmm0
movq -0x370(%rbp), %rax
movl 0x8(%rax), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x1b4(%rbp)
leaq -0x220(%rbp), %rdi
callq 0xdd90
jmp 0xb372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x220(%rbp), %rdi
callq 0xdd90
jmp 0xb9e8
jmp 0xb374
movq -0x370(%rbp), %rdi
addq $0x44, %rdi
movl -0x198(%rbp), %eax
movl %eax, %esi
callq 0x132d0
movq %rax, -0x3b8(%rbp)
jmp 0xb395
movq -0x3b8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x22c(%rbp)
cmpl $0x1, -0x198(%rbp)
jne 0xb402
movq -0x370(%rbp), %rdi
addq $0x50, %rdi
movl $0x2, %esi
callq 0x131d0
movq %rax, -0x3c0(%rbp)
jmp 0xb3cb
movq -0x3c0(%rbp), %rdi
callq 0xd690
cmpq $0x0, %rax
jne 0xb400
movq -0x370(%rbp), %rdi
addq $0x44, %rdi
movl $0x2, %esi
callq 0x13330
movl (%rax), %eax
addl -0x22c(%rbp), %eax
movl %eax, -0x22c(%rbp)
jmp 0xb402
movl $0x0, -0x230(%rbp)
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
cmpl -0x198(%rbp), %eax
jae 0xb481
movq -0x370(%rbp), %rdi
addq $0x44, %rdi
movl -0x234(%rbp), %eax
movl %eax, %esi
callq 0x132d0
movq %rax, -0x3c8(%rbp)
jmp 0xb445
movq -0x370(%rbp), %rax
movq -0x3c8(%rbp), %rcx
movl (%rcx), %ecx
addl -0x230(%rbp), %ecx
movl %ecx, -0x230(%rbp)
movl 0x4(%rax), %eax
addl -0x230(%rbp), %eax
movl %eax, -0x230(%rbp)
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0xb416
leaq -0x1b0(%rbp), %rdi
callq 0xd690
movq %rax, %rcx
movq -0x370(%rbp), %rax
movl -0x1b4(%rbp), %edx
subl %edx, %ecx
movl %ecx, -0x23c(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x240(%rbp)
leaq -0x23c(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x13360
movq %rax, -0x3d0(%rbp)
jmp 0xb4ca
movq -0x3d0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x238(%rbp)
movl $0x0, -0x244(%rbp)
movl -0x244(%rbp), %eax
cmpl -0x238(%rbp), %eax
jae 0xb9c8
movl -0x244(%rbp), %eax
movl -0x1b4(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x248(%rbp)
movl -0x248(%rbp), %eax
movl %eax, %esi
leaq -0x1b0(%rbp), %rdi
callq 0xe270
movq %rax, -0x3d8(%rbp)
jmp 0xb526
movq -0x3d8(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0xdc90
jmp 0xb53b
movl -0x248(%rbp), %eax
movl %eax, %esi
leaq -0x1b0(%rbp), %rdi
callq 0xe270
movq %rax, -0x3e0(%rbp)
jmp 0xb558
movq -0x3e0(%rbp), %rdi
callq 0x10100
movq %rax, %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x10110
jmp 0xb575
leaq -0x298(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x10210
jmp 0xb58a
leaq -0x2c0(%rbp), %rdi
callq 0xddb0
leaq -0x300(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x4100
jmp 0xb5ab
movl -0x22c(%rbp), %eax
addl $-0x4, %eax
movslq %eax, %rdx
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x4ee0
jmp 0xb5cc
leaq -0x300(%rbp), %rdi
callq 0x41c0
movl -0x244(%rbp), %esi
movl -0x230(%rbp), %edx
leaq -0x320(%rbp), %rdi
callq 0x4dc0
jmp 0xb5f2
leaq -0x188(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x42b0
jmp 0xb607
leaq -0x320(%rbp), %rdi
callq 0x41c0
leaq -0x360(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x4100
jmp 0xb628
leaq -0x340(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x50e0
jmp 0xb63d
leaq -0x188(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x42b0
movq %rax, -0x3e8(%rbp)
jmp 0xb659
movq -0x3e8(%rbp), %rdi
leaq 0xbd8f(%rip), %rsi      # 0x173f6
callq 0x42f0
jmp 0xb66e
leaq -0x340(%rbp), %rdi
callq 0x41c0
leaq -0x360(%rbp), %rdi
callq 0x41c0
movq -0x370(%rbp), %rdi
addq $0x10, %rdi
callq 0xe130
testb $0x1, %al
jne 0xb703
movl -0x248(%rbp), %eax
movl %eax, %esi
leaq -0x1b0(%rbp), %rdi
callq 0xe270
movq %rax, -0x3f0(%rbp)
jmp 0xb6b7
movq -0x370(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x133a0
movq %rax, -0x3f8(%rbp)
jmp 0xb6d4
movq -0x3f8(%rbp), %rsi
movq -0x3f0(%rbp), %rdi
callq 0x10fa0
testb $0x1, %al
jne 0xb6ed
jmp 0xb703
movq -0x370(%rbp), %rcx
movl -0x198(%rbp), %eax
cmpl 0x40(%rcx), %eax
je 0xb78c
movq -0x370(%rbp), %rdi
addq $0x28, %rdi
callq 0xe130
testb $0x1, %al
jne 0xb8e2
movl -0x248(%rbp), %eax
movl %eax, %esi
leaq -0x1b0(%rbp), %rdi
callq 0xe270
movq %rax, -0x400(%rbp)
jmp 0xb738
movq -0x370(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x133a0
movq %rax, -0x408(%rbp)
jmp 0xb755
movq -0x408(%rbp), %rsi
movq -0x400(%rbp), %rdi
callq 0x10fa0
testb $0x1, %al
jne 0xb771
jmp 0xb8e2
movq -0x370(%rbp), %rcx
movl -0x198(%rbp), %eax
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb8e2
movl -0x198(%rbp), %eax
testl %eax, %eax
leaq 0xbb9c(%rip), %rax      # 0x17337
leaq 0xbb9c(%rip), %rsi      # 0x1733e
cmoveq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0x42f0
movq %rax, -0x410(%rbp)
jmp 0xb7bb
movq -0x410(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x42b0
movq %rax, -0x418(%rbp)
jmp 0xb7d7
movq -0x418(%rbp), %rdi
leaq 0xba58(%rip), %rsi      # 0x1723d
callq 0x42f0
jmp 0xb7ec
jmp 0xb96a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xb9ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0xddb0
jmp 0xb9ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xb9ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x41c0
jmp 0xb9ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xb9a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x41c0
jmp 0xb9a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xb8d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x41c0
leaq -0x360(%rbp), %rdi
callq 0x41c0
jmp 0xb9a2
leaq -0x278(%rbp), %rdi
callq 0xff40
movb %al, -0x419(%rbp)
jmp 0xb8f6
movb -0x419(%rbp), %al
testb $0x1, %al
jne 0xb902
jmp 0xb951
leaq 0xb926(%rip), %rsi      # 0x1722f
leaq -0x188(%rbp), %rdi
callq 0x42f0
movq %rax, -0x428(%rbp)
jmp 0xb91e
movq -0x428(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x42b0
movq %rax, -0x430(%rbp)
jmp 0xb93a
movq -0x430(%rbp), %rdi
leaq 0xb8f5(%rip), %rsi      # 0x1723d
callq 0x42f0
jmp 0xb94f
jmp 0xb968
leaq -0x188(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x42b0
jmp 0xb966
jmp 0xb968
jmp 0xb96a
leaq -0x2e0(%rbp), %rdi
callq 0x41c0
leaq -0x298(%rbp), %rdi
callq 0x41c0
leaq -0x278(%rbp), %rdi
callq 0xdd90
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0xb4e3
leaq -0x2e0(%rbp), %rdi
callq 0x41c0
leaq -0x298(%rbp), %rdi
callq 0x41c0
leaq -0x278(%rbp), %rdi
callq 0xdd90
jmp 0xb9e8
leaq -0x1b0(%rbp), %rdi
callq 0xa720
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0xb086
leaq -0x1b0(%rbp), %rdi
callq 0xa720
jmp 0xba27
movq -0x380(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x4320
jmp 0xba0b
leaq -0x188(%rbp), %rdi
callq 0x4060
movq -0x378(%rbp), %rax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
leaq -0x188(%rbp), %rdi
callq 0x4060
movq -0x190(%rbp), %rdi
callq 0x4560
nop