LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, -0x18(%rbp)
jl 0x169693
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0x16969f
movl $0x0, -0x4(%rbp)
jmp 0x169786
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0x1696ca
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
jmp 0x169752
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0xd, %eax
jne 0x169724
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x2a(%rbp)
movzbl -0x2a(%rbp), %eax
cmpl $0xa, %eax
jne 0x169712
movq $0x2, -0x48(%rbp)
jmp 0x169752
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
jmp 0x169752
movzbl -0x29(%rbp), %eax
cmpl $0xa, %eax
jne 0x16973f
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
jmp 0x169752
jmp 0x169741
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1696a7
movq -0x40(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
addq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x1679e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x166070
movq -0x18(%rbp), %rdi
callq 0x1676a0
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
cmpl $0x1, -0x1c(%rbp)
jl 0x169887
cmpl $0x4, -0x1c(%rbp)
jle 0x16988c
jmp 0x169942
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x19140
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movslq -0x1c(%rbp), %rcx
callq 0x164d10
movl -0x20(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1698c8
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x169950
movq -0x18(%rbp), %rdi
callq 0x165430
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x4, -0x1c(%rbp)
jge 0x1698f9
movl $0x4, %ecx
subl -0x1c(%rbp), %ecx
shll $0x3, %ecx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
shrl %cl, %edx
movl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
movl $0x8, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x161ab0
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
movl $0x20, %ecx
movl $0x20, %r8d
movl $0x1, %r9d
callq 0x161ab0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: reverse_fourcc
static void reverse_fourcc(u8 *buf, int nbytes)
{
	size_t k;

	for(k=0; k<((size_t)nbytes)/2; k++) {
		u8 tmpc;
		tmpc = buf[k];
		buf[k] = buf[(size_t)nbytes-1-k];
		buf[(size_t)nbytes-1-k] = tmpc;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq -0xc(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
jae 0x1699c3
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
subq $0x1, %rcx
subq -0x18(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
subq $0x1, %rcx
subq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x169963
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: buffered_read_zero_len
static int buffered_read_zero_len(struct de_bufferedreadctx *brctx,
	de_buffered_read_cbfn cbfn)
{
	const u8 dummybuf[1] = { 0 };
	int ret;

	brctx->offset = 0;
	brctx->eof_flag = 1;
	brctx->bytes_consumed = 0;
	ret = cbfn(brctx, dummybuf, 0);
	return ret?1:0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x11(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19140
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdi
leaq -0x11(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
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)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x1, -0x50(%rbp)
jge 0x169a84
jmp 0x169afc
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
addq -0x40(%rbp), %rcx
addq %rcx, %rsi
movq -0x50(%rbp), %rdx
callq *%rax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x169acc
jmp 0x169b03
movq -0x8(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jl 0x169ae5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x50(%rbp), %rax
jle 0x169ae7
jmp 0x169b03
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x169a6f
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: de_is_all_zeroes
int de_is_all_zeroes(const u8 *b, i64 n)
{
	i64 k;
	for(k=0; k<n; k++) {
		if(b[k]!=0) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x169d18
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x169d08
movl $0x0, -0x4(%rbp)
jmp 0x169d1f
jmp 0x169d0a
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x169ce4
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: slice_has_BOM
static int slice_has_BOM(dbuf *inf, i64 pos, i64 len, de_encoding enc)
{
	i64 len_to_read;
	u8 buf[3] = {0, 0, 0};

	switch(enc) {
	case DE_ENCODING_UTF8:
		len_to_read = 3;
		break;
	case DE_ENCODING_UTF16BE:
	case DE_ENCODING_UTF16LE:
		len_to_read = 2;
		break;
	default:
		return 0;
	}

	if(len < len_to_read) return 0;

	dbuf_read(inf, buf, pos, len_to_read);

	switch(enc) {
	case DE_ENCODING_UTF16BE:
		if(buf[0]==0xfe && buf[1]==0xff) {
			return 1;
		}
		break;
	case DE_ENCODING_UTF16LE:
		if(buf[0]==0xff && buf[1]==0xfe) {
			return 1;
		}
		break;
	default: // UTF8
		if(buf[0]==0xef && buf[1]==0xbb && buf[2]==0xbf) {
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movb $0x0, -0x32(%rbp)
movw $0x0, -0x34(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x38(%rbp)
subl $0x2, %eax
je 0x169f7b
jmp 0x169f6e
movl -0x38(%rbp), %eax
addl $-0x3, %eax
subl $0x2, %eax
jb 0x169f85
jmp 0x169f8f
movq $0x3, -0x30(%rbp)
jmp 0x169f9b
movq $0x2, -0x30(%rbp)
jmp 0x169f9b
movl $0x0, -0x4(%rbp)
jmp 0x16a052
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x169fb1
movl $0x0, -0x4(%rbp)
jmp 0x16a052
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %rsi
callq 0x164d10
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
subl $0x3, %eax
je 0x169ffe
jmp 0x169fd3
movl -0x3c(%rbp), %eax
subl $0x4, %eax
jne 0x16a01f
jmp 0x169fdd
movzbl -0x34(%rbp), %eax
cmpl $0xfe, %eax
jne 0x169ffc
movzbl -0x33(%rbp), %eax
cmpl $0xff, %eax
jne 0x169ffc
movl $0x1, -0x4(%rbp)
jmp 0x16a052
jmp 0x16a04b
movzbl -0x34(%rbp), %eax
cmpl $0xff, %eax
jne 0x16a01d
movzbl -0x33(%rbp), %eax
cmpl $0xfe, %eax
jne 0x16a01d
movl $0x1, -0x4(%rbp)
jmp 0x16a052
jmp 0x16a04b
movzbl -0x34(%rbp), %eax
cmpl $0xef, %eax
jne 0x16a049
movzbl -0x33(%rbp), %eax
cmpl $0xbb, %eax
jne 0x16a049
movzbl -0x32(%rbp), %eax
cmpl $0xbf, %eax
jne 0x16a049
movl $0x1, -0x4(%rbp)
jmp 0x16a052
jmp 0x16a04b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: slice_is_ascii_compatible
static int slice_is_ascii_compatible(dbuf *inf, i64 pos1, i64 len,
	de_ext_encoding input_ee)
{
	deark *c = inf->c;
	struct textconvctx_struct tcctx;
	int retval = 1;

	de_zeromem(&tcctx, sizeof(struct textconvctx_struct));
	tcctx.outf = NULL;
	de_encconv_init(&tcctx.es, input_ee);
	tcctx.tmpstr = ucstring_create(c);

	retval = dbuf_buffered_read(inf, pos1, len, slice_is_ascii_cbfn, (void*)&tcctx);

	ucstring_destroy(tcctx.tmpstr);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x5c(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x19140
movq $0x0, -0x58(%rbp)
leaq -0x58(%rbp), %rdi
addq $0x10, %rdi
movl -0x1c(%rbp), %esi
callq 0x160150
movq -0x28(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x65e(%rip), %rcx       # 0x16a730
leaq -0x58(%rbp), %r8
callq 0x166260
movl %eax, -0x5c(%rbp)
movq -0x50(%rbp), %rdi
callq 0x171750
movl -0x5c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x15ccf0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x0, %eax
je 0x16a14c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x16a14c
movl $0x0, -0x24(%rbp)
jmp 0x16a153
movl $0x40, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x171210
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %r8
addq $0x10, %r8
callq 0x171820
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
xorl %ecx, %ecx
callq 0x172150
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
addl -0x14(%rbp), %eax
cmpl $0x40, %eax
jbe 0x16a1d0
jmp 0x16a225
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x16a1fb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shlq %cl, %rax
movq %rax, %rcx
orq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x16a218
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shlq %cl, %rax
movq %rax, %rcx
movq -0x8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x38, 0x4(%rax)
jbe 0x16a24a
jmp 0x16a29d
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x16a273
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
shlq $0x8, %rcx
movzbl -0x9(%rbp), %eax
orq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x16a290
movzbl -0x9(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shlq %cl, %rax
movq %rax, %rcx
movq -0x8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x8, %ecx
movl %ecx, 0x4(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x16a2c4
movq $0x0, -0x8(%rbp)
jmp 0x16a34e
movl -0x14(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x16a310
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrq %cl, %rax
andq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x16a346
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
andq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movl %ecx, %ecx
shrq %cl, %rdx
movq %rdx, %rcx
movq %rcx, 0x8(%rax)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x18(%rax)
je 0x16a3b6
movq $0x0, -0x8(%rbp)
jmp 0x16a451
cmpl $0x0, -0x14(%rbp)
jne 0x16a3c9
movq $0x0, -0x8(%rbp)
jmp 0x16a451
cmpl $0x39, -0x14(%rbp)
jbe 0x16a3e1
movq -0x10(%rbp), %rax
movb $0x1, 0x18(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x16a451
jmp 0x16a3e3
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
cmpl -0x14(%rbp), %eax
jae 0x16a43d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x16a413
movq -0x10(%rbp), %rax
movb $0x1, 0x18(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x16a451
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
callq 0x165170
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movzbl -0x15(%rbp), %esi
callq 0x16a230
jmp 0x16a3e3
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movl -0x14(%rbp), %esi
callq 0x16a2a0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
shrl $0x3, %eax
movl %eax, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x16a504
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq 0x4ac14(%rip), %rdx     # 0x1b510f
movb $0x0, %al
callq 0x15a980
jmp 0x16a52c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
movl $0x8, %r8d
subl -0x30(%rbp), %r8d
leaq 0x6aa8a(%rip), %rdx     # 0x1d4faf
movb $0x0, %al
callq 0x15a980
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getint_ext_be_direct
static i64 dbuf_getint_ext_be_direct(const u8 *m, unsigned int nbytes)
{
	unsigned int k;
	u64 val = 0;

	// We can handle up to 8 arbitrary bytes. Any more have to be 0xff.
	if(nbytes>8) {
		for(k=0; k<nbytes-8; k++) {
			if(m[k]!=0xff) return 0; // underflow
		}
	}

	// Process bytes in order of increasing significance
	for(k=0; k<8; k++) {
		u8 byteval;

		if(k<nbytes) {
			byteval = m[nbytes-1-k];
		}
		else {
			byteval = 0xff;
		}
		val |= ((u64)byteval) << (k*8);
	}
	return (i64)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpl $0x8, -0x14(%rbp)
jbe 0x16a5d8
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x8, %ecx
cmpl %ecx, %eax
jae 0x16a5d6
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0xff, %eax
je 0x16a5c9
movq $0x0, -0x8(%rbp)
jmp 0x16a632
jmp 0x16a5cb
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x16a5a0
jmp 0x16a5d8
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jae 0x16a62a
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x16a604
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
subl -0x18(%rbp), %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
jmp 0x16a608
movb $-0x1, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl -0x18(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x16a5df
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getuint_ext_le_direct
static i64 dbuf_getuint_ext_le_direct(const u8 *m, unsigned int nbytes)
{
	unsigned int k;
	u64 val = 0;

	for(k=0; k<nbytes; k++) {
		if(m[k]!=0) {
			if(k>7) return 0;
			val |= ((u64)m[k])<<(k*8);
		}
	}
	return (i64)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x16a6ad
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16a6a0
cmpl $0x7, -0x18(%rbp)
jbe 0x16a682
movq $0x0, -0x8(%rbp)
jmp 0x16a6b5
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl -0x18(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x16a6a2
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x16a65a
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getuint_ext_be_direct
static i64 dbuf_getuint_ext_be_direct(const u8 *m, unsigned int nbytes)
{
	unsigned int k;
	u64 val = 0;

	for(k=0; k<nbytes; k++) {
		if(val>0x00ffffffffffffffULL) return 0;
		val = (val<<8) | (u64)m[k];
	}
	return (i64)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x16a721
movabsq $0xffffffffffffff, %rax # imm = 0xFFFFFFFFFFFFFF
cmpq %rax, -0x20(%rbp)
jbe 0x16a6fc
movq $0x0, -0x8(%rbp)
jmp 0x16a729
movq -0x20(%rbp), %rax
shlq $0x8, %rax
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x16a6da
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x15ccf0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x0, %eax
je 0x16a78c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x16a78c
movl $0x0, -0x2c(%rbp)
jmp 0x16a793
movl $0x40, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x171210
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %r8
addq $0x10, %r8
callq 0x171820
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x171ff0
cmpl $0x0, %eax
jne 0x16a7df
movl $0x0, -0x4(%rbp)
jmp 0x16a7e6
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: de_good_image_dimensions
int de_good_image_dimensions(deark *c, i64 w, i64 h)
{
	if(!de_good_image_dimensions_noerr(c, w, h)) {
		de_err(c, "Bad or unsupported image dimensions (%d"DE_CHAR_TIMES"%d)",
			(int)w, (int)h);
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16a7f0
cmpl $0x0, %eax
jne 0x16a8a1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x6a83f(%rip), %rsi     # 0x1d50d0
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
jmp 0x16a8a8
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
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_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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x38(%rax)
je 0x16a92b
movq -0x10(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jl 0x16a90b
movq -0x10(%rbp), %rax
cmpq $0x2710, 0x8(%rax)      # imm = 0x2710
jg 0x16a90b
movq -0x10(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jl 0x16a90b
movq -0x10(%rbp), %rax
cmpq $0x2710, 0x10(%rax)     # imm = 0x2710
jle 0x16a929
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x6a7e4(%rip), %rsi     # 0x1d50fd
movb $0x0, %al
callq 0x15c380
movl $0x0, -0x4(%rbp)
jmp 0x16a997
jmp 0x16a990
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16a962
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x16a960
movl $0x0, -0x4(%rbp)
jmp 0x16a997
jmp 0x16a98e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x16a7f0
cmpl $0x0, %eax
jne 0x16a98c
movl $0x0, -0x4(%rbp)
jmp 0x16a997
jmp 0x16a98e
jmp 0x16a990
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x2710, -0x20(%rbp)    # imm = 0x2710
movq -0x10(%rbp), %rax
cmpl $0x2710, 0x9c(%rax)     # imm = 0x2710
jle 0x16a9d7
movq -0x10(%rbp), %rax
movslq 0x9c(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jl 0x16a9e8
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jle 0x16aa09
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0x6a719(%rip), %rsi     # 0x1d5112
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
jmp 0x16aa10
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x16aab1
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x16aa7c
movl $0x0, -0x4(%rbp)
jmp 0x16aab8
movzbl -0x21(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
andl $0xff, %ecx
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x16aaa1
movl $0x0, -0x4(%rbp)
jmp 0x16aab8
jmp 0x16aaa3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16aa34
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x16acd0
movq -0x8(%rbp), %rdi
callq 0x16b870
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x16a8c0
cmpl $0x0, %eax
jne 0x16ad06
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movslq 0x24(%rax), %rax
imulq %rax, %rcx
movq -0x8(%rbp), %rax
imulq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x15b780
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: valid_imglo
static int valid_imglo(de_bitmap *img, de_bitmap *imglo)
{
	if(imglo->invalid_image_flag) return 0;
	if(img->bytes_per_pixel != imglo->bytes_per_pixel) return 0;
	if(img->width != imglo->width) return 0;
	if(img->height != imglo->height) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x16ad6f
movl $0x0, -0x4(%rbp)
jmp 0x16adc5
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x24(%rcx), %eax
je 0x16ad88
movl $0x0, -0x4(%rbp)
jmp 0x16adc5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x16ada3
movl $0x0, -0x4(%rbp)
jmp 0x16adc5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x16adbe
movl $0x0, -0x4(%rbp)
jmp 0x16adc5
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-bitmap.c
// Function: bitmap16_low_bits_important
static int bitmap16_low_bits_important(de_bitmap *imghi, de_bitmap *imglo)
{
	i64 i, j;

	for(j=0; j<imghi->height; j++) {
		for(i=0; i<imghi->width; i++) {
			de_color c1, c2;

			c1 = de_bitmap_getpixel(imghi, i, j);
			c2 = de_bitmap_getpixel(imglo, i, j);
			if(c1 != c2) return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x16ae65
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16ae55
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16b540
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16b540
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0x16ae45
movl $0x1, -0x4(%rbp)
jmp 0x16ae6c
jmp 0x16ae47
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x16adfe
jmp 0x16ae57
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x16ade8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
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: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x16d270
movq -0x10(%rbp), %rax
cmpb $0x0, 0x3(%rax)
jne 0x16aeac
jmp 0x16af4c
movq -0x10(%rbp), %rax
movzbl (%rax), %edx
movl $0x1, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x16aed9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jl 0x16aee7
jmp 0x16af4c
movq -0x8(%rbp), %rdi
callq 0x16d760
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %r9
xorl %eax, %eax
movl %eax, %ecx
xorl %eax, %eax
movq %rcx, %rdx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x16ce50
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_destroy
void de_bitmap_destroy(de_bitmap *b)
{
	if(b) {
		deark *c = b->c;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x16af94
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16b870
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x15b820
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x16b046
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x16b046
movq -0x20(%rbp), %rdi
callq 0x15d230
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x15d4c0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x16afa0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15d260
jmp 0x16b056
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x16afa0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x16b092
movq -0x8(%rbp), %rdi
callq 0x16acb0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x16b0a2
jmp 0x16b1b7
cmpq $0x0, -0x10(%rbp)
jl 0x16b0cc
cmpq $0x0, -0x18(%rbp)
jl 0x16b0cc
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16b0cc
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x16b0d1
jmp 0x16b1b7
cmpq $0x0, -0x20(%rbp)
jl 0x16b0df
cmpq $0x3, -0x20(%rbp)
jle 0x16b0e4
jmp 0x16b1b7
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rax
movslq 0x24(%rcx), %rcx
imulq %rcx, %rax
movq -0x18(%rbp), %rdx
imulq %rdx, %rax
movq -0x10(%rbp), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3, %eax
ja 0x16b1b7
movq -0x38(%rbp), %rax
leaq 0x69f32(%rip), %rcx     # 0x1d5060
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x3, -0x20(%rbp)
jge 0x16b150
movb -0x21(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x16b1b7
cmpq $0x3, -0x20(%rbp)
jne 0x16b16e
movb -0x21(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
jmp 0x16b180
movb -0x21(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x16b1b7
cmpq $0x3, -0x20(%rbp)
jge 0x16b19f
movb -0x21(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
addq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x16b1b7
movb -0x21(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
addq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
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)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x16b1ed
movq -0x8(%rbp), %rdi
callq 0x16acb0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x16b1fd
jmp 0x16b2fc
cmpq $0x0, -0x10(%rbp)
jl 0x16b227
cmpq $0x0, -0x18(%rbp)
jl 0x16b227
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16b227
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x16b22c
jmp 0x16b2fc
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rax
movslq 0x24(%rcx), %rcx
imulq %rcx, %rax
movq -0x18(%rbp), %rdx
imulq %rdx, %rax
movq -0x10(%rbp), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x2, %eax
je 0x16b28a
jmp 0x16b276
movl -0x2c(%rbp), %eax
subl $0x3, %eax
je 0x16b29d
jmp 0x16b280
movl -0x2c(%rbp), %eax
subl $0x4, %eax
je 0x16b2c5
jmp 0x16b2fc
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb $-0x1, 0x1(%rax,%rcx)
jmp 0x16b2fc
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
jmp 0x16b2fc
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movb -0x19(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
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_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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16b7b0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jge 0x16b81e
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x16b750
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
jle 0x16b857
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x16b857
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
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_free_pixels
static void de_bitmap_free_pixels(de_bitmap *b)
{
	if(b) {
		deark *c = b->c;

		if(b->bitmap) {
			de_free(c, b->bitmap);
			b->bitmap = NULL;
		}
		b->bitmap_size = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x16b8c2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x16b8b6
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)