// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
xorl %ebp, %ebp
movl $0xff, %edi
movq %r15, 0x8(%rsp)
movl $0x0, %r13d
testl %ebp, %ebp
je 0x129f
movl %ebp, %eax
cltd
idivl 0x8(%r14)
testl %edx, %edx
je 0x1270
movl %ebp, %r13d
jmp 0x129f
movl $0x5, %edx
movq %r15, %rdi
leaq 0x7349(%rip), %rsi      # 0x85c8
callq 0x1060
movl $0xff, %edi
movl 0x8(%r14), %eax
addl %eax, %ebp
imull 0xc(%r14), %eax
movl %ebp, %r13d
cmpl %eax, %ebp
jge 0x1514
movq (%r14), %rcx
movl 0x8(%r14), %esi
leal (%rsi,%r13), %edx
imull 0xc(%r14), %esi
xorl %eax, %eax
cmpl %esi, %edx
jge 0x12bd
movslq %edx, %rax
movl (%rcx,%rax,4), %eax
bswapl %eax
movslq %r13d, %rdx
movl (%rcx,%rdx,4), %ecx
bswapl %ecx
movl %eax, %edx
orb %cl, %dl
js 0x12df
movl $0x5, %edx
movq %r15, %rdi
leaq 0x72f4(%rip), %rsi      # 0x85ce
jmp 0x14ff
movl %eax, %ebx
shrl $0x18, %ebx
movl %eax, %r12d
shrl $0x10, %r12d
andl %edi, %r12d
movl %eax, %ebp
shrl $0x8, %ebp
andl %edi, %ebp
testb %cl, %cl
js 0x1372
movl $0xb, %edx
movq %r15, %rdi
leaq 0x72cc(%rip), %rsi      # 0x85d4
callq 0x1060
movl %ebx, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x72b5(%rip), %rbx      # 0x85de
movq %rbx, %rsi
callq 0x1060
movl %r12d, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movl %ebp, %esi
movq %r15, %rdi
movq 0x8(%rsp), %r15
callq 0x1030
movl $0x4, %edx
movq %r15, %rdi
leaq 0x7273(%rip), %rsi      # 0x85e0
jmp 0x14ff
movl %ecx, %edx
shrl $0x18, %edx
movl %ecx, %esi
shrl $0x10, %esi
andl %edi, %esi
shrl $0x8, %ecx
andl %edi, %ecx
movl %edx, %r15d
movl %esi, %edx
movq %rdx, 0x10(%rsp)
movl %ecx, %ecx
movq %rcx, 0x18(%rsp)
testb %al, %al
js 0x1413
movl $0xb, %edx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x7228(%rip), %rsi      # 0x85d4
callq 0x1060
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7210(%rip), %r12      # 0x85de
movq %r12, %rsi
callq 0x1060
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1060
movq %r15, %rdi
movq %rbx, %r15
movq 0x18(%rsp), %rsi
callq 0x1030
movl $0x4, %edx
movq %rbx, %rdi
jmp 0x14f8
movl $0x7, %edx
movq 0x8(%rsp), %rdi
movq %r15, 0x20(%rsp)
movq %rdi, %r15
leaq 0x71ac(%rip), %rsi      # 0x85d8
callq 0x1060
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x718e(%rip), %rsi      # 0x85de
callq 0x1060
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x716a(%rip), %rsi      # 0x85de
callq 0x1060
movq %r15, %rdi
movq 0x18(%rsp), %rsi
callq 0x1030
movl $0x6, %edx
movq 0x8(%rsp), %r15
movq %r15, %rdi
leaq 0x7150(%rip), %rsi      # 0x85ea
callq 0x1060
movl %ebx, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7123(%rip), %rbx      # 0x85de
movq %rbx, %rsi
callq 0x1060
movl %r12d, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movl %ebp, %esi
movq %r15, %rdi
movq 0x8(%rsp), %r15
callq 0x1030
movl $0x4, %edx
movq %r15, %rdi
leaq 0x70e6(%rip), %rsi      # 0x85e5
callq 0x1060
incl %r13d
movl %r13d, %ebp
movl $0xff, %edi
jmp 0x1256
leaq 0x70d6(%rip), %rsi      # 0x85f1
movl $0x4, %edx
movq %r15, %rdi
callq 0x1060
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq