LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rar.c
// Function: rar_get_fmtver
static int rar_get_fmtver(dbuf *f, i64 pos)
{
	u8 buf[8];

	dbuf_read(f, buf, pos, sizeof(buf));
	if(!de_memcmp(buf, g_rar4_sig, 7)) {
		return 4; // ver 1.5x-4.xx
	}
	if(!de_memcmp(buf, g_rar5_sig, 8)) {
		return 5;
	}
	if(!de_memcmp(buf, g_rar_oldsig, 4)) {
		return 1; // ver < 1.50
	}
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movl $0x8, %ecx
movq %rbx, %rsi
callq 0xee8d4
movl $0x21726152, %eax       # imm = 0x21726152
xorl (%rbx), %eax
movl $0x71a21, %ecx          # imm = 0x71A21
xorl 0x3(%rbx), %ecx
orl %eax, %ecx
je 0xe29da
movabsq $0x1071a21726152, %rax  # imm = 0x1071A21726152
cmpq %rax, 0x8(%rsp)
je 0xe29e1
xorl %eax, %eax
cmpl $0x5e7e4552, 0x8(%rsp)  # imm = 0x5E7E4552
sete %al
jmp 0xe29e6
movl $0x4, %eax
jmp 0xe29e6
movl $0x5, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rar.c
// Function: rar_handle_noncmpr_comment
static void rar_handle_noncmpr_comment(deark *c, de_arch_lctx *d, i64 pos, i64 len,
	de_encoding enc, int is_file_comment)
{
	de_ucstring *comment = NULL;
	const char *ext;

	if(len<1) goto done;

	ext = is_file_comment?"fcomment.txt":"comment.txt";

	if(c->extract_level>=2) {
		dbuf_create_file_from_slice(c->infile, pos, len, ext,
			NULL, DE_CREATEFLAG_IS_AUX);
	}
	else {
		comment = ucstring_create(c);
		dbuf_read_to_ucstring_n(c->infile, pos, len, DE_DBG_MAX_STRLEN,
			comment, 0, DE_EXTENC_MAKE(enc, DE_ENCSUBTYPE_HYBRID));
		de_dbg(c, "%scomment: \"%s\"", (is_file_comment?"file ":""),
			ucstring_getpsz_d(comment));
	}

done:
	ucstring_destroy(comment);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
jle 0xe2a41
movl %r8d, %ebp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
cmpl $0x2, 0x90(%rdi)
jl 0xe2a45
testl %ebp, %ebp
leaq 0x35b19(%rip), %rax     # 0x118533
leaq 0x35b11(%rip), %rcx     # 0x118532
cmoveq %rax, %rcx
movq 0x18(%r14), %rdi
xorl %ebx, %ebx
movq %r12, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefd48
jmp 0xe2aac
xorl %ebx, %ebx
jmp 0xe2aac
movl %ecx, %r13d
movq %r14, %rdi
callq 0xf6410
movq %rax, %rbx
movq 0x18(%r14), %rdi
movzbl %r13b, %eax
orl $0x300, %eax            # imm = 0x300
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xefc2a
testl %ebp, %ebp
leaq 0x6262e(%rip), %rax     # 0x1450b0
leaq 0x62817(%rip), %r15     # 0x1452a0
cmoveq %rax, %r15
movq %rbx, %rdi
callq 0xf70f6
leaq 0x627f4(%rip), %rsi     # 0x145290
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6753
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rar.c
// Function: rar_get_vint_i64_p
static i64 rar_get_vint_i64_p(de_arch_lctx *d, dbuf *f, i64 *ppos)
{
	u64 v1u;
	i64 v1i;

	v1u = rar_get_vint_p(d, f, ppos);
	v1i = (i64)v1u;
	if(v1i<0) v1i = 0;
	return v1i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq $0x3f, %r15
ja 0xe34a3
movq %r14, %rdi
movq %rbx, %rsi
callq 0xeeb4b
movl %eax, %ecx
andb $0x7f, %cl
movzbl %cl, %edx
movl %r15d, %ecx
shlq %cl, %rdx
orq %rdx, %r12
addq $0x7, %r15
testb %al, %al
js 0xe3477
jmp 0xe34a6
xorl %r12d, %r12d
xorl %eax, %eax
testq %r12, %r12
cmovgq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rodraw.c
// Function: de_module_rodraw
void de_module_rodraw(deark *c, struct deark_module_info *mi)
{
	mi->id = "rodraw";
	mi->desc = "RISC OS Draw, Acorn Draw";
	mi->run_fn = de_run_rodraw;
	mi->identify_fn = de_identify_rodraw;
}

// Assembly:
leaq 0x62272(%rip), %rax     # 0x145735
movq %rax, (%rsi)
leaq 0x6226f(%rip), %rax     # 0x14573c
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe34e8
movq %rax, 0x18(%rsi)
leaq 0xc1(%rip), %rax        # 0xe35a4
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rodraw.c
// Function: de_run_rodraw
static void de_run_rodraw(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;

	d = de_malloc(c, sizeof(lctx));

	pos = 0;
	if(!do_header(c, d, pos)) goto done;
	pos += 40;

	if(!do_object_sequence(c, d, pos, c->infile->len-pos)) goto done;

done:
	de_free(c, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0xc, %esi
callq 0xe8b2b
movq %rax, %r14
leaq 0x561e6(%rip), %rsi     # 0x1396ee
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x8(%rsp), %r15
movq $0x4, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movl %eax, (%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movl %eax, 0x4(%r14)
movl (%r14), %edx
leaq 0x621ff(%rip), %rsi     # 0x145755
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
addq $0x1c, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rcx
addq $-0x28, %rcx
movl $0x28, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe35fb
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rodraw.c
// Function: do_object_sprite
static void do_object_sprite(deark *c, lctx *d, struct objinfo *oi)
{
	i64 dpos, dlen;
	dbuf *outf = NULL;
	de_finfo *fi = NULL;

	fi = de_finfo_create(c);

	dpos = oi->dpos;
	dlen = oi->dlen;

	if(oi->objtype==13) {
		// Skip transformation matrix
		dpos += 24;
		dlen -= 24;
	}

	if(dlen>=16) {
		// Peek at the sprite name, to use in the output filename.
		de_ucstring *s = NULL;
		s = ucstring_create(c);
		dbuf_read_to_ucstring(c->infile, dpos+4, 12, s,
			DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_RISCOS);
		de_finfo_set_name_from_ucstring(c, fi, s, 0);
		ucstring_destroy(s);
	}

	// An .acorn extension may be needed to open these files with XnView.
	outf = dbuf_create_output_file(c, "acorn", fi, 0x0);

	// Manufacture a sprite file, by adding a 12-byte header.
	dbuf_writeu32le(outf, 1); // number of sprites
	dbuf_writeu32le(outf, 12+4); // offset of sprite data (+4)
	dbuf_writeu32le(outf, 12+dlen+4); // file size (+4)
	dbuf_copy(c->infile, dpos, dlen, outf);

	dbuf_close(outf);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
callq 0xea504
movq %rax, %r14
movq 0x18(%r12), %rax
movq 0x20(%r12), %rcx
leaq -0x18(%rcx), %r15
cmpl $0xd, (%r12)
cmovneq %rcx, %r15
leaq 0x18(%rax), %r12
cmovneq %rax, %r12
cmpq $0x10, %r15
jl 0xe38c8
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r13
movq 0x18(%rbx), %rdi
leaq 0x4(%r12), %rsi
movl $0xc, %edx
movq %rax, %rcx
movl $0x1, %r8d
movl $0x14, %r9d
callq 0xefbd7
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xea53f
movq %r13, %rdi
callq 0xf6753
leaq 0x61f47(%rip), %rsi     # 0x145816
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r13
movl $0x1, %esi
movq %rax, %rdi
callq 0xf1042
movl $0x10, %esi
movq %r13, %rdi
callq 0xf1042
leaq 0x10(%r15), %rsi
movq %r13, %rdi
callq 0xf1042
movq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0xef481
movq %r13, %rdi
callq 0xf052b
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xea50e
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rm.c
// Function: de_module_rm
void de_module_rm(deark *c, struct deark_module_info *mi)
{
	mi->id = "rm";
	mi->desc = "RealMedia";
	mi->run_fn = de_run_rm;
	mi->identify_fn = de_identify_rm;
}

// Assembly:
leaq 0x3749b(%rip), %rax     # 0x11b172
movq %rax, (%rsi)
leaq 0x61b9c(%rip), %rax     # 0x14587d
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe3cfc
movq %rax, 0x18(%rsi)
leaq 0x5eb(%rip), %rax       # 0xe42e2
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/reko.c
// Function: de_module_reko
void de_module_reko(deark *c, struct deark_module_info *mi)
{
	mi->id = "reko";
	mi->desc = "REKO cardset";
	mi->run_fn = de_run_reko;
	mi->identify_fn = de_identify_reko;
	mi->help_fn = de_help_reko;
}

// Assembly:
leaq 0x6165c(%rip), %rax     # 0x14596b
movq %rax, (%rsi)
leaq 0x61657(%rip), %rax     # 0x145970
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0xe433f
movq %rax, 0x18(%rsi)
leaq 0x1250(%rip), %rax      # 0xe557f
movq %rax, 0x20(%rsi)
leaq 0x1259(%rip), %rax      # 0xe5593
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/reko.c
// Function: de_module_wizsolitaire
void de_module_wizsolitaire(deark *c, struct deark_module_info *mi)
{
	mi->id = "wizsolitaire";
	mi->desc = "Wiz Solitaire deck";
	mi->run_fn = de_run_wizsolitaire;
	mi->identify_fn = de_identify_wizsolitaire;
}

// Assembly:
leaq 0x603d5(%rip), %rax     # 0x14597d
movq %rax, (%rsi)
leaq 0x603d8(%rip), %rax     # 0x14598a
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe55cd
movq %rax, 0x18(%rsi)
leaq 0x2d4(%rip), %rax       # 0xe589c
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/reko.c
// Function: reko_fmt_from_sig
static u8 reko_fmt_from_sig(deark *c)
{
	u8 buf[8];

	de_read(buf, 0, sizeof(buf));

	if(!de_memcmp(buf, (const void*)"REKO", 4)) {
		// Just to screen out text files, I think we can assume the high byte
		// of the cardsize field is 0.
		if(de_getbyte(8) == 0) {
			return RKFMT_AMIGA;
		}
	}
	if(!de_memcmp(buf, (const void*)"PCREKO", 6)) {
		if(buf[6]=='D' && buf[7]==0x20) return RKFMT_RKP8;
		if(buf[6]==0 && buf[7]==0) return RKFMT_RKP16;
	}
	if(!de_memcmp(buf, (const void*)"PCRKP\0", 6)) {
		return RKFMT_RKP24;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %r14
movl $0x8, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0xee8d4
cmpl $0x4f4b4552, (%r14)     # imm = 0x4F4B4552
jne 0xe58fa
movq 0x18(%rbx), %rdi
movl $0x8, %esi
callq 0xeead3
testb %al, %al
je 0xe5952
movl $0x45524350, %eax       # imm = 0x45524350
xorl (%rsp), %eax
movzwl 0x4(%rsp), %ecx
xorl $0x4f4b, %ecx           # imm = 0x4F4B
orl %eax, %ecx
je 0xe592f
movl $0x4b524350, %eax       # imm = 0x4B524350
xorl (%rsp), %eax
movzwl 0x4(%rsp), %ecx
xorl $0x50, %ecx
xorl %edx, %edx
orl %eax, %ecx
movl $0x6, %eax
cmovnel %edx, %eax
jmp 0xe5954
movb 0x6(%rsp), %cl
movb 0x7(%rsp), %dl
movl %ecx, %esi
xorb $0x44, %sil
movl %edx, %edi
xorb $0x20, %dil
movb $0x4, %al
orb %sil, %dil
je 0xe5954
movb $0x5, %al
orb %dl, %cl
jne 0xe5911
jmp 0xe5954
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/reko.c
// Function: set_reko_card_filename
static void set_reko_card_filename(deark *c, i64 idx_of_first_main_card,
	i64 cardidx, de_finfo *fi)
{
	static const char *cnames = "a23456789tjqk";
	static const char *snames = "cdhs";
	char nbuf[16];

	if(cardidx>=idx_of_first_main_card && cardidx<idx_of_first_main_card+52) {
		nbuf[0] = cnames[(cardidx-idx_of_first_main_card)/4];
		nbuf[1] = snames[(cardidx-idx_of_first_main_card)%4];
		nbuf[2] = '\0';
	}
	else if(cardidx==0) {
		de_strlcpy(nbuf, "back", sizeof(nbuf));
	}
	else {
		de_strlcpy(nbuf, "other", sizeof(nbuf));
	}

	de_finfo_set_name_from_sz(c, fi, nbuf, 0, DE_ENCODING_LATIN1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdi, %r14
movq %rdx, %rax
subq %rsi, %rax
setge %cl
addq $0x34, %rsi
cmpq %rdx, %rsi
setg %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0xe59c1
leaq 0x60104(%rip), %rcx     # 0x145a91
leaq 0x3(%rax), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
movq %rdx, %rsi
sarq $0x2, %rsi
movb (%rsi,%rcx), %cl
movb %cl, (%rsp)
andq $-0x4, %rdx
subq %rdx, %rax
leaq 0x600ec(%rip), %rcx     # 0x145a9f
movb (%rcx,%rax), %al
movb %al, 0x1(%rsp)
movb $0x0, 0x2(%rsp)
jmp 0xe59e3
testq %rdx, %rdx
je 0xe59cf
leaq 0x66f00(%rip), %rsi     # 0x14c8cd
jmp 0xe59d6
leaq 0x600ce(%rip), %rsi     # 0x145aa4
movq %rsp, %rdi
movl $0x10, %edx
callq 0xe8219
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
movl $0x5, %r8d
callq 0xea78f
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/sgiimage.c
// Function: de_module_sgiimage
void de_module_sgiimage(deark *c, struct deark_module_info *mi)
{
	mi->id = "sgiimage";
	mi->desc = "SGI image";
	mi->run_fn = de_run_sgiimage;
	mi->identify_fn = de_identify_sgiimage;
}

// Assembly:
leaq 0x601f4(%rip), %rax     # 0x145bff
movq %rax, (%rsi)
leaq 0x601f3(%rip), %rax     # 0x145c08
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe5a30
movq %rax, 0x18(%rsi)
leaq 0x744(%rip), %rax       # 0xe616f
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/sgiimage.c
// Function: de_identify_sgiimage
static int de_identify_sgiimage(deark *c)
{
	UI n;

	if(c->infile->len<513) return 0;

	n = (UI)de_getu16be(0); // MAGIC
	if(n!=474) return 0;

	n = (UI)de_getbyte(2); // "STORAGE"
	if(n>1) return 0;

	n = (UI)de_getbyte(3); // "BPC"
	if(n<1 || n>2) return 0;

	n = (UI)de_getu16be(4); // "DIMENSION"
	// Only 1-3 are legal, but we allow 0-4 because this field is confusing
	// and underspecified.
	if(n>4) return 0;

	n = (UI)de_getu16be(10); // "ZSIZE"
	// Allow 0 because this field may be unused for some image types.
	if(n>4) return 0;

	return 60;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
cmpq $0x201, 0x18(%rdi)      # imm = 0x201
jl 0xe61ea
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xeeb67
cmpl $0x1da, %eax            # imm = 0x1DA
jne 0xe61ea
movq 0x18(%r14), %rdi
movl $0x2, %esi
callq 0xeead3
cmpb $0x1, %al
ja 0xe61ea
movq 0x18(%r14), %rdi
movl $0x3, %esi
callq 0xeead3
addb $-0x3, %al
cmpb $-0x2, %al
jb 0xe61ea
movq 0x18(%r14), %rdi
movl $0x4, %esi
callq 0xeeb67
cmpl $0x4, %eax
ja 0xe61ea
movq 0x18(%r14), %rdi
movl $0xa, %esi
callq 0xeeb67
xorl %ecx, %ecx
cmpl $0x5, %eax
movl $0x3c, %ebx
cmovael %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/sgiimage.c
// Function: sgiimage_decode_image
static void sgiimage_decode_image(deark *c, struct sgiimage_ctx *d,
	dbuf *inf, i64 pos1, de_bitmap *img, de_bitmap *imglo)
{
	i64 pos = pos1;
	i64 pn;
	i64 i, j;

	for(pn=0; pn<d->num_channels; pn++) {
		i64 samplenum;

		if(d->has_alpha && pn==(d->num_channels-1))
			samplenum = 3;
		else
			samplenum = pn;

		for(j=0; j<d->height; j++) {
			for(i=0; i<d->width; i++) {
				UI s;

				s = sgiimage_getsample_p(d, inf, &pos);

				if(imglo) {
					de_bitmap_setsample(img, i, j, samplenum, (de_colorsample)(s>>8));
					de_bitmap_setsample(imglo, i, j, samplenum, (s&0xff));
				}
				else {
					de_bitmap_setsample(img, i, j, samplenum, (de_colorsample)s);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x10(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x30(%rdi), %rcx
testq %rcx, %rcx
jle 0xe6332
movq %r8, %rbx
movq %rdi, %r12
movq 0x28(%rdi), %rax
xorl %esi, %esi
leaq -0x1(%rcx), %rdx
cmpq %rdx, %rsi
movq %rsi, %rdi
movl $0x3, %edx
cmoveq %rdx, %rdi
cmpb $0x0, 0x39(%r12)
cmoveq %rsi, %rdi
movq %rdi, 0x18(%rsp)
testq %rax, %rax
jle 0xe6326
movq %rsi, 0x20(%rsp)
movq 0x20(%r12), %rcx
movq $0x0, 0x8(%rsp)
testq %rcx, %rcx
jle 0xe6306
xorl %r14d, %r14d
movl 0x8(%r12), %edi
movq 0x28(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xe6341
movl %eax, %r15d
testq %rbx, %rbx
je 0xe62d5
movl %r15d, %r8d
shrl $0x8, %r8d
movl $0xff, %eax
andl %eax, %r8d
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rbp
movq %rbp, %rdx
movq 0x18(%rsp), %r13
movq %r13, %rcx
callq 0xf2355
movl $0xff, %eax
andl %eax, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movl %r15d, %r8d
jmp 0xe62eb
movzbl %r15b, %r8d
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0xf2355
incq %r14
movq 0x20(%r12), %rcx
cmpq %rcx, %r14
jl 0xe6274
movq 0x28(%r12), %rax
movq 0x8(%rsp), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
cmpq %rax, %rsi
jl 0xe6268
movq 0x30(%r12), %rcx
movq 0x20(%rsp), %rsi
incq %rsi
cmpq %rcx, %rsi
jl 0xe622a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/sgiimage.c
// Function: sgiimage_getsample_p
static UI sgiimage_getsample_p(struct sgiimage_ctx *d, dbuf *f, i64 *ppos)
{
	UI s;

	if(d->bytes_per_sample==2) {
		s = (UI)dbuf_getu16be_p(f, ppos);
	}
	else {
		s = dbuf_getbyte_p(f, ppos);
	}
	return s;
}

// Assembly:
pushq %rax
cmpl $0x2, %edi
jne 0xe6354
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xeeb91
jmp 0xe6362
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xeeb4b
movzbl %al, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/storyboard.c
// Function: de_module_storyboard
void de_module_storyboard(deark *c, struct deark_module_info *mi)
{
	mi->id = "storyboard";
	mi->desc = "Storyboard PIC/CAP";
	mi->run_fn = de_run_storyboard;
	mi->identify_fn = de_identify_storyboard;
}

// Assembly:
leaq 0x5fac5(%rip), %rax     # 0x145e30
movq %rax, (%rsi)
leaq 0x5fac6(%rip), %rax     # 0x145e3b
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe6390
movq %rax, 0x18(%rsi)
leaq 0xe2b(%rip), %rax       # 0xe71b6
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/storyboard.c
// Function: de_identify_storyboard
static int de_identify_storyboard(deark *c)
{
	u8 b[6];
	int has_ext;

	de_read(b, 0, sizeof(b));

	if(!de_memcmp(b, (const void*)"EP_CAP", 6)) {
		return 100;
	}

	if(c->infile->len<1856) return 0;
	if(b[2]!=0xc1) return 0;
	if(b[0]!=0x00 && b[0]!=0x54) return 0;

	has_ext = de_input_file_has_ext(c, "pic") ||
		de_input_file_has_ext(c, "cap");

	if(b[1]==0x84) {
		if(b[3]==0x01 || b[3]==0x03 || b[3]==0x07 || b[3]==0x08) {
			return has_ext ? 90 : 50;
		}
	}
	else if(b[1]==0x85 || b[1]==0x86) {
		return has_ext ? 51 : 11;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
xorl %ebx, %ebx
leaq 0xa(%rsp), %r15
movl $0x6, %ecx
movq %r15, %rsi
xorl %edx, %edx
callq 0xee8d4
movl $0x435f5045, %eax       # imm = 0x435F5045
xorl (%r15), %eax
movzwl 0x4(%r15), %ecx
xorl $0x5041, %ecx           # imm = 0x5041
orl %eax, %ecx
je 0xe7278
movq 0x18(%r14), %rax
cmpq $0x740, 0x18(%rax)      # imm = 0x740
jl 0xe7297
cmpb $-0x3f, 0xc(%rsp)
jne 0xe7297
movzbl 0xa(%rsp), %eax
cmpl $0x54, %eax
je 0xe7222
testl %eax, %eax
jne 0xe7297
leaq 0x4ef3c(%rip), %rsi     # 0x136165
movq %r14, %rdi
callq 0xea491
movb $0x1, %cl
testl %eax, %eax
jne 0xe724b
leaq 0x5ed48(%rip), %rsi     # 0x145f86
movq %r14, %rdi
callq 0xea491
testl %eax, %eax
setne %cl
movb 0xb(%rsp), %al
cmpb $-0x7c, %al
jne 0xe727f
movzbl 0xd(%rsp), %eax
cmpl $0x8, %eax
ja 0xe7297
movl $0x18a, %edx            # imm = 0x18A
btl %eax, %edx
jae 0xe7297
testb %cl, %cl
movl $0x5a, %eax
movl $0x32, %ebx
cmovnel %eax, %ebx
jmp 0xe7297
movl $0x64, %ebx
jmp 0xe7297
addb $0x7b, %al
testb %cl, %cl
movl $0x33, %ecx
movl $0xb, %edx
cmovnel %ecx, %edx
xorl %ebx, %ebx
cmpb $0x2, %al
cmovbl %edx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/xwd.c
// Function: de_module_xwd
void de_module_xwd(deark *c, struct deark_module_info *mi)
{
	mi->id = "xwd";
	mi->desc = "X-Windows screen dump";
	mi->run_fn = de_run_xwd;
	mi->identify_fn = de_identify_xwd;
}

// Assembly:
leaq 0x5eb47(%rip), %rax     # 0x145f8a
movq %rax, (%rsi)
leaq 0x5eb41(%rip), %rax     # 0x145f8e
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0xe7468
movq %rax, 0x18(%rsi)
leaq 0xb4b(%rip), %rax       # 0xe7fae
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/xwd.c
// Function: de_identify_xwd
static int de_identify_xwd(deark *c)
{
	int has_ext = 0;
	i64 hdrsize;
	i64 cmapn;
	UI n;

	// TODO: Identification could be improved.

	n = (UI)de_getu32be(4); // version
	if (n!=7) return 0;

	hdrsize = (UI)de_getu32be(0);
	if(hdrsize<100 || hdrsize>500) return 0;

	n = (UI)de_getu32be(8); // pixfmt
	if(n>2) return 0;

	n = (UI)de_getu32be(12); // depth
	if(n<1 || n>32) return 0;

	cmapn = de_getu32be(76);
	if(cmapn>512) return 0;
	if(hdrsize + 12*cmapn > c->infile->len) return 0;

	has_ext = de_input_file_has_ext(c, "xwd");
	if(has_ext) return 100;
	return 75;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movl $0x4, %esi
callq 0xeed0d
xorl %ebx, %ebx
cmpl $0x7, %eax
jne 0xe805d
movq 0x18(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xeed0d
movl %eax, %r15d
leaq -0x1f5(%r15), %rax
cmpq $-0x191, %rax           # imm = 0xFE6F
jb 0xe805d
movq 0x18(%r14), %rdi
movl $0x8, %esi
callq 0xeed0d
cmpl $0x2, %eax
ja 0xe805d
movq 0x18(%r14), %rdi
movl $0xc, %esi
callq 0xeed0d
addl $-0x21, %eax
cmpl $-0x20, %eax
jb 0xe805d
movq 0x18(%r14), %rdi
movl $0x4c, %esi
callq 0xeed0d
cmpq $0x200, %rax            # imm = 0x200
jg 0xe805d
leaq (%rax,%rax,2), %rax
leaq (%r15,%rax,4), %rax
movq 0x18(%r14), %rcx
cmpq 0x18(%rcx), %rax
jg 0xe805d
leaq 0x5df44(%rip), %rsi     # 0x145f8a
movq %r14, %rdi
callq 0xea491
testl %eax, %eax
movl $0x4b, %eax
movl $0x64, %ebx
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/xwd.c
// Function: find_cmap_and_image
static void find_cmap_and_image(deark *c, lctx *d)
{
	u8 need_cmap_warning = 0;
	i64 size1, size2;
	i64 avail_size;

	d->cmap_num_entries = (i64)d->hf[HF_CMAP_NUM_ENTRIES];
	d->cmap_size_in_bytes = d->cmap_num_entries * 12;

	// It's critical that we know exactly how many entries are in the colormap.
	// Sometimes its in one field, sometimes in another, and it's not clear
	// how to tell which.

	// We hope these two fields are the same.
	if(d->hf[HF_CMAP_NUM_ENTRIES] == d->hf[HF_NCOLORS]) goto done;

	if(d->hf[HF_NCOLORS] > d->hf[HF_CMAP_NUM_ENTRIES]) {
		// I haven't seen this happen.
		goto done;
	}

	// d->hf[HF_NCOLORS] < d->hf[HF_CMAP_NUM_ENTRIES]

	size1 = (i64)d->hf[HF_NCOLORS] * 12; // Note, size1 is smaller than size2
	size2 = (i64)d->hf[HF_CMAP_NUM_ENTRIES] * 12;
	avail_size = c->infile->len - d->expected_image_size - d->cmap_pos;

	if(size2==avail_size) {
		goto done;
	}
	if(size1==avail_size) {
		d->cmap_num_entries = (i64)d->hf[HF_NCOLORS];
		goto done;
	}
	if(size2>avail_size && size1<avail_size) {
		d->cmap_num_entries = (i64)d->hf[HF_NCOLORS];
		need_cmap_warning = 1;
		goto done;
	}

	need_cmap_warning = 1;

done:
	if(need_cmap_warning) {
		de_warn(c, "Can't reliably locate the image. Might not be decoded correctly.");
	}
	d->cmap_size_in_bytes = d->cmap_num_entries * 12;
	d->imgpos = d->cmap_pos + d->cmap_size_in_bytes;
	d->actual_image_size = c->infile->len - d->imgpos;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4c(%rsi), %ecx
movl 0x50(%rsi), %eax
movq %rcx, 0x78(%rsi)
movq %rcx, %rdx
shlq $0x2, %rdx
leaq (%rdx,%rdx,2), %rdx
movq %rdx, 0x80(%rsi)
cmpl %ecx, %eax
jae 0xe80aa
movq 0x18(%r14), %rcx
movq 0x18(%rcx), %rsi
movq 0x90(%rbx), %rcx
addq 0x70(%rbx), %rcx
subq %rcx, %rsi
cmpq %rsi, %rdx
jne 0xe80d9
movq %rdx, %rcx
movq %rcx, 0x80(%rbx)
addq 0x70(%rbx), %rcx
movq %rcx, 0x88(%rbx)
movq 0x18(%r14), %rax
movq 0x18(%rax), %rax
subq %rcx, %rax
movq %rax, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq (,%rax,4), %rcx
leaq (%rcx,%rcx,2), %rcx
cmpq %rsi, %rcx
jne 0xe80f0
movq %rax, 0x78(%rbx)
jmp 0xe80ad
cmpq %rsi, %rdx
setg %dl
cmpq %rsi, %rcx
setl %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0xe8107
movq %rax, 0x78(%rbx)
leaq 0x5e02f(%rip), %rsi     # 0x14613d
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8faa
movq 0x78(%rbx), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rcx
jmp 0xe80ad
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_strcasecmp_internal
static int de_strcasecmp_internal(const char *a, const char *b,
	int has_n, size_t n)
{
	size_t k = 0;

	while(1) {
		unsigned char a1, b1;

		if(has_n && (k>=n)) break;
		a1 = (unsigned char)a[k];
		b1 = (unsigned char)b[k];
		if(a1==0 && b1==0) break;
		if(a1>='A' && a1<='Z') a1 += 32;
		if(b1>='A' && b1<='Z') b1 += 32;
		if(a1<b1) return -1;
		if(a1>b1) return 1;
		k++;
	}
	return 0;
}

// Assembly:
testl %edx, %edx
setne %r8b
testq %rcx, %rcx
sete %r9b
xorl %eax, %eax
testb %r9b, %r8b
jne 0xe82e0
pushq %rbx
movl $0x1, %r8d
movb -0x1(%rdi,%r8), %r10b
movb -0x1(%rsi,%r8), %r9b
movl %r10d, %r11d
orb %r9b, %r11b
je 0xe82df
leal -0x41(%r10), %r11d
movzbl %r10b, %ebx
orb $0x20, %r10b
cmpb $0x1a, %r11b
movzbl %r10b, %r10d
cmovael %ebx, %r10d
leal -0x41(%r9), %r11d
movzbl %r9b, %ebx
orb $0x20, %r9b
cmpb $0x1a, %r11b
movzbl %r9b, %r9d
cmovael %ebx, %r9d
cmpb %r9b, %r10b
jb 0xe82d3
ja 0xe82da
testl %edx, %edx
setne %r9b
cmpq %rcx, %r8
setae %r10b
incq %r8
testb %r10b, %r9b
je 0xe8273
jmp 0xe82df
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xe82df
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_dbg
void de_dbg(deark *c, const char *fmt, ...)
{
	va_list ap;

	if(c && c->debug_level<1) return;
	va_start(ap, fmt);
	de_vdbg_internal(c, fmt, ap);
	va_end(ap);
}

// Assembly:
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xe866d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0xe869e
cmpl $0x0, (%rdi)
jle 0xe86ca
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
jmp 0xe86c5
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
xorl %edi, %edi
callq 0xe86d2
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_vdbg_internal
static void de_vdbg_internal(deark *c, const char *fmt, va_list ap)
{
	char bars_and_spaces[128];
	size_t bpos;
	int nspaces;
	int nbars;
	const char *dprefix = "DEBUG: ";

	if(c) {
		if(c->dprefix) dprefix = c->dprefix;

		nbars = c->module_nesting_level - 1;
		if(nbars>10) nbars=10;

		nspaces = c->dbg_indent_amount;
		if(nspaces>50) nspaces=50;
	}
	else {
		nbars = 0;
		nspaces = 0;
	}

	bpos = 0;
	while(nbars>0) {
		// One or more vertical lines, to indicate module nesting
		bars_and_spaces[bpos++] = '\xe2'; // U+2502 Box drawings light vertical
		bars_and_spaces[bpos++] = '\x94';
		bars_and_spaces[bpos++] = '\x82';
		nbars--;
	}
	while(nspaces>0) {
		bars_and_spaces[bpos++] = ' ';
		nspaces--;
	}
	bars_and_spaces[bpos] = '\0';

	de_printf(c, DE_MSGTYPE_DEBUG, "%s%s", dprefix, bars_and_spaces);
	de_vprintf(c, DE_MSGTYPE_DEBUG, fmt, ap);
	de_puts(c, DE_MSGTYPE_DEBUG, "\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rdi, %rdi
je 0xe8747
movq 0x120(%rbx), %rax
testq %rax, %rax
leaq 0x5de47(%rip), %r12     # 0x146549
cmovneq %rax, %r12
movl 0x10(%rbx), %edx
movl 0xc8(%rbx), %eax
cmpl $0x32, %eax
movl $0x32, %ebp
cmovll %eax, %ebp
cmpl $0x2, %edx
jl 0xe8753
cmpl $0xb, %edx
movl $0xb, %ecx
cmovll %edx, %ecx
xorl %r13d, %r13d
decl %ecx
movw $0x94e2, (%rsp,%r13)    # imm = 0x94E2
movb $-0x7e, 0x2(%rsp,%r13)
addq $0x3, %r13
cmpl $0x1, %ecx
ja 0xe872d
jmp 0xe8756
leaq 0x5ddfb(%rip), %r12     # 0x146549
xorl %r13d, %r13d
jmp 0xe8772
xorl %r13d, %r13d
testl %eax, %eax
jle 0xe8772
leaq (%rsp,%r13), %rdi
movl %ebp, %edx
movl $0x20, %esi
callq 0x18140
decl %ebp
addq %rbp, %r13
incq %r13
movb $0x0, (%rsp,%r13)
leaq 0x5ddef(%rip), %rdx     # 0x14656d
movq %rsp, %r8
movq %rbx, %rdi
movl $0x3, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0xe856b
leaq 0x80(%rsp), %r12
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x109360
movq %rbx, %rdi
movl $0x3, %esi
movq %r12, %rdx
callq 0xe82fa
leaq 0x279c2(%rip), %rdx     # 0x110187
movq %rbx, %rdi
movl $0x3, %esi
callq 0xe82fa
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_dbg2
void de_dbg2(deark *c, const char *fmt, ...)
{
	va_list ap;

	if(c && c->debug_level<2) return;
	va_start(ap, fmt);
	de_vdbg_internal(c, fmt, ap);
	va_end(ap);
}

// Assembly:
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xe883a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0xe886b
cmpl $0x2, (%rdi)
jl 0xe8897
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
jmp 0xe8892
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
xorl %edi, %edi
callq 0xe86d2
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_dbgx
void de_dbgx(deark *c, int lv, const char *fmt, ...)
{
	va_list ap;

	if(c && c->debug_level<lv) return;
	va_start(ap, fmt);
	de_vdbg_internal(c, fmt, ap);
	va_end(ap);
}

// Assembly:
subq $0xd8, %rsp
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xe89ab
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0xe89db
cmpl %esi, (%rdi)
jl 0xe8a0d
leaq 0x20(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
jmp 0xe8a02
leaq 0x20(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
xorl %edi, %edi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xe86d2
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_render_hexbytes_from_mem
char *de_render_hexbytes_from_mem(const u8 *inbytes, i64 ilen,
	char *outbuf, size_t outbuf_len)
{
	i64 inpos;
	size_t outpos = 0;

	if(ilen<1) goto done;
	if(ilen > (i64)(outbuf_len/3)) {
		ilen = (i64)(outbuf_len/3);
	}

	for(inpos = 0; inpos<ilen; inpos++) {
		if(inpos>0) outbuf[outpos++] = ' ';
		outbuf[outpos++] = de_get_hexchar((int)(inbytes[inpos]/16));
		outbuf[outpos++] = de_get_hexchar((int)(inbytes[inpos]%16));
	}

done:
	outbuf[outpos] = '\0';
	return outbuf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
testq %rsi, %rsi
jle 0xe8a60
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
movq %rdx, %r15
shrq %r15
cmpq %rsi, %r15
cmovaeq %rsi, %r15
cmpq $0x3, %rcx
jae 0xe8a65
xorl %r12d, %r12d
jmp 0xe8aaa
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
testq %r13, %r13
je 0xe8a7b
movb $0x20, (%rbx,%r12)
incq %r12
movzbl (%r14,%r13), %edi
shrl $0x4, %edi
callq 0xebba8
movb %al, (%rbx,%r12)
movzbl (%r14,%r13), %edi
andl $0xf, %edi
callq 0xebba8
movb %al, 0x1(%rbx,%r12)
addq $0x2, %r12
incq %r13
cmpq %r13, %r15
jne 0xe8a6e
movb $0x0, (%rbx,%r12)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_render_hexbytes_from_dbuf
char *de_render_hexbytes_from_dbuf(dbuf *inf, i64 pos, i64 ilen,
	char *outbuf, size_t outbuf_len)
{
	u8 *inbuf = 0;

	if(ilen>1024) ilen = 1024;
	inbuf = de_malloc(inf->c, ilen);

	dbuf_read(inf, inbuf, pos, ilen);
	(void)de_render_hexbytes_from_mem(inbuf, ilen, outbuf, outbuf_len);
	de_free(inf->c, inbuf);
	return outbuf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movl $0x400, %r13d           # imm = 0x400
cmpq %r13, %rdx
cmovlq %rdx, %r13
movq 0x8(%rdi), %rdi
movq %r13, %rsi
callq 0xe8b2b
movq %rax, %rbp
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0xee8d4
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xe8a2c
movq %rbp, %rdi
callq 0x18030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_malloc
void *de_malloc(deark *c, i64 n)
{
	void *m;

	if(n==0) n=1;
	if(n<0 || n>DE_MAX_MALLOC) {
		de_err(c,"Out of memory (%"I64_FMT" bytes requested)", n);
		de_fatalerror(c);
		// NOTREACHED
		n = 1;
	}

	while(1) {
		m = calloc((size_t)n, 1);
		if(m) return m;

		de_err(c, "Memory allocation failed (%"I64_FMT" bytes)", n);
		de_fatalerror(c);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x1, %rsi
movq %rsi, %r14
adcq $0x0, %r14
cmpq $0x1dcd6501, %rsi       # imm = 0x1DCD6501
jb 0xe8b81
leaq 0x5d880(%rip), %rsi     # 0x1463ce
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9295
testq %rbx, %rbx
je 0xe8b71
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0xe8b71
movq %rbx, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
movl $0x1, %r14d
movl $0x1, %esi
movq %r14, %rdi
callq 0x18190
testq %rax, %rax
jne 0xe8bdc
leaq 0x5d858(%rip), %r15     # 0x1463f2
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9295
testq %rbx, %rbx
je 0xe8bc0
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0xe8bc0
movq %rbx, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
movl $0x1, %esi
movq %r14, %rdi
callq 0x18190
testq %rax, %rax
je 0xe8b9a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_dbg_hexdump
void de_dbg_hexdump(deark *c, dbuf *f, i64 pos1,
	i64 nbytes_avail, i64 max_nbytes_to_dump,
	const char *prefix1, unsigned int flags)
{
	struct hexdump_ctx hctx;

	hctx.flags = flags;
	hctx.prefix = (prefix1) ? prefix1 : "data";
	hctx.printlinefn = hexdump_printline_dbg;

	de_hexdump_internal(c, &hctx, f, pos1, nbytes_avail, max_nbytes_to_dump);
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %r8, %rax
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movl 0x130(%rsp), %r10d
testq %r9, %r9
leaq 0x51716(%rip), %r11     # 0x13a325
cmovneq %r9, %r11
movq %rsp, %rsi
movl %r10d, 0x10(%rsi)
movq %r11, (%rsi)
leaq 0x14(%rip), %r9         # 0xe8c38
movq %r9, 0x18(%rsi)
movq %rax, %r9
callq 0xe8c4a
addq $0x128, %rsp            # imm = 0x128
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_hexdump2
void de_hexdump2(deark *c, dbuf *f, i64 pos1, i64 nbytes_avail,
	i64 max_nbytes_to_dump, unsigned int flags)
{
	struct hexdump_ctx hctx;

	hctx.flags = flags | 0x2;
	hctx.prefix = NULL;
	hctx.printlinefn = hexdump_printline_ext;
	de_hexdump_internal(c, &hctx, f, pos1, nbytes_avail, max_nbytes_to_dump);
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %r8, %rax
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
orl $0x2, %r9d
movq %rsp, %rsi
movl %r9d, 0x10(%rsi)
movq $0x0, (%rsi)
leaq 0x14(%rip), %r9         # 0xe8f74
movq %r9, 0x18(%rsi)
movq %rax, %r9
callq 0xe8c4a
addq $0x128, %rsp            # imm = 0x128
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_dbg_pal_entry2
void de_dbg_pal_entry2(deark *c, i64 idx, de_color clr,
	const char *txt_before, const char *txt_in, const char *txt_after)
{
	int r,g,b,a;
	char astr[32];
	char csamp[16];

	if(c->debug_level<2) return;
	if(!txt_before) txt_before="";
	if(!txt_in) txt_in="";
	if(!txt_after) txt_after="";
	r = (int)DE_COLOR_R(clr);
	g = (int)DE_COLOR_G(clr);
	b = (int)DE_COLOR_B(clr);
	a = (int)DE_COLOR_A(clr);
	if(a!=0xff) {
		de_snprintf(astr, sizeof(astr), ",A=%d", a);
	}
	else {
		astr[0] = '\0';
	}

	de_get_colorsample_code(c, clr, csamp, sizeof(csamp));
	de_dbg2(c, "pal[%3d] = %s(%3d,%3d,%3d%s%s)%s%s", (int)idx, txt_before,
		r, g, b, astr, txt_in, csamp, txt_after);
}

// Assembly:
cmpl $0x2, (%rdi)
jl 0xe91fb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %rdx
testq %rcx, %rcx
leaq 0x5d1dd(%rip), %rax     # 0x1462b0
cmoveq %rax, %r15
testq %r8, %r8
cmoveq %rax, %rbx
testq %r9, %r9
cmoveq %rax, %r14
movl %r12d, %ebp
shrl $0x10, %ebp
movl $0xff, %eax
movl %ebp, %r8d
andl %eax, %r8d
movl %r12d, %r13d
shrl $0x8, %r13d
movl %r13d, %r9d
andl %eax, %r9d
movl %r12d, %ecx
andl %eax, %ecx
movq %rcx, 0x18(%rsp)
movl %r12d, %ecx
shrl $0x18, %ecx
cmpl %eax, %ecx
jne 0xe911e
movb $0x0, 0x20(%rsp)
jmp 0xe915c
movq %rdx, 0x10(%rsp)
leaq 0x5d23d(%rip), %rdx     # 0x146367
movq %rdi, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x20, %esi
xorl %eax, %eax
movl %r8d, 0x4(%rsp)
movl %r9d, (%rsp)
callq 0xe8193
movl (%rsp), %r9d
movl 0x4(%rsp), %r8d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl %r12d, %eax
shrl $0x14, %eax
movl $0xff, %ecx
andl %ecx, %eax
andl %ecx, %ebp
shll $0x8, %ebp
orl %eax, %ebp
movl %r12d, %eax
shll $0x4, %eax
andl $0xff0000, %eax         # imm = 0xFF0000
orl %ebp, %eax
shll $0x18, %r13d
orl %eax, %r13d
movd %r13d, %xmm0
pand 0x5d04f(%rip), %xmm0    # 0x1461e0
por 0x5d057(%rip), %xmm0    # 0x1461f0
leaq 0x40(%rsp), %r10
movd %xmm0, 0x1(%r10)
movl %r12d, %eax
shrb $0x4, %al
orb $0x10, %al
movb %al, 0x5(%r10)
andb $0xf, %r12b
orb $0x10, %r12b
movb %r12b, 0x6(%r10)
movb $0x0, 0x7(%r10)
movb $0x3, (%r10)
subq $0x8, %rsp
leaq 0x28(%rsp), %r11
leaq 0x5d198(%rip), %rsi     # 0x14636d
movq %r15, %rcx
xorl %eax, %eax
pushq %r14
pushq %r10
pushq %rbx
pushq %r11
pushq 0x40(%rsp)
callq 0xe87e4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_verr
void de_verr(deark *c, const char *fmt, va_list ap)
{
	if(c) {
		c->error_count++;
	}

	de_puts(c, DE_MSGTYPE_ERROR, "Error: ");
	de_vprintf(c, DE_MSGTYPE_ERROR, fmt, ap);
	de_puts(c, DE_MSGTYPE_ERROR, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %r14
movq %rsi, %r15
testq %rdi, %rdi
je 0xe9288
movq %rdi, %rbx
incl 0x48(%rdi)
leaq 0x5d15b(%rip), %rdx     # 0x146390
movl $0x2, %esi
callq 0xe82fa
movq %rsp, %r12
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x109360
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xe82fa
leaq 0x26f1b(%rip), %rdx     # 0x110187
movq %rbx, %rdi
movl $0x2, %esi
callq 0xe82fa
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x182e0
jmp 0xe9279
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_vwarn
void de_vwarn(deark *c, const char *fmt, va_list ap)
{
	if(!c->show_warnings) return;
	de_puts(c, DE_MSGTYPE_WARNING, "Warning: ");
	de_vprintf(c, DE_MSGTYPE_WARNING, fmt, ap);
	de_puts(c, DE_MSGTYPE_WARNING, "\n");
}

// Assembly:
cmpl $0x0, 0xc4(%rdi)
je 0xe9392
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x5d058(%rip), %rdx     # 0x146398
movl $0x1, %esi
callq 0xe82fa
movq %rsp, %r12
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x109360
movq %rbx, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0xe82fa
leaq 0x26e10(%rip), %rdx     # 0x110187
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe82fa
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_info
void de_info(deark *c, const char *fmt, ...)
{
	va_list ap;

	if(!c->show_infomessages) return;
	va_start(ap, fmt);
	de_vprintf(c, DE_MSGTYPE_MESSAGE, fmt, ap);
	va_end(ap);
	de_puts(c, DE_MSGTYPE_MESSAGE, "\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xe93ec
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x0, 0xc0(%rdi)
je 0xe9456
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x4f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %r10, %rdx
callq 0x109360
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xe82fa
leaq 0x26d3b(%rip), %rdx     # 0x110187
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe82fa
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_msg
void de_msg(deark *c, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	de_vprintf(c, DE_MSGTYPE_MESSAGE, fmt, ap);
	va_end(ap);
	de_puts(c, DE_MSGTYPE_MESSAGE, "\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xe94c1
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x4f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
movq %r10, %rdx
callq 0x109360
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xe82fa
leaq 0x26c7a(%rip), %rdx     # 0x110187
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe82fa
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_internal_err_fatal
void de_internal_err_fatal(deark *c, const char *fmt, ...)
{
	va_list ap;

	de_puts(c, DE_MSGTYPE_ERROR, "Internal error: ");
	va_start(ap, fmt);
	de_vprintf(c, DE_MSGTYPE_ERROR, fmt, ap);
	va_end(ap);
	de_puts(c, DE_MSGTYPE_ERROR, "\n");
	de_fatalerror(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0xe95a6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x5cdf5(%rip), %rdx     # 0x1463a2
movl $0x2, %esi
callq 0xe82fa
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0x4f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
movq %r14, %rdx
callq 0x109360
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0xe82fa
leaq 0x26b81(%rip), %rdx     # 0x110187
movq %rbx, %rdi
movl $0x2, %esi
callq 0xe82fa
testq %rbx, %rbx
je 0xe9629
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0xe9629
movq %rbx, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_mallocarray
void *de_mallocarray(deark *c, i64 nmemb, size_t membsize)
{
	if(nmemb>DE_MAX_MALLOC || nmemb<0 || membsize>DE_MAX_MALLOC) {
		de_err(c, "Out of memory");
		de_fatalerror(c);
		// NOTREACHED
		return de_malloc(c, 1);
	}

	return de_malloc(c, nmemb*(i64)membsize);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1dcd6501, %eax       # imm = 0x1DCD6501
cmpq %rax, %rsi
setb %cl
cmpq %rax, %rdx
setb %al
testb %al, %cl
jne 0xe9748
leaq 0x5cca9(%rip), %rsi     # 0x1463c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
testq %rbx, %rbx
je 0xe9737
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0xe9737
movq %rbx, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
movl $0x1, %edx
jmp 0xe974c
imulq %rsi, %rdx
movq %rbx, %rdi
movq %rdx, %rsi
popq %rbx
jmp 0xe8b2b
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_reallocarray
void *de_reallocarray(deark *c, void *m, i64 oldnmemb, size_t membsize,
	i64 newnmemb)
{
	if(newnmemb>DE_MAX_MALLOC || newnmemb<0 || oldnmemb<0 || membsize>DE_MAX_MALLOC) {
		de_err(c, "Out of memory");
		de_fatalerror(c);
		// NOTREACHED
		return de_malloc(c, 1);
	}

	return de_realloc(c, m,
		oldnmemb*(i64)membsize,
		newnmemb*(i64)membsize);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x1dcd6500, %rcx       # imm = 0x1DCD6500
ja 0xe9787
testq %rdx, %rdx
js 0xe9787
cmpq $0x1dcd6501, %r8        # imm = 0x1DCD6501
jae 0xe9787
imulq %rcx, %rdx
imulq %rcx, %r8
movq %rbx, %rdi
movq %r8, %rcx
popq %rbx
jmp 0xe97c6
leaq 0x5cc32(%rip), %rsi     # 0x1463c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
testq %rbx, %rbx
je 0xe97ae
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0xe97ae
movq %rbx, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
movl $0x1, %esi
movq %rbx, %rdi
popq %rbx
jmp 0xe8b2b
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-util.c
// Function: de_realloc
void *de_realloc(deark *c, void *oldmem, i64 oldsize, i64 newsize)
{
	void *newmem;

	if(!oldmem) {
		return de_malloc(c, newsize);
	}

	newmem = realloc(oldmem, (size_t)newsize);
	if(!newmem) {
		de_err(c, "Memory reallocation failed (%"I64_FMT" bytes)", newsize);
		free(oldmem);
		de_fatalerror(c);
		// NOTREACHED
		return de_malloc(c, newsize);
	}

	if(oldsize<newsize) {
		// zero out any newly-allocated bytes
		de_zeromem(&((u8*)newmem)[oldsize], (size_t)(newsize-oldsize));
	}

	return newmem;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0xe9851
movq %rdx, %r12
movq %rsi, %r15
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x18250
testq %rax, %rax
je 0xe9815
movq %rax, %r13
subq %r12, %rbx
jle 0xe9808
movq %r13, %rdi
addq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x18140
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5cbfb(%rip), %rsi     # 0x146417
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xe9295
movq %r15, %rdi
callq 0x18030
testq %r14, %r14
je 0xe9847
movq 0x118(%r14), %rax
testq %rax, %rax
je 0xe9847
movq %r14, %rdi
callq *%rax
movl $0x1, %edi
callq 0x1097b3
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe8b2b