LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hfs.c
// Function: read_timestamp_fields
static void read_timestamp_fields(deark *c, lctx *d, i64 pos1,
	de_finfo *fi1)
{
	i64 pos = pos1;

	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_CREATE], "create date");
	pos += 4;
	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod date");
	pos += 4;
	read_one_timestamp(c, d, pos, &fi1->timestamp[DE_TIMESTAMPIDX_BACKUP], "backup date");
	//pos += 4;
}

// 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
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
addq $0x10, %rcx
leaq 0x131962(%rip), %r8     # 0x1ac6b1
callq 0x794a0
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
leaq 0x13194c(%rip), %r8     # 0x1ac6c7
callq 0x794a0
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq $0x18, %rcx
addq $0x40, %rcx
leaq 0x127c8a(%rip), %r8     # 0x1a2a35
callq 0x794a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hfs.c
// Function: read_finder_info
static void read_finder_info(deark *c, lctx *d, struct de_advfile *advf, i64 pos1)
{
	i64 pos = pos1;
	unsigned int flags;
	struct de_fourcc filetype;
	struct de_fourcc creator;

	dbuf_read_fourcc(c->infile, pos, &filetype, 4, 0x0);
	de_dbg(c, "filetype: '%s'", filetype.id_dbgstr);
	de_memcpy(advf->typecode, filetype.bytes, 4);
	advf->has_typecode = 1;
	pos += 4;
	dbuf_read_fourcc(c->infile, pos, &creator, 4, 0x0);
	de_dbg(c, "creator: '%s'", creator.id_dbgstr);
	de_memcpy(advf->creatorcode, creator.bytes, 4);
	advf->has_creatorcode = 1;
	pos += 4;

	flags = (unsigned int)de_getu16be(pos);
	de_dbg(c, "finder flags: 0x%04x", flags);
	advf->finderflags = (u16)flags;
	advf->has_finderflags = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
leaq -0x5c(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
leaq -0x5c(%rbp), %rdx
addq $0x10, %rdx
leaq 0x1258f4(%rip), %rsi    # 0x1a0707
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %ecx, 0x90(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x7b(%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
leaq -0x8c(%rbp), %rdx
addq $0x10, %rdx
leaq 0x144ec1(%rip), %rsi    # 0x1bfd32
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movl -0x8c(%rbp), %ecx
movl %ecx, 0x94(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x7c(%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x1651d0
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %edx
leaq 0x125858(%rip), %rsi    # 0x1a0716
movb $0x0, %al
callq 0x15b0d0
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x7e(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x7d(%rax)
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hfs.c
// Function: do_extract_fork_init
static void do_extract_fork_init(deark *c, lctx *d, struct recorddata *rd,
	struct fork_info *fki)
{
	i64 len_avail;

	len_avail = d->drAlBlkSiz * (fki->ExtRec[0].num_alloc_blks +
		fki->ExtRec[1].num_alloc_blks + fki->ExtRec[2].num_alloc_blks);
	if(fki->logical_eof > len_avail) {
		// TODO: Need to be able to read the Extents Overflow tree.
		de_err(c, "%s: Files with more than 3 fragments are not supported",
			rd->name_srd?ucstring_getpsz(rd->name_srd->str):"");
		fki->extract_error_flag = 1;
		goto done;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x20(%rbp), %rdx
addq 0x38(%rdx), %rcx
movq -0x20(%rbp), %rdx
addq 0x48(%rdx), %rcx
imulq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x28(%rbp), %rax
jle 0x7af95
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7af68
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq %rax, -0x38(%rbp)
jmp 0x7af75
leaq 0x155c61(%rip), %rax    # 0x1d0bd0
movq %rax, -0x38(%rbp)
jmp 0x7af75
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x131a9e(%rip), %rsi    # 0x1aca22
movb $0x0, %al
callq 0x15bfb0
movq -0x20(%rbp), %rax
movb $0x1, 0x2(%rax)
jmp 0x7af97
jmp 0x7af97
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hfs.c
// Function: my_advfile_cbfn
static int my_advfile_cbfn(deark *c, struct de_advfile *advf,
	struct de_advfile_cbparams *afp)
{
	struct extract_ctx *ectx = (struct extract_ctx*)advf->userdata;

	if(afp->whattodo == DE_ADVFILE_WRITEMAIN) {
		do_extract_fork_run(c, ectx->d, ectx->rd, ectx->fki_data, afp->outf);
	}
	else if(afp->whattodo == DE_ADVFILE_WRITERSRC) {
		do_extract_fork_run(c, ectx->d, ectx->rd, ectx->fki_rsrc, afp->outf);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x7aff3
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x7b040
jmp 0x7b026
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x7b024
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x7b040
jmp 0x7b026
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hfs.c
// Function: do_extract_fork_run
static void do_extract_fork_run(deark *c, lctx *d, struct recorddata *rd,
	struct fork_info *fki, dbuf *outf)
{
	i64 nbytes_still_to_write;
	size_t k;

	nbytes_still_to_write = fki->logical_eof;

	for(k=0; k<3; k++) {
		i64 fragment_dpos;
		i64 nbytes_to_write_this_time;

		if(nbytes_still_to_write<=0) break;

		fragment_dpos = allocation_blk_dpos(d, fki->ExtRec[k].first_alloc_blk);
		nbytes_to_write_this_time = d->drAlBlkSiz * fki->ExtRec[k].num_alloc_blks;
		if(nbytes_to_write_this_time > nbytes_still_to_write) {
			nbytes_to_write_this_time = nbytes_still_to_write;
		}

		if(fragment_dpos + nbytes_to_write_this_time > c->infile->len) {
			de_err(c, "Member file data goes beyond end of file");
			goto done;
		}

		dbuf_copy(c->infile, fragment_dpos, nbytes_to_write_this_time, outf);

		nbytes_still_to_write -= nbytes_to_write_this_time;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x3, -0x38(%rbp)
jae 0x7b143
cmpq $0x0, -0x30(%rbp)
jg 0x7b087
jmp 0x7b143
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
addq $0x20, %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x79660
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x20(%rbp), %rcx
addq $0x20, %rcx
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
imulq 0x8(%rcx), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x7b0e0
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x7b10a
movq -0x8(%rbp), %rdi
leaq 0x131958(%rip), %rsi    # 0x1aca59
movb $0x0, %al
callq 0x15bfb0
jmp 0x7b145
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x166070
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7b070
jmp 0x7b145
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: de_module_hlp
void de_module_hlp(deark *c, struct deark_module_info *mi)
{
	mi->id = "hlp";
	mi->desc = "HLP";
	mi->run_fn = de_run_hlp;
	mi->identify_fn = de_identify_hlp;
	mi->help_fn = de_help_hlp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x131afe(%rip), %rcx    # 0x1acc65
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x131af4(%rip), %rcx    # 0x1acc69
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0x7b1b0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x32d(%rip), %rcx       # 0x7b4c0
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x36e(%rip), %rcx       # 0x7b510
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_header
static void do_header(deark *c, lctx *d, i64 pos)
{
	i64 n;

	de_dbg(c, "header at %"I64_FMT, pos);
	de_dbg_indent(c, 1);

	d->internal_dir_FILEHEADER_offs = de_geti32le(4);
	de_dbg(c, "internal dir FILEHEADER pos: %"I64_FMT, d->internal_dir_FILEHEADER_offs);

	n = de_geti32le(8);
	de_dbg(c, "FREEHEADER pos: %"I64_FMT, n);

	n = de_geti32le(12);
	de_dbg(c, "reported file size: %"I64_FMT, n);

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x1337f0(%rip), %rsi    # 0x1aed63
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165600
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x131753(%rip), %rsi    # 0x1acd0b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x8, %esi
callq 0x165600
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x131748(%rip), %rsi    # 0x1acd2c
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xc, %esi
callq 0x165600
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x12be35(%rip), %rsi    # 0x1a7445
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: file_type_to_type_name
static const char* file_type_to_type_name(enum hlp_filetype file_fmt)
{
	const char *name = "unspecified";
	switch(file_fmt) {
	case FILETYPE_SYSTEM: name="system"; break;
	case FILETYPE_TOPIC: name="topic"; break;
	case FILETYPE_SHG: name="SHG/MRB"; break;
	case FILETYPE_INTERNALDIR: name="directory"; break;
	case FILETYPE_PHRASES: name="Phrases"; break;
	case FILETYPE_PHRINDEX: name="PhrIndex"; break;
	case FILETYPE_PHRIMAGE: name="PhrImage"; break;
	case FILETYPE_OTHERSPECIAL: name="other special stream"; break;
	case FILETYPE_EXTRACTABLE: name="other extractable file"; break;
	default: ;
	}
	return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
leaq 0x137eef(%rip), %rax    # 0x1b379d
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x8, %eax
ja 0x7b94f
movq -0x18(%rbp), %rax
leaq 0x13129f(%rip), %rcx    # 0x1acb70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1314d8(%rip), %rax    # 0x1acdb9
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x1314d2(%rip), %rax    # 0x1acdc0
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x1314cb(%rip), %rax    # 0x1acdc6
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x12424f(%rip), %rax    # 0x19fb57
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x13171d(%rip), %rax    # 0x1ad032
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x131719(%rip), %rax    # 0x1ad03b
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x131716(%rip), %rax    # 0x1ad045
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x131492(%rip), %rax    # 0x1acdce
movq %rax, -0x10(%rbp)
jmp 0x7b951
leaq 0x13149a(%rip), %rax    # 0x1acde3
movq %rax, -0x10(%rbp)
jmp 0x7b951
jmp 0x7b951
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_extract_raw_file
static void do_extract_raw_file(deark *c, lctx *d, i64 pos1, i64 used_space,
	struct de_stringreaderdata *fn)
{
	de_finfo *fi = NULL;
	const char *ext = NULL;

	fi = de_finfo_create(c);
	fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = d->gendate;
	if(fn && ucstring_isnonempty(fn->str)) {
		de_finfo_set_name_from_ucstring(c, fi, fn->str, 0);
		fi->original_filename_flag = 1;
	}
	else {
		ext = "bin";
	}
	dbuf_create_file_from_slice(c->infile, pos1, used_space, ext, fi, 0);

	de_finfo_destroy(c, fi);
}

// 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 $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x120(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x128(%rcx), %rcx
movq %rcx, 0x20(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x7b9f1
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x7b9f1
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %ecx, %ecx
callq 0x15d2c0
movq -0x30(%rbp), %rax
movb $0x1, 0x8(%rax)
jmp 0x7b9fc
leaq 0x14580f(%rip), %rax    # 0x1c1207
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
callq 0x166be0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x15d260
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_file_PhrImage
static void do_file_PhrImage(deark *c, lctx *d, i64 pos1, i64 len)
{
	de_dbg(c, "PhrImage data at %"I64_FMT", len=%"I64_FMT, pos1, len);
	if(len < d->PhrImageCmprSize) {
		return;
	}

	if(d->PhrImageCmprSize == d->PhrImageUncSize) {
		dbuf_copy(c->infile, pos1, d->PhrImageCmprSize, d->phrases_data);
	}
	else {
		decompress_Phrases(c, d, pos1, d->PhrImageCmprSize, d->PhrImageUncSize);
		de_dbg(c, "decompressed to %"I64_FMT" bytes", d->phrases_data->len);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x1310df(%rip), %rsi    # 0x1ad58a
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0xe8(%rcx), %rax
jge 0x7c4c8
jmp 0x7c551
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0xe0(%rcx), %rax
jne 0x7c509
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rcx
callq 0x166070
jmp 0x7c551
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %r8
callq 0x7ebc0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rax
movq 0x18(%rax), %rdx
leaq 0x1232ac(%rip), %rsi    # 0x19f7f6
movb $0x0, %al
callq 0x15b0d0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_file_SYSTEM
static void do_file_SYSTEM(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);

	// We'll read the SYSTEM "file" before pass 2, most importantly to record
	// the format version information.
	//
	// The SYSTEM file may contain a series of SYSTEMREC records that we want
	// to parse.
	// Note: It seems like we might have to make two (sub)passes over the
	// SYSTEMREC records, the first pass to collect the "charset" setting, so it
	// can be used to interpret records that appear before it. But I've never
	// seen a charset record that I can make sense of -- it's usually just a
	// random number of NUL bytes.

	if(d->pass!=1) goto done;

	if(!do_file_SYSTEM_header(c, d, pos)) goto done;
	pos += 12;

	if(d->ver_minor<=16) {
		d->help_file_title = ucstring_create(c);
		do_display_and_store_STRINGZ(c, d, pos, (pos1+len)-pos, "HelpFileTitle", d->help_file_title);
	}
	else {
		// A sequence of variable-sized SYSTEMRECs
		do_file_SYSTEM_SYSTEMRECS(c, d, pos, (pos1+len)-pos, 1);
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// 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
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x15b580
movq -0x10(%rbp), %rax
cmpl $0x1, 0xa4(%rax)
je 0x7c59f
jmp 0x7c640
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7edf0
cmpl $0x0, %eax
jne 0x7c5ba
jmp 0x7c640
movq -0x28(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x8c(%rax)
jg 0x7c61b
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x110(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x110(%rax), %r9
leaq 0x130f94(%rip), %r8     # 0x1ad5a8
callq 0x7f080
jmp 0x7c63e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
subq -0x28(%rbp), %rcx
movl $0x1, %r8d
callq 0x7f160
jmp 0x7c640
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x15b5a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_file_SHG
static void do_file_SHG(deark *c, lctx *d, i64 pos1, i64 used_space)
{
	i64 oldsig;
	const char *ext;
	dbuf *outf = NULL;
	de_finfo *fi = NULL;

	// Reportedly, 0x506c = SHG = 1 image, and 0x706c = MRB = >1 image.
	// But I'm not convinced that's correct.
	// I'm not sure what to do, as far as selecting a file extension, and potentially
	// correcting the signature. Current behavior is to leave the signature the same,
	// and derive the file extension from the number of images.
	oldsig = de_getu16le(pos1);

	if(oldsig==0x506c || oldsig==0x706c) {
		i64 num_images;

		num_images = de_getu16le(pos1+2);
		if(num_images>1) {
			ext="mrb";
		}
		else {
			ext="shg";
		}
	}
	else {
		ext="bin";
	}

	fi = de_finfo_create(c);
	// (Note that if we were to correct the signature, we probably should not copy
	// the mod time.)
	fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = d->gendate;
	outf = dbuf_create_output_file(c, ext, fi, 0);
	dbuf_copy(c->infile, pos1, used_space, outf);
	dbuf_close(outf);
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165280
movq %rax, -0x28(%rbp)
cmpq $0x506c, -0x28(%rbp)    # imm = 0x506C
je 0x7c6b1
cmpq $0x706c, -0x28(%rbp)    # imm = 0x706C
jne 0x7c6eb
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x48(%rbp)
cmpq $0x1, -0x48(%rbp)
jle 0x7c6de
leaq 0x13108a(%rip), %rax    # 0x1ad762
movq %rax, -0x30(%rbp)
jmp 0x7c6e9
leaq 0x130610(%rip), %rax    # 0x1accf5
movq %rax, -0x30(%rbp)
jmp 0x7c6f6
leaq 0x144b15(%rip), %rax    # 0x1c1207
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x15d230
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x120(%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x128(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x166070
movq -0x38(%rbp), %rdi
callq 0x1676a0
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x15d260
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: find_first_leaf_page
static int find_first_leaf_page(deark *c, lctx *d)
{
	i64 curr_page;
	i64 curr_level;
	int saved_indent_level;
	int retval = 0;

	de_dbg_indent_save(c, &saved_indent_level);
	curr_page = d->bpt.root_page;
	curr_level = d->bpt.num_levels;

	de_dbg(c, "looking for first leaf page");
	de_dbg_indent(c, 1);

	while(curr_level>1) {
		i64 prev_page;
		i64 page_pos;

		if(curr_page<0) goto done;
		page_pos = d->bpt.pagesdata_pos + curr_page*d->bpt.pagesize;

		de_dbg(c, "page %d is an index page, level=%d", (int)curr_page, (int)curr_level);

		prev_page = -1;
		de_dbg_indent(c, 1);
		do_index_page(c, d, page_pos, &prev_page);
		de_dbg_indent(c, -1);

		curr_page = prev_page;
		curr_level--;
	}

	de_dbg(c, "page %d is the first leaf page", (int)curr_page);
	d->bpt.first_leaf_page = curr_page;

	retval = 1;

done:
	de_dbg_indent_restore(c, saved_indent_level);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x15b580
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x130287(%rip), %rsi    # 0x1acf2e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
cmpq $0x1, -0x20(%rbp)
jle 0x7cd5f
cmpq $0x0, -0x18(%rbp)
jge 0x7ccd3
jmp 0x7cd8a
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq 0x20(%rdx), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x130244(%rip), %rsi    # 0x1acf4a
movb $0x0, %al
callq 0x15b0d0
movq $-0x1, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x7d2f0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7ccbc
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0x1301fd(%rip), %rsi    # 0x1acf6d
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movl $0x1, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x15b5a0
movl -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: filename_to_filetype
static enum hlp_filetype filename_to_filetype(deark *c, lctx *d, const char *fn)
{
	const char *ext;
	size_t extlen;

	if(fn[0]=='|') {
		if(!de_strcmp(fn, "|TOPIC")) return FILETYPE_TOPIC;
		if(!de_strcmp(fn, "|SYSTEM")) return FILETYPE_SYSTEM;
		if(!de_strncmp(fn, "|bm", 3) && de_is_digit(fn[3])) return FILETYPE_SHG;
		if(!de_strcmp(fn, "|Phrases")) return FILETYPE_PHRASES;
		if(!de_strcmp(fn, "|PhrIndex")) return FILETYPE_PHRINDEX;
		if(!de_strcmp(fn, "|PhrImage")) return FILETYPE_PHRIMAGE;
		return FILETYPE_OTHERSPECIAL;
	}

	ext = de_get_sz_ext(fn);
	extlen = de_strlen(ext);

	// Some SHG streams' names don't start with "|". Assume it is SHG if it
	// starts with "bm" and a digit, and doesn't have a ".".
	if(extlen==0) {
		if(!de_strncmp(fn, "bm", 2) && de_is_digit(fn[2])) return FILETYPE_SHG;
	}

	// Not sure how bold to be here. Should we extract every file that we can't
	// identify? Or maybe only those that have a filename extension?
	return FILETYPE_EXTRACTABLE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7c, %eax
jne 0x7d457
movq -0x20(%rbp), %rdi
leaq 0x12fc9f(%rip), %rsi    # 0x1ad01e
callq 0x191a0
cmpl $0x0, %eax
jne 0x7d395
movl $0x5, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
leaq 0x12fc85(%rip), %rsi    # 0x1ad025
callq 0x191a0
cmpl $0x0, %eax
jne 0x7d3b6
movl $0x4, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
leaq 0x12fc6c(%rip), %rsi    # 0x1ad02d
movl $0x3, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0x7d3ee
movq -0x20(%rbp), %rax
movsbl 0x3(%rax), %edi
callq 0x7d4c0
cmpl $0x0, %eax
je 0x7d3ee
movl $0x6, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
leaq 0x12fc38(%rip), %rsi    # 0x1ad031
callq 0x191a0
cmpl $0x0, %eax
jne 0x7d40f
movl $0x7, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
leaq 0x12fc20(%rip), %rsi    # 0x1ad03a
callq 0x191a0
cmpl $0x0, %eax
jne 0x7d430
movl $0x8, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
leaq 0x12fc09(%rip), %rsi    # 0x1ad044
callq 0x191a0
cmpl $0x0, %eax
jne 0x7d44e
movl $0x9, -0x4(%rbp)
jmp 0x7d4b6
movl $0x1, -0x4(%rbp)
jmp 0x7d4b6
movq -0x20(%rbp), %rdi
callq 0x15d000
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x190e0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x7d4af
movq -0x20(%rbp), %rdi
leaq 0x136c10(%rip), %rsi    # 0x1b4093
movl $0x2, %edx
callq 0x19050
cmpl $0x0, %eax
jne 0x7d4ad
movq -0x20(%rbp), %rax
movsbl 0x2(%rax), %edi
callq 0x7d4c0
cmpl $0x0, %eax
je 0x7d4ad
movl $0x6, -0x4(%rbp)
jmp 0x7d4b6
jmp 0x7d4af
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: sanitize_phrase_info
static void sanitize_phrase_info(deark *c, lctx *d)
{
	UI k;

	if(!d->phrases_data) {
		d->num_phrases = 0;
		return;
	}

	for(k=0; k<d->num_phrases; k++) {
		if((i64)d->phrase_info[k].pos + (i64)d->phrase_info[k].len > d->phrases_data->len) {
			d->phrase_info[k].pos = 0;
			d->phrase_info[k].len = 0;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
jne 0x7d51d
movq -0x10(%rbp), %rax
movl $0x0, 0xf8(%rax)
jmp 0x7d5a2
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xf8(%rcx), %eax
jae 0x7d5a2
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,8), %eax
movq -0x10(%rbp), %rcx
movq 0x100(%rcx), %rcx
movl -0x14(%rbp), %edx
movl 0x4(%rcx,%rdx,8), %ecx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x7d595
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movl -0x14(%rbp), %ecx
movl $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movl -0x14(%rbp), %ecx
movl $0x0, 0x4(%rax,%rcx,8)
jmp 0x7d597
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7d524
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: format_topiclink
static void format_topiclink(deark *c, lctx *d, u32 n, char *buf, size_t buf_len)
{
	if(d->ver_minor<=16) {
		de_snprintf(buf, buf_len, "%u", (UI)n);
	}
	else {
		if(n==INVALIDPOS) {
			de_strlcpy(buf, "-1", buf_len);
		}
		else {
			de_snprintf(buf, buf_len, "Blk%u:%u", (UI)(n/16384),
				(UI)(n%16384));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x8c(%rax)
jg 0x7d5f3
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %ecx
leaq 0x123cd2(%rip), %rdx    # 0x1a12bc
movb $0x0, %al
callq 0x15a980
jmp 0x7d638
cmpl $-0x1, -0x14(%rbp)
jne 0x7d60f
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x124b1a(%rip), %rsi    # 0x1a2122
callq 0x15aa30
jmp 0x7d636
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %ecx
shrl $0xe, %ecx
movl -0x14(%rbp), %r8d
andl $0x3fff, %r8d           # imm = 0x3FFF
leaq 0x12fac0(%rip), %rdx    # 0x1ad0ef
movb $0x0, %al
callq 0x15a980
jmp 0x7d638
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: decompress_topic_block
static void decompress_topic_block(deark *c, lctx *d, struct topic_ctx *tctx,
	i64 blknum, i64 blk_dpos, i64 blk_dlen,
	dbuf *outf)
{
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;
	i64 len_before;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);

	dcmpri.f = c->infile;
	dcmpri.pos = blk_dpos;
	dcmpri.len = blk_dlen;
	dcmpro.f = outf;
	dcmpro.len_known = 1;
	// TODO: Confirm what happens if a block decompresses to more than 16384-12 bytes.
	dcmpro.expected_len = 16384-TOPICBLOCKHDRSIZE;
	len_before = outf->len;
	fmtutil_hlp_lz77_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	de_dbg(c, "decompressed %"I64_FMT" to %"I64_FMT" bytes", blk_dlen,
		outf->len - len_before);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x68(%rbp), %rdx
leaq -0xc8(%rbp), %rcx
callq 0x1773f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movb $0x1, -0x60(%rbp)
movq $0x3ff4, -0x58(%rbp)    # imm = 0x3FF4
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x68(%rbp), %rdx
leaq -0xc8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1789f0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rcx
subq -0xd0(%rbp), %rcx
leaq 0x12f9ff(%rip), %rsi    # 0x1ad0f8
movb $0x0, %al
callq 0x15b0d0
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: calc_next_topiclink_pos
static int calc_next_topiclink_pos(deark *c, lctx *d, struct topic_ctx *tctx, i64 curpos,
	u32 next_pos_code, i64 *pnextpos)
{
	*pnextpos = 0;

	if(next_pos_code==INVALIDPOS) {
		de_dbg(c, "[stopping TOPIC parsing, end-of-links marker found]");
		return 0;
	}

	if(d->ver_minor<=16) {
		if(next_pos_code < 21) {
			de_dbg(c, "[stopping TOPIC parsing, no nextblock available]");
			return 0;
		}
		*pnextpos = hc30_abspos_plus_offset_to_abspos(c, d, curpos, next_pos_code);
	}
	else {
		if(!topicpos_to_abspos(c, d, tctx, next_pos_code, pnextpos)) {
			de_dbg(c, "[stopping TOPIC parsing, no nextblock available]");
			return 0;
		}

		if((*pnextpos) <= curpos) {
			de_dbg(c, "[stopping TOPIC parsing, blocks not in order]");
			return 0;
		}
	}

	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)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
cmpl $-0x1, -0x2c(%rbp)
jne 0x7de7f
movq -0x10(%rbp), %rdi
leaq 0x12f4fd(%rip), %rsi    # 0x1ad369
movb $0x0, %al
callq 0x15b0d0
movl $0x0, -0x4(%rbp)
jmp 0x7df3d
movq -0x18(%rbp), %rax
cmpl $0x10, 0x8c(%rax)
jg 0x7ded2
cmpl $0x15, -0x2c(%rbp)
jae 0x7deb0
movq -0x10(%rbp), %rdi
leaq 0x12f500(%rip), %rsi    # 0x1ad39d
movb $0x0, %al
callq 0x15b0d0
movl $0x0, -0x4(%rbp)
jmp 0x7df3d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %eax
movl %eax, %ecx
callq 0x7e9e0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0x7df36
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x2c(%rbp), %eax
movl %eax, %ecx
movq -0x38(%rbp), %r8
callq 0x7ea90
cmpl $0x0, %eax
jne 0x7df0c
movq -0x10(%rbp), %rdi
leaq 0x12f4a1(%rip), %rsi    # 0x1ad39d
movb $0x0, %al
callq 0x15b0d0
movl $0x0, -0x4(%rbp)
jmp 0x7df3d
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jg 0x7df34
movq -0x10(%rbp), %rdi
leaq 0x12f4aa(%rip), %rsi    # 0x1ad3ce
movb $0x0, %al
callq 0x15b0d0
movl $0x0, -0x4(%rbp)
jmp 0x7df3d
jmp 0x7df36
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/hlp.c
// Function: do_phrase_decompression
static void do_phrase_decompression(deark *c, lctx *d, dbuf *inf, i64 pos1, i64 len,
	dbuf *outf,  i64 unc_len_expected)
{
	i64 pos = pos1;
	i64 endpos = pos1+len;

	if(!d->phrases_data) return;

	while(1) {
		u8 b;

		if(pos >= endpos) break;
		b = dbuf_getbyte_p(inf, &pos);
		if(b==0 || b>=0x10) {
			dbuf_writebyte(outf, b);
		}
		else {
			u8 b2;
			UI n;

			if(pos >= endpos) break;
			b2 = dbuf_getbyte_p(inf, &pos);
			n = ((UI)(b-1)<<8) | b2;
			emit_phrase(c, d, outf, n>>1);
			if(n & 0x1) {
				dbuf_writebyte(outf, ' ');
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
jne 0x7df9b
jmp 0x7e042
jmp 0x7df9d
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jl 0x7dfac
jmp 0x7e042
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x0, %eax
je 0x7dfce
movzbl -0x41(%rbp), %eax
cmpl $0x10, %eax
jl 0x7dfdd
movq -0x30(%rbp), %rdi
movzbl -0x41(%rbp), %esi
callq 0x168380
jmp 0x7e03d
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jl 0x7dfe9
jmp 0x7e042
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x165170
movb %al, -0x42(%rbp)
movzbl -0x41(%rbp), %eax
subl $0x1, %eax
shll $0x8, %eax
movzbl -0x42(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x48(%rbp), %ecx
shrl %ecx
callq 0x7e410
movl -0x48(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7e03b
movq -0x30(%rbp), %rdi
movl $0x20, %esi
callq 0x168380
jmp 0x7e03d
jmp 0x7df9d
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: ensure_text_output_file_open
static void ensure_text_output_file_open(deark *c, lctx *d)
{
	if(d->outf_text) return;
	d->outf_text = dbuf_create_output_file(c, "dump.txt", NULL, 0);
	if(d->output_is_utf8 && c->write_bom) {
		dbuf_write_uchar_as_utf8(d->outf_text, 0xfeff);
	}
	if(ucstring_isnonempty(d->help_file_title)) {
		dbuf_puts(d->outf_text, "Title: ");
		// TODO: This doesn't do the right thing if !d->output_is_utf8.
		ucstring_write_as_utf8(c, d->help_file_title, d->outf_text, 0);
		dbuf_puts(d->outf_text, "\n");
	}
	if(ucstring_isnonempty(d->help_file_copyright)) {
		dbuf_puts(d->outf_text, "Copyright: ");
		ucstring_write_as_utf8(c, d->help_file_copyright, d->outf_text, 0);
		dbuf_puts(d->outf_text, "\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
je 0x7e4a3
jmp 0x7e5be
movq -0x8(%rbp), %rdi
leaq 0x12ee57(%rip), %rsi    # 0x1ad305
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x166c60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc0(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x7e4f6
movq -0x8(%rbp), %rax
movzbl 0xcc(%rax), %eax
cmpl $0x0, %eax
je 0x7e4f6
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
movl $0xfeff, %esi           # imm = 0xFEFF
callq 0x160cc0
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x7e55a
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
leaq 0x12edf1(%rip), %rsi    # 0x1ad30e
callq 0x168da0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdx
xorl %ecx, %ecx
callq 0x172150
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
leaq 0x11dc2e(%rip), %rsi    # 0x19c183
callq 0x168da0
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rdi
callq 0x1717f0
cmpl $0x0, %eax
je 0x7e5be
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
leaq 0x12ed95(%rip), %rsi    # 0x1ad316
callq 0x168da0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdx
xorl %ecx, %ecx
callq 0x172150
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdi
leaq 0x11dbca(%rip), %rsi    # 0x19c183
callq 0x168da0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: emit_slice
static void emit_slice(deark *c, lctx *d, dbuf *inf, i64 pos, i64 len)
{
	if(!d->outf_text) return;

	if(!d->output_is_utf8) {
		dbuf_copy(inf, pos, len, d->outf_text);
		return;
	}

	ucstring_empty(d->tmpucstring1);
	dbuf_read_to_ucstring(inf, pos, len, d->tmpucstring1, 0, d->input_encoding);
	ucstring_write_as_utf8(c, d->tmpucstring1, d->outf_text, 0);
}

// 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 %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
jne 0x7e7fc
jmp 0x7e87b
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x7e824
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rcx
callq 0x166070
jmp 0x7e87b
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rdi
callq 0x171210
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rdx
xorl %ecx, %ecx
callq 0x172150
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: do_topiclink_rectype_2_linkdata2
static void do_topiclink_rectype_2_linkdata2(deark *c, lctx *d,
	struct topic_ctx *tctx, struct topiclink_data *tld, dbuf *linkdata2)
{
	i64 k;
	int bytecount = 0;

	dbuf_truncate(d->tmpdbuf1, 0);
	emit_raw_sz(c, d, "# ");

	for(k=0; k<linkdata2->len; k++) {
		u8 b;

		b = dbuf_getbyte(linkdata2, k);
		if(b==0) break;
		dbuf_writebyte(d->tmpdbuf1, b);
		bytecount++;
	}

	if(bytecount>0) {
		emit_slice(c, d, d->tmpdbuf1, 0, d->tmpdbuf1->len);
	}
	else {
		emit_raw_sz(c, d, "(untitled topic)");
	}

	emit_raw_sz(c, d, " #\n");
}

// 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)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x168900
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x12ea3b(%rip), %rdx    # 0x1ad351
callq 0x7e890
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x7e977
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x165060
movb %al, -0x35(%rbp)
movzbl -0x35(%rbp), %eax
cmpl $0x0, %eax
jne 0x7e94c
jmp 0x7e977
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rdi
movzbl -0x35(%rbp), %esi
callq 0x168380
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7e923
cmpl $0x0, -0x34(%rbp)
jle 0x7e9aa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rax
movq 0x18(%rax), %r8
xorl %eax, %eax
movl %eax, %ecx
callq 0x7e7d0
jmp 0x7e9be
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x12e99b(%rip), %rdx    # 0x1ad354
callq 0x7e890
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x12e998(%rip), %rdx    # 0x1ad365
callq 0x7e890
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: hc30_abspos_plus_offset_to_abspos
static i64 hc30_abspos_plus_offset_to_abspos(deark *c, lctx *d, i64 pos, i64 offset)
{
	i64 blksize = d->topic_block_size-TOPICBLOCKHDRSIZE;
	i64 start_of_curr_block;
	i64 end_of_curr_block;
	i64 n;

	// We're at a position in blocks of size (d->topic_block_size-12). We need to add
	// 'offset', but subtract 12 every time we cross a block boundary.
	start_of_curr_block = (pos/blksize)*blksize;
	end_of_curr_block = start_of_curr_block + blksize;
	if(pos+offset <= end_of_curr_block) {
		return pos + offset;
	}

	n = pos+offset - end_of_curr_block;
	return pos + offset - TOPICBLOCKHDRSIZE*(1+(n / blksize));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x90(%rax), %rax
subq $0xc, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cqto
idivq -0x30(%rbp)
imulq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
cmpq -0x40(%rbp), %rax
jg 0x7ea42
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7ea7e
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
cqto
idivq -0x30(%rbp)
movq %rax, %rcx
movq -0x50(%rbp), %rax
addq $0x1, %rcx
imulq $0xc, %rcx, %rcx
subq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: topicpos_to_abspos
static int topicpos_to_abspos(deark *c, lctx *d, struct topic_ctx *tctx, i64 topicpos,
	i64 *pabspos)
{
	i64 blknum, blkoffs;

	if(!d->topic_block_size) return 0;
	blkoffs = topicpos % 16384;
	if(blkoffs<TOPICBLOCKHDRSIZE) return 0;
	blknum = topicpos / 16384;
	if(blknum<0 || blknum>=tctx->num_topic_blocks) return 0;
	*pabspos = tctx->topic_block_info[blknum].pos + (blkoffs-TOPICBLOCKHDRSIZE);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0x7eac2
movl $0x0, -0x4(%rbp)
jmp 0x7eb42
movq -0x28(%rbp), %rax
movl $0x4000, %ecx           # imm = 0x4000
cqto
idivq %rcx
movq %rdx, -0x40(%rbp)
cmpq $0xc, -0x40(%rbp)
jge 0x7eae4
movl $0x0, -0x4(%rbp)
jmp 0x7eb42
movq -0x28(%rbp), %rax
movl $0x4000, %ecx           # imm = 0x4000
cqto
idivq %rcx
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x7eb0a
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x7eb13
movl $0x0, -0x4(%rbp)
jmp 0x7eb42
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
subq $0xc, %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: dump_phrase_offset_table
static void dump_phrase_offset_table(deark *c, lctx *d)
{
	UI k;

	for(k=0; k<d->num_phrases; k++) {
		de_dbg2(c, "phrase[%u]: offs=%u, len=%u", k, d->phrase_info[k].pos,
			d->phrase_info[k].len);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xf8(%rcx), %eax
jae 0x7ebba
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,8), %ecx
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movl -0x14(%rbp), %esi
movl 0x4(%rax,%rsi,8), %r8d
leaq 0x12e93b(%rip), %rsi    # 0x1ad4e3
movb $0x0, %al
callq 0x15b350
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7eb67
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/hlp.c
// Function: decompress_Phrases
static void decompress_Phrases(deark *c, lctx *d, i64 pos, i64 cmpr_len, i64 uncmpr_len)
{
	struct de_dfilter_in_params dcmpri;
	struct de_dfilter_out_params dcmpro;
	struct de_dfilter_results dres;

	de_dfilter_init_objects(c, &dcmpri, &dcmpro, &dres);
	dcmpri.f = c->infile;
	dcmpri.pos = pos;
	dcmpri.len = cmpr_len;
	dcmpro.f = d->phrases_data;
	dcmpro.len_known = 1;
	dcmpro.expected_len = uncmpr_len;
	fmtutil_hlp_lz77_codectype1(c, &dcmpri, &dcmpro, &dres, NULL);
	if(dres.errcode || (d->phrases_data->len!=uncmpr_len)) {
		de_warn(c, "Phrases decompression may have failed");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x1773f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x60(%rbp)
movb $0x1, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x1789f0
cmpl $0x0, -0xc0(%rbp)
jne 0x7ec69
movq -0x10(%rbp), %rax
movq 0xf0(%rax), %rax
movq 0x18(%rax), %rax
cmpq -0x28(%rbp), %rax
je 0x7ec7b
movq -0x8(%rbp), %rdi
leaq 0x12e88b(%rip), %rsi    # 0x1ad4ff
movb $0x0, %al
callq 0x15bc10
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)