LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-zip.c
// Function: do_UT_times
static void do_UT_times(deark *c, struct zipw_md *md,
	dbuf *ef, int is_central)
{
	int have_crtime = 0;
	int have_actime = 0;
	i64 num_timestamps = 0; // Number to write
	i64 actime_unix = 0;
	i64 crtime_unix = 0;
	u8 flags = 0;

	if(md->actime.is_valid) {
		actime_unix = de_timestamp_to_unix_time(&md->actime);
		if(is_valid_32bit_unix_time(actime_unix)) {
			have_actime = 1;
		}
	}

	if(md->crtime.is_valid) {
		crtime_unix = de_timestamp_to_unix_time(&md->crtime);
		if(is_valid_32bit_unix_time(crtime_unix)) {
			have_crtime = 1;
		}
	}

	// Always write mod time
	num_timestamps++;
	flags |= 0x01;

	if(have_actime) {
		if(!is_central) num_timestamps++;
		flags |= 0x02;
	}

	if(have_crtime) {
		if(!is_central) num_timestamps++;
		flags |= 0x04;
	}

	dbuf_writeu16le(ef, 0x5455);
	dbuf_writeu16le(ef, (i64)(1+4*num_timestamps));
	dbuf_writebyte(ef, flags); // tells which fields are present in local header
	dbuf_writei32le(ef, md->modtime_unix);
	if(have_actime && !is_central) {
		dbuf_writei32le(ef, actime_unix);
	}
	if(have_crtime && !is_central) {
		dbuf_writei32le(ef, crtime_unix);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x41(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x10(%rax)
je 0x162b13
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x15dd00
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x162a70
cmpl $0x0, %eax
je 0x162b11
movl $0x1, -0x24(%rbp)
jmp 0x162b13
movq -0x10(%rbp), %rax
cmpb $0x0, 0x20(%rax)
je 0x162b45
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x15dd00
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x162a70
cmpl $0x0, %eax
je 0x162b43
movl $0x1, -0x20(%rbp)
jmp 0x162b45
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movzbl -0x41(%rbp), %eax
orl $0x1, %eax
movb %al, -0x41(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x162b7d
cmpl $0x0, -0x1c(%rbp)
jne 0x162b73
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movzbl -0x41(%rbp), %eax
orl $0x2, %eax
movb %al, -0x41(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x162b9f
cmpl $0x0, -0x1c(%rbp)
jne 0x162b95
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movzbl -0x41(%rbp), %eax
orl $0x4, %eax
movb %al, -0x41(%rbp)
movq -0x18(%rbp), %rdi
movl $0x5455, %esi           # imm = 0x5455
callq 0x168a10
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
shlq $0x2, %rsi
addq $0x1, %rsi
callq 0x168a10
movq -0x18(%rbp), %rdi
movzbl -0x41(%rbp), %esi
callq 0x168380
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x168c70
cmpl $0x0, -0x24(%rbp)
je 0x162bf9
cmpl $0x0, -0x1c(%rbp)
jne 0x162bf9
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x168c70
cmpl $0x0, -0x20(%rbp)
je 0x162c12
cmpl $0x0, -0x1c(%rbp)
jne 0x162c12
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x168c70
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-zip.c
// Function: do_ntfs_times
static void do_ntfs_times(deark *c, struct zipw_md *md,
	dbuf *ef, int is_central)
{
	u64 modtm, actm, crtm;

	dbuf_writeu16le(ef, 0x000a); // = NTFS
	dbuf_writeu16le(ef, 32); // data size
	dbuf_write_zeroes(ef, 4);
	dbuf_writeu16le(ef, 0x0001); // file times element
	dbuf_writeu16le(ef, 24); // element data size
	// We only necessarily know the mod time, but we have to write something for
	// the others.
	modtm = (u64)md->modtime_as_FILETIME;
	actm = (md->actime_as_FILETIME>0) ? (u64)md->actime_as_FILETIME : modtm;
	crtm = (md->crtime_as_FILETIME>0) ? (u64)md->crtime_as_FILETIME : modtm;
	dbuf_writeu64le(ef, modtm);
	dbuf_writeu64le(ef, actm);
	dbuf_writeu64le(ef, crtm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
movl $0xa, %esi
callq 0x168a10
movq -0x18(%rbp), %rdi
movl $0x20, %esi
callq 0x168a10
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x1685f0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x168a10
movq -0x18(%rbp), %rdi
movl $0x18, %esi
callq 0x168a10
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jle 0x162ca2
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x162caa
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jle 0x162ccb
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x162cd3
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x168d60
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x168d60
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x168d60
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-zip.c
// Function: do_riscos_attribs
static void do_riscos_attribs(deark *c, struct zipw_md *md, de_finfo *fi, dbuf *ef)
{
	 if(!fi) return;
	 if(fi->riscos_appended_type) return; // Already handled attribs in a different way
	 if(!fi->has_riscos_data) return;
	 if(md->is_directory) return;
	 if(md->is_volume_label) return;
	 dbuf_writeu16le(ef, 0x4341); // AC
	 dbuf_writeu16le(ef, 20); // data size
	 dbuf_write(ef, (const u8*)"ARC0", 4);

	 // The only thing we really want to write is the file type (part of
	 // the load_addr), but unfortunately there's no way to do just that.
	 dbuf_writeu32le(ef, fi->load_addr);
	 dbuf_writeu32le(ef, fi->exec_addr);

	 // The attributes field has a "gotcha" and/or error: The ZIP documentation
	 // (from Info-Zip zip/unzip) has the Readable and Writable bits swapped
	 // from the standard RISC OS format. I can't assume that all other
	 // programmers will notice that and respect it.
	 // This just sets the file to be user-readable and user-writable.
	 // I'd like to make it public-readable (and not writable), but I don't
	 // see a safe way to do that.
	 dbuf_writeu32le(ef, 0x00000003);

	 dbuf_writeu32le(ef, 0); // reserved
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x162d34
jmp 0x162de3
movq -0x18(%rbp), %rax
cmpb $0x0, 0x11(%rax)
je 0x162d43
jmp 0x162de3
movq -0x18(%rbp), %rax
cmpb $0x0, 0x10(%rax)
jne 0x162d52
jmp 0x162de3
movq -0x10(%rbp), %rax
cmpb $0x0, 0x59(%rax)
je 0x162d61
jmp 0x162de3
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5a(%rax)
je 0x162d6d
jmp 0x162de3
movq -0x20(%rbp), %rdi
movl $0x4341, %esi           # imm = 0x4341
callq 0x168a10
movq -0x20(%rbp), %rdi
movl $0x14, %esi
callq 0x168a10
movq -0x20(%rbp), %rdi
leaq 0x6d0e5(%rip), %rsi     # 0x1cfe79
movl $0x4, %edx
callq 0x166170
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xa4(%rax), %eax
movl %eax, %esi
callq 0x168c30
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xa8(%rax), %eax
movl %eax, %esi
callq 0x168c30
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x168c30
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x168c30
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-zip.c
// Function: de_zip_close_file
void de_zip_close_file(deark *c)
{
	struct zipw_ctx *zzz;

	if(!c->zip_data) return;
	de_dbg(c, "closing zip file");

	zzz = (struct zipw_ctx*)c->zip_data;

	zipw_finalize(c, zzz);

	if(c->archive_to_stdout && zzz->outf && zzz->outf->btype==DBUF_TYPE_MEMBUF) {
		dbuf_copy_to_FILE(zzz->outf, 0, zzz->outf->len, stdout);
	}

	dbuf_close(zzz->cdir);
	dbuf_close(zzz->outf);
	de_crcobj_destroy(zzz->crc32o);

	de_free(c, zzz);
	c->zip_data = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x138(%rax)
jne 0x16339f
jmp 0x16345f
movq -0x8(%rbp), %rdi
leaq 0x7177e(%rip), %rsi     # 0x1d4b28
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x163470
movq -0x8(%rbp), %rax
movzbl 0x88(%rax), %eax
cmpl $0x0, %eax
je 0x16341c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x16341c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x3, (%rax)
jne 0x16341c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rdx
movq 0xc1bc0(%rip), %rax     # 0x224fd0
movq (%rax), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x163780
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x15f2e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x138(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-zip.c
// Function: zipw_deflate
static int zipw_deflate(deark *c, struct zipw_ctx *zzz, dbuf *uncmpr_data,
	dbuf *cmpr_data, unsigned int level)
{
	int retval = 0;
	int ret;
	const u8 *uncmpr_mem;
	struct fmtutil_tdefl_ctx *tdctx = NULL;

	tdctx = fmtutil_tdefl_create(c, cmpr_data,
		fmtutil_tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY));

	uncmpr_mem = dbuf_get_membuf_direct_ptr(uncmpr_data);
	if(uncmpr_mem==NULL && uncmpr_data->len!=0) goto done;

	ret = fmtutil_tdefl_compress_buffer(tdctx, uncmpr_mem, (size_t)uncmpr_data->len,
		FMTUTIL_TDEFL_FINISH);
	if(ret != FMTUTIL_TDEFL_STATUS_DONE) goto done;
	retval = 1;

done:
	if(retval==0) {
		de_err(c, "Deflate compression error");
	}
	fmtutil_tdefl_destroy(tdctx);
	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)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x24(%rbp), %edi
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
xorl %edx, %edx
callq 0x198380
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl %eax, %edx
callq 0x198180
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x169340
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x16384e
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x16384e
jmp 0x16387a
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0x4, %ecx
callq 0x198220
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
je 0x163873
jmp 0x16387a
movl $0x1, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x163892
movq -0x8(%rbp), %rdi
leaq 0x7131f(%rip), %rsi     # 0x1d4baa
movb $0x0, %al
callq 0x15bfb0
movq -0x40(%rbp), %rdi
callq 0x198340
movl -0x28(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: de_tar_create_file
int de_tar_create_file(deark *c)
{
	struct tar_ctx *tctx = NULL;
	int retval = 0;

	if(c->tar_data) return 1;

	tctx = de_malloc(c, sizeof(struct tar_ctx));
	c->tar_data = (void*)tctx;

	if(c->archive_to_stdout) {
		tctx->tar_filename = "[stdout]";
		de_err(c, "TAR to stdout is not implemented");
		de_fatalerror(c);
		goto done;
	}


	if(c->output_archive_filename) {
		tctx->tar_filename = c->output_archive_filename;
	}
	else {
		tctx->tar_filename = "output.tar";
	}

	de_info(c, "Creating %s", tctx->tar_filename);
	tctx->outf = dbuf_create_unmanaged_file(c, tctx->tar_filename,
		c->overwrite_mode, 0);

	if(tctx->outf->btype==DBUF_TYPE_NULL) {
		de_fatalerror(c);
		goto done;
	}

	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x140(%rax)
je 0x163935
movl $0x1, -0x4(%rbp)
jmp 0x163a26
movq -0x10(%rbp), %rdi
movl $0x28, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x140(%rax)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x88(%rax)
je 0x163991
movq -0x18(%rbp), %rax
leaq 0x71512(%rip), %rcx     # 0x1d4e80
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
leaq 0x712bd(%rip), %rsi     # 0x1d4c39
movb $0x0, %al
callq 0x15bfb0
movq -0x10(%rbp), %rdi
callq 0x15c250
jmp 0x163a20
movq -0x10(%rbp), %rax
cmpq $0x0, 0x160(%rax)
je 0x1639b3
movq -0x10(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1639c1
movq -0x18(%rbp), %rax
leaq 0x7129c(%rip), %rcx     # 0x1d4c5a
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x7110c(%rip), %rsi     # 0x1d4adf
movb $0x0, %al
callq 0x15c0c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movl 0xd8(%rax), %edx
xorl %ecx, %ecx
callq 0x1679e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, (%rax)
jne 0x163a19
movq -0x10(%rbp), %rdi
callq 0x15c250
jmp 0x163a20
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: de_tar_close_file
void de_tar_close_file(deark *c)
{
	struct tar_ctx *tctx = (struct tar_ctx *)c->tar_data;

	if(!tctx) return;
	if(tctx->outf) {
		dbuf_write_zeroes(tctx->outf, 512*2);
		dbuf_close(tctx->outf);
		de_crcobj_destroy(tctx->crco_cksum);
	}
	destroy_md(c, tctx->md);
	de_free(c, tctx);
	c->tar_data = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x140(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x163a54
jmp 0x163ab8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x163a8b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1685f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x15f2e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x163ac0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rax
movq $0x0, 0x140(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: prepare_timestamp_exthdr
static void prepare_timestamp_exthdr(deark *c, struct tar_md *md, int tsidx)
{
	i64 unix_time;
	i64 subsec = 0;
	int is_high_prec = 0;
	struct timestamp_data *tsd = &md->tsdata[tsidx];

	if(!tsd->timestamp.is_valid) return;

	unix_time = tsd->timestamp_unix;

	if(unix_time>=0 && tsd->timestamp.precision>DE_TSPREC_1SEC) {
		subsec = de_timestamp_get_subsec(&tsd->timestamp);
		if(subsec!=0) is_high_prec = 1;
	}

	if(tsidx!=DE_TIMESTAMPIDX_MODIFY || is_high_prec || unix_time<0 || unix_time>0x1ffffffffLL) {
		tsd->need_exthdr = 1;
	}
	else {
		return;
	}

	if(is_high_prec) {
		de_snprintf(tsd->exthdr_sz, sizeof(tsd->exthdr_sz),
			"%"I64_FMT".%07"I64_FMT, unix_time, subsec);
	}
	else {
		de_snprintf(tsd->exthdr_sz, sizeof(tsd->exthdr_sz),
			"%"I64_FMT, unix_time);
	}

	// Max length for this item is around 29, so we allow 2 bytes for the
	// length field.
	// E.g. "28 mtime=1222333444.5555555\n"
	md->extdata_nbytes_needed += 2 + 1 + 5 + 1 + (i64)de_strlen(tsd->exthdr_sz) + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
addq $0x40, %rax
movslq -0x14(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x163f57
jmp 0x164031
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jl 0x163f94
movq -0x38(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x1e, %eax
jle 0x163f94
movq -0x38(%rbp), %rdi
callq 0x15d6a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x163f92
movl $0x1, -0x2c(%rbp)
jmp 0x163f94
cmpl $0x0, -0x14(%rbp)
jne 0x163fb7
cmpl $0x0, -0x2c(%rbp)
jne 0x163fb7
cmpq $0x0, -0x20(%rbp)
jl 0x163fb7
movabsq $0x1ffffffff, %rax      # imm = 0x1FFFFFFFF
cmpq %rax, -0x20(%rbp)
jle 0x163fc1
movq -0x38(%rbp), %rax
movb $0x1, 0x18(%rax)
jmp 0x163fc3
jmp 0x164031
cmpl $0x0, -0x2c(%rbp)
je 0x163fee
movq -0x38(%rbp), %rdi
addq $0x19, %rdi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0x20, %esi
leaq 0x70c80(%rip), %rdx     # 0x1d4c65
movb $0x0, %al
callq 0x15a980
jmp 0x16400d
movq -0x38(%rbp), %rdi
addq $0x19, %rdi
movq -0x20(%rbp), %rcx
movl $0x20, %esi
leaq 0x51109(%rip), %rdx     # 0x1b510f
movb $0x0, %al
callq 0x15a980
movq -0x38(%rbp), %rdi
addq $0x19, %rdi
callq 0x190e0
movq %rax, %rcx
addq $0x9, %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: make_main_header
static void make_main_header(deark *c, struct tar_ctx *tctx,
	dbuf *f, dbuf *mainhdr)
{
	struct tar_md *md = tctx->md;
	i64 mode;
	u8 typeflag = '0';

	if(md->is_dir) {
		mode = 0755;
		typeflag = '5';
	}
	else if(f->fi_copy && (f->fi_copy->mode_flags&DE_MODEFLAG_EXE)) {
		mode = 0755;
	}
	else {
		mode = 0644;
	}

	set_common_header_fields(c, tctx, mainhdr);

	// "name"
	format_and_write_ascii_field(c, tctx, md->filename, 100, mainhdr, 0);

	// "mode"
	format_and_write_ascii_octal_field(c, tctx, mode, 8, mainhdr, 100);

	// "size"
	format_and_write_ascii_octal_field(c, tctx, f->len, 12, mainhdr, 124);

	// typeflag
	dbuf_writebyte_at(mainhdr, 156, typeflag);

	// Done populating main header, now set the checksum

	dbuf_truncate(mainhdr, 512);
	set_checksum_field(c, tctx, mainhdr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movb $0x30, -0x31(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1642af
movq $0x1ed, -0x30(%rbp)     # imm = 0x1ED
movb $0x35, -0x31(%rbp)
jmp 0x1642e7
movq -0x18(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x1642dd
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rax
movl 0x14(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1642dd
movq $0x1ed, -0x30(%rbp)     # imm = 0x1ED
jmp 0x1642e5
movq $0x1a4, -0x30(%rbp)     # imm = 0x1A4
jmp 0x1642e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x164660
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x20(%rbp), %r8
movl $0x64, %ecx
xorl %eax, %eax
movl %eax, %r9d
callq 0x164750
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %r8
movl $0x8, %ecx
movl $0x64, %r9d
callq 0x1647e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %r8
movl $0xc, %ecx
movl $0x7c, %r9d
callq 0x1647e0
movq -0x20(%rbp), %rdi
movl $0x9c, %esi
movzbl -0x31(%rbp), %edx
callq 0x168790
movq -0x20(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x168900
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x164840
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: set_common_header_fields
static void set_common_header_fields(deark *c, struct tar_ctx *tctx,
	dbuf *hdr)
{
	struct tar_md *md = tctx->md;

	// uid
	format_and_write_ascii_octal_field(c, tctx, 0, 8, hdr, 108);
	// gid
	format_and_write_ascii_octal_field(c, tctx, 0, 8, hdr, 116);
	// mtime
	format_and_write_ascii_octal_field(c, tctx, md->tsdata[DE_TIMESTAMPIDX_MODIFY].timestamp_unix, 12, hdr, 136);
	// magic/version
	dbuf_write_at(hdr, 257, (const u8*)"ustar\0" "00", 8);
	format_and_write_ascii_field(c, tctx, "root", 32, hdr, 265); // uname
	format_and_write_ascii_field(c, tctx, "root", 32, hdr, 297); // gname
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
movl $0x8, %ecx
movl $0x6c, %r9d
callq 0x1647e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
movl $0x8, %ecx
movl $0x74, %r9d
callq 0x1647e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x18(%rbp), %r8
movl $0xc, %ecx
movl $0x88, %r9d
callq 0x1647e0
movq -0x18(%rbp), %rdi
movl $0x101, %esi            # imm = 0x101
leaq 0x70597(%rip), %rdx     # 0x1d4c8b
movl $0x8, %ecx
callq 0x1683f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %r8
leaq 0x4149b(%rip), %rdx     # 0x1a5bac
movl $0x20, %ecx
movl $0x109, %r9d            # imm = 0x109
callq 0x164750
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %r8
leaq 0x41478(%rip), %rdx     # 0x1a5bac
movl $0x20, %ecx
movl $0x129, %r9d            # imm = 0x129
callq 0x164750
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: format_and_write_ascii_field
static void format_and_write_ascii_field(deark *c, struct tar_ctx *tctx,
	const char *val_sz, size_t fieldlen, dbuf *hdrs, i64 fieldpos)
{
	size_t val_strlen;

	val_strlen = de_strlen(val_sz);
	if(val_strlen < fieldlen) {
		dbuf_write_at(hdrs, fieldpos, (const u8*)val_sz, val_strlen);
		// (padding bytes will remain at 0)
	}
	else if(val_strlen==fieldlen) {
		dbuf_write_at(hdrs, fieldpos, (const u8*)val_sz, fieldlen);
	}
	else {
		dbuf_write_at(hdrs, fieldpos, (const u8*)val_sz, fieldlen);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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)
movq -0x18(%rbp), %rdi
callq 0x190e0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x16479e
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x1683f0
jmp 0x1647d6
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x1647bf
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x1683f0
jmp 0x1647d4
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x1683f0
jmp 0x1647d6
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: set_checksum_field
static void set_checksum_field(deark *c, struct tar_ctx *tctx,
	dbuf *hdr)
{
	u8 buf[8];

	calc_checksum(c, tctx, hdr);
	format_ascii_octal_field(c, tctx, tctx->checksum_calc, buf, 7);
	buf[6] = 0x00;
	buf[7] = 0x20;
	dbuf_write_at(hdr, 148, buf, 8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x164a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0x20(%rbp), %rcx
movl $0x7, %r8d
callq 0x1648b0
movb $0x0, -0x1a(%rbp)
movb $0x20, -0x19(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rdx
movl $0x94, %esi
movl $0x8, %ecx
callq 0x1683f0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: format_ascii_octal_field
static int format_ascii_octal_field(deark *c, struct tar_ctx *tctx,
	i64 val, u8 *buf2, size_t buf2len)
{
	char buf1[32]; // The largest field we need to support is 12 bytes
	size_t k;
	size_t len_in_octal;

	de_zeromem(buf2, buf2len);
	if(buf2len>12) return 0;
	if(val<0) val = 0;

	de_snprintf(buf1, sizeof(buf1), "%"U64_FMTo, (u64)val);
	len_in_octal = de_strlen(buf1);
	if(len_in_octal > buf2len) {
		for(k=0; k<buf2len; k++) {
			buf2[k] = '7';
		}
	}
	else if(len_in_octal == buf2len) {
		de_memcpy(buf2, buf1, buf2len);
	}
	else {
		size_t num_leading_0s = buf2len - 1 - len_in_octal;

		for(k=0; k<buf2len; k++) {
			if(k < num_leading_0s) {
				buf2[k] = '0';
			}
			else if(k < buf2len - 1) {
				buf2[k] = buf1[k-num_leading_0s];
			}
			else {
				buf2[k] = '\0';
			}
		}
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %esi, %esi
callq 0x19140
cmpq $0xc, -0x30(%rbp)
jbe 0x1648ee
movl $0x0, -0x4(%rbp)
jmp 0x164a0d
cmpq $0x0, -0x20(%rbp)
jge 0x1648fd
movq $0x0, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x20, %esi
leaq 0x7035e(%rip), %rdx     # 0x1d4c6f
movb $0x0, %al
callq 0x15a980
leaq -0x50(%rbp), %rdi
callq 0x190e0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x164960
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x16495b
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movb $0x37, (%rax,%rcx)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x164937
jmp 0x164a06
movq -0x60(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x164980
movq -0x28(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x191e0
jmp 0x164a04
movq -0x30(%rbp), %rax
subq $0x1, %rax
subq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x164a02
movq -0x58(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x1649ba
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movb $0x30, (%rax,%rcx)
jmp 0x1649f2
movq -0x58(%rbp), %rax
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x1649e4
movq -0x58(%rbp), %rax
subq -0x68(%rbp), %rax
movb -0x50(%rbp,%rax), %dl
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x1649f0
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x1649f2
jmp 0x1649f4
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x164998
jmp 0x164a04
jmp 0x164a06
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: calc_checksum
static void calc_checksum(deark *c, struct tar_ctx *tctx, dbuf *f)
{
	if(!tctx->crco_cksum) {
		tctx->crco_cksum = de_crcobj_create(c, DE_CRCOBJ_SUM_BYTES);
	}
	else {
		de_crcobj_reset(tctx->crco_cksum);
	}

	de_crcobj_addslice(tctx->crco_cksum, f, 0, 148);
	de_crcobj_addrun(tctx->crco_cksum, 32, 8); // (The checksum field itself)
	de_crcobj_addslice(tctx->crco_cksum, f, 156, 512-156);
	tctx->checksum_calc = (i64)de_crcobj_getval(tctx->crco_cksum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x164a5a
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x15eac0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x164a67
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x15f250
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x94, %ecx
callq 0x15f500
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x20, %esi
movl $0x8, %edx
callq 0x15f480
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movl $0x9c, %edx
movl $0x164, %ecx            # imm = 0x164
callq 0x15f500
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x15f340
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-tar.c
// Function: add_exthdr_item
static void add_exthdr_item(deark *c, struct tar_ctx *tctx,
	dbuf *extdata, const char *name, const char *val, i64 *ppos)
{
	i64 len1;
	i64 item_len = 0;
	char *tmps = NULL;

	len1 = (i64)de_strlen(name) + (i64)de_strlen(val) + 3;
	// This size of the size field depends on itself. Ugh.
	if(len1<=8) item_len = len1+1;
	else if(len1<=97) item_len = len1+2;
	else if(len1<=996) item_len = len1+3;
	else if(len1<=9995) item_len = len1+4;
	else if(len1<=99994) item_len = len1+5;
	else if(len1<=999993) item_len = len1+6;
	else { // Error
		(*ppos)++;
		goto done;
	}

	tmps = de_malloc(c, item_len+1);
	de_snprintf(tmps, (size_t)(item_len+1), "%"I64_FMT" %s=%s\n", item_len, name, val);
	dbuf_write_at(extdata, *ppos, (const u8*)tmps, item_len);
	(*ppos) += item_len;

done:
	de_free(c, tmps);
}

// 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)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x190e0
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x190e0
movq %rax, %rcx
movq -0x50(%rbp), %rax
addq %rcx, %rax
addq $0x3, %rax
movq %rax, -0x38(%rbp)
cmpq $0x8, -0x38(%rbp)
jg 0x164b50
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bdf
cmpq $0x61, -0x38(%rbp)
jg 0x164b65
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bdd
cmpq $0x3e4, -0x38(%rbp)     # imm = 0x3E4
jg 0x164b7d
movq -0x38(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bdb
cmpq $0x270b, -0x38(%rbp)    # imm = 0x270B
jg 0x164b95
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bd9
cmpq $0x1869a, -0x38(%rbp)   # imm = 0x1869A
jg 0x164bad
movq -0x38(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bd7
cmpq $0xf4239, -0x38(%rbp)   # imm = 0xF4239
jg 0x164bc5
movq -0x38(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x40(%rbp)
jmp 0x164bd5
movq -0x30(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x164c40
jmp 0x164bd7
jmp 0x164bd9
jmp 0x164bdb
jmp 0x164bdd
jmp 0x164bdf
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
callq 0x15b780
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
leaq 0x7006d(%rip), %rdx     # 0x1d4c80
movb $0x0, %al
callq 0x15a980
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x1683f0
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x15b820
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_constrain_length
int dbuf_constrain_length(dbuf *f, i64 pos, i64 *plen)
{
	i64 maxlen;

	if(*plen < 0 || pos < 0 || pos > f->len ) {
		*plen = 0;
		return 0;
	}

	maxlen = f->len - pos;
	if(*plen > maxlen) {
		*plen = maxlen;
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jl 0x164cbf
cmpq $0x0, -0x18(%rbp)
jl 0x164cbf
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x164cd3
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x164d0b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jle 0x164d04
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x164d0b
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_standard_read
i64 dbuf_standard_read(dbuf *f, u8 *buf, i64 n, i64 *fpos)
{
	i64 amt_to_read;

	if(*fpos < 0 || *fpos >= f->len) return 0;

	amt_to_read = n;
	if(*fpos + amt_to_read > f->len) amt_to_read = f->len - *fpos;
	dbuf_read(f, buf, *fpos, amt_to_read);
	*fpos += amt_to_read;
	return amt_to_read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jl 0x164fe3
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0x164fed
movq $0x0, -0x8(%rbp)
jmp 0x16504b
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
addq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x16501d
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq -0x30(%rbp), %rcx
callq 0x164d10
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%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_getbyte
u8 dbuf_getbyte(dbuf *f, i64 pos)
{
	u8 b;

	if(pos<0 || pos>=f->len) return 0x00;

	if(pos<f->rcache_bytes_used) {
		return f->rcache[pos];
	}
	if(f->btype==DBUF_TYPE_MEMBUF) {
		return f->membuf_buf[pos];
	}

	dbuf_read(f, &b, pos, 1);
	return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jl 0x165085
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0x16508b
movb $0x0, -0x1(%rbp)
jmp 0x1650ec
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0xc0(%rcx), %rax
jge 0x1650b3
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
jmp 0x1650ec
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x1650d0
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1(%rbp)
jmp 0x1650ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x19(%rbp), %rsi
movl $0x1, %ecx
callq 0x164d10
movb -0x19(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
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: de_getu64be_direct
u64 de_getu64be_direct(const u8 *m)
{
	unsigned int i;
	u64 val = 0;

	for(i=0; i<8; i++) {
		val |= ((u64)m[i])<<((7-i)*8);
	}
	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jae 0x1656fb
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl $0x7, %ecx
subl -0xc(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1656c7
movq -0x18(%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_getu64le_direct
u64 de_getu64le_direct(const u8 *m)
{
	unsigned int i;
	u64 val = 0;

	for(i=0; i<8; i++) {
		val |= ((u64)m[i])<<(i*8);
	}
	return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jae 0x1657b6
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shlq %cl, %rax
orq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x165787
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getint_ext
i64 dbuf_getint_ext(dbuf *f, i64 pos, unsigned int nbytes,
	int is_le, int is_signed)
{
	if(is_signed) {
		// TODO: Extend this to any number of bytes, 1-8.
		switch(nbytes) {
		case 1: return (i64)(signed char)dbuf_getbyte(f, pos); break;
		case 2: return dbuf_geti16x(f, pos, is_le); break;
		case 4: return dbuf_geti32x(f, pos, is_le); break;
		case 8: return dbuf_geti64x(f, pos, is_le); break;
		default:
			return dbuf_getint_ext_x(f, pos, nbytes, is_le);
		}
	}
	else {
		switch(nbytes) {
		case 1: return (i64)dbuf_getbyte(f, pos); break;
		case 2: return dbuf_getu16x(f, pos, is_le); break;
		case 4: return dbuf_getu32x(f, pos, is_le); break;
		case 8: return dbuf_geti64x(f, pos, is_le); break;
		default:
			return dbuf_getuint_ext_x(f, pos, nbytes, is_le);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x165b49
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x7, %eax
ja 0x165b2d
movq -0x30(%rbp), %rax
leaq 0x6f1f5(%rip), %rcx     # 0x1d4cb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movsbq %al, %rax
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x165870
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x165910
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x165960
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x165bf0
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x7, %eax
ja 0x165bc5
movq -0x38(%rbp), %rax
leaq 0x6f130(%rip), %rcx     # 0x1d4c94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movzbl %al, %eax
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x165820
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x1658c0
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x165960
movq %rax, -0x8(%rbp)
jmp 0x165bdc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x165c60
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %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_x
static i64 dbuf_getint_ext_x(dbuf *f, i64 pos, unsigned int nbytes, int is_le)
{
	u8 m[24];

	if(nbytes>(unsigned int)sizeof(m)) return 0;
	dbuf_read(f, m, pos, (i64)nbytes);
	if(is_le) {
		return 0; // TODO
	}
	return dbuf_getint_ext_be_direct(m, nbytes);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
cmpl $0x18, -0x1c(%rbp)
jbe 0x165c16
movq $0x0, -0x8(%rbp)
jmp 0x165c4c
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %eax
movl %eax, %ecx
callq 0x164d10
cmpl $0x0, -0x20(%rbp)
je 0x165c3c
movq $0x0, -0x8(%rbp)
jmp 0x165c4c
leaq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x16a580
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getuint_ext_x
static i64 dbuf_getuint_ext_x(dbuf *f, i64 pos, unsigned int nbytes,
	int is_le)
{
	u8 m[24];

	if(nbytes>(unsigned int)sizeof(m)) return 0;
	dbuf_read(f, m, pos, (i64)nbytes);
	if(is_le) {
		return dbuf_getuint_ext_le_direct(m, nbytes);
	}
	return dbuf_getuint_ext_be_direct(m, nbytes);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
cmpl $0x18, -0x1c(%rbp)
jbe 0x165c86
movq $0x0, -0x8(%rbp)
jmp 0x165cc4
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %eax
movl %eax, %ecx
callq 0x164d10
cmpl $0x0, -0x20(%rbp)
je 0x165cb4
leaq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x16a640
movq %rax, -0x8(%rbp)
jmp 0x165cc4
leaq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x16a6c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: de_getfloat32x_direct
double de_getfloat32x_direct(deark *c, const u8 *m, int is_le)
{
	char buf[4];
	float val = 0.0;

	if(c->can_decode_fltpt<0) {
		init_fltpt_decoder(c);
	}
	if(!c->can_decode_fltpt) return 0.0;

	// FIXME: This assumes that the native floating point format is
	// IEEE 754, but that does not have to be the case.

	de_memcpy(buf, m, 4);

	if(is_le != c->host_is_le) {
		int i;
		char tmpc;
		// Reverse order of bytes
		for(i=0; i<2; i++) {
			tmpc = buf[i]; buf[i] = buf[3-i]; buf[3-i] = tmpc;
		}
	}

	de_memcpy(&val, buf, 4);
	return (double)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xf0(%rax)
jge 0x165d01
movq -0x10(%rbp), %rdi
callq 0x165da0
movq -0x10(%rbp), %rax
cmpl $0x0, 0xf0(%rax)
jne 0x165d18
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x165d90
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xf4(%rcx), %eax
je 0x165d7c
movl $0x0, -0x28(%rbp)
cmpl $0x2, -0x28(%rbp)
jge 0x165d7a
movslq -0x28(%rbp), %rax
movb -0x20(%rbp,%rax), %al
movb %al, -0x29(%rbp)
movl $0x3, %eax
subl -0x28(%rbp), %eax
cltq
movb -0x20(%rbp,%rax), %cl
movslq -0x28(%rbp), %rax
movb %cl, -0x20(%rbp,%rax)
movb -0x29(%rbp), %cl
movl $0x3, %eax
subl -0x28(%rbp), %eax
cltq
movb %cl, -0x20(%rbp,%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x165d37
jmp 0x165d7c
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: init_fltpt_decoder
static void init_fltpt_decoder(deark *c)
{
	unsigned int x = 1;
	char b = 0;

	c->can_decode_fltpt = 0;
	if(sizeof(float)!=4) return;
	if(sizeof(double)!=8) return;
	c->can_decode_fltpt = 1;

	de_memcpy(&b, &x, 1);
	if(b==0)
		c->host_is_le = 0;
	else
		c->host_is_le = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0xf0(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0xf0(%rax)
movb -0xc(%rbp), %al
movb %al, -0xd(%rbp)
movsbl -0xd(%rbp), %eax
cmpl $0x0, %eax
jne 0x165dee
movq -0x8(%rbp), %rax
movl $0x0, 0xf4(%rax)
jmp 0x165dfc
movq -0x8(%rbp), %rax
movl $0x1, 0xf4(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: de_getfloat64x_direct
double de_getfloat64x_direct(deark *c, const u8 *m, int is_le)
{
	char buf[8];
	double val = 0.0;

	if(c->can_decode_fltpt<0) {
		init_fltpt_decoder(c);
	}
	if(!c->can_decode_fltpt) return 0.0;

	de_memcpy(buf, m, 8);

	if(is_le != c->host_is_le) {
		int i;
		char tmpc;
		// Reverse order of bytes
		for(i=0; i<4; i++) {
			tmpc = buf[i]; buf[i] = buf[7-i]; buf[7-i] = tmpc;
		}
	}

	de_memcpy(&val, buf, 8);
	return (double)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xf0(%rax)
jge 0x165e81
movq -0x10(%rbp), %rdi
callq 0x165da0
movq -0x10(%rbp), %rax
cmpl $0x0, 0xf0(%rax)
jne 0x165e98
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x165f10
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xf4(%rcx), %eax
je 0x165efe
movl $0x0, -0x34(%rbp)
cmpl $0x4, -0x34(%rbp)
jge 0x165efc
movslq -0x34(%rbp), %rax
movb -0x24(%rbp,%rax), %al
movb %al, -0x35(%rbp)
movl $0x7, %eax
subl -0x34(%rbp), %eax
cltq
movb -0x24(%rbp,%rax), %cl
movslq -0x34(%rbp), %rax
movb %cl, -0x24(%rbp,%rax)
movb -0x35(%rbp), %cl
movl $0x7, %eax
subl -0x34(%rbp), %eax
cltq
movb %cl, -0x24(%rbp,%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x165eb9
jmp 0x165efe
movq -0x24(%rbp), %rax
movq %rax, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_read_ascii_number
int dbuf_read_ascii_number(dbuf *f, i64 pos, i64 fieldsize,
	int base, i64 *value)
{
	char buf[32];

	*value = 0;
	if(fieldsize>(i64)(sizeof(buf)-1)) return 0;

	dbuf_read(f, (u8*)buf, pos, fieldsize);
	buf[fieldsize] = '\0';

	*value = de_strtoll(buf, NULL, base);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x1f, -0x20(%rbp)
jle 0x165fa6
movl $0x0, -0x4(%rbp)
jmp 0x165fe5
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x164d10
movq -0x20(%rbp), %rax
movb $0x0, -0x50(%rbp,%rax)
leaq -0x50(%rbp), %rdi
movl -0x24(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x18fa00
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -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_getRGB
de_color dbuf_getRGB(dbuf *f, i64 pos, unsigned int flags)
{
	u8 buf[3];
	dbuf_read(f, buf, pos, 3);
	if(flags&DE_GETRGBFLAG_BGR)
		return DE_MAKE_RGB(buf[2], buf[1], buf[0]);
	return DE_MAKE_RGB(buf[0], buf[1], buf[2]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1f(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x3, %ecx
callq 0x164d10
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x166044
movzbl -0x1d(%rbp), %eax
shll $0x10, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
movzbl -0x1e(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x1f(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x166062
movzbl -0x1f(%rbp), %eax
shll $0x10, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
movzbl -0x1e(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x1d(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)