LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/amiga-dsk.c
// Function: read_file_segment_from_blocks_tbl
static int read_file_segment_from_blocks_tbl(deark *c, lctx *d, struct member_data *md)
{
	i64 nbytes_left_to_copy;
	i64 k;
	int retval = 0;

	nbytes_left_to_copy = md->fsize - md->outf->len;

	for(k=0; k<md->tmpbpt.high_seq; k++) {
		i64 blknum;
		i64 blkpos;
		i64 nbytes_to_copy;

		if(nbytes_left_to_copy<1) break;

		blknum = md->tmpbpt.blocks_tbl[md->tmpbpt.blocks_tbl_capacity-1-k];
		if(!claim_block(c, d, blknum)) {
			goto done;
		}

		blkpos = blocknum_to_offset(d, blknum);
		nbytes_to_copy = d->bsize;
		if(!d->is_ffs) {
			// TODO: If we allow this, it might be better to call
			// do_file_ofs_data_block(), somehow.
			blkpos += 24;
			nbytes_to_copy -= 24;
		}

		if(nbytes_to_copy > nbytes_left_to_copy) {
			nbytes_to_copy = nbytes_left_to_copy;
		}
		dbuf_copy(c->infile, blkpos, nbytes_to_copy, md->outf);
		nbytes_left_to_copy -= nbytes_to_copy;
	}
	retval = 1;

done:
	return retval;
}

// Assembly:
cmpq $0x0, 0x70(%rdx)
movl $0x1, %eax
jle 0x29d47
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq 0x18(%rdx), %rbp
movq 0x50(%rdx), %rcx
subq 0x18(%rcx), %rbp
testq %rbp, %rbp
jle 0x29d39
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %eax
movq $-0x8, %r12
movq %rsi, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x78(%rbx), %rax
shlq $0x3, %rax
addq 0x80(%rbx), %rax
movq (%r12,%rax), %r13
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x299f6
testl %eax, %eax
je 0x29d37
movq 0x8(%r14), %rax
imulq %rax, %r13
leaq 0x18(%r13), %rsi
cmpb $0x0, (%r14)
cmovneq %r13, %rsi
leaq -0x18(%rax), %r13
cmovneq %rax, %r13
cmpq %rbp, %r13
cmovgeq %rbp, %r13
movq %r15, %r14
movq 0x18(%r15), %rdi
movq 0x50(%rbx), %rcx
movq %r13, %rdx
callq 0xef481
movq 0x10(%rsp), %rax
cmpq 0x70(%rbx), %rax
jge 0x29d30
subq %r13, %rbp
incq %rax
addq $-0x8, %r12
testq %rbp, %rbp
movq %r14, %r15
movq 0x8(%rsp), %r14
jg 0x29caa
movl $0x1, %eax
jmp 0x29d39
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/binscii.c
// Function: de_module_binscii
void de_module_binscii(deark *c, struct deark_module_info *mi)
{
	mi->id = "binscii";
	mi->desc = "BinSCII";
	mi->run_fn = de_run_binscii;
	mi->identify_fn = de_identify_binscii;
}

