// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
xorl %r15d, %r15d
movl $0xff, %ebp
leaq 0x7349(%rip), %r12      # 0x85ce
movl 0x8(%r14), %ecx
testl %r15d, %r15d
je 0x12c1
movl %r15d, %eax
cltd
idivl %ecx
testl %edx, %edx
jne 0x12c4
movq 0x8(%rsp), %rdi
leaq 0x7324(%rip), %rsi      # 0x85c8
callq 0x1060
movl 0x8(%r14), %ecx
addl %ecx, %r15d
movl 0xc(%r14), %eax
imull %ecx, %eax
cmpl %eax, %r15d
jl 0x12c4
jmp 0x14b2
xorl %r15d, %r15d
movq (%r14), %rdx
leal (%rcx,%r15), %esi
imull 0xc(%r14), %ecx
xorl %eax, %eax
cmpl %ecx, %esi
jge 0x12de
movslq %esi, %rax
movl (%rdx,%rax,4), %eax
bswapl %eax
movslq %r15d, %rcx
movl (%rdx,%rcx,4), %ecx
bswapl %ecx
movl %eax, %edx
orb %cl, %dl
movq %r12, %rsi
jns 0x14a0
movl %eax, %edx
shrl $0x18, %edx
movl %eax, %esi
shrl $0x10, %esi
andl %ebp, %esi
movl %eax, %edi
shrl $0x8, %edi
andl %ebp, %edi
movl %edx, %r13d
movl %esi, %r8d
movl %edi, %r12d
testb %cl, %cl
js 0x1371
movq 0x8(%rsp), %rdi
leaq 0x72b5(%rip), %rsi      # 0x85d4
movq %r8, %rbx
callq 0x1060
movq %rax, %rdi
movq %r13, %rsi
callq 0x1030
movq %rax, %rdi
leaq 0x72a2(%rip), %r13      # 0x85de
movq %r13, %rsi
callq 0x1060
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1030
movq %rax, %rdi
movq %r13, %rsi
callq 0x1060
movq %rax, %rdi
movq %r12, %rsi
callq 0x1030
leaq 0x7274(%rip), %rsi      # 0x85e0
jmp 0x1499
movq 0x8(%rsp), %rbx
movl %ecx, %edx
shrl $0x18, %edx
movl %ecx, %esi
shrl $0x10, %esi
andl %ebp, %esi
shrl $0x8, %ecx
andl %ebp, %ecx
movl %edx, %ebp
movl %esi, %edx
movq %rdx, 0x10(%rsp)
movl %ecx, %ecx
movq %rcx, 0x18(%rsp)
testb %al, %al
js 0x13ec
movq %rbx, %rdi
leaq 0x722f(%rip), %rsi      # 0x85d4
callq 0x1060
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1030
movq %rax, %rdi
leaq 0x721f(%rip), %r12      # 0x85de
movq %r12, %rsi
callq 0x1060
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x1030
movq %rax, %rdi
movq %r12, %rsi
callq 0x1060
movq %rax, %rdi
movq 0x18(%rsp), %rsi
jmp 0x1488
movq %r12, 0x20(%rsp)
movq %rbx, %rdi
leaq 0x71dd(%rip), %rsi      # 0x85d8
movq %r8, %r12
callq 0x1060
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1030
movq %rax, %rdi
leaq 0x71c6(%rip), %rbp      # 0x85de
movq %rbp, %rsi
callq 0x1060
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x1030
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1060
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x1030
movq %rbx, %rdi
leaq 0x719b(%rip), %rsi      # 0x85ea
callq 0x1060
movq %rax, %rdi
movq %r13, %rsi
callq 0x1030
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1060
movq %rax, %rdi
movq %r12, %rsi
callq 0x1030
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1060
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x1030
leaq 0x7151(%rip), %rsi      # 0x85e5
movl $0xff, %ebp
leaq 0x712e(%rip), %r12      # 0x85ce
movq 0x8(%rsp), %rdi
callq 0x1060
incl %r15d
jmp 0x1285
leaq 0x7138(%rip), %rsi      # 0x85f1
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1060
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq