LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_iinf
static void do_box_iinf(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 nitems;
	u8 version;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;

	do_read_version_and_flags(c, d, bctx, &version, NULL, 1);
	pos += 4;

	if(version==0) {
		nitems = dbuf_getu16be_p(bctx->f, &pos);
	}
	else {
		nitems = dbuf_getu32be_p(bctx->f, &pos);
	}
	de_dbg(c, "number of items: %d", (int)nitems);

	curbox->num_children_is_known = 1;
	curbox->num_children = nitems;
	curbox->extra_bytes_before_children = pos - curbox->payload_pos;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq 0x28(%rdx), %r12
movq 0x38(%r12), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xea647(%rip), %rsi     # 0x115a88
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r15
movq 0x10(%r14), %rdi
movq %rsp, %rsi
testb %r15b, %r15b
je 0x2b467
callq 0xef34e
jmp 0x2b46c
callq 0xef193
movq %rax, %r14
leaq 0x100dae(%rip), %rsi    # 0x12c224
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movl $0x1, 0x60(%r12)
movq %r14, 0x68(%r12)
movq (%rsp), %rax
subq 0x38(%r12), %rax
movq %rax, 0x70(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_infe
static void do_box_infe(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 n;
	unsigned int item_id;

	do_read_version_and_flags(c, d, bctx, &version, NULL, 1);
	pos += 4;

	if(version==2 || version==3) {
		struct de_fourcc itemtype4cc;

		if(version==2) {
			item_id = (unsigned int)dbuf_getu16be_p(bctx->f, &pos);
		}
		else {
			item_id = (unsigned int)dbuf_getu32be_p(bctx->f, &pos);
		}
		de_dbg(c, "item id: %u", item_id);

		n = dbuf_getu16be_p(bctx->f, &pos);
		de_dbg(c, "item protection: %u", (unsigned int)n);

		dbuf_read_fourcc(bctx->f, pos, &itemtype4cc, 4, 0x0);
		pos += 4;
		de_dbg(c, "item type: '%s'", itemtype4cc.id_dbgstr);

		if(itemtype4cc.id==CODE_Exif) {
			d->exif_item_id_known = 1;
			d->exif_item_id = item_id;
		}

		// TODO: string item_name
		// TODO: sometimes there are additional strings after item_name
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r12
shrq $0x18, %r12
andl $0xffffff, %eax         # imm = 0xFFFFFF
movzbl %r12b, %edx
leaq 0xea055(%rip), %rsi     # 0x115a88
movq %r14, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
addq $0x4, 0x8(%rsp)
movl %r12d, %eax
andb $-0x2, %al
cmpb $0x2, %al
jne 0x2baf2
movq 0x10(%r15), %rdi
leaq 0x8(%rsp), %rsi
cmpb $0x2, %r12b
jne 0x2ba68
callq 0xef193
jmp 0x2ba6d
callq 0xef34e
movq %rax, %r12
leaq 0xea10d(%rip), %rsi     # 0x115b84
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r15), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
callq 0xef193
leaq 0xea157(%rip), %rsi     # 0x115bf3
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r15), %rdi
movq (%r13), %rsi
leaq 0x10(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
addq $0x4, (%r13)
leaq 0x20(%rsp), %r15
leaq 0xea134(%rip), %rsi     # 0x115c07
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
cmpl $0x45786966, -0xc(%r15) # imm = 0x45786966
jne 0x2baf2
movb $0x1, 0x18(%rbx)
movl %r12d, 0x1c(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_mdhd
static void do_box_mdhd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	i64 pos;
	i64 n;
	i64 timescale;
	double nd;
	struct de_boxdata *curbox = bctx->curbox;

	// TODO: Share code with do_box_mvhd()?
	if(curbox->payload_len<4) return;

	pos = curbox->payload_pos;
	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos+=4;

	if(version==1) {
		if(curbox->payload_len<36) return;
	}
	else {
		if(curbox->payload_len<24) return;
	}

	// creation time, mod time
	if(version==1)
		pos += 8 + 8;
	else
		pos += 4 + 4;

	timescale = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "timescale: %d time units per second", (int)timescale);

	// duration
	if(version==1) {
		n = dbuf_geti64be(bctx->f, pos);
		pos += 8;
	}
	else {
		n = dbuf_getu32be_p(bctx->f, &pos);
	}
	if(timescale>0)
		nd = (double)n / (double)timescale;
	else
		nd = 0.0;
	de_dbg(c, "duration: %d time units (%.2f seconds)", (int)n, nd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdx), %r12
cmpq $0x4, 0x40(%r12)
jl 0x2bc4f
movq %rdx, %r14
movq %rdi, %rbx
movq 0x38(%r12), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe9ef9(%rip), %rsi     # 0x115a88
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq (%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, (%rsp)
andl $0xff000000, %r15d      # imm = 0xFF000000
movq 0x40(%r12), %rdx
cmpq $0x1000000, %r15        # imm = 0x1000000
jne 0x2bbca
movl $0x14, %ecx
cmpq $0x24, %rdx
jge 0x2bbd5
jmp 0x2bc4f
movl $0xc, %ecx
cmpq $0x18, %rdx
jl 0x2bc4f
addq %rax, %rcx
movq %rsp, %rsi
movq %rcx, (%rsi)
movq 0x10(%r14), %rdi
callq 0xef34e
movq %rax, %r12
leaq 0xea026(%rip), %rsi     # 0x115c17
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
cmpl $0x1000000, %r15d       # imm = 0x1000000
jne 0x2bc1b
movq (%rsp), %rsi
callq 0xef4c3
addq $0x8, (%rsp)
jmp 0x2bc23
movq %rsp, %rsi
callq 0xef34e
testq %r12, %r12
jg 0x2bc2e
xorpd %xmm0, %xmm0
jmp 0x2bc3c
cvtsi2sd %rax, %xmm0
cvtsi2sd %r12, %xmm1
divsd %xmm1, %xmm0
leaq 0xe9ff8(%rip), %rsi     # 0x115c3b
movq %rbx, %rdi
movl %eax, %edx
movb $0x1, %al
callq 0xe9226
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_meta
static void do_box_meta(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	if(bctx->curbox->payload_len>=8) {
		// The QuickTime spec says 'meta' is not a full box, but in newer files
		// it is. I don't know how you're supposed to know, but sniffing for
		// "hdlr" should be good enough.
		u32 n = (u32)dbuf_getu32be(bctx->f, bctx->curbox->payload_pos+4);
		if(n==BOX_hdlr) {
			return;
		}
	}

	do_box_full_superbox(c, d, bctx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x28(%rdx), %rax
cmpq $0x8, 0x40(%rax)
jl 0x2bc90
movq 0x10(%rbx), %rdi
movq 0x38(%rax), %rsi
addq $0x4, %rsi
callq 0xef32a
cmpl $0x68646c72, %eax       # imm = 0x68646C72
jne 0x2bc90
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2bb00
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_smhd
static void do_box_smhd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	unsigned int n;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;

	if(curbox->payload_len<8) return;
	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0x0) return;

	n = (unsigned int)dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "balance: %u", n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rsi
movq %rsi, (%rsp)
cmpq $0x8, 0x40(%rax)
jl 0x2beb5
movq %rdx, %r14
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe9c1d(%rip), %rsi     # 0x115a88
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r15
testb %r15b, %r15b
setne %al
orb %bpl, %al
jne 0x2beb5
movq 0x10(%r14), %rdi
movq %rsp, %rsi
callq 0xef193
leaq 0xe9de3(%rip), %rsi     # 0x115c8c
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_stsc
static void do_box_stsc(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 e_count, e_to_print;
	i64 bytesleft;
	i64 k;

	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0) return;

	e_count = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "entry count: %u", (unsigned int)e_count);

	bytesleft = curbox->payload_pos + curbox->payload_len - pos;
	if(bytesleft/12 < e_count) return;

	e_to_print = de_min_int(e_count, d->max_entries_to_print);

	for(k=0; k<e_to_print; k++) {
		i64 first_chunk, spc, sdi;
		first_chunk = dbuf_getu32be_p(bctx->f, &pos);
		spc = dbuf_getu32be_p(bctx->f, &pos);
		sdi = dbuf_getu32be_p(bctx->f, &pos);
		de_dbg(c, "entry[%d]: first chunk=%d, samples/chunk=%d, descr. index=%d",
			(int)k, (int)first_chunk, (int)spc, (int)sdi);
	}
	if(e_to_print < e_count) {
		de_dbg(c, "[%d more entry(s) omitted, starting at %"I64_FMT"]",
			(int)(e_count-e_to_print), pos);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r13
movq 0x28(%rdx), %rbx
movq 0x38(%rbx), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe9b8c(%rip), %rsi     # 0x115a88
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r15
testb %r15b, %r15b
setne %al
orb %bpl, %al
jne 0x2c017
movq 0x10(%r14), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xef34e
movq %rax, %rbp
leaq 0xe9b34(%rip), %rsi     # 0x115a78
movq %r13, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x40(%rbx), %rax
addq 0x38(%rbx), %rax
subq (%r15), %rax
movabsq $0x2aaaaaaaaaaaaaab, %rcx # imm = 0x2AAAAAAAAAAAAAAB
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq %rdx
addq %rax, %rdx
cmpq %rbp, %rdx
jl 0x2c017
movq 0x10(%r12), %rsi
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
callq 0xea792
movq %rax, %r12
testq %rax, %rax
movq %r13, 0x8(%rsp)
jle 0x2bff3
movq %rsp, %r13
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xef34e
movq %rax, %rbp
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xef34e
movq %rax, %rbx
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xef34e
movq 0x8(%rsp), %rdi
leaq 0xe9cbf(%rip), %rsi     # 0x115c98
movl %r15d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
incq %r15
cmpq %r15, %r12
jne 0x2bfa3
movq 0x10(%rsp), %rdx
cmpq %r12, %rdx
movq 0x8(%rsp), %rdi
jle 0x2c017
subl %r12d, %edx
movq (%rsp), %rcx
leaq 0xe9cc5(%rip), %rsi     # 0x115cd5
xorl %eax, %eax
callq 0xe9226
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_stsd
static void do_box_stsd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	i64 pos;
	i64 num_entries;
	i64 entry_size;
	struct de_fourcc fmt4cc;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->payload_len<8) return;

	pos = curbox->payload_pos;
	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0) return;

	num_entries = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "number of sample description entries: %d", (int)num_entries);

	while(1) {
		if(pos + 16 >= curbox->payload_pos + curbox->payload_len) break;
		entry_size = dbuf_getu32be(bctx->f, pos);
		de_dbg(c, "sample description entry at %d, len=%d", (int)pos, (int)entry_size);
		if(entry_size<16) break;

		de_dbg_indent(c, 1);
		dbuf_read_fourcc(bctx->f, pos+4, &fmt4cc, 4, 0x0);
		de_dbg(c, "data format: '%s'", fmt4cc.id_dbgstr);
		de_dbg_indent(c, -1);

		pos += entry_size;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x28(%rdx), %r12
cmpq $0x8, 0x40(%r12)
jl 0x2c170
movq %rdx, %rbx
movq %rdi, %r14
movq 0x38(%r12), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe9a13(%rip), %rsi     # 0x115a88
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r15
testb %r15b, %r15b
jne 0x2c170
movq 0x10(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xef34e
leaq 0xe9c5a(%rip), %rsi     # 0x115d01
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r15), %rsi
leaq 0x10(%rsi), %rax
movq 0x40(%r12), %rcx
addq 0x38(%r12), %rcx
cmpq %rcx, %rax
jge 0x2c170
leaq 0x8(%rsp), %r13
leaq 0xe9c78(%rip), %rbp     # 0x115d51
movq 0x10(%rbx), %rdi
callq 0xef32a
movq %rax, %r15
movl (%rsp), %edx
movq %r14, %rdi
leaq 0xe9c38(%rip), %rsi     # 0x115d2a
movl %r15d, %ecx
xorl %eax, %eax
callq 0xe9226
cmpq $0x10, %r15
jl 0x2c170
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x10(%rbx), %rdi
movq (%rsp), %rsi
addq $0x4, %rsi
movq %r13, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq (%rsp), %rax
leaq (%rax,%r15), %rsi
movq %rsi, (%rsp)
addq %r15, %rax
addq $0x10, %rax
movq 0x40(%r12), %rcx
addq 0x38(%r12), %rcx
cmpq %rcx, %rax
jl 0x2c0d9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_stss
static void do_box_stss(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 e_count;

	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0) return;

	e_count = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "entry count: %u", (unsigned int)e_count);

	do_simple_int_table(c, d, bctx, pos, e_count, 4, "entry", "sample number");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r12
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xe98d0(%rip), %rsi     # 0x115a88
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r15, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r12
testb %r12b, %r12b
setne %al
orb %bpl, %al
jne 0x2c239
movq 0x10(%rbx), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xef34e
movq %rax, %r13
leaq 0xe987c(%rip), %rsi     # 0x115a78
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r12), %rcx
leaq 0xe9b4f(%rip), %rax     # 0x115d63
leaq 0x118618(%rip), %r10    # 0x144833
movl $0x4, %r9d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %r8
pushq %rax
pushq %r10
callq 0x2d6e5
addq $0x10, %rsp
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_stsz
static void do_box_stsz(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 s_size, s_count;

	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0) return;

	s_size = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "sample size: %u", (unsigned int)s_size);
	s_count = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "sample count: %u", (unsigned int)s_count);

	if(s_size!=0) goto done;

	do_simple_int_table(c, d, bctx, pos, s_count, 4, "sample", "entry size");

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rsi
movq %rsi, (%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r12
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xe9807(%rip), %rsi     # 0x115a88
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r15, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, (%rsp)
shrq $0x18, %r12
testb %r12b, %r12b
setne %al
orb %bpl, %al
jne 0x2c32a
movq 0x10(%rbx), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xef34e
movq %rax, %r13
leaq 0xe9aac(%rip), %rsi     # 0x115d71
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0xef34e
movq %rax, %r12
leaq 0xe9a99(%rip), %rsi     # 0x115d81
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
testq %r13, %r13
jne 0x2c32a
movq (%rsp), %rcx
leaq 0xe9a8d(%rip), %rax     # 0x115d92
leaq 0xe941b(%rip), %r10     # 0x115727
movl $0x4, %r9d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %r8
pushq %rax
pushq %r10
callq 0x2d6e5
addq $0x10, %rsp
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_stts
static void do_box_stts(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 e_count, e_to_print;
	i64 bytesleft;
	i64 k;

	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0) return;

	e_count = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "entry count: %u", (unsigned int)e_count);

	bytesleft = curbox->payload_pos + curbox->payload_len - pos;
	if(bytesleft/8 < e_count) return;

	e_to_print = de_min_int(e_count, d->max_entries_to_print);

	for(k=0; k<e_to_print; k++) {
		i64 s_count, s_delta;
		s_count = dbuf_getu32be_p(bctx->f, &pos);
		s_delta = dbuf_getu32be_p(bctx->f, &pos);
		de_dbg(c, "entry[%d]: sample count=%d, delta=%d", (int)k,
			(int)s_count, (int)s_delta);
	}
	if(e_to_print < e_count) {
		de_dbg(c, "[%d more entry(s) omitted, starting at %"I64_FMT"]",
			(int)(e_count-e_to_print), pos);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x28(%rdx), %r13
movq 0x38(%r13), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe9712(%rip), %rsi     # 0x115a88
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x4, 0x8(%rsp)
shrq $0x18, %r15
testb %r15b, %r15b
setne %al
orb %bpl, %al
jne 0x2c471
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef34e
movq %rax, %rbp
leaq 0xe96b7(%rip), %rsi     # 0x115a78
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x40(%r13), %rax
addq 0x38(%r13), %rax
subq (%r15), %rax
leaq 0x7(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
jl 0x2c471
movq 0x10(%r12), %rsi
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
callq 0xea792
movq %rax, %r12
testq %rax, %rax
jle 0x2c44e
leaq 0x8(%rsp), %r13
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xef34e
movq %rax, %rbp
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xef34e
movq %rbx, %rdi
leaq 0xe9966(%rip), %rsi     # 0x115d9d
movl %r15d, %edx
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe9226
incq %r15
cmpq %r15, %r12
jne 0x2c412
movq 0x10(%rsp), %rdx
cmpq %r12, %rdx
jle 0x2c471
subl %r12d, %edx
movq 0x8(%rsp), %rcx
leaq 0xe986e(%rip), %rsi     # 0x115cd5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_ctts
static void do_box_ctts(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 e_count, e_to_print;
	i64 bytesleft;
	i64 k;

	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version>1 || flags!=0) return;

	e_count = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "entry count: %u", (unsigned int)e_count);

	bytesleft = curbox->payload_pos + curbox->payload_len - pos;
	if(bytesleft < e_count*8) return;

	e_to_print = e_count;
	if(e_to_print > d->max_entries_to_print) {
		e_to_print = d->max_entries_to_print;
	}

	for(k=0; k<e_to_print; k++) {
		i64 s_count, s_offset;
		s_count = dbuf_getu32be_p(bctx->f, &pos);
		if(version==0) {
			s_offset = dbuf_getu32be_p(bctx->f, &pos);
		}
		else {
			s_offset = dbuf_geti32be(bctx->f, pos); pos += 4;
		}
		de_dbg(c, "entry[%d]: sample count=%"I64_FMT", offset=%"I64_FMT,
			(int)k, s_count, s_offset);
	}
	if(e_to_print < e_count) {
		de_dbg(c, "[%d more entry(s) omitted, starting at %"I64_FMT"]",
			(int)(e_count-e_to_print), pos);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x28(%rdx), %rbp
movq 0x38(%rbp), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r13
shrq $0x18, %r13
movzbl %r13b, %edx
leaq 0xe95c9(%rip), %rsi     # 0x115a88
andl $0xffffff, %eax         # imm = 0xFFFFFF
setne %r15b
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
addq $0x4, 0x8(%rsp)
cmpb $0x2, %r13b
setae %al
orb %r15b, %al
jne 0x2c5dd
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef34e
movq %r12, %r15
movq %rax, %r12
leaq 0xe9573(%rip), %rsi     # 0x115a78
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x40(%rbp), %rax
addq 0x38(%rbp), %rax
leaq 0x8(%rsp), %rcx
subq (%rcx), %rax
leaq (,%r12,8), %rcx
cmpq %rcx, %rax
jl 0x2c5dd
movq %r12, %rdx
movq %rbx, 0x10(%rsp)
movq 0x10(%r15), %r12
cmpq %r12, %rdx
movq %r12, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmovlq %rdx, %r12
testq %r12, %r12
jle 0x2c5b6
leaq 0x8(%rsp), %rbx
xorl %ebp, %ebp
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0xef34e
movq %rax, %r15
movq 0x10(%r14), %rdi
testb %r13b, %r13b
je 0x2c586
movq 0x8(%rsp), %rsi
callq 0xef3cb
addq $0x4, 0x8(%rsp)
jmp 0x2c58e
movq %rbx, %rsi
callq 0xef34e
movq 0x10(%rsp), %rdi
leaq 0xe9828(%rip), %rsi     # 0x115dc2
movl %ebp, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xe9226
incq %rbp
cmpq %rbp, %r12
leaq 0x8(%rsp), %rbx
jne 0x2c55c
movq 0x20(%rsp), %rdx
cmpq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rdi
jle 0x2c5dd
subl %r12d, %edx
movq 0x8(%rsp), %rcx
leaq 0xe96ff(%rip), %rsi     # 0x115cd5
xorl %eax, %eax
callq 0xe9226
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_tkhd
static void do_box_tkhd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	i64 pos;
	double w, h;
	i64 n;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->payload_len<4) return;

	pos = curbox->payload_pos;
	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos+=4;

	if(version==1) {
		if(curbox->payload_len<96) return;
	}
	else {
		if(curbox->payload_len<84) return;
	}

	// creation time, mod time
	if(version==1)
		pos += 8 + 8;
	else
		pos += 4 + 4;

	n = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "track id: %d", (int)n);

	pos += 4; // reserved

	// duration
	if(version==1)
		pos += 8;
	else
		pos += 4;

	pos += 4*2; // reserved
	pos += 2; // layer
	pos += 2; // alternate group

	n = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "volume: %.3f", ((double)n)/256.0);

	pos += 2; // reserved
	pos += 4*9; // matrix

	w = dbuf_fmtutil_read_fixed_16_16(bctx->f, pos);
	pos += 4;
	h = dbuf_fmtutil_read_fixed_16_16(bctx->f, pos);
	pos += 4;
	de_dbg(c, "dimensions: %.1f"DE_CHAR_TIMES"%.1f", w, h);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x28(%rdx), %r15
