// File: cjsmeele[P]stipje/./stipje.hh
// Function: std::ostream& stipje::image_format::console256_squared::format<ImageProxy<stipje::pixel_format::rgba>, std::ostream>(std::ostream&, ImageProxy<stipje::pixel_format::rgba> const&)
static S &format(S &s, const Img &img) {
            for (int i = 0;; ++i) {
                if (i && i % img.width() == 0) {
                    s << "\x1b[0m\n";
                    i += img.width(); // Skip even rows.
                    if (i >= img.width() * img.height())
                        break;
                }

                auto tp = Img::PixelFormat::unformat(img.pixels()[i]);
                auto bp = i + img.width() >= img.width() * img.height()
                    ? 0x0000000 // Special case for uneven-height images.
                    : Img::PixelFormat::unformat(img.pixels()[i + img.width()]);

                auto [tr,tg,tb,ta] = ptorgba(tp);
                auto [br,bg,bb,ba] = ptorgba(bp);

                if (ta < 128 && ba < 128) {
                    s << "\x1b[0m "; // Transparency case.
                } else if (ta < 128) {
                    s << "\x1b[0m\x1b[38;2;" << br << ";" << bg << ";" << bb;
                    s << "m▄"; // Transparent top half case.
                } else if (ba < 128) {
                    s << "\x1b[0m\x1b[38;2;" << tr << ";" << tg << ";" << tb;
                    s << "m▀"; // Transparent bottom half case.
                } else {
                    s << "\x1b[38;2;" << tr << ";" << tg << ";" << tb;
                    s <<     ";48;2;" << br << ";" << bg << ";" << bb;
                    s << "m▀"; // Full opacity case.
                }
            }
            s << "\x1b[0m";
            return s;
        }

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
cmpl $0x0, 0xa4(%rsp)
je 0x1416
movl 0xa4(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1840
movl %eax, %ecx
movl 0x34(%rsp), %eax
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1416
movq 0xb0(%rsp), %rdi
leaq 0x7214(%rip), %rsi      # 0x85c9
callq 0x1070
movq 0xa8(%rsp), %rdi
callq 0x1840
addl 0xa4(%rsp), %eax
movl %eax, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x30(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1840
movl %eax, 0x2c(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1850
movl 0x2c(%rsp), %ecx
movl %eax, %edx
movl 0x30(%rsp), %eax
imull %edx, %ecx
cmpl %ecx, %eax
jl 0x1414
jmp 0x17d1
jmp 0x1416
movq 0xa8(%rsp), %rdi
callq 0x18a0
movslq 0xa4(%rsp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x1860
movl %eax, 0xa0(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1840
movl %eax, %ecx
movl 0x20(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x28(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1840
movl %eax, 0x24(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1850
movl 0x24(%rsp), %ecx
movl %eax, %edx
movl 0x28(%rsp), %eax
imull %edx, %ecx
cmpl %ecx, %eax
jl 0x1495
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x14db
movq 0xa8(%rsp), %rdi
callq 0x18a0
movq %rax, 0x10(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1840
movl 0xc(%rsp), %ecx
movl %eax, %edx
movq 0x10(%rsp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edi
callq 0x1860
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl 0xa0(%rsp), %edx
leaq 0x8c(%rsp), %rdi
leaq 0x70cc(%rip), %rsi      # 0x85c8
callq 0x1250
leaq 0x8c(%rsp), %rdi
callq 0x18b0
movq %rax, 0x80(%rsp)
leaq 0x8c(%rsp), %rdi
callq 0x18c0
movq %rax, 0x78(%rsp)
leaq 0x8c(%rsp), %rdi
callq 0x18d0
movq %rax, 0x70(%rsp)
leaq 0x8c(%rsp), %rdi
callq 0x18e0
movq %rax, 0x68(%rsp)
movl 0x9c(%rsp), %edx
leaq 0x58(%rsp), %rdi
leaq 0x7069(%rip), %rsi      # 0x85c8
callq 0x1250
leaq 0x58(%rsp), %rdi
callq 0x18b0
movq %rax, 0x50(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x18c0
movq %rax, 0x48(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x18d0
movq %rax, 0x40(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x18e0
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
cmpl $0x80, (%rax)
jae 0x15d3
movq 0x38(%rsp), %rax
cmpl $0x80, (%rax)
jae 0x15d3
movq 0xb0(%rsp), %rdi
leaq 0x7006(%rip), %rsi      # 0x85cf
callq 0x1070
jmp 0x17b9
movq 0x68(%rsp), %rax
cmpl $0x80, (%rax)
jae 0x1658
movq 0xb0(%rsp), %rdi
leaq 0x6fe6(%rip), %rsi      # 0x85d5
callq 0x1070
movq %rax, %rdi
movq 0x50(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6fd2(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x48(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6fb4(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x40(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq 0xb0(%rsp), %rdi
leaq 0x6f93(%rip), %rsi      # 0x85e1
callq 0x1070
jmp 0x17b7
movq 0x38(%rsp), %rax
cmpl $0x80, (%rax)
jae 0x16e0
movq 0xb0(%rsp), %rdi
leaq 0x6f61(%rip), %rsi      # 0x85d5
callq 0x1070
movq %rax, %rdi
movq 0x80(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6f4a(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x78(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6f2c(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x70(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq 0xb0(%rsp), %rdi
leaq 0x6f10(%rip), %rsi      # 0x85e6
callq 0x1070
jmp 0x17b5
movq 0xb0(%rsp), %rdi
leaq 0x6eea(%rip), %rsi      # 0x85d9
callq 0x1070
movq %rax, %rdi
movq 0x80(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6ecf(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x78(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6eb1(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x70(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq 0xb0(%rsp), %rdi
leaq 0x6e9a(%rip), %rsi      # 0x85eb
callq 0x1070
movq %rax, %rdi
movq 0x50(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6e70(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x48(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq %rax, %rdi
leaq 0x6e52(%rip), %rsi      # 0x85df
callq 0x1070
movq %rax, %rdi
movq 0x40(%rsp), %rax
movl (%rax), %esi
callq 0x1080
movq 0xb0(%rsp), %rdi
leaq 0x6e36(%rip), %rsi      # 0x85e6
callq 0x1070
jmp 0x17b7
jmp 0x17b9
jmp 0x17bb
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x1372
movq 0xb0(%rsp), %rdi
leaq 0x6e12(%rip), %rsi      # 0x85f2
callq 0x1070
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)
nop