// Assembly:
leaq 0xeb455(%rip), %rax     # 0x1151a4
movq %rax, (%rsi)
leaq 0xeb453(%rip), %rax     # 0x1151ac
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x29d74
movq %rax, 0x18(%rsi)
leaq 0x8b0(%rip), %rax       # 0x2a61f
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/binscii.c
// Function: de_identify_binscii
static int de_identify_binscii(deark *c)
{
	int has_ext;
	int ret;
	i64 foundpos;

	has_ext = de_input_file_has_ext(c, "bsc") ||
		de_input_file_has_ext(c, "bsq");
	if(!dbuf_memcmp(c->infile, 0, g_binscii_seg_sig, 18)) {
		return has_ext?100:90;
	}

	if(!has_ext) return 0;

	ret = dbuf_search(c->infile, g_binscii_seg_sig, 18, 0, 4096, &foundpos);
	if(ret) {
		// TODO? We could do better, by making sure the string starts at the
		// beginning of a line, etc.
		return 35;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xead01(%rip), %rsi     # 0x115332
callq 0xea491
testl %eax, %eax
je 0x2a657
movq 0x18(%rbx), %rdi
leaq 0xeab9b(%rip), %rdx     # 0x1151e0
movl $0x12, %ecx
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
jne 0x2a68a
jmp 0x2a6c1
leaq 0xeacd8(%rip), %rsi     # 0x115336
movq %rbx, %rdi
callq 0xea491
movl %eax, %ebp
movq 0x18(%rbx), %rdi
leaq 0xeab6d(%rip), %rdx     # 0x1151e0
xorl %r14d, %r14d
movl $0x12, %ecx
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
je 0x2a6bd
testl %ebp, %ebp
je 0x2a6c7
addq $0x18, %rbx
movq (%rbx), %rdi
leaq 0xeab48(%rip), %rsi     # 0x1151e0
leaq 0x8(%rsp), %r9
movl $0x12, %edx
movl $0x1000, %r8d           # imm = 0x1000
xorl %ecx, %ecx
callq 0xf149c
testl %eax, %eax
movl $0x23, %r14d
cmovel %eax, %r14d
jmp 0x2a6c7
testl %ebp, %ebp
je 0x2a6d3
movl $0x64, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x5a, %r14d
jmp 0x2a6c7
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/binscii.c
// Function: binscii_close_cur_file
static void binscii_close_cur_file(deark *c, struct binscii_ctx *d)
{
	struct binscii_md *md;

	md = d->cur_md;
	if(!d->cur_md) return;
	de_dbg(c, "closing file");
	if(d->cur_md->orig_len != d->cur_md->nbytes_written) {
		binscii_set_generic_error(c, d);
	}
	dbuf_close(md->outf);
	ucstring_destroy(md->fn);
	de_free(c, md);
	d->cur_md = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rsi), %r14
testq %r14, %r14
je 0x2a739
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xeac30(%rip), %rsi     # 0x115325
xorl %eax, %eax
callq 0xe8617
movq (%rbx), %rax
movq 0x8(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x2a715
cmpb $0x0, 0xc(%rbx)
jne 0x2a715
movw $0x101, 0xc(%rbx)       # imm = 0x101
movq 0x20(%r14), %rdi
callq 0xf052b
movq 0x18(%r14), %rdi
callq 0xf6753
movq %r15, %rdi
movq %r14, %rsi
callq 0xe8be2
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/binscii.c
// Function: binscii_decode
static void binscii_decode(deark *c, struct binscii_ctx *d, const u8 *src,
	i64 num_units, dbuf *outf)
{
	i64 i;
	u8 ib[4];

	for(i=0; i<num_units; i++) {
		UI j;

		for(j=0; j<4; j++) {
			ib[j] = d->cur_seg.bmap[(UI)src[i*4+j]];
		}
		dbuf_writebyte(outf, (ib[3]<<2)|(ib[2]>>4));
		dbuf_writebyte(outf, ((ib[2]&0x0f)<<4)|(ib[1]>>2));
		dbuf_writebyte(outf, ((ib[1]&0x03)<<6)|ib[0]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
testq %rdx, %rdx
jle 0x2a7e1
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
xorl %eax, %eax
movzbl (%r15,%rax), %ecx
movb 0x120(%r12,%rcx), %cl
movb %cl, 0xc(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x2a769
movb 0xe(%rsp), %bpl
movb 0xf(%rsp), %al
shlb $0x2, %al
movl %ebp, %ecx
shrb $0x4, %cl
orb %al, %cl
movzbl %cl, %esi
movq %rbx, %rdi
callq 0xf0bd6
shlb $0x4, %bpl
movb 0xd(%rsp), %r14b
movl %r14d, %eax
shrb $0x2, %al
orb %bpl, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0xf0bd6
shlb $0x6, %r14b
orb 0xc(%rsp), %r14b
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0xf0bd6
incq %r13
addq $0x4, %r15
cmpq 0x10(%rsp), %r13
jne 0x2a767
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/binscii.c
// Function: binscii_create_output_file
static void binscii_create_output_file(deark *c, struct binscii_ctx *d)
{
	de_finfo *fi = NULL;

	if(!d->cur_md) {
		binscii_set_generic_error(c, d);
		goto done;
	}
	if(d->cur_md->outf) {
		binscii_set_generic_error(c, d);
		goto done;
	}

	fi = de_finfo_create(c);
	if(d->cur_md->fn) {
		de_finfo_set_name_from_ucstring(c, fi, d->cur_md->fn, 0);
		fi->original_filename_flag = 1;
	}
	fi->timestamp[DE_TIMESTAMPIDX_MODIFY] = d->cur_md->mod_time;
	fi->timestamp[DE_TIMESTAMPIDX_CREATE] = d->cur_md->create_time;

	d->cur_md->outf = dbuf_create_output_file(c, NULL, fi, 0);
	dbuf_enable_wbuffer(d->cur_md->outf);

done:
	de_finfo_destroy(c, fi);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rax
testq %rax, %rax
je 0x2a80a
cmpq $0x0, 0x20(%rax)
je 0x2a81d
cmpb $0x0, 0xc(%r15)
jne 0x2a818
movw $0x101, 0xc(%r15)       # imm = 0x101
xorl %r14d, %r14d
jmp 0x2a87c
movq %rbx, %rdi
callq 0xea504
movq %rax, %r14
movq (%r15), %rax
movq 0x18(%rax), %rdx
testq %rdx, %rdx
je 0x2a849
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0xea53f
movb $0x1, 0x8(%r14)
movq (%r15), %rax
movups 0x28(%rax), %xmm0
movups %xmm0, 0x18(%r14)
movq (%r15), %rax
movups 0x38(%rax), %xmm0
movups %xmm0, 0x28(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xefda1
movq (%r15), %rcx
movq %rax, 0x20(%rcx)
movq %rax, %rdi
callq 0xf0855
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xea50e
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: de_module_jpeg2000
void de_module_jpeg2000(deark *c, struct deark_module_info *mi)
{
	mi->id = "jpeg2000";
	mi->desc = "JPEG 2000 image";
	mi->desc2 = "resources only";
	mi->run_fn = de_run_bmff;
	mi->identify_fn = de_identify_jpeg2000;
}

// Assembly:
leaq 0xeaae5(%rip), %rax     # 0x115378
movq %rax, (%rsi)
leaq 0xeaae4(%rip), %rax     # 0x115381
movq %rax, 0x8(%rsi)
leaq 0xeaae9(%rip), %rax     # 0x115391
movq %rax, 0x10(%rsi)
leaq 0x10(%rip), %rax        # 0x2a8c3
movq %rax, 0x18(%rsi)
leaq 0x174(%rip), %rax       # 0x2aa32
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: de_module_bmff
void de_module_bmff(deark *c, struct deark_module_info *mi)
{
	mi->id = "bmff";
	mi->desc = "ISO Base Media File Format";
	mi->desc2 = "MP4, QuickTime, etc.";
	mi->id_alias[0] = "mp4";
	mi->run_fn = de_run_bmff;
	mi->identify_fn = de_identify_bmff;
	mi->help_fn = de_help_bmff;
}

// Assembly:
leaq 0xea941(%rip), %rax     # 0x1153a0
movq %rax, (%rsi)
leaq 0xea93c(%rip), %rax     # 0x1153a5
movq %rax, 0x8(%rsi)
leaq 0xea94c(%rip), %rax     # 0x1153c0
movq %rax, 0x10(%rsi)
leaq 0xea956(%rip), %rax     # 0x1153d5
movq %rax, 0x38(%rsi)
leaq -0x1c7(%rip), %rax      # 0x2a8c3
movq %rax, 0x18(%rsi)
leaq 0x10(%rip), %rax        # 0x2aaa5
movq %rax, 0x20(%rsi)
leaq 0x75(%rip), %rax        # 0x2ab15
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: de_identify_bmff
static int de_identify_bmff(deark *c)
{
	u32 first_boxtype;

	first_boxtype = (u32)de_getu32be(4);
	if(first_boxtype==BOX_ftyp) return 80;
	if(first_boxtype==BOX_mdat) return 35;
	if(first_boxtype==BOX_moov) return 35;
	if(first_boxtype==BOX_skip) return 10;
	if(first_boxtype==BOX_wide) return 10;
	if(first_boxtype==BOX_pnot) return 10;
	if(first_boxtype==BOX_free) return 9;
	return 0;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rdi
movl $0x4, %esi
callq 0xeed0d
cmpl $0x6d6f6f75, %eax       # imm = 0x6D6F6F75
jle 0x2aad2
cmpl $0x736b696f, %eax       # imm = 0x736B696F
jg 0x2aaee
cmpl $0x6d6f6f76, %eax       # imm = 0x6D6F6F76
je 0x2aae7
cmpl $0x706e6f74, %eax       # imm = 0x706E6F74
je 0x2aafc
jmp 0x2ab0a
cmpl $0x66726565, %eax       # imm = 0x66726565
je 0x2ab03
cmpl $0x66747970, %eax       # imm = 0x66747970
je 0x2ab0e
cmpl $0x6d646174, %eax       # imm = 0x6D646174
jne 0x2ab0a
movl $0x23, %eax
jmp 0x2ab13
cmpl $0x736b6970, %eax       # imm = 0x736B6970
je 0x2aafc
cmpl $0x77696465, %eax       # imm = 0x77696465
jne 0x2ab0a
movl $0xa, %eax
jmp 0x2ab13
movl $0x9, %eax
jmp 0x2ab13
xorl %eax, %eax
jmp 0x2ab13
movl $0x50, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: my_box_identify_fn
static void my_box_identify_fn(deark *c, struct de_boxesctx *bctx)
{
	const struct box_type_info *bti;
	lctx *d = (lctx*)bctx->userdata;
	struct de_boxdata *curbox = bctx->curbox;
	struct de_boxdata *par = curbox->parent;
	struct de_boxdata *gpar = NULL;
	int is_ilst_child = 0;

	if(curbox->boxtype != BOX_uuid) {
		curbox->box_name = "?";
	}

	if(par) {
		gpar = par->parent;
	}

	if((par && (par->boxtype==BOX_ilst)) ||
		(gpar && (gpar->boxtype==BOX_ilst)) )
	{
		is_ilst_child = 1;
	}

	if(is_ilst_child) {
		bti = find_ilst_box_type_info(c, d, curbox->boxtype);
	}
	else {
		bti = find_box_type_info(c, d, curbox->boxtype, curbox->level);
	}

	if(bti) {
		// So that we don't have to run "find" again in my_box_handler(),
		// record it here.
		curbox->box_userdata = (void*)bti;

		if(bti->name) {
			curbox->box_name = bti->name;
		}
	}
	// TODO: Do we need special handling of 'data' boxes?
}

// Assembly:
movq (%rsi), %rdi
movq 0x28(%rsi), %rax
movq (%rax), %rdx
movl 0xc(%rax), %ecx
cmpl $0x75756964, %ecx       # imm = 0x75756964
je 0x2ab43
leaq 0x101612(%rip), %rsi    # 0x12c151
movq %rsi, 0x50(%rax)
testq %rdx, %rdx
je 0x2ab82
cmpl $0x696c7374, 0xc(%rdx)  # imm = 0x696C7374
je 0x2ab62
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x2ab82
cmpl $0x696c7374, 0xc(%rdx)  # imm = 0x696C7374
jne 0x2ab82
xorl %edx, %edx
leaq 0x153895(%rip), %rsi    # 0x17e400
cmpl %ecx, (%rdx,%rsi)
je 0x2abff
addq $0x20, %rdx
cmpq $0x140, %rdx            # imm = 0x140
jne 0x2ab6b
retq
movl 0x8(%rax), %edx
xorl %esi, %esi
cmpb $0x0, 0x4(%rdi)
setne %sil
leal 0x8(%rsi), %r8d
cmpb $0x0, 0x8(%rdi)
cmovel %esi, %r8d
cmpb $0x0, 0x5(%rdi)
leal 0x10000(%r8), %esi
cmovel %r8d, %esi
leal 0x40000(%rsi), %r9d
cmpb $0x0, 0xa(%rdi)
cmovel %esi, %r9d
movl %r9d, %r8d
orl $0x80000, %r8d          # imm = 0x80000
cmpb $0x0, 0x9(%rdi)
cmovel %r9d, %r8d
xorl %edi, %edi
leaq 0x15396c(%rip), %rsi    # 0x17e540
cmpl %ecx, (%rdi,%rsi)
jne 0x2abeb
testl %edx, %edx
jne 0x2abe4
testb $0x2, 0x8(%rdi,%rsi)
jne 0x2abfa
testl %r8d, 0x4(%rdi,%rsi)
jne 0x2abfa
addq $0x20, %rdi
cmpq $0xf00, %rdi            # imm = 0xF00
jne 0x2abd4
jmp 0x2ab81
addq %rdi, %rsi
jmp 0x2ac02
addq %rdx, %rsi
movq %rsi, 0x48(%rax)
movq 0x10(%rsi), %rcx
testq %rcx, %rcx
je 0x2ab81
movq %rcx, 0x50(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: my_box_handler
static int my_box_handler(deark *c, struct de_boxesctx *bctx)
{
	const struct box_type_info *bti;
	lctx *d = (lctx*)bctx->userdata;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->is_uuid) {
		if(!de_memcmp(curbox->uuid, g_uuid_cr3_85c0, 16)) {
			curbox->is_superbox = 1;
		}
		else if(!de_memcmp(curbox->uuid, g_uuid_cr3_eaf4, 16)) {
			curbox->is_superbox = 1;
			curbox->extra_bytes_before_children = 8;
		}
		else {
			return fmtutil_default_box_handler(c, bctx);
		}
		return 1;
	}

	bti = (const struct box_type_info *)curbox->box_userdata;

	if(bti && (bti->flags2 & 0x1)) {
		curbox->is_superbox = 1;
	}
	else if(d->is_bmff && curbox->parent && (curbox->parent->boxtype==BOX_ilst)) {
		curbox->is_superbox = 1;
	}

	if(bti && bti->hfn) {
		bti->hfn(c, d, bctx);
	}

	return 1;
}

// Assembly:
movq %rsi, %rdx
movq 0x28(%rsi), %rax
cmpl $0x0, 0x10(%rax)
je 0x2ac5f
movdqu 0x14(%rax), %xmm0
pcmpeqb 0xea70e(%rip), %xmm0    # 0x115340
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x2ac97
movdqu 0x14(%rax), %xmm0
pcmpeqb 0xea705(%rip), %xmm0    # 0x115350
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x2aca0
movq %rdx, %rsi
jmp 0xf816a
movq (%rdx), %rsi
movq 0x48(%rax), %rcx
testq %rcx, %rcx
je 0x2ac71
testb $0x1, 0x8(%rcx)
jne 0x2acb1
cmpb $0x0, 0x4(%rsi)
je 0x2ac90
movq (%rax), %r8
testq %r8, %r8
je 0x2ac90
cmpl $0x696c7374, 0xc(%r8)   # imm = 0x696C7374
jne 0x2ac90
movl $0x1, 0x5c(%rax)
testq %rcx, %rcx
jne 0x2acb8
jmp 0x2acc8
movl $0x1, 0x5c(%rax)
jmp 0x2acc8
movl $0x1, 0x5c(%rax)
movq $0x8, 0x70(%rax)
jmp 0x2acc8
movl $0x1, 0x5c(%rax)
movq 0x18(%rcx), %rax
testq %rax, %rax
je 0x2acc8
pushq %rax
callq *%rax
addq $0x8, %rsp
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_ftyp
static void do_box_ftyp(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 i;
	i64 mver;
	i64 num_compat_brands;
	struct de_fourcc brand4cc;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->payload_len<4) goto done;
	dbuf_read_fourcc(bctx->f, curbox->payload_pos, &brand4cc, 4, 0x0);
	d->major_brand = brand4cc.id;
	de_dbg(c, "major brand: '%s'", brand4cc.id_dbgstr);
	if(curbox->level==0)
		apply_brand(c, d, d->major_brand);

	if(curbox->payload_len<8) goto done;
	mver = dbuf_getu32be(bctx->f, curbox->payload_pos+4);
	de_dbg(c, "minor version: %u", (unsigned int)mver);

	if(curbox->payload_len<12) goto done;
	num_compat_brands = (curbox->payload_len - 8)/4;

	for(i=0; i<num_compat_brands; i++) {
		dbuf_read_fourcc(bctx->f, curbox->payload_pos + 8 + i*4, &brand4cc, 4, 0x0);
		if(brand4cc.id==0) continue; // Placeholder. Ignore.
		de_dbg(c, "compatible brand: '%s'", brand4cc.id_dbgstr);
		if(curbox->level==0)
			apply_brand(c, d, brand4cc.id);
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, (%rsp)
movq 0x28(%rdx), %rbp
cmpq $0x4, 0x40(%rbp)
jl 0x2b032
movq %rdx, %rbx
movq %rdi, %r15
movq 0x10(%rdx), %rdi
movq 0x38(%rbp), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
movl 0x4(%r12), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
leaq 0x18(%rsp), %rdx
leaq 0xeab5c(%rip), %rsi     # 0x115ad3
movq %r15, %rdi
xorl %eax, %eax
callq 0xe8617
cmpl $0x0, 0x8(%rbp)
jne 0x2af92
movq (%rsp), %rdi
movl (%rdi), %esi
callq 0x2d548
cmpq $0x8, 0x40(%rbp)
jl 0x2b032
movq 0x10(%rbx), %rdi
movq 0x38(%rbp), %rsi
addq $0x4, %rsi
callq 0xeed0d
leaq 0xeab30(%rip), %rsi     # 0x115ae5
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x40(%rbp), %r12
cmpq $0xc, %r12
jl 0x2b032
addq $-0x8, %r12
shrq $0x2, %r12
movl $0x8, %r14d
leaq 0x8(%rsp), %r13
movq 0x10(%rbx), %rdi
movq 0x38(%rbp), %rsi
addq %r14, %rsi
movq %r13, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
cmpl $0x0, 0xc(%rsp)
je 0x2b029
movq %r15, %rdi
leaq 0xeaaed(%rip), %rsi     # 0x115af7
leaq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0xe8617
cmpl $0x0, 0x8(%rbp)
jne 0x2b029
movl 0xc(%rsp), %esi
movq (%rsp), %rdi
callq 0x2d548
addq $0x4, %r14
decq %r12
jne 0x2afde
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_jP
static void do_box_jP(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	u32 n;
	struct de_boxdata *curbox = bctx->curbox;

	if(curbox->level!=0) return;
	if(curbox->payload_len<4) return;
	n = (u32)dbuf_getu32be(bctx->f, curbox->payload_pos);
	if(n==0x0d0a870a) {
		de_dbg(c, "found JPEG 2000 signature");
	}
}

// Assembly:
pushq %rbx
movq 0x28(%rdx), %rax
cmpl $0x0, 0x8(%rax)
jne 0x2b07c
cmpq $0x4, 0x40(%rax)
jl 0x2b07c
movq %rdi, %rbx
movq 0x10(%rdx), %rdi
movq 0x38(%rax), %rsi
callq 0xeed0d
cmpl $0xd0a870a, %eax        # imm = 0xD0A870A
jne 0x2b07c
leaq 0xeaa9d(%rip), %rsi     # 0x115b0e
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0xe8617
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_stco
static void do_box_stco(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;
	i64 e_size;

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

	e_size = (bctx->curbox->boxtype == BOX_co64) ? 8 : 4;
	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, e_size, "entry", "chunk offset");
}

// 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), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r13
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xeaa82(%rip), %rsi     # 0x115b38
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r15, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r12
movq %r12, (%rsp)
shrq $0x18, %r13
testb %r13b, %r13b
setne %al
orb %bpl, %al
jne 0x2b14e
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x636f3634, 0xc(%rax)  # imm = 0x636F3634
sete %cl
leaq 0x4(,%rcx,4), %r12
movq %rsp, %r13
movq %r13, %rsi
callq 0xeed31
movq %rax, %rbp
leaq 0xeaa13(%rip), %rsi     # 0x115b28
movq %r15, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r13), %rcx
leaq 0xea3dd(%rip), %rax     # 0x115509
leaq 0x119be0(%rip), %r10    # 0x144d13
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rbp, %r8
movq %r12, %r9
pushq %rax
pushq %r10
callq 0x2d5f3
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_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_colr_bmff
static void do_box_colr_bmff(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	struct de_fourcc ct4cc; // colour_type

	if(curbox->payload_len<4) goto done;

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

	if(ct4cc.id==CODE_rICC || ct4cc.id==CODE_prof) {
		dbuf_create_file_from_slice(bctx->f, pos,
			curbox->payload_pos+curbox->payload_len-pos,
			"icc", NULL, DE_CREATEFLAG_IS_AUX);
	}

done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq 0x28(%rdx), %r13
cmpq $0x4, 0x40(%r13)
jl 0x2b1f9
movq %rdx, %r14
movq %rdi, %r15
movq 0x38(%r13), %rbx
movq 0x10(%rdx), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x10(%rsp), %r12
leaq 0xea9e5(%rip), %rsi     # 0x115b8b
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movl -0xc(%r12), %eax
cmpl $0x72494343, %eax       # imm = 0x72494343
je 0x2b1c6
cmpl $0x70726f66, %eax       # imm = 0x70726F66
jne 0x2b1f9
movq 0x10(%r14), %rdi
movq 0x38(%r13), %rax
movq 0x40(%r13), %rcx
subq %rbx, %rax
addq $0x4, %rbx
leaq (%rax,%rcx), %rdx
addq $-0x4, %rdx
leaq 0xea9b5(%rip), %rcx     # 0x115b9d
movq %rbx, %rsi
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefd48
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_dref
static void do_box_dref(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;

	nitems = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg(c, "number of items: %u", (unsigned 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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq 0x28(%rdx), %r13
movq 0x38(%r13), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movl %eax, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
shrl $0x18, %eax
leaq 0xea8f8(%rip), %rsi     # 0x115b38
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
leaq 0x8(%rsp), %r12
movq %r15, (%r12)
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0xeed31
movq %rax, %r14
leaq 0xea932(%rip), %rsi     # 0x115ba1
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
movl $0x1, 0x60(%r13)
movq %r14, 0x68(%r13)
movq (%r12), %rax
subq 0x38(%r13), %rax
movq %rax, 0x70(%r13)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmff.c
// Function: do_box_hdlr
static void do_box_hdlr(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	de_ucstring *s = NULL;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	struct de_fourcc tmp4cc;

	if(curbox->payload_len<4) goto done;
	do_read_version_and_flags(c, d, bctx, NULL, NULL, 1);
	pos += 4;
	if(curbox->payload_len<24) goto done;
	pos += 4; // "Predefined"

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

	pos += 12; // reserved
	if(curbox->payload_len<25) goto done;
	if(dbuf_getbyte(bctx->f, pos) == 0x00) 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, "metadata type name: \"%s\"", ucstring_getpsz_d(s));

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x28(%rdx), %rbp
cmpq $0x4, 0x40(%rbp)
jge 0x2b2c3
xorl %r14d, %r14d
jmp 0x2b3b4
movq %rdx, %r15
movq %rdi, %rbx
movq 0x38(%rbp), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movl %eax, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
shrl $0x18, %eax
leaq 0xea84d(%rip), %rsi     # 0x115b38
xorl %r14d, %r14d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x18, 0x40(%rbp)
jl 0x2b3b4
leaq 0x8(%r12), %rsi
movq 0x10(%r15), %rdi
leaq 0x8(%rsp), %rdx
xorl %r14d, %r14d
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x18(%rsp), %rdx
leaq 0xea886(%rip), %rsi     # 0x115bb5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
cmpq $0x19, 0x40(%rbp)
jl 0x2b3b4
leaq 0x18(%r12), %r13
movq 0x10(%r15), %rdi
movq %r13, %rsi
callq 0xeead3
testb %al, %al
je 0x2b2bb
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r14
movq 0x10(%r15), %rdi
movq 0x38(%rbp), %rax
movq 0x40(%rbp), %rcx
subq %r12, %rax
leaq (%rax,%rcx), %rdx
addq $-0x18, %rdx
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rsi
movq %r14, %r8
movl $0x1, %r9d
callq 0xefc2a
movq %r14, %rdi
callq 0xf70f6
leaq 0xea821(%rip), %rsi     # 0x115bc8
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
callq 0xf6753
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq 0x28(%rdx), %r13
movq 0x38(%r13), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r12
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xea72d(%rip), %rsi     # 0x115b38
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, 0x8(%rsp)
shrq $0x18, %r12
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %rsi
testb %r12b, %r12b
je 0x2b437
callq 0xeed31
jmp 0x2b43c
callq 0xeeb91
movq %rax, %r14
leaq 0x1010c6(%rip), %rsi    # 0x12c50c
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
movl $0x1, 0x60(%r13)
movq %r14, 0x68(%r13)
movq 0x8(%rsp), %rax
subq 0x38(%r13), %rax
movq %rax, 0x70(%r13)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r13
shrq $0x18, %r13
andl $0xffffff, %eax         # imm = 0xFFFFFF
movzbl %r13b, %edx
leaq 0xea1da(%rip), %rsi     # 0x115b38
movq %r14, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r12
movq %r12, 0x8(%rsp)
movl %r13d, %eax
andb $-0x2, %al
cmpb $0x2, %al
jne 0x2ba20
movq 0x10(%r15), %rdi
leaq 0x8(%rsp), %rsi
cmpb $0x2, %r13b
jne 0x2b996
callq 0xeeb91
jmp 0x2b99b
callq 0xeed31
movq %rax, %r12
leaq 0xea28f(%rip), %rsi     # 0x115c34
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r15), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
callq 0xeeb91
leaq 0xea2d9(%rip), %rsi     # 0x115ca3
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r15), %rdi
movq (%r13), %rsi
leaq 0x10(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
addq $0x4, (%r13)
leaq 0x20(%rsp), %r15
leaq 0xea2b6(%rip), %rsi     # 0x115cb7
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
cmpl $0x45786966, -0xc(%r15) # imm = 0x45786966
jne 0x2ba20
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_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x28(%rdx), %r13
cmpq $0x4, 0x40(%r13)
jl 0x2bb7c
movq %rdx, %r14
movq %rdi, %rbx
movq 0x38(%r13), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r15
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r15d, %edx
shrl $0x18, %edx
leaq 0xea079(%rip), %rsi     # 0x115b38
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
andl $0xff000000, %r15d      # imm = 0xFF000000
movq 0x40(%r13), %rcx
cmpq $0x1000000, %r15        # imm = 0x1000000
jne 0x2baed
movl $0x14, %eax
cmpq $0x24, %rcx
jge 0x2bafc
jmp 0x2bb7c
movl $0xc, %eax
cmpq $0x18, %rcx
jl 0x2bb7c
addq %r12, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%r14), %rdi
callq 0xeed31
movq %rax, %r12
leaq 0xea1ad(%rip), %rsi     # 0x115cc7
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r14), %rdi
cmpl $0x1000000, %r15d       # imm = 0x1000000
jne 0x2bb46
movq 0x8(%rsp), %rsi
callq 0xeee96
addq $0x8, 0x8(%rsp)
jmp 0x2bb50
leaq 0x8(%rsp), %rsi
callq 0xeed31
testq %r12, %r12
jg 0x2bb5b
xorpd %xmm0, %xmm0
jmp 0x2bb69
cvtsi2sd %rax, %xmm0
cvtsi2sd %r12, %xmm1
divsd %xmm1, %xmm0
leaq 0xea17b(%rip), %rsi     # 0x115ceb
movq %rbx, %rdi
movl %eax, %edx
movb $0x1, %al
callq 0xe8617
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2bbbf
movq 0x10(%rbx), %rdi
movq 0x38(%rax), %rsi
addq $0x4, %rsi
callq 0xeed0d
cmpl $0x68646c72, %eax       # imm = 0x68646C72
jne 0x2bbbf
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2ba2e
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x10, %rsp
movq 0x28(%rdx), %rax
cmpq $0x8, 0x40(%rax)
jl 0x2bded
movq %rdx, %r14
movq %rdi, %rbx
movq 0x38(%rax), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r12
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xe9d9b(%rip), %rsi     # 0x115b38
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, 0x8(%rsp)
shrq $0x18, %r12
testb %r12b, %r12b
setne %al
orb %bpl, %al
jne 0x2bded
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0xeeb91
leaq 0xe9f5b(%rip), %rsi     # 0x115d3c
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, (%rsp)
movq %rdi, %r12
movq 0x28(%rdx), %rbx
movq 0x38(%rbx), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r13
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xe9d02(%rip), %rsi     # 0x115b38
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r12, 0x8(%rsp)
movq %r12, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, 0x10(%rsp)
shrq $0x18, %r13
testb %r13b, %r13b
setne %al
orb %bpl, %al
jne 0x2bf5e
movq 0x10(%r14), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xeed31
movq %rax, %r12
leaq 0xe9c9f(%rip), %rsi     # 0x115b28
movq 0x8(%rsp), %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
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 %r12, %rdx
jl 0x2bf5e
movq (%rsp), %rax
movq 0x10(%rax), %rsi
movq %r12, (%rsp)
movq %r12, %rdi
callq 0xe9c3b
movq %rax, %r12
testq %rax, %rax
jle 0x2bf3a
leaq 0x10(%rsp), %r13
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xeed31
movq %rax, %rbp
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xeed31
movq %rax, %rbx
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xeed31
movq 0x8(%rsp), %rdi
leaq 0xe9e28(%rip), %rsi     # 0x115d48
movl %r15d, %edx
movl %ebp, %ecx
movl %ebx, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0xe8617
incq %r15
cmpq %r15, %r12
jne 0x2beea
movq (%rsp), %rdx
cmpq %r12, %rdx
jle 0x2bf5e
subl %r12d, %edx
movq 0x10(%rsp), %rcx
leaq 0xe9e33(%rip), %rsi     # 0x115d85
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/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), %r13
cmpq $0x8, 0x40(%r13)
jl 0x2c0b3
movq %rdx, %rbx
movq %rdi, %r14
movq 0x38(%r13), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r12
movl %r12d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
movl %r12d, %edx
shrl $0x18, %edx
leaq 0xe9b7f(%rip), %rsi     # 0x115b38
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, (%rsp)
shrq $0x18, %r12
testb %r12b, %r12b
jne 0x2c0b3
movq 0x10(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xeed31
leaq 0xe9dc3(%rip), %rsi     # 0x115db1
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r15), %rsi
leaq 0x10(%rsi), %rax
movq 0x40(%r13), %rcx
addq 0x38(%r13), %rcx
cmpq %rcx, %rax
jge 0x2c0b3
leaq 0x8(%rsp), %r12
leaq 0xe9de3(%rip), %rbp     # 0x115e01
movq 0x10(%rbx), %rdi
callq 0xeed0d
movq %rax, %r15
movl (%rsp), %edx
movq %r14, %rdi
leaq 0xe9da3(%rip), %rsi     # 0x115dda
movl %r15d, %ecx
xorl %eax, %eax
callq 0xe8617
cmpq $0x10, %r15
jl 0x2c0b3
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x10(%rbx), %rdi
movq (%rsp), %rsi
addq $0x4, %rsi
movq %r12, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq (%rsp), %rax
leaq (%rax,%r15), %rsi
movq %rsi, (%rsp)
addq %r15, %rax
addq $0x10, %rax
movq 0x40(%r13), %rcx
addq 0x38(%r13), %rcx
cmpq %rcx, %rax
jl 0x2c01e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/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), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r13
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xe9a3e(%rip), %rsi     # 0x115b38
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r15, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r12
movq %r12, (%rsp)
shrq $0x18, %r13
testb %r13b, %r13b
setne %al
orb %bpl, %al
jne 0x2c17e
movq 0x10(%rbx), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xeed31
movq %rax, %r13
leaq 0xe99e7(%rip), %rsi     # 0x115b28
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r12), %rcx
leaq 0xe9cba(%rip), %rax     # 0x115e13
leaq 0x118bb3(%rip), %r10    # 0x144d13
movl $0x4, %r9d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %r8
pushq %rax
pushq %r10
callq 0x2d5f3
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_O3/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), %r12
movq 0x10(%rdx), %rdi
movq %r12, %rsi
callq 0xeed0d
movq %rax, %r13
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xe9973(%rip), %rsi     # 0x115b38
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %bpl
movq %r15, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r12
movq %r12, (%rsp)
shrq $0x18, %r13
testb %r13b, %r13b
setne %al
orb %bpl, %al
jne 0x2c271
movq 0x10(%rbx), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xeed31
movq %rax, %r13
leaq 0xe9c15(%rip), %rsi     # 0x115e21
movq %r15, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0xeed31
movq %rax, %r12
leaq 0xe9c02(%rip), %rsi     # 0x115e31
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
testq %r13, %r13
jne 0x2c271
movq (%rsp), %rcx
leaq 0xe9bf6(%rip), %rax     # 0x115e42
leaq 0xe9584(%rip), %r10     # 0x1157d7
movl $0x4, %r9d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %r8
pushq %rax
pushq %r10
callq 0x2d5f3
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_O3/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, 0x8(%rsp)
movq %rdi, %rbx
movq 0x28(%rdx), %rbp
movq 0x38(%rbp), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r13
movl %r13d, %edx
shrl $0x18, %edx
leaq 0xe987b(%rip), %rsi     # 0x115b38
movl %r13d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
setne %r12b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, 0x10(%rsp)
shrq $0x18, %r13
testb %r13b, %r13b
setne %al
orb %r12b, %al
jne 0x2c3c0
movq 0x10(%r14), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xeed31
movq %rax, %r12
leaq 0xe981d(%rip), %rsi     # 0x115b28
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x40(%rbp), %rax
addq 0x38(%rbp), %rax
subq (%r15), %rax
leaq 0x7(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jl 0x2c3c0
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movq %r12, 0x8(%rsp)
movq %r12, %rdi
callq 0xe9c3b
movq %rax, %r12
testq %rax, %rax
jle 0x2c39d
leaq 0x10(%rsp), %r13
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xeed31
movq %rax, %rbp
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0xeed31
movq %rbx, %rdi
leaq 0xe9ac7(%rip), %rsi     # 0x115e4d
movl %r15d, %edx
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0xe8617
incq %r15
cmpq %r15, %r12
jne 0x2c361
movq 0x8(%rsp), %rdx
cmpq %r12, %rdx
jle 0x2c3c0
subl %r12d, %edx
movq 0x10(%rsp), %rcx
leaq 0xe99cf(%rip), %rsi     # 0x115d85
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/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, 0x10(%rsp)
movq %rdi, %rbx
movq 0x28(%rdx), %rbp
movq 0x38(%rbp), %r15
movq 0x10(%rdx), %rdi
movq %r15, %rsi
callq 0xeed0d
movq %rax, %r13
shrq $0x18, %r13
movzbl %r13b, %edx
leaq 0xe972a(%rip), %rsi     # 0x115b38
andl $0xffffff, %eax         # imm = 0xFFFFFF
setne %r12b
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
addq $0x4, %r15
movq %r15, 0x8(%rsp)
cmpb $0x2, %r13b
setae %al
orb %r12b, %al
jne 0x2c534
movq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xeed31
movq %rax, %r12
leaq 0xe96d1(%rip), %rsi     # 0x115b28
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x40(%rbp), %rax
addq 0x38(%rbp), %rax
subq (%r15), %rax
leaq (,%r12,8), %rcx
cmpq %rcx, %rax
jl 0x2c534
movq %rbx, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
cmpq %rcx, %r12
movq %r12, %rax
movq %rcx, 0x20(%rsp)
movq %rcx, %r12
movq %rax, 0x10(%rsp)
cmovlq %rax, %r12
testq %r12, %r12
jle 0x2c50b
leaq 0x8(%rsp), %rbx
xorl %ebp, %ebp
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0xeed31
movq %rax, %r15
movq 0x10(%r14), %rdi
testb %r13b, %r13b
je 0x2c4db
movq 0x8(%rsp), %rsi
callq 0xeedae
addq $0x4, 0x8(%rsp)
jmp 0x2c4e3
movq %rbx, %rsi
callq 0xeed31
movq 0x18(%rsp), %rdi
leaq 0xe9983(%rip), %rsi     # 0x115e72
movl %ebp, %edx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xe8617
incq %rbp
cmpq %rbp, %r12
leaq 0x8(%rsp), %rbx
jne 0x2c4b1
movq 0x10(%rsp), %rdx
movq 0x20(%rsp), %rax
cmpq %rax, %rdx
movq 0x18(%rsp), %rdi
jle 0x2c534
subl %eax, %edx
movq 0x8(%rsp), %rcx
leaq 0xe9858(%rip), %rsi     # 0x115d85
xorl %eax, %eax
callq 0xe8617
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq