LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol
u8 de_get_bits_symbol(dbuf *f, i64 bps, i64 rowstart, i64 index)
{
	i64 byte_offset;
	u8 b;
	u8 x = 0;

	switch(bps) {
	case 1:
		byte_offset = rowstart + index/8;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (7 - index%8)) & 0x01;
		break;
	case 2:
		byte_offset = rowstart + index/4;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (2 * (3 - index%4))) & 0x03;
		break;
	case 4:
		byte_offset = rowstart + index/2;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (4 * (1 - index%2))) & 0x0f;
		break;
	case 8:
		byte_offset = rowstart + index;
		x = dbuf_getbyte(f, byte_offset);
	}
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x2a(%rbp)
movq -0x10(%rbp), %rax
decq %rax
movq %rax, -0x38(%rbp)
subq $0x7, %rax
ja 0x16ba55
movq -0x38(%rbp), %rax
leaq 0x69784(%rip), %rcx     # 0x1d5090
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movl -0x3c(%rbp), %eax
movl $0x7, %ecx
subq %rdx, %rcx
sarl %cl, %eax
andl $0x1, %eax
movb %al, -0x2a(%rbp)
jmp 0x16ba55
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movl -0x4c(%rbp), %eax
movl $0x3, %ecx
subq %rdx, %rcx
shlq %rcx
sarl %cl, %eax
andl $0x3, %eax
movb %al, -0x2a(%rbp)
jmp 0x16ba55
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x68(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movl -0x5c(%rbp), %eax
movl $0x1, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
sarl %cl, %eax
andl $0xf, %eax
movb %al, -0x2a(%rbp)
jmp 0x16ba55
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol_lsb
u8 de_get_bits_symbol_lsb(dbuf *f, i64 bps, i64 rowstart, i64 index)
{
	i64 byte_offset;
	u8 b;
	u8 x = 0;

	switch(bps) {
	case 1:
		byte_offset = rowstart + index/8;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (index%8)) & 0x01;
		break;
	case 2:
		byte_offset = rowstart + index/4;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (2 * (index%4))) & 0x03;
		break;
	case 4:
		byte_offset = rowstart + index/2;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (4 * (index%2))) & 0x0f;
		break;
	case 8:
		byte_offset = rowstart + index;
		x = dbuf_getbyte(f, byte_offset);
	}
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x2a(%rbp)
movq -0x10(%rbp), %rax
decq %rax
movq %rax, -0x38(%rbp)
subq $0x7, %rax
ja 0x16bbd3
movq -0x38(%rbp), %rax
leaq 0x69614(%rip), %rcx     # 0x1d50b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movl -0x3c(%rbp), %eax
movl %edx, %ecx
sarl %cl, %eax
andl $0x1, %eax
movb %al, -0x2a(%rbp)
jmp 0x16bbd3
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movl -0x4c(%rbp), %eax
shlq %rdx
movl %edx, %ecx
sarl %cl, %eax
andl $0x3, %eax
movb %al, -0x2a(%rbp)
jmp 0x16bbd3
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x68(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movl -0x5c(%rbp), %eax
shlq $0x2, %rdx
movl %edx, %ecx
sarl %cl, %eax
andl $0xf, %eax
movb %al, -0x2a(%rbp)
jmp 0x16bbd3
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x165060
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol2
u8 de_get_bits_symbol2(dbuf *f, int nbits, i64 bytepos, i64 bitpos)
{
	u8 b0, b1;
	int bits_in_first_byte;
	int bits_in_second_byte;

	bits_in_first_byte = 8-(bitpos%8);

	b0 = dbuf_getbyte(f, bytepos + bitpos/8);

	if(bits_in_first_byte<8) {
		b0 &= (0xff >> (8-bits_in_first_byte)); // Zero out insignificant bits
	}

	if(bits_in_first_byte == nbits) {
		// First byte has all the bits
		return b0;
	}
	else if(bits_in_first_byte >= nbits) {
		// First byte has all the bits
		return b0 >> (bits_in_first_byte - nbits);
	}

	bits_in_second_byte = nbits - bits_in_first_byte;
	b1 = dbuf_getbyte(f, bytepos + bitpos/8 +1);

	return (b0<<bits_in_second_byte) | (b1>>(8-bits_in_second_byte));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
movl $0x8, %eax
subq %rdx, %rax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
addq %rax, %rsi
callq 0x165060
movb %al, -0x29(%rbp)
cmpl $0x8, -0x30(%rbp)
jge 0x16bc51
movl $0x8, %ecx
subl -0x30(%rbp), %ecx
movl $0xff, %eax
sarl %cl, %eax
movl %eax, %ecx
movzbl -0x29(%rbp), %eax
andl %ecx, %eax
movb %al, -0x29(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x16bc61
movb -0x29(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x16bcc8
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x16bc7a
movzbl -0x29(%rbp), %eax
movl -0x30(%rbp), %ecx
subl -0x14(%rbp), %ecx
sarl %cl, %eax
movb %al, -0x1(%rbp)
jmp 0x16bcc8
jmp 0x16bc7c
movl -0x14(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
addq %rax, %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x2a(%rbp)
movzbl -0x29(%rbp), %eax
movl -0x34(%rbp), %ecx
shll %cl, %eax
movzbl -0x2a(%rbp), %edx
movl $0x8, %ecx
subl -0x34(%rbp), %ecx
sarl %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpack_pixels_bilevel_from_byte
void de_unpack_pixels_bilevel_from_byte(de_bitmap *img, i64 xpos, i64 ypos,
	u8 val, UI npixels, unsigned int flags)
{
	UI i;
	u8 xv;

	if(npixels>8) return;
	xv = (flags & DE_CVTF_WHITEISZERO) ? 0xff : 0x00;

	for(i=0; i<npixels; i++) {
		u8 x;

		if(flags & DE_CVTF_LSBFIRST) {
			x = (val & 0x01) ? 0xff : 0x00;
			val >>= 1;
		}
		else {
			x = (val & 0x80) ? 0xff : 0x00;
			val <<= 1;
		}

		x ^= xv;
		if(x==0x00 && (flags & DE_CVTF_ONLYWHITE)) continue;
		de_bitmap_setpixel_gray(img, xpos+(i64)i, ypos, x);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
cmpl $0x8, -0x20(%rbp)
jbe 0x16bd0c
jmp 0x16bdd1
movl -0x24(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0x29(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x16bdd1
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x16bd62
movzbl -0x19(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0x2a(%rbp)
movzbl -0x19(%rbp), %eax
sarl %eax
movb %al, -0x19(%rbp)
jmp 0x16bd85
movzbl -0x19(%rbp), %edx
andl $0x80, %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0x2a(%rbp)
movzbl -0x19(%rbp), %eax
shll %eax
movb %al, -0x19(%rbp)
movzbl -0x29(%rbp), %ecx
movzbl -0x2a(%rbp), %eax
xorl %ecx, %eax
movb %al, -0x2a(%rbp)
movzbl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jne 0x16bda8
movl -0x24(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x16bda8
jmp 0x16bdc3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x28(%rbp), %eax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
movzbl -0x2a(%rbp), %ecx
callq 0x16b1c0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x16bd29
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_pixels_bilevel
void de_convert_pixels_bilevel(dbuf *f, i64 pos1, de_bitmap *img,
	i64 xpos1, i64 ypos, i64 npixels, unsigned int flags)
{
	i64 pos = pos1;
	i64 xpos = xpos1;
	i64 npixels_remaining = npixels;
	i64 npixels_this_time;

	while(npixels_remaining>0) {
		u8 b;

		b = dbuf_getbyte_p(f, &pos);
		npixels_this_time = de_min_int(npixels_remaining, 8);
		de_unpack_pixels_bilevel_from_byte(img, xpos, ypos, b,
			(UI)npixels_this_time, flags);
		npixels_remaining -= npixels_this_time;
		xpos += 8;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jle 0x16be83
movq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x51(%rbp)
movq -0x48(%rbp), %rdi
movl $0x8, %esi
callq 0x15ccf0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rdx
movb -0x51(%rbp), %al
movq -0x50(%rbp), %rcx
movl %ecx, %r8d
movl 0x10(%rbp), %r9d
movzbl %al, %ecx
callq 0x16bce0
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
jmp 0x16be1b
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_and_write_image_bilevel
void de_convert_and_write_image_bilevel(dbuf *f, i64 fpos,
	i64 width, i64 height, i64 rowspan, unsigned int cvtflags,
	de_finfo *fi, unsigned int createflags)
{
	de_bitmap *img = NULL;
	deark *c = f->c;

	if(!de_good_image_dimensions(c, width, height)) return;

	img = de_bitmap_create(c, width, height, 1);
	de_convert_image_bilevel(f, fpos, rowspan, img, cvtflags);
	de_bitmap_write_to_file_finfo(img, fi, createflags | DE_CREATEFLAG_IS_BWIMG);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x16bfa3
jmp 0x16bff2
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x16b750
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x16bee0
movq -0x38(%rbp), %rdi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
orl $0x8, %edx
callq 0x16afa0
movq -0x38(%rbp), %rdi
callq 0x16af60
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_and_write_image_bilevel2
void de_convert_and_write_image_bilevel2(dbuf *f, i64 fpos,
	i64 width, i64 height, i64 rowspan, unsigned int cvtflags,
	de_finfo *fi, unsigned int createflags)
{
	de_bitmap *img = NULL;
	deark *c = f->c;

	if(!de_good_image_dimensions(c, width, height)) return;
	img = de_bitmap_create2(c, width, rowspan*8, height, 1);
	de_convert_image_bilevel(f, fpos, rowspan, img, cvtflags);
	de_bitmap_write_to_file_finfo(img, fi, createflags | DE_CREATEFLAG_IS_BWIMG);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x16c053
jmp 0x16c0ab
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
shlq $0x3, %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %r8d
callq 0x16b7f0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x16bee0
movq -0x38(%rbp), %rdi
movq 0x10(%rbp), %rsi
movl 0x18(%rbp), %edx
orl $0x8, %edx
callq 0x16afa0
movq -0x38(%rbp), %rdi
callq 0x16af60
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_read_palette_rgb
void de_read_palette_rgb(dbuf *f,
	i64 fpos, i64 num_entries, i64 entryspan,
	de_color *pal, i64 ncolors_in_pal,
	unsigned int flags)
{
	i64 k;

	if(num_entries > ncolors_in_pal) num_entries = ncolors_in_pal;
	for(k=0; k<num_entries; k++) {
		pal[k] = dbuf_getRGB(f, fpos + k*entryspan, flags);
		de_dbg_pal_entry(f->c, k, pal[k]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x16c0f5
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x16c15a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rax
imulq -0x20(%rbp), %rax
addq %rax, %rsi
movl 0x10(%rbp), %edx
callq 0x165ff0
movl %eax, %edx
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
callq 0x15bf00
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x16c0fd
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_image_paletted
void de_convert_image_paletted(dbuf *f, i64 fpos,
	i64 bpp, i64 rowspan, const de_color *pal,
	de_bitmap *img, unsigned int flags)
{
	i64 i, j;
	unsigned int palent;
	u8 mask;

	if(bpp!=1 && bpp!=2 && bpp!=4 && bpp!=8) return;
	if(!de_bitmap_good_dimensions(img, 0)) return;

	mask = (1U<<(UI)bpp)-1;

	for(j=0; j<img->height; j++) {
		i64 pos = fpos + j*rowspan;

		i = 0;

		while(1) {
			UI nbits_avail;
			u8 b = 0;

			b = dbuf_getbyte_p(f, &pos);
			nbits_avail = 8;

			while(nbits_avail >= (UI)bpp) {
				nbits_avail -= (UI)bpp;
				if(flags & 0x1) {
					palent = b & mask;
					b >>= (UI)bpp;
				}
				else {
					palent = (b >> nbits_avail) & mask;
				}
				de_bitmap_setpixel_rgba(img, i++, j, pal[palent]);
				if(i>=img->width) goto nextrow;
			}
		}
	nextrow:
		;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x1, -0x18(%rbp)
je 0x16c564
cmpq $0x2, -0x18(%rbp)
je 0x16c564
cmpq $0x4, -0x18(%rbp)
je 0x16c564
cmpq $0x8, -0x18(%rbp)
je 0x16c564
jmp 0x16c688
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x16a8c0
cmpl $0x0, %eax
jne 0x16c579
jmp 0x16c688
movq -0x18(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movb %al, -0x45(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16c688
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
imulq -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x38(%rbp)
movb $0x0, -0x55(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x165170
movb %al, -0x55(%rbp)
movl $0x8, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl %ecx, %eax
jb 0x16c670
movq -0x18(%rbp), %rax
movl %eax, %ecx
movl -0x54(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x54(%rbp)
movl 0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16c623
movzbl -0x55(%rbp), %eax
movzbl -0x45(%rbp), %ecx
andl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %ecx
movzbl -0x55(%rbp), %eax
sarl %cl, %eax
movb %al, -0x55(%rbp)
jmp 0x16c635
movzbl -0x55(%rbp), %eax
movl -0x54(%rbp), %ecx
sarl %cl, %eax
movzbl -0x45(%rbp), %ecx
andl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
callq 0x16b350
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x16c66b
jmp 0x16c675
jmp 0x16c5dd
jmp 0x16c5c2
jmp 0x16c677
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x16c594
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_image_rgb
void de_convert_image_rgb(dbuf *f, i64 fpos,
	i64 rowspan, i64 pixelspan, de_bitmap *img, unsigned int flags)
{
	i64 i, j;
	de_color clr;

	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			clr = dbuf_getRGB(f, fpos + j*rowspan + i*pixelspan, flags);
			de_bitmap_setpixel_rgb(img, i, j, clr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16c95c
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16c949
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
imulq -0x18(%rbp), %rax
addq %rax, %rsi
movq -0x38(%rbp), %rax
imulq -0x20(%rbp), %rax
addq %rax, %rsi
movl -0x2c(%rbp), %edx
callq 0x165ff0
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x44(%rbp), %ecx
callq 0x16b310
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x16c8ee
jmp 0x16c94b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x16c8d8
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_flip
void de_bitmap_flip(de_bitmap *img)
{
	i64 i, j;
	i64 nr;

	nr = img->height/2;

	for(j=0; j<nr; j++) {
		i64 row1, row2;

		row1 = j;
		row2 = img->height-1-j;

		for(i=0; i<img->width; i++) {
			de_color tmp1, tmp2;

			tmp1 = de_bitmap_getpixel(img, i, row1);
			tmp2 = de_bitmap_getpixel(img, i, row2);
			if(tmp1==tmp2) continue;
			de_bitmap_setpixel_rgba(img, i, row2, tmp1);
			de_bitmap_setpixel_rgba(img, i, row1, tmp2);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x16ca55
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
subq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16ca42
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16b540
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x16b540
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x16ca0c
jmp 0x16ca34
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x34(%rbp), %ecx
callq 0x16b350
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl -0x38(%rbp), %ecx
callq 0x16b350
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16c9cc
jmp 0x16ca44
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16c99a
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_mirror
void de_bitmap_mirror(de_bitmap *img)
{
	i64 i, j;
	i64 nc;

	de_bitmap_apply_padding(img);
	nc = img->width/2;

	for(j=0; j<img->height; j++) {
		for(i=0; i<nc; i++) {
			i64 col1, col2;
			de_color tmp1, tmp2;

			col1 = i;
			col2 = img->width-1-i;

			tmp1 = de_bitmap_getpixel(img, col1, j);
			tmp2 = de_bitmap_getpixel(img, col2, j);
			if(tmp1==tmp2) continue;
			de_bitmap_setpixel_rgba(img, col2, j, tmp1);
			de_bitmap_setpixel_rgba(img, col1, j, tmp2);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16cb60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16cb55
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x16cb42
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
subq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x16b540
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x16b540
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x16cb09
jmp 0x16cb31
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x34(%rbp), %ecx
callq 0x16b350
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x38(%rbp), %ecx
callq 0x16b350
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16caad
jmp 0x16cb44
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16ca93
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_transpose
void de_bitmap_transpose(de_bitmap *img)
{
	i64 i, j;
	de_bitmap *imgtmp = NULL;

	de_bitmap_apply_padding(img);

	if(img->width == img->height) {
		bitmap_transpose_square(img);
		goto done;
	}

	imgtmp = de_bitmap_clone(img);

	de_bitmap_free_pixels(img);
	img->width = imgtmp->height;
	img->unpadded_width = imgtmp->height;
	img->height = imgtmp->width;

	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			de_color tmp1;

			tmp1 = de_bitmap_getpixel(imgtmp, j, i);
			de_bitmap_setpixel_rgba(img, i, j, tmp1);
		}
	}

done:
	if(imgtmp) de_bitmap_destroy(imgtmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16cb60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x16cbcd
movq -0x8(%rbp), %rdi
callq 0x16cca0
jmp 0x16cc87
movq -0x8(%rbp), %rdi
callq 0x16cd60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16b870
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16cc85
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16cc75
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x16b540
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x16b350
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16cc31
jmp 0x16cc77
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16cc1b
jmp 0x16cc87
cmpq $0x0, -0x20(%rbp)
je 0x16cc97
movq -0x20(%rbp), %rdi
callq 0x16af60
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: bitmap_transpose_square
static void bitmap_transpose_square(de_bitmap *img)
{
	i64 i, j;

	for(j=0; j<img->height; j++) {
		for(i=0; i<j; i++) {
			de_color tmp1, tmp2;

			tmp1 = de_bitmap_getpixel(img, i, j);
			tmp2 = de_bitmap_getpixel(img, j, i);
			if(tmp1==tmp2) continue;
			de_bitmap_setpixel_rgba(img, j, i, tmp1);
			de_bitmap_setpixel_rgba(img, i, j, tmp2);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16cd53
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x16cd40
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x16b540
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x16b540
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x16cd0a
jmp 0x16cd32
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x16b350
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x20(%rbp), %ecx
callq 0x16b350
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16ccce
jmp 0x16cd42
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16ccb4
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_clone
static de_bitmap *de_bitmap_clone(de_bitmap *img1)
{
	de_bitmap *img2;
	i64 nbytes_to_copy;

	img2 = de_bitmap_clone_noalloc(img1);
	de_bitmap_alloc_pixels(img2);
	nbytes_to_copy = de_min_int(img2->bitmap_size, img1->bitmap_size);
	de_memcpy(img2->bitmap, img1->bitmap, (size_t)nbytes_to_copy);
	return img2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16d760
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x16acb0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x15ccf0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x191e0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_rect
void de_bitmap_rect(de_bitmap *img,
	i64 xpos, i64 ypos, i64 width, i64 height,
	de_color clr, unsigned int flags)
{
	i64 i, j;

	for(j=0; j<height; j++) {
		for(i=0; i<width; i++) {
			de_bitmap_setpixel_rgba(img, xpos+i, ypos+j, clr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x16ce41
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x16ce31
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq -0x40(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x16b350
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x16cdfd
jmp 0x16ce33
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x16cdeb
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_copy_rect
void de_bitmap_copy_rect(de_bitmap *srcimg, de_bitmap *dstimg,
	i64 srcxpos, i64 srcypos, i64 width, i64 height,
	i64 dstxpos, i64 dstypos, unsigned int flags)
{
	i64 i, j;
	de_color dst_clr, src_clr, clr;
	de_colorsample src_a;

	for(j=0; j<height; j++) {
		for(i=0; i<width; i++) {
			src_clr = de_bitmap_getpixel(srcimg, srcxpos+i, srcypos+j);
			if(!(flags&DE_BITMAPFLAG_MERGE)) {
				clr = src_clr;
			}
			else {
				src_a = DE_COLOR_A(src_clr);
				if(src_a>0) {
					// TODO: Support partial transparency (of both foreground and
					// background, ideally)
					clr = src_clr;
				}
				else {
					dst_clr = de_bitmap_getpixel(dstimg, dstxpos+i, dstypos+j);
					clr = dst_clr;
				}
			}
			de_bitmap_setpixel_rgba(dstimg, dstxpos+i, dstypos+j, clr);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x16cf59
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x16cf46
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq -0x40(%rbp), %rdx
callq 0x16b540
movl %eax, -0x48(%rbp)
movl 0x20(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x16ced6
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x16cf19
movl -0x48(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, -0x4d(%rbp)
movzbl -0x4d(%rbp), %eax
cmpl $0x0, %eax
jle 0x16cef5
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x16cf17
movq -0x10(%rbp), %rdi
movq 0x10(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq 0x18(%rbp), %rdx
addq -0x40(%rbp), %rdx
callq 0x16b540
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x16cf19
movq -0x10(%rbp), %rdi
movq 0x10(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq 0x18(%rbp), %rdx
addq -0x40(%rbp), %rdx
movl -0x4c(%rbp), %ecx
callq 0x16b350
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x16ce99
jmp 0x16cf48
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x16ce83
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_apply_mask
void de_bitmap_apply_mask(de_bitmap *fg, de_bitmap *mask,
	unsigned int flags)
{
	i64 i, j;
	de_color clr;
	de_colorsample a;

	for(j=0; j<fg->height && j<mask->height; j++) {
		for(i=0; i<fg->width && i<mask->width; i++) {
			clr = de_bitmap_getpixel(mask, i, j);
			a = DE_COLOR_K(clr);
			if(flags&DE_BITMAPFLAG_WHITEISTRNS)
				a = 0xff-a;
			de_bitmap_setsample(fg, i, j, 3, a);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq 0x10(%rdx), %rcx
movb %al, -0x2e(%rbp)
jge 0x16cfa0
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
setl %al
movb %al, -0x2e(%rbp)
movb -0x2e(%rbp), %al
testb $0x1, %al
jne 0x16cfac
jmp 0x16d05c
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
movb %al, -0x2f(%rbp)
jge 0x16cfd9
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
setl %al
movb %al, -0x2f(%rbp)
movb -0x2f(%rbp), %al
testb $0x1, %al
jne 0x16cfe2
jmp 0x16d049
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16b540
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, -0x2d(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16d01d
movzbl -0x2d(%rbp), %ecx
movl $0xff, %eax
subl %ecx, %eax
movb %al, -0x2d(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x3, %ecx
movzbl -0x2d(%rbp), %r8d
callq 0x16b060
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16cfb4
jmp 0x16d04b
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x16cf7b
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_remove_alpha
void de_bitmap_remove_alpha(de_bitmap *img)
{
	i64 i, j;
	i64 k;

	if(img->bytes_per_pixel!=2 && img->bytes_per_pixel!=4) return;

	// Note that the format conversion is done in-place. The extra memory used
	// by the alpha channel is not de-allocated.
	for(j=0; j<img->height; j++) {
		for(i=0; i<img->width; i++) {
			for(k=0; k<(i64)img->bytes_per_pixel-1; k++) {
				img->bitmap[(j*img->width+i)*((i64)img->bytes_per_pixel-1) + k] =
					img->bitmap[(j*img->width+i)*(img->bytes_per_pixel) + k];
			}
		}
	}

	img->bytes_per_pixel--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x24(%rax)
je 0x16d091
movq -0x8(%rbp), %rax
cmpl $0x4, 0x24(%rax)
je 0x16d091
jmp 0x16d17f
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16d172
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16d15f
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x24(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jge 0x16d14c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rdx
imulq 0x8(%rdx), %rcx
addq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq 0x24(%rdx), %rdx
imulq %rdx, %rcx
addq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rsi
imulq 0x8(%rsi), %rcx
addq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rsi
movslq 0x24(%rsi), %rsi
subq $0x1, %rsi
imulq %rsi, %rcx
addq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16d0cd
jmp 0x16d14e
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16d0b3
jmp 0x16d161
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16d099
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_optimize_alpha
void de_bitmap_optimize_alpha(de_bitmap *img, unsigned int flags)
{
	struct image_scan_opt_data optctx;

	if(img->bytes_per_pixel!=2 && img->bytes_per_pixel!=4) return;

	de_zeromem(&optctx, sizeof(struct image_scan_opt_data));
	scan_image(img, &optctx);

	if((flags&0x4) && !optctx.has_visible_pixels &&
		(optctx.has_only_invis_black_pixels || optctx.has_only_invis_white_pixels))
	{
		// No visible pixels, but the image is boring enough that it may be by
		// design, so don't remove the alpha channel.
		return;
	}

	if(optctx.has_trns && !optctx.has_visible_pixels && (flags&(0x1|0x4))) {
		if(flags&0x2) {
			de_warn(img->c, "Invisible image detected. Ignoring transparency.");
		}
	}
	else if(optctx.has_trns) {
		return;
	}

	// No meaningful transparency found.
	de_dbg3(img->c, "Removing alpha channel from image");

	de_bitmap_remove_alpha(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x24(%rax)
je 0x16d1b8
movq -0x8(%rbp), %rax
cmpl $0x4, 0x24(%rax)
je 0x16d1b8
jmp 0x16d25e
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19140
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x16d270
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x16d1fa
cmpb $0x0, -0x1e(%rbp)
jne 0x16d1fa
movzbl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jne 0x16d1f8
movzbl -0x1b(%rbp), %eax
cmpl $0x0, %eax
je 0x16d1fa
jmp 0x16d25e
movzbl -0x1f(%rbp), %eax
cmpl $0x0, %eax
je 0x16d236
cmpb $0x0, -0x1e(%rbp)
jne 0x16d236
movl -0xc(%rbp), %eax
andl $0x5, %eax
cmpl $0x0, %eax
je 0x16d236
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x16d234
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x67f65(%rip), %rsi     # 0x1d5192
movb $0x0, %al
callq 0x15bc10
jmp 0x16d240
cmpb $0x0, -0x1f(%rbp)
je 0x16d23e
jmp 0x16d25e
jmp 0x16d240
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x67f75(%rip), %rsi     # 0x1d51c3
movb $0x0, %al
callq 0x15b400
movq -0x8(%rbp), %rdi
callq 0x16d070
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_make_grayscale_palette
void de_make_grayscale_palette(de_color *pal, i64 num_entries, unsigned int flags)
{
	i64 k;
	u8 b;

	for(k=0; k<num_entries; k++) {
		b = (u8)(0.5+ (double)k * (255.0 / (double)(num_entries-1)));
		if(flags&0x1) b = 255-b;
		pal[k] = DE_MAKE_GRAY(b);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jge 0x16d62b
cvtsi2sdq -0x20(%rbp), %xmm0
movq -0x10(%rbp), %rax
decq %rax
cvtsi2sd %rax, %xmm2
movsd 0x36071(%rip), %xmm1    # 0x1a3630
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x36069(%rip), %xmm1    # 0x1a3638
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, -0x21(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16d5f3
movzbl -0x21(%rbp), %ecx
movl $0xff, %eax
subl %ecx, %eax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %edx
shll $0x10, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movzbl -0x21(%rbp), %eax
shll $0x8, %eax
orl %eax, %edx
movzbl -0x21(%rbp), %eax
orl %eax, %edx
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16d597
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpremultiply_alpha_samp
de_colorsample de_unpremultiply_alpha_samp(de_colorsample cval, de_colorsample a)
{
	if(a==0xff) {
		return cval;
	}
	if(a==0 || cval==0) {
		return 0;
	}
	if(cval>=a) {
		return 0xff;
	}
	return (de_colorsample)(0.5 + (double)cval / ((double)a/255.0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movb %dil, %cl
movb %cl, -0x2(%rbp)
movb %al, -0x3(%rbp)
movzbl -0x3(%rbp), %eax
cmpl $0xff, %eax
jne 0x16d653
movb -0x2(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x16d6b0
movzbl -0x3(%rbp), %eax
cmpl $0x0, %eax
je 0x16d665
movzbl -0x2(%rbp), %eax
cmpl $0x0, %eax
jne 0x16d66b
movb $0x0, -0x1(%rbp)
jmp 0x16d6b0
movzbl -0x2(%rbp), %eax
movzbl -0x3(%rbp), %ecx
cmpl %ecx, %eax
jl 0x16d67d
movb $-0x1, -0x1(%rbp)
jmp 0x16d6b0
movzbl -0x2(%rbp), %eax
cvtsi2sd %eax, %xmm0
movzbl -0x3(%rbp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x35f9b(%rip), %xmm2    # 0x1a3630
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x35f93(%rip), %xmm1    # 0x1a3638
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpremultiply_alpha_clr
de_color de_unpremultiply_alpha_clr(de_color clr)
{
	de_colorsample r, g, b, a;

	r = DE_COLOR_R(clr);
	g = DE_COLOR_G(clr);
	b = DE_COLOR_B(clr);
	a = DE_COLOR_A(clr);
	r = de_unpremultiply_alpha_samp(r, a);
	g = de_unpremultiply_alpha_samp(g, a);
	b = de_unpremultiply_alpha_samp(b, a);
	return DE_MAKE_RGBA(r, g, b, a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, -0x5(%rbp)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, -0x6(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
movb %al, -0x7(%rbp)
movl -0x4(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, -0x8(%rbp)
movb -0x5(%rbp), %al
movzbl %al, %edi
movzbl -0x8(%rbp), %esi
callq 0x16d630
movb %al, -0x5(%rbp)
movb -0x6(%rbp), %al
movzbl %al, %edi
movzbl -0x8(%rbp), %esi
callq 0x16d630
movb %al, -0x6(%rbp)
movb -0x7(%rbp), %al
movzbl %al, %edi
movzbl -0x8(%rbp), %esi
callq 0x16d630
movb %al, -0x7(%rbp)
movzbl -0x8(%rbp), %eax
shll $0x18, %eax
movzbl -0x5(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movzbl -0x6(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x7(%rbp), %ecx
orl %ecx, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_clone_noalloc
static de_bitmap *de_bitmap_clone_noalloc(de_bitmap *img1)
{
	de_bitmap *img2;

	img2 = de_bitmap_create_noinit(img1->c);
	de_memcpy(img2, img1, sizeof(de_bitmap));
	img2->bitmap = NULL;
	img2->bitmap_size = 0;
	return img2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x16b7b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x191e0
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-char.c
// Function: de_free_charctx_screens
void de_free_charctx_screens(deark *c, struct de_char_context *charctx)
{
	i64 pgnum;
	i64 j;

	if(!charctx || !charctx->screens) return;

	for(pgnum=0; pgnum<charctx->nscreens; pgnum++) {
		if(charctx->screens[pgnum]) {
			if(charctx->screens[pgnum]->cell_rows) {
				for(j=0; j<charctx->screens[pgnum]->height; j++) {
					de_free(c, charctx->screens[pgnum]->cell_rows[j]);
				}
				de_free(c, charctx->screens[pgnum]->cell_rows);
			}
			de_free(c, charctx->screens[pgnum]);
		}
	}
	de_free(c, charctx->screens);
	charctx->screens = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x16d802
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x16d807
jmp 0x16d90a
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16d8ed
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x16d8da
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x16d8c1
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16d8a4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x15b820
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16d857
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x15b820
jmp 0x16d8dc
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16d80f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-char.c
// Function: de_destroy_charctx
void de_destroy_charctx(deark *c, struct de_char_context *charctx)
{
	if(!charctx) return;

	if(charctx->screens) {
		de_internal_err_fatal(c, "charctx");
	}
	de_free(c, charctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x16d929
jmp 0x16d953
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x16d946
movq -0x8(%rbp), %rdi
leaq 0x678b1(%rip), %rsi     # 0x1d51f0
movb $0x0, %al
callq 0x15c2a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-char.c
// Function: de_char_decide_output_format
void de_char_decide_output_format(deark *c, struct de_char_context *charctx)
{
	const char *s;

	if(charctx->outfmt_known) return;
	charctx->outfmt_known = 1;

	if(charctx->prefer_image_output)
		charctx->outfmt = 1;

	s = de_get_ext_option(c, "char:output");
	if(s) {
		if(!de_strcmp(s, "html")) {
			charctx->outfmt = 0;
		}
		else if(!de_strcmp(s, "image")) {
			charctx->outfmt = 1;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5(%rax)
je 0x16d9bc
jmp 0x16da39
movq -0x10(%rbp), %rax
movb $0x1, 0x5(%rax)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16d9d8
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rdi
leaq 0x67815(%rip), %rsi     # 0x1d51f8
callq 0x15cb30
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x16da39
movq -0x18(%rbp), %rdi
leaq 0x5e707(%rip), %rsi     # 0x1cc105
callq 0x191a0
cmpl $0x0, %eax
jne 0x16da15
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x16da37
movq -0x18(%rbp), %rdi
leaq 0x42a44(%rip), %rsi     # 0x1b0464
callq 0x191a0
cmpl $0x0, %eax
jne 0x16da35
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0x16da37
jmp 0x16da39
addq $0x20, %rsp
popq %rbp
retq
nop