LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: search_cbfn
static int search_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct search_ctx *sctx = (struct search_ctx*)brctx->userdata;
	i64 i;
	i64 num_starting_positions_to_check;

	if(buf_len < sctx->needle_len) return 0;
	num_starting_positions_to_check = buf_len + 1 - sctx->needle_len;

	for(i=0; i<num_starting_positions_to_check; i++) {
		if(sctx->needle[0]==buf[i] &&
			!de_memcmp(sctx->needle, &buf[i], (size_t)sctx->needle_len))
		{
			sctx->foundpos_rel = brctx->offset+i;
			sctx->foundflag = 1;
			return 0;
		}
	}

	if(brctx->eof_flag) return 0;
	brctx->bytes_consumed = num_starting_positions_to_check;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rcx
movq 0x8(%rcx), %r13
xorl %eax, %eax
cmpq %rdx, %r13
jg 0xf1bfb
movq %rdx, %r15
movq %rcx, (%rsp)
movq %rdi, 0x8(%rsp)
movq %rdx, %rax
subq %r13, %rax
incq %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jle 0xf1bbe
movq %rsi, %r12
movq (%rsp), %rax
movq (%rax), %rbp
movb (%rbp), %r14b
notq %r15
addq %r13, %r15
xorl %ebx, %ebx
cmpb (%r12), %r14b
jne 0xf1bb3
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x18230
testl %eax, %eax
je 0xf1bde
decq %rbx
incq %r12
cmpq %rbx, %r15
jne 0xf1b9b
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x20(%rcx)
movl $0x0, %eax
jne 0xf1bfb
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rcx)
movl $0x1, %eax
jmp 0xf1bfb
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
subq %rbx, %rax
movq (%rsp), %rcx
movq %rax, 0x18(%rcx)
movl $0x1, 0x10(%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_get_utf16_NULterm_len
int dbuf_get_utf16_NULterm_len(dbuf *f, i64 pos1, i64 bytes_avail,
	i64 *bytes_consumed)
{
	i64 x;
	i64 pos = pos1;

	*bytes_consumed = bytes_avail;
	while(1) {
		if(pos1+bytes_avail-pos < 2) {
			break;
		}
		x = dbuf_getu16le(f, pos);
		pos += 2;
		if(x==0) {
			*bytes_consumed = pos - pos1;
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq %rdx, (%rcx)
leaq 0x6(%rsp), %rbp
xorl %ebx, %ebx
cmpq $0x2, %r15
jl 0xf1c61
leaq (%r12,%rbx), %rdx
movl $0x2, %ecx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xeeee8
movzwl 0x6(%rsp), %eax
addq $-0x2, %r15
addq $0x2, %rbx
testq %rax, %rax
jne 0xf1c2b
movq %rbx, (%r14)
movl $0x1, %eax
jmp 0xf1c63
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_find_line
int dbuf_find_line(dbuf *f, i64 pos1, i64 *pcontent_len, i64 *ptotal_len)
{
	u8 b0, b1;
	i64 pos;
	i64 eol_pos = 0;
	i64 eol_size = 0;

	*pcontent_len = 0;
	*ptotal_len = 0;
	if(pos1<0 || pos1>=f->len) {
		return 0;
	}

	pos = pos1;

	while(1) {
		if(pos>=f->len) {
			// No EOL.
			eol_pos = pos;
			eol_size = 0;
			break;
		}

		b0 = dbuf_getbyte(f, pos);

		if(b0==0x0d) {
			eol_pos = pos;
			// Look ahead at the next byte.
			b1 = dbuf_getbyte(f, pos+1);
			if(b1==0x0a) {
				// CR+LF
				eol_size = 2;
				break;
			}
			// LF
			eol_pos = pos;
			eol_size = 1;
			break;
		}
		else if(b0==0x0a) {
			eol_pos = pos;
			eol_size = 1;
			break;
		}

		pos++;
	}

	*pcontent_len = eol_pos - pos1;
	*ptotal_len = *pcontent_len + eol_size;

	return (*ptotal_len > 0);
}

// Assembly:
xorl %eax, %eax
movq %rax, (%rdx)
movq %rax, (%rcx)
testq %rsi, %rsi
js 0xf1d12
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r13
cmpq %rsi, 0x18(%rdi)
jle 0xf1d04
movq %rcx, %rbx
movq %rdx, %r14
cmpq %r15, 0x18(%r13)
jle 0xf1ccd
xorl %ebp, %ebp
movq %r15, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0xef0d5
cmpb $0xa, %al
je 0xf1cee
movzbl %al, %eax
cmpl $0xd, %eax
je 0xf1cd4
incq %r12
cmpq 0x18(%r13), %r12
jl 0xf1cab
jmp 0xf1cf3
xorl %ebp, %ebp
movq %r15, %r12
jmp 0xf1cf3
leaq 0x1(%r12), %rsi
movq %r13, %rdi
callq 0xef0d5
xorl %ebp, %ebp
cmpb $0xa, %al
sete %bpl
incq %rbp
jmp 0xf1cf3
movl $0x1, %ebp
subq %r15, %r12
movq %r12, (%r14)
xorl %eax, %eax
addq %rbp, %r12
movq %r12, (%rbx)
setg %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_dump_to_file
int dbuf_dump_to_file(dbuf *inf, const char *fn)
{
	dbuf *outf;
	deark *c = inf->c;

	outf = dbuf_create_unmanaged_file(c, fn, DE_OVERWRITEMODE_STANDARD, 0);
	dbuf_copy(inf, 0, inf->len, outf);
	dbuf_close(outf);
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
xorl %ecx, %ecx
callq 0xf0d34
movq %rax, %r14
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xefabc
movq %r14, %rdi
callq 0xf0b13
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_read_fourcc
void dbuf_read_fourcc(dbuf *f, i64 pos, struct de_fourcc *fcc,
	int nbytes, unsigned int flags)
{
	if(nbytes<1 || nbytes>4) return;

	de_zeromem(fcc->bytes, 4);
	dbuf_read(f, fcc->bytes, pos, (i64)nbytes);
	if(flags&DE_4CCFLAG_REVERSED) {
		reverse_fourcc(fcc->bytes, nbytes);
	}

	fcc->id = (u32)de_getu32be_direct(fcc->bytes);
	if(nbytes<4) {
		fcc->id >>= (4-(unsigned int)nbytes)*8;
	}

	de_bytes_to_printable_sz(fcc->bytes, (i64)nbytes,
		fcc->id_sanitized_sz, sizeof(fcc->id_sanitized_sz),
		0, DE_ENCODING_ASCII);
	de_bytes_to_printable_sz(fcc->bytes, (i64)nbytes,
		fcc->id_dbgstr, sizeof(fcc->id_dbgstr),
		DE_CONVFLAG_ALLOW_HL, DE_ENCODING_ASCII);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
leal -0x5(%r15), %eax
cmpl $-0x4, %eax
jae 0xf1d92
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, %rdx
movl $0x0, (%rbx)
movl %r15d, %r14d
movq %rbx, %rsi
movq %r14, %rcx
callq 0xeeee8
testb $0x1, %bpl
je 0xf1de2
cmpl $0x2, %r15d
jb 0xf1de2
movl %r14d, %eax
shrl %eax
leaq (%r14,%rbx), %rcx
decq %rcx
xorl %edx, %edx
movb (%rbx,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%rbx,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0xf1dc9
movl (%rbx), %eax
bswapl %eax
leal (,%r15,8), %ecx
movb $0x20, %dl
subb %cl, %dl
xorl %esi, %esi
cmpl $0x4, %r15d
movzbl %dl, %ecx
cmovgel %esi, %ecx
shrl %cl, %eax
movl %eax, 0x4(%rbx)
leaq 0x8(%rbx), %rdx
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xed004
leaq 0x10(%rbx), %rdx
movl $0x20, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %r8d
movl $0x1, %r9d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xed004
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: buffered_read_from_mem
static int buffered_read_from_mem(struct de_bufferedreadctx *brctx,
	dbuf *f, const u8 *mem, i64 pos1, i64 len, de_buffered_read_cbfn cbfn)
{
	int retval = 0;
	i64 total_nbytes_consumed = 0;

	while(1) {
		int ret;
		i64 nbytes_to_send;

		nbytes_to_send = len - total_nbytes_consumed;
		if(nbytes_to_send<1) break;
		brctx->bytes_consumed = nbytes_to_send;
		brctx->offset = total_nbytes_consumed;
		brctx->eof_flag = 1;

		ret = cbfn(brctx, &mem[pos1+total_nbytes_consumed],
			nbytes_to_send);
		if(!ret) goto done;
		if(brctx->bytes_consumed<1 || brctx->bytes_consumed>nbytes_to_send) {
			goto done;
		}
		total_nbytes_consumed += brctx->bytes_consumed;
	}
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
addq %rdx, %r15
xorl %ebp, %ebp
movq %r14, %r13
subq %rbp, %r13
jle 0xf1eb0
movq %r13, 0x18(%r12)
movq %rbp, 0x10(%r12)
movb $0x1, 0x20(%r12)
leaq (%r15,%rbp), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq *%rbx
testl %eax, %eax
je 0xf1eb7
movq 0x18(%r12), %rax
testq %rax, %rax
setle %dl
cmpq %r13, %rax
setg %cl
orb %dl, %cl
je 0xf1ea5
xorl %eax, %eax
addq %rax, %rbp
movzbl %cl, %eax
shll $0x2, %eax
jmp 0xf1ebc
movl $0x3, %eax
jmp 0xf1ebc
movl $0x4, %eax
testl %eax, %eax
je 0xf1e66
cmpl $0x3, %eax
jne 0xf1ecc
movl $0x1, %eax
jmp 0xf1ece
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: text2utf8_cbfn
static int text2utf8_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct textconvctx_struct *tcctx = (struct textconvctx_struct*)brctx->userdata;
	UI conv_flags;

	// There's no limit to how much data dbuf_buffered_read() could send us
	// at once, so we won't try to put it all in a ucstring at once.
	brctx->bytes_consumed = de_min_int(buf_len, 4096);

	// For best results, ucstring_append_bytes_ex() needs to be told whether there will
	// be any more bytes after this.
	if(brctx->eof_flag && brctx->bytes_consumed==buf_len)
		conv_flags = 0;
	else
		conv_flags = DE_CONVFLAG_PARTIAL_DATA;

	ucstring_empty(tcctx->tmpstr);
	ucstring_append_bytes_ex(tcctx->tmpstr, buf, brctx->bytes_consumed, conv_flags,
		&tcctx->es);
	ucstring_write_as_utf8(brctx->c, tcctx->tmpstr, tcctx->outf, 0);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
movl $0x1000, %esi           # imm = 0x1000
movq %rdx, %rdi
callq 0xea792
movq %rax, 0x18(%rbx)
cmpb $0x0, 0x20(%rbx)
sete %cl
cmpq %r14, %rax
setne %al
orb %cl, %al
movzbl %al, %ebp
shll $0x6, %ebp
movq 0x8(%r12), %rdi
callq 0xf6883
movq 0x8(%r12), %rdi
movq 0x18(%rbx), %rdx
leaq 0x10(%r12), %r8
movq %r15, %rsi
movl %ebp, %ecx
callq 0xf6c10
movq 0x8(%rbx), %rdi
movq (%r12), %rdx
movq 0x8(%r12), %rsi
xorl %ecx, %ecx
callq 0xf71f7
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_add_bits
void de_bitbuf_lowlevel_add_bits(struct de_bitbuf_lowlevel *bbll, u64 n, UI nbits)
{
	if(bbll->nbits_in_bitbuf+nbits>64) return;
	if(bbll->is_lsb==0) {
		bbll->bit_buf = (bbll->bit_buf<<nbits) | n;
	}
	else {
		bbll->bit_buf |= (u64)n << bbll->nbits_in_bitbuf;
	}
	bbll->nbits_in_bitbuf += nbits;
}

// Assembly:
movl 0x4(%rdi), %ecx
leal (%rcx,%rdx), %eax
cmpl $0x40, %eax
ja 0xf21e8
cmpb $0x0, (%rdi)
je 0xf21d5
shlq %cl, %rsi
orq %rsi, 0x8(%rdi)
jmp 0xf21e5
movq 0x8(%rdi), %r8
movl %edx, %ecx
shlq %cl, %r8
orq %rsi, %r8
movq %r8, 0x8(%rdi)
movl %eax, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_add_byte
void de_bitbuf_lowlevel_add_byte(struct de_bitbuf_lowlevel *bbll, u8 n)
{
	if(bbll->nbits_in_bitbuf>56) return;
	if(bbll->is_lsb==0) {
		bbll->bit_buf = (bbll->bit_buf<<8) | n;
	}
	else {
		bbll->bit_buf |= (u64)n << bbll->nbits_in_bitbuf;
	}
	bbll->nbits_in_bitbuf += 8;
}

// Assembly:
movl 0x4(%rdi), %ecx
cmpq $0x38, %rcx
ja 0xf221d
cmpb $0x0, (%rdi)
je 0xf2204
movzbl %sil, %eax
shlq %cl, %rax
orq %rax, 0x8(%rdi)
jmp 0xf2217
movq 0x8(%rdi), %rax
shlq $0x8, %rax
movzbl %sil, %edx
orq %rax, %rdx
movq %rdx, 0x8(%rdi)
addl $0x8, %ecx
movl %ecx, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_get_bits
u64 de_bitbuf_lowlevel_get_bits(struct de_bitbuf_lowlevel *bbll, UI nbits)
{
	u64 n;
	u64 mask;

	if(nbits > bbll->nbits_in_bitbuf) return 0;
	mask = ((u64)1 << nbits)-1;
	if(bbll->is_lsb==0) {
		bbll->nbits_in_bitbuf -= nbits;
		n = (bbll->bit_buf >> bbll->nbits_in_bitbuf) & mask;
	}
	else {
		n = bbll->bit_buf & mask;
		bbll->bit_buf >>= nbits;
		bbll->nbits_in_bitbuf -= nbits;
	}
	return n;
}

// Assembly:
movl 0x4(%rdi), %edx
subl %esi, %edx
jae 0xf2228
xorl %eax, %eax
retq
movq $-0x1, %r8
movl %esi, %ecx
shlq %cl, %r8
notq %r8
cmpb $0x0, (%rdi)
je 0xf2251
movl %esi, %ecx
movq 0x8(%rdi), %rax
movq %rax, %rsi
shrq %cl, %rsi
movq %rsi, 0x8(%rdi)
movl %edx, 0x4(%rdi)
jmp 0xf225d
movl %edx, 0x4(%rdi)
movq 0x8(%rdi), %rax
movl %edx, %ecx
shrq %cl, %rax
andq %r8, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitreader_getbits
u64 de_bitreader_getbits(struct de_bitreader *bitrd, UI nbits)
{
	if(bitrd->eof_flag) return 0;
	if(nbits==0) {
		// TODO: Decide if we always want to do this. Could risk infinite loops
		// with this successful no-op.
		return 0;
	}
	if(nbits > 57) {
		bitrd->eof_flag = 1;
		return 0;
	}

	while(bitrd->bbll.nbits_in_bitbuf < nbits) {
		u8 b;

		if(bitrd->curpos >= bitrd->endpos) {
			bitrd->eof_flag = 1;
			return 0;
		}
		b = dbuf_getbyte_p(bitrd->f, &bitrd->curpos);
		de_bitbuf_lowlevel_add_byte(&bitrd->bbll, b);
	}

	return de_bitbuf_lowlevel_get_bits(&bitrd->bbll, nbits);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testl %esi, %esi
je 0xf22d2
movq %rdi, %r14
cmpb $0x0, 0x18(%rdi)
jne 0xf22d2
movl %esi, %ebx
cmpl $0x39, %esi
jbe 0xf2295
movb $0x1, 0x18(%r14)
jmp 0xf22d2
leaq 0x20(%r14), %r15
cmpl %ebx, 0x24(%r14)
jae 0xf22de
movq 0x8(%r14), %r12
movq 0x10(%r14), %r13
cmpq %r13, %r12
jge 0xf22c8
movq (%r14), %rdi
movq %r12, %rsi
callq 0xef0d5
incq 0x8(%r14)
movzbl %al, %esi
movq %r15, %rdi
callq 0xf21e9
jmp 0xf22cd
movb $0x1, 0x18(%r14)
cmpq %r13, %r12
jl 0xf2299
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
movl %ebx, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf221e
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_describe_curpos
char *de_bitbuf_describe_curpos(struct de_bitbuf_lowlevel *bbll, i64 pos1,
	 char *buf, size_t buf_len)
{
	i64 curpos;
	UI nwholebytes;
	UI nbits;

	nwholebytes = (i64)(bbll->nbits_in_bitbuf / 8);
	nbits = bbll->nbits_in_bitbuf % 8;
	curpos = pos1 - (i64)nwholebytes;

	if(nbits==0) {
		de_snprintf(buf, buf_len, "%"I64_FMT, curpos);
	}
	else {
		de_snprintf(buf, buf_len, "%"I64_FMT"+%ubits", curpos-1, (UI)(8-nbits));
	}
	return buf;
}

// Assembly:
pushq %rbx
movq %rcx, %rax
movq %rdx, %rbx
movq %rsi, %rcx
movl 0x4(%rdi), %edx
movl %edx, %esi
shrl $0x3, %esi
subq %rsi, %rcx
andl $0x7, %edx
je 0xf2347
decq %rcx
movl $0x8, %r8d
subl %edx, %r8d
leaq 0x56b9b(%rip), %rdx     # 0x148ed3
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xe8d67
jmp 0xf235b
leaq 0x37263(%rip), %rdx     # 0x1295b1
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xe8d67
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: slice_is_ascii_cbfn
static int slice_is_ascii_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct textconvctx_struct *tcctx = (struct textconvctx_struct*)brctx->userdata;
	UI conv_flags;

	brctx->bytes_consumed = de_min_int(buf_len, 4096);

	if(brctx->eof_flag && brctx->bytes_consumed==buf_len)
		conv_flags = 0;
	else
		conv_flags = DE_CONVFLAG_PARTIAL_DATA;

	ucstring_empty(tcctx->tmpstr);
	ucstring_append_bytes_ex(tcctx->tmpstr, buf, brctx->bytes_consumed, conv_flags,
		&tcctx->es);
	if(!ucstring_is_ascii(tcctx->tmpstr)) {
		return 0;
	}
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %r12
movl $0x1000, %esi           # imm = 0x1000
movq %rdx, %rdi
callq 0xea792
movq %rax, 0x18(%r15)
cmpb $0x0, 0x20(%r15)
sete %cl
cmpq %rbx, %rax
setne %al
orb %cl, %al
movzbl %al, %ebx
shll $0x6, %ebx
movq 0x8(%r12), %rdi
callq 0xf6883
movq 0x8(%r12), %rdi
movq 0x18(%r15), %rdx
leaq 0x10(%r12), %r8
movq %r14, %rsi
movl %ebx, %ecx
callq 0xf6c10
movq 0x8(%r12), %rdi
callq 0xf7178
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_good_dimensions
int de_bitmap_good_dimensions(de_bitmap *img, UI flags)
{
	if(img->is_internal) {
		// Images for internal use, that aren't going to be written to a file,
		// should not respect the "-maxdim" setting from the user.
		//
		// Note - The is_internal flag should only be used for images with
		// a fixed size, that does not depend on width/height fields in the
		// input file.
		if(img->width<1 || img->width>MAX_INTERNAL_IMAGE_DIMENSION ||
			img->height<1 || img->height>MAX_INTERNAL_IMAGE_DIMENSION)
		{
			de_internal_err_nonfatal(img->c, "Bad temp bitmap size");
			return 0;
		}
	}
	else if(flags & 0x1) {
		if(!de_good_image_dimensions(img->c, img->width, img->height)) {
			return 0;
		}
	}
	else {
		if(!de_good_image_dimensions_noerr(img->c, img->width, img->height)) {
			return 0;
		}
	}
	return 1;
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x38(%rdi)
je 0xf24a7
movq $-0x2711, %rax          # imm = 0xD8EF
movq 0x8(%rdi), %rcx
addq %rax, %rcx
cmpq $-0x2710, %rcx          # imm = 0xD8F0
jb 0xf2492
movq 0x10(%rdi), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0xf24fc
movq (%rdi), %rdi
leaq 0x56b85(%rip), %rsi     # 0x149021
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xea1a2
jmp 0xf2501
testb $0x1, %sil
jne 0xf24e5
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
testq %rcx, %rcx
setle %dl
testq %rax, %rax
setle %sil
xorl %ebx, %ebx
orb %dl, %sil
jne 0xf2501
movq (%rdi), %rdx
movq 0xa8(%rdx), %rdx
cmpq %rcx, %rdx
setl %cl
cmpq %rax, %rdx
setl %al
orb %cl, %al
je 0xf24fc
jmp 0xf2501
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
movq %rax, %rdi
callq 0xf241d
testl %eax, %eax
je 0xf2505
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
xorl %ebx, %ebx
jmp 0xf2501
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_good_image_count
int de_good_image_count(deark *c, i64 n)
{
	i64 maximages;

	maximages = DE_MAX_IMAGES_PER_FILE;
	if(c->max_output_files>DE_MAX_IMAGES_PER_FILE) {
		maximages = c->max_output_files;
	}

	if(n<0 || n>maximages) {
		de_err(c, "Bad or unsupported number of images (%d)", (int)n);
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movl 0x9c(%rdi), %ecx
cmpl $0x2711, %ecx           # imm = 0x2711
movl $0x2710, %eax           # imm = 0x2710
cmovgel %ecx, %eax
testq %rsi, %rsi
js 0xf2530
movl $0x1, %ebx
cmpq %rdx, %rax
jge 0xf2540
leaq 0x56aff(%rip), %rsi     # 0x149036
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe9df7
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_is_grayscale_palette
int de_is_grayscale_palette(const de_color *pal, i64 num_entries)
{
	i64 k;
	de_colorsample cr;

	for(k=0; k<num_entries; k++) {
		cr = DE_COLOR_R(pal[k]);
		if(cr != DE_COLOR_G(pal[k])) return 0;
		if(cr != DE_COLOR_B(pal[k])) return 0;
	}
	return 1;
}

// Assembly:
movl $0x1, %eax
testq %rsi, %rsi
jle 0xf2582
xorl %ecx, %ecx
movl $0xff, %edx
movl (%rdi,%rcx,4), %r8d
movl %r8d, %r9d
shrl $0x10, %r9d
andl %edx, %r9d
movl %r8d, %r10d
shrl $0x8, %r10d
andl %edx, %r10d
cmpl %r10d, %r9d
jne 0xf2583
andl %edx, %r8d
cmpl %r8d, %r9d
jne 0xf2583
incq %rcx
cmpq %rcx, %rsi
jne 0xf2555
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_alloc_pixels
static void de_bitmap_alloc_pixels(de_bitmap *img)
{
	if(img->bitmap) {
		de_bitmap_free_pixels(img);
	}

	if(!de_bitmap_good_dimensions(img, 0x1)) {
		// This function is not allowed to fail. If something goes wrong, create
		// a dummy image, and set invalid_image_flag.
		img->invalid_image_flag = 1;

		img->width = 1;
		img->height = 1;
	}

	img->bitmap_size = (img->width*img->bytes_per_pixel) * img->height;
	img->bitmap = de_malloc(img->c, img->bitmap_size);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0xf27e3
leaq 0x28(%rbx), %r14
movq (%rbx), %rdi
callq 0xe9752
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf2468
testl %eax, %eax
jne 0xf2808
movl $0x1, 0x20(%rbx)
movl $0x1, %eax
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movslq 0x24(%rbx), %rsi
imulq 0x8(%rbx), %rsi
imulq 0x10(%rbx), %rsi
movq %rsi, 0x30(%rbx)
movq (%rbx), %rdi
callq 0xe969b
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: get_optimized_image
static void get_optimized_image(de_bitmap *img1, struct image_scan_opt_data *optctx)
{
	int opt_bytes_per_pixel;

	scan_image(img1, optctx);

	if(!optctx->is_nonbilevel) {
		// We don't optimize this type of image here. It will be handled
		// by the PNG encoder.
		return;
	}

	opt_bytes_per_pixel = optctx->has_color ? 3 : 1;
	if(optctx->has_trns) opt_bytes_per_pixel++;

	if(opt_bytes_per_pixel>=img1->bytes_per_pixel) {
		return;
	}

	optctx->optimg = de_bitmap_clone_noalloc(img1);
	optctx->optimg->bytes_per_pixel = opt_bytes_per_pixel;
	de_bitmap_copy_rect(img1, optctx->optimg, 0, 0, img1->width, img1->height, 0, 0, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0xf3fb7
cmpb $0x0, 0x3(%r14)
je 0xf28c9
xorl %eax, %eax
cmpb $0x0, (%r14)
setne %al
xorl %ecx, %ecx
cmpb $0x0, 0x1(%r14)
setne %cl
leal (%rcx,%rax,2), %ebp
incl %ebp
cmpl 0x24(%rbx), %ebp
jge 0xf28c9
movq (%rbx), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0xe969b
movq %r15, (%rax)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm2, 0x20(%rax)
movups %xmm3, 0x30(%rax)
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rax, 0x8(%r14)
movl %ebp, 0x24(%rax)
movq 0x8(%rbx), %r8
movq 0x10(%rbx), %r9
movups %xmm0, (%rsp)
movl $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf3d2f
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_destroy
void de_bitmap_destroy(de_bitmap *b)
{
	if(b) {
		deark *c = b->c;

		de_bitmap_free_pixels(b);
		de_free(c, b);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xf2916
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0xf28fc
movq %r14, %rdi
callq 0xe9752
movq $0x0, 0x28(%rbx)
movq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_write_to_file
void de_bitmap_write_to_file(de_bitmap *img, const char *token,
	unsigned int createflags)
{
	deark *c = img->c;

	if(token && token[0]) {
		de_finfo *tmpfi = de_finfo_create(c);
		de_finfo_set_name_from_sz(c, tmpfi, token, 0, DE_ENCODING_UTF8);
		de_bitmap_write_to_file_finfo(img, tmpfi, createflags);
		de_finfo_destroy(c, tmpfi);
	}
	else {
		de_bitmap_write_to_file_finfo(img, NULL, createflags);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
testq %rsi, %rsi
je 0xf2985
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0xf2985
movq (%r14), %r12
movq %r12, %rdi
callq 0xea9a9
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0xeac7c
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movl %ebx, %ecx
callq 0xf2586
movq %r12, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xea9b3
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf2586
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setsample
void de_bitmap_setsample(de_bitmap *img, i64 x, i64 y,
	i64 samplenum, de_colorsample v)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	if(samplenum<0 || samplenum>3) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 1: // gray
		if(samplenum<3) {
			img->bitmap[pos] = v;
		}
		break;
	case 2: // gray+alpha
		if(samplenum==3) {
			img->bitmap[pos+1] = v;
		}
		else {
			img->bitmap[pos] = v;
		}
		break;
	case 3: // RGB
		if(samplenum<3) {
			img->bitmap[pos+samplenum] = v;
		}
		break;
	case 4: // RGBA
		img->bitmap[pos+samplenum] = v;
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
cmpq $0x0, 0x28(%rdi)
jne 0xf29c3
movq %r13, %rdi
callq 0xf27b5
movq 0x28(%r13), %rax
testq %rax, %rax
sete %cl
movq %r12, %rdx
orq %r15, %rdx
sets %dl
orb %cl, %dl
jne 0xf2a40
movq 0x8(%r13), %rcx
cmpq %r15, %rcx
jle 0xf2a40
cmpq $0x3, %r14
ja 0xf2a40
cmpq %r12, 0x10(%r13)
jle 0xf2a40
movslq 0x24(%r13), %rsi
leal -0x1(%rsi), %edx
cmpl $0x3, %edx
ja 0xf2a40
imulq %r12, %rcx
addq %r15, %rcx
imulq %rsi, %rcx
leaq 0x56577(%rip), %rsi     # 0x148f84
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
cmpq $0x3, %r14
je 0xf2a40
addq %rcx, %rax
jmp 0xf2a3e
cmpq $0x3, %r14
je 0xf2a40
addq %rcx, %rax
addq %r14, %rax
jmp 0xf2a3e
xorl %edx, %edx
cmpq $0x3, %r14
sete %dl
addq %rcx, %rax
addq %rdx, %rax
movb %bl, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setpixel_gray
void de_bitmap_setpixel_gray(de_bitmap *img, i64 x, i64 y, de_colorsample v)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	img->bitmap[pos] = v;
	switch(img->bytes_per_pixel) {
	case 2: // gray+alpha
		img->bitmap[pos+1] = 255;
		break;
	case 3: // RGB
		img->bitmap[pos+1] = v;
		img->bitmap[pos+2] = v;
		break;
	case 4: // RGBA
		img->bitmap[pos+1] = v;
		img->bitmap[pos+2] = v;
		img->bitmap[pos+3] = 255;
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0xf2a6b
movq %rbx, %rdi
callq 0xf27b5
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
sete %al
movq %r15, %rdx
orq %r14, %rdx
sets %dl
orb %al, %dl
jne 0xf2af2
movq 0x8(%rbx), %rax
cmpq %r14, %rax
jle 0xf2af2
cmpq %r15, 0x10(%rbx)
jle 0xf2af2
movslq 0x24(%rbx), %rdx
imulq %r15, %rax
addq %r14, %rax
imulq %rdx, %rax
movb %bpl, (%rcx,%rax)
movl 0x24(%rbx), %edx
movl $0x1, %ecx
cmpl $0x2, %edx
je 0xf2ae9
cmpl $0x3, %edx
je 0xf2ad2
cmpl $0x4, %edx
jne 0xf2af2
movq 0x28(%rbx), %rcx
movb %bpl, 0x1(%rcx,%rax)
movb $-0x1, %dl
movl $0x3, %esi
movl $0x2, %ecx
jmp 0xf2ad9
movl $0x2, %esi
movl %ebp, %edx
movq 0x28(%rbx), %rdi
addq %rax, %rdi
movb %bpl, (%rcx,%rdi)
movq %rsi, %rcx
jmp 0xf2aeb
movb $-0x1, %dl
addq 0x28(%rbx), %rax
movb %dl, (%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setpixel_rgba
void de_bitmap_setpixel_rgba(de_bitmap *img, i64 x, i64 y,
	de_color color)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 4:
		img->bitmap[pos]   = DE_COLOR_R(color);
		img->bitmap[pos+1] = DE_COLOR_G(color);
		img->bitmap[pos+2] = DE_COLOR_B(color);
		img->bitmap[pos+3] = DE_COLOR_A(color);
		break;
	case 3:
		img->bitmap[pos]   = DE_COLOR_R(color);
		img->bitmap[pos+1] = DE_COLOR_G(color);
		img->bitmap[pos+2] = DE_COLOR_B(color);
		break;
	case 2:
		img->bitmap[pos]   = DE_COLOR_G(color);
		img->bitmap[pos+1] = DE_COLOR_A(color);
		break;
	case 1:
		// TODO: We could do real grayscale conversion, but for now we
		// assume this won't happen, or that if it does the color given to
		// us is a gray shade.
		img->bitmap[pos]   = DE_COLOR_G(color);
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0xf2b24
movq %r14, %rdi
callq 0xf27b5
movq 0x28(%r14), %rcx
testq %rcx, %rcx
sete %al
movq %r12, %rdx
orq %r15, %rdx
sets %dl
orb %al, %dl
jne 0xf2bc7
movq 0x8(%r14), %rax
cmpq %r15, %rax
jle 0xf2bc7
cmpq %r12, 0x10(%r14)
jle 0xf2bc7
movslq 0x24(%r14), %rsi
leal -0x1(%rsi), %edx
cmpl $0x3, %edx
ja 0xf2bc7
imulq %r12, %rax
addq %r15, %rax
imulq %rsi, %rax
leaq 0x56428(%rip), %rsi     # 0x148f94
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movb %bh, (%rcx,%rax)
jmp 0xf2bc7
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, (%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bh, 0x1(%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bl, 0x2(%rcx,%rax)
jmp 0xf2bc7
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, (%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bh, 0x1(%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bl, 0x2(%rcx,%rax)
shrl $0x18, %ebx
movq 0x28(%r14), %rcx
movb %bl, 0x3(%rcx,%rax)
jmp 0xf2bc7
movb %bh, (%rcx,%rax)
shrl $0x18, %ebx
movq 0x28(%r14), %rcx
movb %bl, 0x1(%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_getpixel
de_color de_bitmap_getpixel(de_bitmap *img, i64 x, i64 y)
{
	i64 pos;

	if(!img) return 0;
	if(!img->bitmap) return 0;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return 0;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 4:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos+1],
			img->bitmap[pos+2], img->bitmap[pos+3]);
	case 3:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos+1],
			img->bitmap[pos+2], 0xff);
		break;
	case 2:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos],
			img->bitmap[pos], img->bitmap[pos+1]);
		break;
	case 1:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos],
			img->bitmap[pos], 0xff);
		break;
	}
	return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xf2c8b
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
sete %r8b
movq %rdx, %r9
orq %rsi, %r9
sets %r9b
orb %r8b, %r9b
jne 0xf2c8b
movq 0x8(%rdi), %r8
cmpq %rsi, %r8
jle 0xf2c8b
cmpq %rdx, 0x10(%rdi)
jle 0xf2c8b
movslq 0x24(%rdi), %r9
leal -0x1(%r9), %edi
cmpl $0x3, %edi
ja 0xf2c8b
imulq %rdx, %r8
addq %rsi, %r8
imulq %r9, %r8
leaq 0x56376(%rip), %rax     # 0x148fa4
movslq (%rax,%rdi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movzbl (%rcx,%r8), %eax
imull $0x10101, %eax, %eax    # imm = 0x10101
jmp 0xf2c5f
movzbl (%rcx,%r8), %eax
shll $0x10, %eax
movzbl 0x1(%rcx,%r8), %edx
shll $0x8, %edx
orl %eax, %edx
movzbl 0x2(%rcx,%r8), %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
movzbl 0x3(%rcx,%r8), %eax
shll $0x18, %eax
movzbl (%rcx,%r8), %edx
shll $0x10, %edx
orl %eax, %edx
movzbl 0x1(%rcx,%r8), %esi
shll $0x8, %esi
orl %edx, %esi
movzbl 0x2(%rcx,%r8), %eax
orl %esi, %eax
retq
movzbl 0x1(%rcx,%r8), %eax
shll $0x18, %eax
movzbl (%rcx,%r8), %ecx
movl %ecx, %edx
shll $0x10, %edx
orl %eax, %edx
movl %ecx, %eax
shll $0x8, %eax
orl %edx, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_create
de_bitmap *de_bitmap_create(deark *c, i64 width, i64 height, int bypp)
{
	de_bitmap *img;
	img = de_bitmap_create_noinit(c);
	img->width = width;
	img->unpadded_width = width;
	img->height = height;
	img->bytes_per_pixel = bypp;
	//img->rowspan = img->width * img->bytes_per_pixel;
	return img;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x40, %esi
callq 0xe969b
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x10(%rax)
movl %ebx, 0x24(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_create2
de_bitmap *de_bitmap_create2(deark *c, i64 npwidth, i64 pdwidth, i64 height, int bypp)
{
	de_bitmap *img;

	if(pdwidth<npwidth) pdwidth = npwidth;

	img = de_bitmap_create(c, pdwidth, height, bypp);

	if(npwidth>0 && npwidth<img->width) {
		img->unpadded_width = npwidth;
	}

	return img;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl $0x40, %esi
callq 0xe969b
testq %rbx, %rbx
setle %cl
cmpq %rbx, %r15
cmovleq %rbx, %r15
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x24(%rax)
setle %dl
orb %cl, %dl
jne 0xf2d31
movq %rbx, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
decq %rsi
cmpq $0x7, %rsi
ja 0xf2def
movq %rcx, %rbx
leaq 0x5625d(%rip), %rcx     # 0x148fb4
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
leaq 0x7(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x3, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
shll $0x3, %r14d
subl %r14d, %ebx
movb $0x7, %cl
subb %bl, %cl
movzbl %cl, %ecx
btl %ecx, %eax
setb %al
jmp 0xf2def
movq %rbx, %r14
shrq $0x3f, %r14
addq %rbx, %r14
sarq %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
addl %r14d, %r14d
subl %r14d, %ebx
shll $0x2, %ebx
movb $0x4, %cl
subb %bl, %cl
shrl %cl, %eax
andb $0xf, %al
jmp 0xf2def
leaq 0x3(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x2, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
shll $0x2, %r14d
subl %r14d, %ebx
addl %ebx, %ebx
movb $0x6, %cl
subb %bl, %cl
shrl %cl, %eax
andb $0x3, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rdx, %rbx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xef0d5
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
decq %rsi
cmpq $0x7, %rsi
ja 0xf2eb3
movq %rcx, %rbx
leaq 0x561ae(%rip), %rcx     # 0x148fd4
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
leaq 0x7(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x3, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
shll $0x3, %r14d
subl %r14d, %ebx
btl %ebx, %eax
setb %al
jmp 0xf2eb3
movq %rbx, %r14
shrq $0x3f, %r14
addq %rbx, %r14
sarq %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
addl %r14d, %r14d
subl %r14d, %ebx
shll $0x2, %ebx
movl %ebx, %ecx
shrl %cl, %eax
andb $0xf, %al
jmp 0xf2eb3
leaq 0x3(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x2, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xef0d5
movzbl %al, %eax
shll $0x2, %r14d
subl %r14d, %ebx
addl %ebx, %ebx
movl %ebx, %ecx
shrl %cl, %eax
andb $0x3, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rdx, %rbx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xef0d5
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movl %esi, %ebx
leaq 0x7(%rcx), %r14
testq %rcx, %rcx
cmovnsq %rcx, %r14
movq %rdi, %r15
movq %r14, %rax
andq $-0x8, %rax
subq %rax, %r12
movl $0x8, %r13d
subl %r12d, %r13d
sarq $0x3, %r14
addq %rdx, %r14
movq %r14, %rsi
callq 0xef0d5
movl $0xff, %ebp
movl %r12d, %ecx
shrl %cl, %ebp
movl $0xff, %ecx
testq %r12, %r12
cmovlel %ecx, %ebp
andb %al, %bpl
movl %r13d, %ecx
subl %ebx, %ecx
je 0xf2f5a
jge 0xf2f54
subl %r13d, %ebx
incq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xef0d5
movzbl %bpl, %edx
movl %ebx, %ecx
shll %cl, %edx
movzbl %al, %ebp
movb $0x8, %cl
subb %bl, %cl
shrl %cl, %ebp
orl %edx, %ebp
jmp 0xf2f5a
movzbl %bpl, %ebp
shrl %cl, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
leal -0x1(%r8), %eax
cmpl $0x7, %eax
ja 0xf2fd8
movl %r9d, %ebx
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movl %ebx, %r13d
andb $0x1, %r13b
negb %r13b
movl %r8d, %r14d
movl %ebp, %eax
testb $0x2, %bl
jne 0xf2faa
sarb $0x7, %al
addb %bpl, %bpl
jmp 0xf2fb1
andb $0x1, %al
negb %al
shrb %bpl
testb $0x4, %bl
je 0xf2fbb
cmpb %r13b, %al
je 0xf2fd0
xorb %r13b, %al
movzbl %al, %ecx
movq %r12, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
callq 0xf2a4a
incq %r15
decq %r14
jne 0xf2f9b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testq %r9, %r9
jle 0xf305a
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r15
movq %rdi, %r13
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0xef14d
movq %rbp, %r12
movl %eax, %ebp
movl $0x8, %esi
movq %rbx, %rdi
callq 0xea792
movq %rax, %r14
movzbl %bpl, %ecx
movq %r12, %rbp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %r14d, %r8d
movl 0x50(%rsp), %r9d
callq 0xf2f6b
addq $0x8, %r15
subq %r14, %rbx
jg 0xf3010
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, %r14
movq %rdx, %rbp
movq %rsi, 0x18(%rsp)
movq %rdi, %r13
movl 0x68(%rsp), %ebx
movq 0x60(%rsp), %r12
movq 0x8(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xf241d
testl %eax, %eax
je 0xf318d
movl $0x40, %esi
movq %r15, %rdi
callq 0xe969b
movq %r12, 0x10(%rsp)
movq %rax, %r12
movq %r15, (%rax)
movq %rbp, 0x8(%rax)
movq %rbp, 0x18(%rax)
movq %r14, 0x10(%rax)
movl $0x1, 0x24(%rax)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
movl 0xc(%rsp), %r8d
callq 0xf3081
orl $0x8, %ebx
movq %r12, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
movl %ebx, %ecx
callq 0xf2586
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf28d4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movl 0x68(%rsp), %ebx
movq 0x60(%rsp), %r12
movq %rdi, 0x18(%rsp)
movq 0x8(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xf241d
testl %eax, %eax
je 0xf3280
movq %r12, 0x10(%rsp)
movl %ebx, (%rsp)
movq %r13, 0x8(%rsp)
leaq (,%r13,8), %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0xe969b
testq %r14, %r14
setle %cl
cmpq %r14, %rbx
cmovleq %r14, %rbx
movq %rax, %r12
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movq %rbx, 0x18(%rax)
movq %rbp, 0x10(%rax)
movl $0x1, 0x24(%rax)
setle %al
orb %cl, %al
jne 0xf3239
movq %r14, 0x18(%r12)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
movl 0x4(%rsp), %r8d
callq 0xf3081
movl (%rsp), %ecx
orl $0x8, %ecx
movq %r12, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
callq 0xf2586
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf28d4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
cmpq %r9, %rdx
cmovlq %rdx, %rbx
testq %rbx, %rbx
jle 0xf32e3
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
movq %r13, %rdi
movq %r12, %rsi
movl 0x40(%rsp), %edx
callq 0xefa60
movl %eax, (%r14,%rbp,4)
movq 0x8(%r13), %rdi
movq %rbp, %rsi
movl %eax, %edx
callq 0xe9d68
incq %rbp
addq %r15, %r12
cmpq %rbp, %rbx
jne 0xf32b7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, 0x38(%rsp)
movq %rcx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x28(%rsp)
cmpq $0x8, %rdx
ja 0xf36ea
movq %rdx, %r12
movl $0x116, %eax            # imm = 0x116
btq %rdx, %rax
jae 0xf36ea
movq %r9, %rbx
movq %r9, %rdi
xorl %esi, %esi
callq 0xf2468
testl %eax, %eax
je 0xf36ea
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %r12d, %ecx
shll %cl, %eax
cmpq $0x0, 0x10(%rbx)
jle 0xf36ea
notb %al
movl %eax, 0xc(%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl %r12d, %eax
negl %eax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
imulq 0x20(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
xorl %r15d, %r15d
movq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xef14d
movl %eax, %r13d
movl $0x8, %r14d
movq %r15, %rsi
movl %r14d, %ebp
subl %r12d, %r14d
jb 0xf36cc
movzbl %r13b, %eax
movl 0x80(%rsp), %ecx
testb $0x1, %cl
jne 0xf3695
movq 0x30(%rsp), %rcx
addl %ebp, %ecx
shrl %cl, %eax
andl 0x8(%rsp), %eax
movl %eax, %edx
jmp 0xf36a6
movl %eax, %ecx
andb 0xc(%rsp), %cl
movzbl %cl, %edx
movl %r12d, %ecx
shrl %cl, %eax
movl %eax, %r13d
leaq 0x1(%rsi), %r15
movl %edx, %eax
movq 0x38(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
callq 0xf2b02
movq %r15, %rsi
cmpq 0x8(%rbx), %r15
jl 0xf366c
jmp 0xf36cf
movq %rsi, %r15
cmpl %r12d, %ebp
jb 0xf3651
movq 0x10(%rsp), %rax
incq %rax
cmpq 0x10(%rbx), %rax
jl 0xf3639
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, (%rsp)
cmpq $0x0, 0x10(%r8)
jle 0xf3961
movl %r9d, %r15d
movq %r8, %r14
movq %rcx, %rbp
movq %rdi, %r12
xorl %eax, %eax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%r14)
jle 0xf3943
movq (%rsp), %r13
xorl %ebx, %ebx
movq %r12, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0xefa60
movq %r14, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movl %eax, %ecx
callq 0xf2b02
incq %rbx
addq %rbp, %r13
cmpq 0x8(%r14), %rbx
jl 0xf3917
movq 0x8(%rsp), %rdx
incq %rdx
movq (%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpq 0x10(%r14), %rdx
movq %rdx, %rax
jl 0xf3905
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq