// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_img.c
// Function: selftest
static void selftest( void )
{
    BLM_INIT();
    bcore_img_u2_s* i1 = BLM_CREATE( bcore_img_u2_s );
    bcore_img_u2_s* i2 = BLM_CREATE( bcore_img_u2_s );
    sz_t rows = 128;
    sz_t cols = 256;
    bcore_img_u2_s_set_size( i1, rows, cols );
    for( sz_t i = 0; i < rows; i++ )
    {
        for( sz_t j = 0; j < cols; j++ )
        {
            bcore_img_u2_s_set_rgb( i1, i, j, ( i & 32 ) ? 255 : 0, ( j & 32 ) ? 255 : 0, ( ( j + i ) & 32 ) ? 255 : 0 );
        }
    }

    bcore_sink_buffer_s* sink = BLM_CREATE( bcore_sink_buffer_s );
    bcore_img_u2_s_pnm_to_sink( i1, ( bcore_sink* )sink );

    bcore_source_buffer_s* source = BLM_A_PUSH( bcore_source_buffer_s_create_from_data( sink->data, sink->size ) );
    bcore_img_u2_s_pnm_from_source( i2, ( bcore_source* )source );
    ASSERT( bcore_compare_aware( i1, i2 ) == 0 );

    BLM_DOWN();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x83e4e(%rip), %rax     # 0x1b2330
movq (%rax), %rax
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xbfe80
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0x12dca0
movq -0x90(%rbp), %rdi
movq %rax, %rdx
movabsq $0x7e104f76f874d1b6, %rsi # imm = 0x7E104F76F874D1B6
callq 0xc00e0
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x12dca0
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movabsq $0x7e104f76f874d1b6, %rsi # imm = 0x7E104F76F874D1B6
callq 0xc00e0
movq %rax, -0x50(%rbp)
movq $0x80, -0x58(%rbp)
movq $0x100, -0x60(%rbp)     # imm = 0x100
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x12ddf0
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x12e638
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0x12e625
movq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %r8
andq $0x20, %r8
xorl %eax, %eax
movl $0xff, %ecx
cmpq $0x0, %r8
cmovnel %ecx, %eax
movb %al, %cl
movq -0x70(%rbp), %r9
andq $0x20, %r9
xorl %eax, %eax
movl $0xff, %r8d
cmpq $0x0, %r9
cmovnel %r8d, %eax
movb %al, %r8b
movq -0x70(%rbp), %r10
addq -0x68(%rbp), %r10
andq $0x20, %r10
xorl %eax, %eax
movl $0xff, %r9d
cmpq $0x0, %r10
cmovnel %r9d, %eax
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x12e320
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x12e59f
jmp 0x12e627
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12e589
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movb $0x0, %al
callq 0xc8dc0
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
movabsq $-0x741f65139500cd47, %rsi # imm = 0x8BE09AEC6AFF32B9
callq 0xc00e0
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x12dec0
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xcb960
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0xc0460
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x12e0a0
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xe0090
cmpl $0x0, %eax
je 0x12e6ef
leaq 0x52d2(%rip), %rdi      # 0x13399f
leaq 0x2b18d(%rip), %rsi     # 0x159861
leaq 0x27a02(%rip), %rdx     # 0x1560dd
leaq 0x2b1a2(%rip), %rcx     # 0x159884
movl $0xa1, %r8d
movb $0x0, %al
callq 0x9cea0
leaq -0x40(%rbp), %rdi
callq 0xc06e0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)