LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_run_base16
static void de_run_base16(deark *c, de_module_params *mparams)
{
	dbuf *f = NULL;

	f = dbuf_create_output_file(c, "bin", NULL, 0);
	de_decode_base16(c, c->infile, 0, c->infile->len, f, 0);
	dbuf_close(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7bc34(%rip), %rsi     # 0x1c1207
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
xorl %r9d, %r9d
callq 0x162030
movq -0x18(%rbp), %rdi
callq 0x1676a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_run_base64
static void de_run_base64(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	dbuf *f = NULL;

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

	f = dbuf_create_output_file(c, "bin", NULL, 0);
	do_base64_internal(c, d, 0, f);

	dbuf_close(f);
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x38, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7bb6a(%rip), %rsi     # 0x1c1207
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x145dc0
movq -0x20(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_module_uuencode
void de_module_uuencode(deark *c, struct deark_module_info *mi)
{
	mi->id = "uuencode";
	mi->desc = "UUEncode";
	mi->run_fn = de_run_uuencode;
	mi->identify_fn = de_identify_uuencode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x89495(%rip), %rcx     # 0x1ceb8c
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x89490(%rip), %rcx     # 0x1ceb95
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x145730
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x18d(%rip), %rcx       # 0x1458b0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_run_uuencode
static void de_run_uuencode(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	dbuf *f = NULL;
	struct uu_hdr_parser *uuhp = NULL;
	int ret;

	uuhp = de_malloc(c, sizeof(struct uu_hdr_parser));
	d = de_malloc(c, sizeof(lctx));

	d->fi = de_finfo_create(c);
	ret = uuencode_read_header(c, uuhp, d->fi, 0);
	if(!ret) goto done;

	if(uuhp->hdr_line_type==HDR_UUENCODE_BASE64) {
		de_declare_fmt(c, "Base64 with uuencode wrapper");
		d->data_fmt = FMT_BASE64;
		f = dbuf_create_output_file(c, NULL, d->fi, 0);
		do_base64_internal(c, d, uuhp->data_startpos, f);
	}
	else {
		de_declare_fmt(c, "Uuencoded");
		d->data_fmt = FMT_UUENCODE;
		f = dbuf_create_output_file(c, NULL, d->fi, 0);
		do_uudecode_internal(c, d, uuhp, f);
	}

done:
	dbuf_close(f);
	if(uuhp) {
		de_free(c, uuhp);
	}
	if(d) {
		de_finfo_destroy(c, d->fi);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x38, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %ecx, %ecx
callq 0x1460f0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x1457b5
jmp 0x14585c
movq -0x28(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x14580f
movq -0x8(%rbp), %rdi
leaq 0x8943f(%rip), %rsi     # 0x1cec08
callq 0x15e380
movq -0x18(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x20(%rbp), %rcx
callq 0x145dc0
jmp 0x14585a
movq -0x8(%rbp), %rdi
leaq 0x8940b(%rip), %rsi     # 0x1cec25
callq 0x15e380
movq -0x18(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x146310
jmp 0x14585c
movq -0x20(%rbp), %rdi
callq 0x1676a0
cmpq $0x0, -0x28(%rbp)
je 0x145879
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
cmpq $0x0, -0x18(%rbp)
je 0x14589e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x15d260
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_identify_uuencode
static int de_identify_uuencode(deark *c)
{
	u8 b[17];
	i64 pos;
	int retval = 0;
	struct uu_hdr_parser *uuhp;

	pos = bom_length(c);
	de_read(b, pos, sizeof(b));

	if(!de_memcmp(b, "begin-base64 ", 13)) {
		return 100;
	}
	if(!de_memcmp(b, "begin ", 6)) {
		if(b[9]==' ' && de_is_digit_string(&b[6], 3)) {
			// This needs to be lower than XXEncode.
			return 85;
		}
	}

	if(!de_input_file_has_ext(c, "uue") &&
		!de_input_file_has_ext(c, "uu"))
	{
		return 0;
	}

	// For some extensions, do detection the slow way.
	uuhp = de_malloc(c, sizeof(struct uu_hdr_parser));
	uuencode_read_header(c, uuhp, NULL, 1);
	if(uuhp->hdr_line_type==HDR_UUENCODE_OR_XXENCODE) {
		retval = 19;
	}
	else if(uuhp->hdr_line_type==HDR_UUENCODE_BASE64) {
		retval = 19;
	}
	de_free(c, uuhp);

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x146550
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl $0x11, %ecx
callq 0x164d10
leaq -0x30(%rbp), %rdi
leaq 0x89341(%rip), %rsi     # 0x1cec36
movl $0xd, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x145910
movl $0x64, -0x4(%rbp)
jmp 0x1459ea
leaq -0x30(%rbp), %rdi
leaq 0x89314(%rip), %rsi     # 0x1cec2f
movl $0x6, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x145958
movzbl -0x27(%rbp), %eax
cmpl $0x20, %eax
jne 0x145956
leaq -0x30(%rbp), %rdi
addq $0x6, %rdi
movl $0x3, %esi
callq 0x146870
cmpl $0x0, %eax
je 0x145956
movl $0x55, -0x4(%rbp)
jmp 0x1459ea
jmp 0x145958
movq -0x10(%rbp), %rdi
leaq 0x89369(%rip), %rsi     # 0x1ceccc
callq 0x15d180
cmpl $0x0, %eax
jne 0x14598b
movq -0x10(%rbp), %rdi
leaq 0x89358(%rip), %rsi     # 0x1cecd0
callq 0x15d180
cmpl $0x0, %eax
jne 0x14598b
movl $0x0, -0x4(%rbp)
jmp 0x1459ea
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x15b780
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x1460f0
movq -0x48(%rbp), %rax
cmpl $0xb, (%rax)
jne 0x1459c5
movl $0x13, -0x3c(%rbp)
jmp 0x1459d7
movq -0x48(%rbp), %rax
cmpl $0xc, (%rax)
jne 0x1459d5
movl $0x13, -0x3c(%rbp)
jmp 0x1459d7
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x15b820
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_module_xxencode
void de_module_xxencode(deark *c, struct deark_module_info *mi)
{
	mi->id = "xxencode";
	mi->desc = "XXEncode";
	mi->run_fn = de_run_xxencode;
	mi->identify_fn = de_identify_xxencode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x89187(%rip), %rcx     # 0x1ceb9e
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x89182(%rip), %rcx     # 0x1ceba7
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x145a50
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x12d(%rip), %rcx       # 0x145b70
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_run_xxencode
static void de_run_xxencode(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	dbuf *f = NULL;
	struct uu_hdr_parser *uuhp = NULL;
	int ret;

	uuhp = de_malloc(c, sizeof(struct uu_hdr_parser));
	d = de_malloc(c, sizeof(lctx));

	d->fi = de_finfo_create(c);
	ret = uuencode_read_header(c, uuhp, d->fi, 0);
	if(!ret) goto done;
	if(uuhp->hdr_line_type!=HDR_UUENCODE_OR_XXENCODE) goto done;

	de_declare_fmt(c, "XXEncoded");
	f = dbuf_create_output_file(c, NULL, d->fi, 0);
	d->data_fmt = FMT_XXENCODE;
	do_uudecode_internal(c, d, uuhp, f);

done:
	dbuf_close(f);
	if(uuhp) {
		de_free(c, uuhp);
	}
	if(d) {
		de_finfo_destroy(c, d->fi);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x38, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %ecx, %ecx
callq 0x1460f0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x145ad2
jmp 0x145b28
movq -0x28(%rbp), %rax
cmpl $0xb, (%rax)
je 0x145add
jmp 0x145b28
movq -0x8(%rbp), %rdi
leaq 0x891eb(%rip), %rsi     # 0x1cecd3
callq 0x15e380
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl $0x3, 0xc(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x146310
movq -0x20(%rbp), %rdi
callq 0x1676a0
cmpq $0x0, -0x28(%rbp)
je 0x145b45
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
cmpq $0x0, -0x18(%rbp)
je 0x145b6a
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x15d260
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_identify_xxencode
static int de_identify_xxencode(deark *c)
{
	int retval = 0;
	struct uu_hdr_parser *uuhp;

	// XXEncode is hard to distinguish from UUEncode, so we rely on the
	// filename.
	if(!de_input_file_has_ext(c, "xxe") &&
		!de_input_file_has_ext(c, "xx"))
	{
		return 0;
	}

	uuhp = de_malloc(c, sizeof(struct uu_hdr_parser));
	uuencode_read_header(c, uuhp, NULL, 1);
	if(uuhp->hdr_line_type==HDR_UUENCODE_OR_XXENCODE) {
		retval = (uuhp->hdr_line_startpos<=3) ? 90 : 20;
	}
	de_free(c, uuhp);

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x8914f(%rip), %rsi     # 0x1cecdd
callq 0x15d180
cmpl $0x0, %eax
jne 0x145bb6
movq -0x10(%rbp), %rdi
leaq 0x8913e(%rip), %rsi     # 0x1cece1
callq 0x15d180
cmpl $0x0, %eax
jne 0x145bb6
movl $0x0, -0x4(%rbp)
jmp 0x145c16
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x15b780
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x1460f0
movq -0x20(%rbp), %rax
cmpl $0xb, (%rax)
jne 0x145c03
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x14, %eax
movl $0x5a, %ecx
cmpq $0x3, %rdx
cmovlel %ecx, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x15b820
movl -0x14(%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/modules/xfer.c
// Function: de_module_ascii85
void de_module_ascii85(deark *c, struct deark_module_info *mi)
{
	mi->id = "ascii85";
	mi->desc = "Ascii85";
	mi->run_fn = de_run_ascii85;
	mi->identify_fn = de_identify_ascii85;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x88f79(%rip), %rcx     # 0x1cebb0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x88f73(%rip), %rcx     # 0x1cebb8
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x145c70
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xfd(%rip), %rcx        # 0x145d60
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_run_ascii85
static void de_run_ascii85(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	dbuf *f = NULL;

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

	d->ascii85_fmt = ascii85_detect_fmt(c);
	if(d->ascii85_fmt==0) {
		// TODO: Scan the file to try to detect the format.
		de_err(c, "Unknown Ascii85 format");
		goto done;
	}

	f = dbuf_create_output_file(c, "bin", NULL, 0);

	if(d->ascii85_fmt==ASCII85_FMT_BTOA_OLD ||
		d->ascii85_fmt==ASCII85_FMT_BTOA_NEW)
	{
		do_ascii85_btoa(c, d, f);
	}
	else if(d->ascii85_fmt==ASCII85_FMT_STANDARD) {
		do_ascii85_standard(c, d, f, 2);
	}

done:
	dbuf_close(f);
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x38, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x146910
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x145cd2
movq -0x8(%rbp), %rdi
leaq 0x8901b(%rip), %rsi     # 0x1cece4
movb $0x0, %al
callq 0x15bfb0
jmp 0x145d37
movq -0x8(%rbp), %rdi
leaq 0x7b52a(%rip), %rsi     # 0x1c1207
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x15, 0x10(%rax)
je 0x145d00
movq -0x18(%rbp), %rax
cmpl $0x16, 0x10(%rax)
jne 0x145d13
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1469d0
jmp 0x145d35
movq -0x18(%rbp), %rax
cmpl $0x17, 0x10(%rax)
jne 0x145d33
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x2, %ecx
callq 0x146c40
jmp 0x145d35
jmp 0x145d37
movq -0x20(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_identify_ascii85
static int de_identify_ascii85(deark *c)
{
	int fmt;

	fmt = ascii85_detect_fmt(c);

	if(fmt==ASCII85_FMT_BTOA_OLD) {
		return 100;
	}
	else if(fmt==ASCII85_FMT_BTOA_NEW) {
		return 100;
	}
	else if(fmt==ASCII85_FMT_STANDARD) {
		return 10;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x146910
movl %eax, -0x14(%rbp)
cmpl $0x15, -0x14(%rbp)
jne 0x145d87
movl $0x64, -0x4(%rbp)
jmp 0x145db0
cmpl $0x16, -0x14(%rbp)
jne 0x145d96
movl $0x64, -0x4(%rbp)
jmp 0x145db0
cmpl $0x17, -0x14(%rbp)
jne 0x145da5
movl $0xa, -0x4(%rbp)
jmp 0x145db0
jmp 0x145da7
jmp 0x145da9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_base64_flush
static i64 do_base64_flush(deark *c, lctx *d, dbuf *f, i64 max_to_write)
{
	i64 bytes_written = 0;

	if(d->cbuf_count>=2 && bytes_written<max_to_write) {
		dbuf_writebyte(f, (u8)((d->cbuf[0]<<2)|(d->cbuf[1]>>4)));
		bytes_written++;
	}
	if(d->cbuf_count>=3 && bytes_written<max_to_write) {
		dbuf_writebyte(f, (u8)((d->cbuf[1]<<4)|(d->cbuf[2]>>2)));
		bytes_written++;
	}
	if(d->cbuf_count>=4 && bytes_written<max_to_write) {
		dbuf_writebyte(f, (u8)((d->cbuf[2]<<6)|d->cbuf[3]));
		bytes_written++;
	}
	d->cbuf_count=0;
	return bytes_written;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jb 0x146053
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x146053
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x4(%rax), %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0x168380
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jb 0x146096
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x146096
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x5(%rax), %eax
shll $0x4, %eax
movq -0x10(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0x168380
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jb 0x1460d6
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x1460d6
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
shll $0x6, %eax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0x168380
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: get_uu_byte_value
static int get_uu_byte_value(deark *c, lctx *d, u8 b, u8 *val)
{
	if(d->data_fmt==FMT_XXENCODE) {
		if(b>='0' && b<='9') *val = b-46;
		else if(b>='A' && b<='Z') *val = b-53;
		else if(b>='a' && b<='z') *val = b-59;
		else if(b=='+') *val = 0;
		else if(b=='-') *val = 1;
		else {
			*val = 0;
			return 0;
		}
		return 1;
	}

	// Standard UUEncoding
	if(b>=32 && b<=96) {
		*val = (b-32)%64;
		return 1;
	}
	*val = 0;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, 0xc(%rax)
jne 0x146824
movzbl -0x19(%rbp), %eax
cmpl $0x30, %eax
jl 0x146799
movzbl -0x19(%rbp), %eax
cmpl $0x39, %eax
jg 0x146799
movzbl -0x19(%rbp), %eax
subl $0x2e, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
jmp 0x14681b
movzbl -0x19(%rbp), %eax
cmpl $0x41, %eax
jl 0x1467bc
movzbl -0x19(%rbp), %eax
cmpl $0x5a, %eax
jg 0x1467bc
movzbl -0x19(%rbp), %eax
subl $0x35, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
jmp 0x146819
movzbl -0x19(%rbp), %eax
cmpl $0x61, %eax
jl 0x1467df
movzbl -0x19(%rbp), %eax
cmpl $0x7a, %eax
jg 0x1467df
movzbl -0x19(%rbp), %eax
subl $0x3b, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
jmp 0x146817
movzbl -0x19(%rbp), %eax
cmpl $0x2b, %eax
jne 0x1467f1
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
jmp 0x146815
movzbl -0x19(%rbp), %eax
cmpl $0x2d, %eax
jne 0x146803
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x146813
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x146864
jmp 0x146815
jmp 0x146817
jmp 0x146819
jmp 0x14681b
movl $0x1, -0x4(%rbp)
jmp 0x146864
movzbl -0x19(%rbp), %eax
cmpl $0x20, %eax
jl 0x146856
movzbl -0x19(%rbp), %eax
cmpl $0x60, %eax
jg 0x146856
movzbl -0x19(%rbp), %eax
subl $0x20, %eax
movl $0x40, %ecx
cltd
idivl %ecx
movb %dl, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x146864
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: de_is_digit_string
static int de_is_digit_string(const u8 *s, i64 len)
{
	i64 i;
	for(i=0; i<len; i++) {
		if(!de_is_digit(s[i])) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x1468c1
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %edi
callq 0x1468e0
cmpl $0x0, %eax
jne 0x1468b1
movl $0x0, -0x4(%rbp)
jmp 0x1468c8
jmp 0x1468b3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x146888
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: ascii85_detect_fmt
static int ascii85_detect_fmt(deark *c)
{
	u8 buf[11];

	de_read(buf, 0, 11);

	if(!de_memcmp(buf, "xbtoa Begin", 11)) {
		return ASCII85_FMT_BTOA_OLD;
	}
	else if(!dbuf_memcmp(c->infile, 0, "xbtoa5 ", 7)) {
		return ASCII85_FMT_BTOA_NEW;
	}
	else if(!dbuf_memcmp(c->infile, 0, "<~", 2)) {
		return ASCII85_FMT_STANDARD;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x1b(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0xb, %ecx
callq 0x164d10
leaq -0x1b(%rbp), %rdi
leaq 0x883ba(%rip), %rsi     # 0x1cecfb
movl $0xb, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x146959
movl $0x15, -0x4(%rbp)
jmp 0x1469ba
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x8839b(%rip), %rdx     # 0x1ced07
movl $0x7, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x146984
movl $0x16, -0x4(%rbp)
jmp 0x1469ba
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x88378(%rip), %rdx     # 0x1ced0f
movl $0x2, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1469af
movl $0x17, -0x4(%rbp)
jmp 0x1469ba
jmp 0x1469b1
jmp 0x1469b3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_ascii85_standard
static void do_ascii85_standard(deark *c, lctx *d, dbuf *f, i64 pos)
{
	u8 x;

	d->cbuf_count = 0;

	while(1) {
		if(pos >= c->infile->len) break;
		x = de_getbyte(pos++);
		if(x=='~') {
			break;
		}
		do_ascii85_data_char_raw(c, d, f, 0, x);
	}

	do_ascii85_flush(c, d, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jl 0x146c76
jmp 0x146cbc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
callq 0x165060
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x7e, %eax
jne 0x146ca0
jmp 0x146cbc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x21(%rbp), %r8d
callq 0x147020
jmp 0x146c62
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x146e40
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_ascii85_read_btoa_end_line
static int do_ascii85_read_btoa_end_line(deark *c, lctx *d, i64 linenum,
	const u8 *linebuf, i64 line_len)
{
	long filesize1 = 0;

	de_dbg(c, "btoa footer at line %d", (int)linenum);
	if(de_sscanf((const char *)linebuf, "xbtoa End N %ld ", &filesize1) != 1) {
		de_err(c, "Bad btoa End line");
		return 0;
	}

	d->output_filesize = (i64)filesize1;
	d->output_filesize_known = 1;
	de_dbg(c, "reported file size: %d", (int)d->output_filesize);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x880a7(%rip), %rsi     # 0x1cedbc
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
leaq 0x880ac(%rip), %rsi     # 0x1cedd3
leaq -0x38(%rbp), %rdx
movb $0x0, %al
callq 0x19220
cmpl $0x1, %eax
je 0x146d52
movq -0x10(%rbp), %rdi
leaq 0x880a2(%rip), %rsi     # 0x1cede4
movb $0x0, %al
callq 0x15bfb0
movl $0x0, -0x4(%rbp)
jmp 0x146d8c
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
leaq 0x6516e(%rip), %rsi     # 0x1abeec
movb $0x0, %al
callq 0x15b0d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_ascii85_data_line
static void do_ascii85_data_line(deark *c, lctx *d, dbuf *f, i64 linenum,
	 const u8 *linebuf, i64 line_len)
{
	i64 i;
	i64 num_data_chars;

	if(line_len<1) return;

	if(d->ascii85_fmt==ASCII85_FMT_BTOA_NEW)
		num_data_chars = line_len-1; // The last character is a checksum
	else
		num_data_chars = line_len;

	for(i=0; i<num_data_chars; i++) {
		do_ascii85_data_char_raw(c, d, f, linenum, linebuf[i]);
	}

	// TODO: Verify the checksum character, if present.
}

// 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)
cmpq $0x1, -0x30(%rbp)
jge 0x146dc9
jmp 0x146e2b
movq -0x10(%rbp), %rax
cmpl $0x16, 0x10(%rax)
jne 0x146de1
movq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x146de9
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jge 0x146e2b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %r8
movzbl (%rax,%r8), %r8d
callq 0x147020
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x146df1
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_ascii85_data_char_raw
static void do_ascii85_data_char_raw(deark *c, lctx *d, dbuf *f, i64 linenum,
	 const u8 x)
{
	i64 k;

	if(x>='!' && x<='u') {
		do_ascii85_data_char_processed(c, d, f, linenum, x-33);
	}
	else if(x=='z') {
		// 'z' represents four 0x00 bytes, which encodes to five 0 values
		// (not including the +33 bias).
		for(k=0; k<5; k++)
			do_ascii85_data_char_processed(c, d, f, linenum, 0);
	}
	else if(x=='y' && d->ascii85_fmt==ASCII85_FMT_BTOA_NEW) {
		// This is what four spaces encodes to (not including the +33 bias).
		do_ascii85_data_char_processed(c, d, f, linenum, 0x0a);
		do_ascii85_data_char_processed(c, d, f, linenum, 0x1b);
		do_ascii85_data_char_processed(c, d, f, linenum, 0x35);
		do_ascii85_data_char_processed(c, d, f, linenum, 0x43);
		do_ascii85_data_char_processed(c, d, f, linenum, 0x2b);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x21, %eax
jl 0x147075
movzbl -0x21(%rbp), %eax
cmpl $0x75, %eax
jg 0x147075
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movzbl -0x21(%rbp), %eax
subl $0x21, %eax
movzbl %al, %r8d
callq 0x147170
jmp 0x14715e
movzbl -0x21(%rbp), %eax
cmpl $0x7a, %eax
jne 0x1470b8
movq $0x0, -0x30(%rbp)
cmpq $0x5, -0x30(%rbp)
jge 0x1470b3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %r8d, %r8d
callq 0x147170
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x147086
jmp 0x14715c
movzbl -0x21(%rbp), %eax
cmpl $0x79, %eax
jne 0x14715a
movq -0x10(%rbp), %rax
cmpl $0x16, 0x10(%rax)
jne 0x14715a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0xa, %r8d
callq 0x147170
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1b, %r8d
callq 0x147170
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x35, %r8d
callq 0x147170
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x43, %r8d
callq 0x147170
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x2b, %r8d
callq 0x147170
jmp 0x14715c
jmp 0x14715e
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/xfer.c
// Function: do_ascii85_data_char_processed
static void do_ascii85_data_char_processed(deark *c, lctx *d, dbuf *f, i64 linenum,
	 u8 x)
{
	// Write to the output file immediately before we empty cbuf, instead of
	// immediately after we fill it.
	// This is necessary because (in old btoa format at least) we don't yet
	// know the file size.
	// Until we know that, we don't know how many bytes need to be written for
	// the very last group.
	if(d->cbuf_count>=5) {
		do_ascii85_flush(c, d, f);
	}

	if(d->cbuf_count<(UI)sizeof(d->cbuf)) {
		d->cbuf[d->cbuf_count] = x;
		d->cbuf_count++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x5, (%rax)
jb 0x1471a8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x146e40
movq -0x10(%rbp), %rax
cmpl $0x5, (%rax)
jae 0x1471cd
movb -0x21(%rbp), %dl
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movb %dl, 0x4(%rax,%rcx)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: de_module_zip
void de_module_zip(deark *c, struct deark_module_info *mi)
{
	mi->id = "zip";
	mi->desc = "ZIP archive";
	mi->run_fn = de_run_zip;
	mi->identify_fn = de_identify_zip;
	mi->help_fn = de_help_zip;
	mi->flags |= DE_MODFLAG_MULTIPART;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x8d8d0(%rip), %rcx     # 0x1d4ac7
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x87d06(%rip), %rcx     # 0x1cef0b
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x3c(%rip), %rcx        # 0x147250
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1cd(%rip), %rcx       # 0x1473f0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x34e(%rip), %rcx       # 0x147580
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x30(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: de_run_zip
static void de_run_zip(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *s;
	u8 combine_mode = 0;
	de_encoding enc;

	combine_mode = (u8)de_get_ext_option_bool(c, "zip:combine", 0);
	if(combine_mode) {
		do_run_zip_combiner(c, mparams);
		return;
	}
	else {
		if(c->mp_data && c->mp_data->count>0) {
			de_err(c, "Multi-segment archives are only supported with \"-opt zip:combine\"");
			goto done;
		}
	}

	if(de_havemodcode(c, mparams, 'R')) {
		do_run_zip_relocator(c, mparams, 1, NULL);
		return;
	}

	s = de_get_ext_option(c, "zip:reloc");
	if(s) {
		do_run_zip_relocator(c, mparams, 0, s);
		return;
	}

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

	enc = de_get_input_encoding(c, NULL, DE_ENCODING_CP437);
	d->default_enc_for_filenames = enc;
	d->default_enc_for_comments = enc;

	d->crco = de_crcobj_create(c, DE_CRCOBJ_CRC32_IEEE);

	if(de_get_ext_option(c, "zip:scanmode")) {
		de_run_zip_scanmode(c, d);
	}
	else {
		de_run_zip_normally(c, d);
	}

done:
	if(d) {
		de_crcobj_destroy(d->crco);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x87b7f(%rip), %rsi     # 0x1cedf6
xorl %edx, %edx
callq 0x15cbc0
movb %al, -0x21(%rbp)
cmpb $0x0, -0x21(%rbp)
je 0x147299
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1475e0
jmp 0x1473dd
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x1472c8
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
cmpl $0x0, (%rax)
jle 0x1472c8
movq -0x8(%rbp), %rdi
leaq 0x87b46(%rip), %rsi     # 0x1cee02
movb $0x0, %al
callq 0x15bfb0
jmp 0x1473b9
jmp 0x1472ca
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x52, %edx
callq 0x15d1d0
cmpl $0x0, %eax
je 0x1472fc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x147940
jmp 0x1473dd
movq -0x8(%rbp), %rdi
leaq 0x87b3d(%rip), %rsi     # 0x1cee44
callq 0x15cb30
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x14732f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
xorl %edx, %edx
callq 0x147940
jmp 0x1473dd
movq -0x8(%rbp), %rdi
movl $0xc0, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xd, %edx
callq 0x15e4a0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15eac0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0x8(%rbp), %rdi
leaq 0x87abe(%rip), %rsi     # 0x1cee4e
callq 0x15cb30
cmpq $0x0, %rax
je 0x1473aa
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x147de0
jmp 0x1473b7
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x147ef0
jmp 0x1473b9
cmpq $0x0, -0x18(%rbp)
je 0x1473dd
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rdi
callq 0x15f2e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: de_help_zip
static void de_help_zip(deark *c)
{
	de_msg(c, "-opt zip:scanmode : Do not use the \"central directory\"");
	de_msg(c, "-opt zip:implodebug : Behave like PKZIP 1.01/1.02");
	de_msg(c, "-opt zip:reloc[=<new_offset>] : Instead of decoding, "
		"copy/optimize the file");
	de_msg(c, "-mp -opt zip:combine : Instead of decoding, "
		"combine a multi-segment archive into one file");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x88f44(%rip), %rsi     # 0x1d04db
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x88f69(%rip), %rsi     # 0x1d0512
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x88f89(%rip), %rsi     # 0x1d0544
movb $0x0, %al
callq 0x15c190
movq -0x8(%rbp), %rdi
leaq 0x88fc3(%rip), %rsi     # 0x1d0590
movb $0x0, %al
callq 0x15c190
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: de_run_zip_scanmode
static void de_run_zip_scanmode(deark *c, lctx *d)
{
	i64 pos = 0;

	d->using_scanmode = 1;

	while(1) {
		int ret;
		i64 foundpos = 0;
		i64 member_size = 0;

		if(pos > c->infile->len-4) break;
		ret = dbuf_search(c->infile, g_zipsig34, 4, pos, c->infile->len-pos, &foundpos);
		if(!ret) break;
		pos = foundpos;
		de_dbg(c, "zip member at %"I64_FMT, pos);
		de_dbg_indent(c, 1);
		ret = do_local_dir_only(c, d, pos, &member_size);
		de_dbg_indent(c, -1);
		if(!ret) break;
		if(member_size<1) break;
		pos += member_size;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0xb0(%rax)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rcx
subq $0x4, %rcx
cmpq %rcx, %rax
jle 0x147e34
jmp 0x147ee4
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r8
subq -0x18(%rbp), %r8
leaq 0x88797(%rip), %rsi     # 0x1d05ee
movl $0x4, %edx
leaq -0x28(%rbp), %r9
callq 0x169370
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x147e70
jmp 0x147ee4
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x8739a(%rip), %rsi     # 0x1cf221
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x149310
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpl $0x0, -0x1c(%rbp)
jne 0x147eca
jmp 0x147ee4
cmpq $0x1, -0x30(%rbp)
jge 0x147ed3
jmp 0x147ee4
movq -0x30(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x147e06
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: simple_read_eocd
static void simple_read_eocd(deark *c, dbuf *f, i64 pos1,
	struct eocd_struct *eocd)
{
	i64 pos = pos1+4;

	eocd->this_seg_num = dbuf_getu16le_p(f, &pos);
	eocd->cdir_starting_seg_num = dbuf_getu16le_p(f, &pos);
	eocd->cdir_num_entries_this_seg = dbuf_getu16le_p(f, &pos);
	eocd->cdir_num_entries_total = dbuf_getu16le_p(f, &pos);
	eocd->cdir_byte_size = dbuf_getu32le_p(f, &pos);
	eocd->cdir_offset = dbuf_getu32le_p(f, &pos);
	eocd->archive_comment_len = dbuf_getu16le_p(f, &pos);

	if(!dbuf_memcmp(f, pos1-20, g_zipsig67, 4)) {
		eocd->is_likely_zip64 = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
subq $0x14, %rsi
leaq 0x8842c(%rip), %rdx     # 0x1d05ea
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1481d5
movq -0x20(%rbp), %rax
movb $0x1, 0x38(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: simple_dbg_eocd
static void simple_dbg_eocd(deark *c, struct eocd_struct *eocd)
{
	de_dbg(c, "this segment num: %"I64_FMT, eocd->this_seg_num);
	de_dbg(c, "central dir num entries on this segment: %"I64_FMT,
		eocd->cdir_num_entries_this_seg);
	de_dbg(c, "central dir num entries: %"I64_FMT, eocd->cdir_num_entries_total);
	de_dbg(c, "central dir size: %"I64_FMT, eocd->cdir_byte_size);
	de_dbg(c, "central dir offset: %"I64_FMT", segment %"I64_FMT, eocd->cdir_offset,
		eocd->cdir_starting_seg_num);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x86d15(%rip), %rsi     # 0x1cef17
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x86d11(%rip), %rsi     # 0x1cef2d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x86d24(%rip), %rsi     # 0x1cef5a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x86d27(%rip), %rsi     # 0x1cef77
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0x86d1b(%rip), %rsi     # 0x1cef8d
movb $0x0, %al
callq 0x15b0d0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: zc_relpos_to_abspos
static void zc_relpos_to_abspos(struct zipcombine_ctx *d, struct zc_advpos *advpos)
{
	if(advpos->rel_seg_id<0 || advpos->rel_seg_id>=d->num_segments) {
		d->errflag = 1;
		advpos->abs_pos = d->f->len;
		return;
	}
	advpos->abs_pos = d->segments[advpos->rel_seg_id].starting_offset + advpos->rel_pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x1484e4
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x148501
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x14852e
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x10(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: zc_modify_eocd
static void zc_modify_eocd(deark *c, struct zipcombine_ctx *d)
{
	de_dbg(c, "[adjusting eocd]");

	// this segment id -> 0
	zc_writeu16le_at(d, d->eocd_pos.abs_pos + 4, 0);

	// cdir segment num -> 0
	zc_writeu16le_at(d, d->eocd_pos.abs_pos + 6, 0);

	// cdir num entries this segment
	zc_writeu16le_at(d, d->eocd_pos.abs_pos + 8, d->eocd.cdir_num_entries_total);

	// cdir offset
	zc_writeu32le_at(d, d->eocd_pos.abs_pos + 16, d->cdir_pos.abs_pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x86aa1(%rip), %rsi     # 0x1cf03c
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0x4, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x148a20
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0x6, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x148a20
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
callq 0x148a20
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0x10, %rsi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdx
callq 0x148a70
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: zc_modify_cdir
static void zc_modify_cdir(deark *c, struct zipcombine_ctx *d)
{
	struct zip_wcd_ctx *wcdctx = NULL;

	de_dbg(c, "[adjusting cdir entries]");
	de_dbg_indent(c, 1);
	wcdctx = de_malloc(c, sizeof(struct zip_wcd_ctx));
	wcdctx->userdata = (void*)d;
	wcdctx->cbfn = wcd_callback_for_fixcdir;
	wcdctx->inf = d->f;
	wcdctx->max_entries = d->eocd.cdir_num_entries_total;
	wcdctx->inf_start_pos = d->cdir_pos.abs_pos;
	zip_wcd_run(c, wcdctx);
	if(wcdctx->errflag) {
		d->errflag = 1;
		d->need_errmsg = 1;
		goto done;
	}

done:
	de_free(c, wcdctx);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x86a0a(%rip), %rsi     # 0x1cf04d
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movl $0x68, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
leaq 0x43f(%rip), %rcx       # 0x148ac0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x148830
movq -0x18(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0x1486dc
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x1486de
jmp 0x1486de
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: wcd_callback_for_cdpadding
static void wcd_callback_for_cdpadding(deark *c, struct zip_wcd_ctx *wcdctx)
{
	if(c->debug_level<2) return;
	de_dbg2(c, "peek at cdir entry #%u: segment %d, pos %"I64_FMT", len %"I64_FMT,
		(UI)wcdctx->num_entries_completed,
		wcdctx->userdata_seg_id, wcdctx->entry_pos, wcdctx->entry_size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jge 0x14871b
jmp 0x14874e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x48(%rax), %r9
leaq 0x868a6(%rip), %rsi     # 0x1cefed
movb $0x0, %al
callq 0x15b350
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/zip.c
// Function: zc_get_real_seg_size
static i64 zc_get_real_seg_size(deark *c, struct zipcombine_ctx *d,
	struct zip_wcd_ctx *wcdctx, dbuf *inf, int seg_id)
{
	i64 rvs = inf->len; // Default: keep everything.

	// Haven't reached the cdir yet, so no problem.
	if(seg_id < d->eocd.cdir_starting_seg_num) goto done;

	// The last segment isn't a problem.
	if(seg_id >= d->eocd.this_seg_num) goto done;

	// There are (probably) some cdir entries on this segment. Figure out where
	// the last one ends, and return that info to the caller.
	wcdctx->inf = inf;
	wcdctx->userdata_seg_id = seg_id;

	if(seg_id==d->eocd.cdir_starting_seg_num) {
		wcdctx->inf_start_pos = d->eocd.cdir_offset;
	}
	else {
		// Not common, and probably untested. It means there was a full segment
		// consisting entirely of cdir entries.
		wcdctx->inf_start_pos = 0;
	}

	zip_wcd_run(c, wcdctx);
	if(wcdctx->errflag) {
		d->errflag = 1;
		d->need_errmsg = 1;
		goto done;
	}

	rvs = wcdctx->inf_end_of_last_completed_entry;

done:
	return rvs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x14879b
jmp 0x148821
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x1487ab
jmp 0x148821
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x1487e1
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x1487ed
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x148830
movq -0x18(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0x148815
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x148821
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)