cmpq $0x4, 0x40(%r15)
jl 0x2c73a
movq %rdx, %r14
movq %rdi, %rbx
movq 0x38(%r15), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r12
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xe9451(%rip), %rsi     # 0x115a88
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x8(%rsp)
andl $0xff000000, %r12d      # imm = 0xFF000000
movq 0x40(%r15), %rdx
cmpq $0x1000000, %r12        # imm = 0x1000000
jne 0x2c673
movl $0x14, %ecx
cmpq $0x60, %rdx
jge 0x2c682
jmp 0x2c73a
movl $0xc, %ecx
cmpq $0x54, %rdx
jl 0x2c73a
addq %rax, %rcx
leaq 0x8(%rsp), %r15
movq %rcx, (%r15)
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0xef34e
leaq 0xe95df(%rip), %rsi     # 0x115c7f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq (%r15), %rax
leaq 0x4(%rax), %rcx
cmpl $0x1000000, %r12d       # imm = 0x1000000
cmovneq %rax, %rcx
addq $0x14, %rcx
movq %rcx, (%r15)
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0xef193
cvtsi2sd %rax, %xmm0
mulsd 0xe8bd2(%rip), %xmm0    # 0x1152b0
leaq 0xe9588(%rip), %rsi     # 0x115c6d
movq %rbx, %rdi
movb $0x1, %al
callq 0xe9226
movq (%r15), %rsi
addq $0x26, %rsi
movq %rsi, (%r15)
movq 0x10(%r14), %rdi
callq 0xf8544
movsd %xmm0, 0x10(%rsp)
movq (%r15), %rsi
addq $0x4, %rsi
movq %rsi, (%r15)
movq 0x10(%r14), %rdi
callq 0xf8544
movapd %xmm0, %xmm1
addq $0x4, (%r15)
leaq 0xe96c0(%rip), %rsi     # 0x115dea
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movb $0x2, %al
callq 0xe9226
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_url
static void do_box_url(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	de_ucstring *s = NULL;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	u32 flags = 0;

	do_read_version_and_flags(c, d, bctx, NULL, &flags, 1);
	pos += 4;

	// "If the self-contained flag is set, [...] no string is present".
	// But there is no flag named "self-contained".
	// I assume it is flag 0x1.
	if(flags&0x000001) goto done;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(bctx->f,
		pos, curbox->payload_pos + curbox->payload_len - pos, DE_DBG_MAX_STRLEN,
		s, DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_UTF8);
	de_dbg(c, "URL: \"%s\"", ucstring_getpsz_d(s));
done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
movq 0x28(%rdx), %rbp
movq 0x38(%rbp), %r15
movq %r15, %rsi
callq 0xef32a
movq %rax, %r13
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xe9304(%rip), %rsi     # 0x115a88
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
testb $0x1, %r13b
jne 0x2c7f7
leaq 0x4(%r15), %r13
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r14
movq 0x10(%r12), %rdi
movq 0x38(%rbp), %rax
movq 0x40(%rbp), %rcx
subq %r15, %rax
leaq (%rax,%rcx), %rdx
addq $-0x4, %rdx
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rsi
movq %r14, %r8
movl $0x1, %r9d
callq 0xf0203
movq %r14, %rdi
callq 0xf7557
leaq 0xe9617(%rip), %rsi     # 0x115e01
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_vmhd
static void do_box_vmhd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 version;
	u32 flags;
	size_t k;
	unsigned int clr[3];
	unsigned int graphicsmode;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;

	if(curbox->payload_len<12) return;
	do_read_version_and_flags(c, d, bctx, &version, &flags, 1);
	pos += 4;
	if(version!=0 || flags!=0x1) return;

	graphicsmode = (unsigned int)dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "graphicsmode: %u", graphicsmode);

	for(k=0; k<3; k++) {
		clr[k] = (unsigned int)dbuf_getu16be_p(bctx->f, &pos);
	}
	de_dbg(c, "opcolor: (%d,%d,%d)", (int)clr[0], (int)clr[1], (int)clr[2]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rsi
movq %rsi, 0x8(%rsp)
cmpq $0xc, 0x40(%rax)
jl 0x2c8de
movq %rdx, %r14
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
callq 0xef32a
movq %rax, %r15
movl %r15d, %ebp
andl $0xffffff, %ebp         # imm = 0xFFFFFF
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xe922f(%rip), %rsi     # 0x115a88
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe9226
addq $0x4, 0x8(%rsp)
shrq $0x18, %r15
testb %r15b, %r15b
setne %al
cmpl $0x1, %ebp
setne %cl
orb %al, %cl
jne 0x2c8de
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef193
leaq 0xe9574(%rip), %rsi     # 0x115e0b
xorl %r12d, %r12d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0xef193
movl %eax, 0x14(%rsp,%r12,4)
incq %r12
cmpq $0x3, %r12
jne 0x2c8a6
movl 0x14(%rsp), %edx
movl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %r8d
leaq 0xe9548(%rip), %rsi     # 0x115e1c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_PICT
static void do_box_PICT(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;
	dbuf *outf = NULL;

	outf = dbuf_create_output_file(c, "pict", NULL, DE_CREATEFLAG_IS_AUX);
	dbuf_write_zeroes(outf, 512);
	dbuf_copy(bctx->f, curbox->payload_pos, curbox->payload_len, outf);
	dbuf_close(outf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x28(%rdx), %r15
leaq 0xe9532(%rip), %rsi     # 0x115e30
xorl %edx, %edx
movl $0x1, %ecx
callq 0xf037a
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdi
callq 0xf1346
movq 0x10(%rbx), %rdi
movq 0x38(%r15), %rsi
movq 0x40(%r15), %rdx
movq %r14, %rcx
callq 0xefabc
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xf0b13
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_PRVW
static void do_box_PRVW(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;
	i64 img_pos;
	i64 img_len;

	if(!curbox->parent) return;
	if(!curbox->parent->is_uuid) return;
	if(de_memcmp(curbox->parent->uuid, g_uuid_cr3_eaf4, 16)) return;
	if(curbox->payload_len<20) return;
	img_pos= curbox->payload_pos+16;
	if(dbuf_memcmp(bctx->f, img_pos, "\xff\xd8\xff", 3)) return;
	img_len = dbuf_getu32be(bctx->f, curbox->payload_pos+12);
	de_dbg(c, "image at %"I64_FMT", len=%"I64_FMT, img_pos, img_len);
	if(img_pos+img_len > curbox->payload_pos+curbox->payload_len) return;
	dbuf_create_file_from_slice(bctx->f, img_pos, img_len, "preview.jpg", NULL,
		DE_CREATEFLAG_IS_AUX);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x28(%rdx), %r13
movq (%r13), %rax
testq %rax, %rax
je 0x2c9e4
cmpl $0x0, 0x10(%rax)
je 0x2c9e4
movdqu 0x14(%rax), %xmm0
pcmpeqb 0xe8934(%rip), %xmm0    # 0x1152a0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x2c9e4
cmpq $0x14, 0x40(%r13)
jl 0x2c9e4
movq %rdx, %rbx
movq %rdi, %r14
movq 0x38(%r13), %r15
addq $0x10, %r15
movq 0x10(%rdx), %rdi
leaq 0xe7b62(%rip), %rdx     # 0x1144f9
movl $0x3, %ecx
movq %r15, %rsi
callq 0xf025e
testl %eax, %eax
jne 0x2c9e4
movq 0x10(%rbx), %rdi
movq 0x38(%r13), %rsi
addq $0xc, %rsi
callq 0xef32a
movq %rax, %r12
leaq 0xe9472(%rip), %rsi     # 0x115e35
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
leaq (%r12,%r15), %rax
movq 0x40(%r13), %rcx
addq 0x38(%r13), %rcx
cmpq %rcx, %rax
jle 0x2c9ee
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rdi
leaq 0xfe6ce(%rip), %rcx     # 0x12b0c7
movq %r15, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf0321
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_THMB
static void do_box_THMB(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;
	i64 img_pos;
	i64 img_len;

	if(!curbox->parent) return;
	if(!curbox->parent->is_uuid) return;
	if(de_memcmp(curbox->parent->uuid, g_uuid_cr3_85c0, 16)) return;
	if(curbox->payload_len<20) return;
	img_pos= curbox->payload_pos+16;
	if(dbuf_memcmp(bctx->f, img_pos, "\xff\xd8\xff", 3)) return;
	img_len = dbuf_getu32be(bctx->f, curbox->payload_pos+8);
	de_dbg(c, "image at %"I64_FMT", len=%"I64_FMT, img_pos, img_len);
	if(img_pos+img_len > curbox->payload_pos+curbox->payload_len) return;
	dbuf_create_file_from_slice(bctx->f, img_pos, img_len, "thumb.jpg", NULL,
		DE_CREATEFLAG_IS_AUX);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x28(%rdx), %r13
movq (%r13), %rax
testq %rax, %rax
je 0x2cabf
cmpl $0x0, 0x10(%rax)
je 0x2cabf
movdqu 0x14(%rax), %xmm0
pcmpeqb 0xe8849(%rip), %xmm0    # 0x115290
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x2cabf
cmpq $0x14, 0x40(%r13)
jl 0x2cabf
movq %rdx, %rbx
movq %rdi, %r14
movq 0x38(%r13), %r15
addq $0x10, %r15
movq 0x10(%rdx), %rdi
leaq 0xe7a87(%rip), %rdx     # 0x1144f9
movl $0x3, %ecx
movq %r15, %rsi
callq 0xf025e
testl %eax, %eax
jne 0x2cabf
movq 0x10(%rbx), %rdi
movq 0x38(%r13), %rsi
addq $0x8, %rsi
callq 0xef32a
movq %rax, %r12
leaq 0xe9397(%rip), %rsi     # 0x115e35
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
leaq (%r12,%r15), %rax
movq 0x40(%r13), %rcx
addq 0x38(%r13), %rcx
cmpq %rcx, %rax
jle 0x2cac9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rdi
leaq 0x1069e0(%rip), %rcx    # 0x1334b4
movq %r15, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
movl $0x1, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf0321
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_cdef
static void do_box_cdef(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 ndescs;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	i64 k;

	ndescs = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "number of channel descriptions: %d", (int)ndescs);

	for(k=0; k<ndescs; k++) {
		i64 idx, typ, asoc;

		if(pos+6 > curbox->payload_pos + curbox->payload_len) break;
		de_dbg(c, "channel description[%d] at %"I64_FMT, (int)k, pos);
		de_dbg_indent(c, 1);
		idx = dbuf_getu16be_p(bctx->f, &pos);
		de_dbg(c, "channel index: %d", (int)idx);
		typ = dbuf_getu16be_p(bctx->f, &pos);
		de_dbg(c, "channel type: %d (%s)", (int)typ, get_channel_type_name(typ));
		asoc = dbuf_getu16be_p(bctx->f, &pos);
		de_dbg(c, "index of associated color: %d", (int)asoc);
		de_dbg_indent(c, -1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x28(%rdx), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rax), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq 0x10(%rdx), %rdi
callq 0xef193
movq %rax, %r15
leaq 0xe9342(%rip), %rsi     # 0x115e6d
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r15, 0x8(%rsp)
testq %r15, %r15
jle 0x2cc5a
decq 0x8(%rsp)
xorl %r12d, %r12d
movq (%rsp), %rcx
leaq 0x6(%rcx), %r15
movq 0x10(%rsp), %rax
movq 0x40(%rax), %r13
addq 0x38(%rax), %r13
cmpq %r13, %r15
jg 0x2cc5a
movq %r14, %rdi
leaq 0xe931a(%rip), %rsi     # 0x115e90
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x10(%rbx), %rdi
movq %rsp, %rbp
movq %rbp, %rsi
callq 0xef193
movq %r14, %rdi
leaq 0xe9309(%rip), %rsi     # 0x115eaf
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%rbx), %rdi
movq %rbp, %rsi
callq 0xef193
cmpq $0x1, %rax
jg 0x2cbdc
leaq 0xe932d(%rip), %rcx     # 0x115ef5
testq %rax, %rax
je 0x2cc03
cmpq $0x1, %rax
jne 0x2cbf3
leaq 0xe9350(%rip), %rcx     # 0x115f2a
jmp 0x2cc03
cmpq $0x2, %rax
je 0x2cbfc
cmpq $0xffff, %rax           # imm = 0xFFFF
jne 0x2cbf3
leaq 0xe9341(%rip), %rcx     # 0x115f32
jmp 0x2cc03
leaq 0xff26f(%rip), %rcx     # 0x12be69
jmp 0x2cc03
leaq 0xe9319(%rip), %rcx     # 0x115f1c
movq %r14, %rdi
leaq 0xe92b4(%rip), %rsi     # 0x115ec1
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0xef193
movq %r14, %rdi
leaq 0xe92ab(%rip), %rsi     # 0x115ed7
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpq %r13, %r15
jg 0x2cc5a
leaq 0x1(%r12), %rax
cmpq %r12, 0x8(%rsp)
movq %rax, %r12
jne 0x2cb4e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_colr_jp2
static void do_box_colr_jp2(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u8 meth;
	u8 n;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	const char *s;

	if(curbox->payload_len<3) goto done;
	meth = dbuf_getbyte_p(bctx->f, &pos);
	switch(meth) {
	case 1: s="enumerated"; break;
	case 2: s="ICC profile (restricted)"; break;
	case 3: s="ICC profile (any)"; break; // JPX only
	case 4: s="vendor"; break; // JPX only
	default: s="?";
	}
	de_dbg(c, "specification method: %d (%s)", (int)meth, s);

	n = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "precedence: %u", (UI)n);
	n = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "approximation code: %u", (UI)n);

	if(meth==1) {
		unsigned int enumcs;
		if(curbox->payload_len<7) goto done;
		enumcs = (unsigned int)dbuf_getu32be_p(bctx->f, &pos);
		switch(enumcs) {
			// TODO: There are lots more valid values for JPX.
		case 16: s="sRGB"; break;
		case 17: s="sRGB-like grayscale"; break;
		case 18: s="sYCC"; break;
		default: s="?";
		}
		de_dbg(c, "enumerated colourspace: %u (%s)", enumcs, s);
	}
	else if(meth==2 || meth==3) {
		dbuf_create_file_from_slice(bctx->f,
			curbox->payload_pos+3, curbox->payload_len-3,
			"icc", NULL, DE_CREATEFLAG_IS_AUX);
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdx), %r13
movq 0x38(%r13), %rax
movq %rax, (%rsp)
cmpq $0x3, 0x40(%r13)
jge 0x2cc96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
movq %rsp, %rsi
callq 0xef14d
movl %eax, %ebp
movzbl %al, %r15d
leal -0x1(%r15), %eax
cmpb $0x3, %al
ja 0x2ccc9
movzbl %al, %eax
leaq 0xe9714(%rip), %rdx     # 0x1163d4
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmp 0x2ccd0
leaq 0xff199(%rip), %rcx     # 0x12be69
leaq 0xe92a6(%rip), %rsi     # 0x115f7d
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xef14d
movzbl %al, %edx
leaq 0xe929e(%rip), %rsi     # 0x115f9b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xef14d
movzbl %al, %edx
leaq 0xe928d(%rip), %rsi     # 0x115faa
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
cmpl $0x1, %r15d
jne 0x2cd5e
cmpq $0x7, 0x40(%r13)
jl 0x2cc87
movq 0x10(%r14), %rdi
movq %rsp, %rsi
callq 0xef34e
leal -0x10(%rax), %ecx
cmpl $0x2, %ecx
ja 0x2cd9a
movl %ecx, %ecx
leaq 0xe968f(%rip), %rdx     # 0x1163e4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x2cda1
andb $-0x2, %bpl
cmpb $0x2, %bpl
jne 0x2cc87
movq 0x10(%r14), %rdi
movq 0x38(%r13), %rsi
movq 0x40(%r13), %rdx
addq $0x3, %rsi
addq $-0x3, %rdx
leaq 0xe8d66(%rip), %rcx     # 0x115aed
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf0321
jmp 0x2cc87
leaq 0xff0c8(%rip), %rcx     # 0x12be69
leaq 0xe9237(%rip), %rsi     # 0x115fdf
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
jmp 0x2cc87
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_dtbl
static void do_box_dtbl(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 ndr;
	struct de_boxdata *curbox = bctx->curbox;

	ndr = dbuf_getu16be(bctx->f, curbox->payload_pos);
	de_dbg(c, "number of data references: %d", (int)ndr);

	curbox->num_children_is_known = 1;
	curbox->num_children = ndr;
	curbox->extra_bytes_before_children = 2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
movq 0x28(%rdx), %r15
movq 0x38(%r15), %rsi
callq 0xef169
movq %rax, %r14
leaq 0xe9223(%rip), %rsi     # 0x115fff
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movl $0x1, 0x60(%r15)
movq %r14, 0x68(%r15)
movq $0x2, 0x70(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_ihdr
static void do_box_ihdr(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 w, h, n;
	u8 b;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	char tmps[80];

	if(curbox->payload_len<14) return;
	h = dbuf_getu32be_p(bctx->f, &pos);
	w = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg_dimensions(c, w, h);

	n = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "number of components: %d", (int)n);

	b = dbuf_getbyte_p(bctx->f, &pos);
	if(b==255) {
		de_strlcpy(tmps, "various", sizeof(tmps));
	}
	else {
		de_snprintf(tmps, sizeof(tmps), "%u bits/comp., %ssigned",
			(unsigned int)(1+(b&0x7f)), (b&0x80)?"":"un");
	}
	de_dbg(c, "bits-per-component code: %u (%s)", (unsigned int)b, tmps);

	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "compression type: %u (%s)", (unsigned int)b,
		get_jpeg2000_cmpr_name(c, d, b));

	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "colorspace-is-unknown flag: %d", (int)b);
	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "has-IPR: %d", (int)b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpq $0xe, 0x40(%rax)
jl 0x2cf8f
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
callq 0xef34e
movq %rax, %r13
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xef34e
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xe9b05
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xef193
leaq 0xe91aa(%rip), %rsi     # 0x11601d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xef14d
movzbl %al, %ebp
cmpb $-0x1, %bpl
je 0x2ceca
movl %ebp, %ecx
andl $0x7f, %ecx
incl %ecx
testb %bpl, %bpl
leaq 0xe677a(%rip), %rax     # 0x11361f
leaq 0x117d24(%rip), %r8     # 0x144bd0
cmovnsq %rax, %r8
leaq 0xe9187(%rip), %rdx     # 0x11603e
leaq 0x10(%rsp), %rdi
movl $0x50, %esi
xorl %eax, %eax
callq 0xe8d67
jmp 0x2cee0
leaq 0xe9165(%rip), %rsi     # 0x116036
leaq 0x10(%rsp), %rdi
movl $0x50, %edx
callq 0xe8ded
leaq 0xe916f(%rip), %rsi     # 0x116056
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef14d
movzbl %al, %edx
cmpb $0x7, %dl
jne 0x2cf17
leaq 0xe91a7(%rip), %rcx     # 0x1160bc
jmp 0x2cf39
cmpb $0x0, 0x6(%r15)
leaq 0xfef46(%rip), %rcx     # 0x12be69
je 0x2cf39
cmpb $0x9, %al
ja 0x2cf39
movl %edx, %eax
leaq 0xe94be(%rip), %rsi     # 0x1163f0
movslq (%rsi,%rax,4), %rcx
addq %rsi, %rcx
leaq 0xe9137(%rip), %rsi     # 0x116077
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef14d
movzbl %al, %edx
leaq 0xe912c(%rip), %rsi     # 0x116091
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0xef14d
movzbl %al, %edx
leaq 0xe912b(%rip), %rsi     # 0x1160b0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_jp2c
static void do_box_jp2c(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;

	de_dbg(c, "JPEG 2000 codestream at %d, len=%d",
		(int)curbox->payload_pos, (int)curbox->payload_len);

	// I think this box is used regardless of the compression format, so make
	// sure it seems to be in "JPEG 2000" format.
	// This is a hack -- we could track the compression method instead.
	if((u32)dbuf_getu32be(bctx->f, curbox->payload_pos) != 0xff4fff51U) {
		de_dbg(c, "[non-J2C]");
		return;
	}

	dbuf_create_file_from_slice(bctx->f, curbox->payload_pos, curbox->payload_len,
		"j2c", NULL, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x28(%rdx), %r15
movl 0x38(%r15), %edx
movl 0x40(%r15), %ecx
leaq 0xe9125(%rip), %rsi     # 0x1160e1
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rdi
movq 0x38(%r15), %rsi
callq 0xef32a
cmpl $0xff4fff51, %eax       # imm = 0xFF4FFF51
jne 0x2cffa
movq 0x10(%r14), %rdi
movq 0x38(%r15), %rsi
movq 0x40(%r15), %rdx
leaq 0xe9124(%rip), %rcx     # 0x11610e
xorl %r8d, %r8d
xorl %r9d, %r9d
popq %rbx
popq %r14
popq %r15
jmp 0xf0321
leaq 0xe9103(%rip), %rsi     # 0x116104
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe9226
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_justtext
static void do_box_justtext(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;
	de_ucstring *s = NULL;
	const char *name;

	name = curbox->box_name ? curbox->box_name : "value";
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(bctx->f, curbox->payload_pos, curbox->payload_len,
		DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF8);
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz_d(s));
	ucstring_destroy(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r12
movq %rdi, %rbx
movq 0x28(%rdx), %r13
movq 0x50(%r13), %rax
testq %rax, %rax
leaq 0x1066e4(%rip), %r14    # 0x133719
cmovneq %rax, %r14
callq 0xf6870
movq %rax, %r15
movq 0x10(%r12), %rdi
movq 0x38(%r13), %rsi
movq 0x40(%r13), %rdx
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rax, %r8
xorl %r9d, %r9d
callq 0xf0203
movq %r15, %rdi
callq 0xf7557
leaq 0xfedce(%rip), %rsi     # 0x12be42
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf6bb0
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/bmff.c
// Function: do_box_resc_resd
static void do_box_resc_resd(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 vn, vd, hn, hd;
	int ve, he;
	struct de_boxdata *curbox = bctx->curbox;
	const char *name;
	i64 pos = curbox->payload_pos;
	char res_buf[160];

	if(curbox->boxtype==BOX_resc)
		name = "capture";
	else
		name = "display";

	if(curbox->payload_len<10) return;
	vn = dbuf_getu16be_p(bctx->f, &pos);
	vd = dbuf_getu16be_p(bctx->f, &pos);
	hn = dbuf_getu16be_p(bctx->f, &pos);
	hd = dbuf_getu16be_p(bctx->f, &pos);
	ve = (int)(signed char)dbuf_getbyte_p(bctx->f, &pos);
	he = (int)(signed char)dbuf_getbyte_p(bctx->f, &pos);
	format_jp2_res(res_buf, sizeof(res_buf), vn, vd, ve);
	de_dbg(c, "vert. %s grid res.: %s", name, res_buf);
	format_jp2_res(res_buf, sizeof(res_buf), hn, hd, he);
	de_dbg(c, "horz. %s grid res.: %s", name, res_buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq 0x28(%rdx), %rax
movq 0x38(%rax), %rcx
movq %rcx, 0x18(%rsp)
cmpq $0xa, 0x40(%rax)
jl 0x2d19f
movq %rdx, %r15
movq %rdi, %rbx
cmpl $0x72657363, 0xc(%rax)  # imm = 0x72657363
leaq 0x108dc4(%rip), %rax    # 0x135e9a
leaq 0xe9035(%rip), %r14     # 0x116112
cmoveq %rax, %r14
movq 0x10(%rdx), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0xef193
movq %rax, 0x8(%rsp)
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xef193
movq %rax, %r13
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xef193
movq %rax, 0x10(%rsp)
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xef193
movq %rax, (%rsp)
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xef14d
movsbl %al, %ebp
movq 0x10(%r15), %rdi
movq %r12, %rsi
callq 0xef14d
movsbl %al, %r15d
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
movl %ebp, %ecx
callq 0x2d7d0
leaq 0xe8fb6(%rip), %rsi     # 0x11611a
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq (%rsp), %rdx
movl %r15d, %ecx
callq 0x2d7d0
leaq 0xe8fa2(%rip), %rsi     # 0x116131
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq