// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/bmff.c
// Function: do_box_rreq
static void do_box_rreq(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 pos = bctx->curbox->payload_pos;
	i64 endpos = pos + bctx->curbox->payload_len;
	UI ml;
	i64 nsf, nvf;
	u64 msk;
	i64 i;

	if(pos>=endpos) goto done;
	ml = (UI)dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "ml: %u byte(s)", ml);
	if(ml<1 || ml>8) goto done;

	msk = (u64)dbuf_getint_ext(bctx->f, pos, ml, 0, 0);
	pos += (i64)ml;
	de_dbg(c, "fuam: 0x%"U64_FMTx, msk);

	msk = (u64)dbuf_getint_ext(bctx->f, pos, ml, 0, 0);
	pos += (i64)ml;
	de_dbg(c, "dcm: 0x%"U64_FMTx, msk);

	nsf = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "nsf: %d", (int)nsf);

	for(i=0; i<nsf; i++) {
		UI sf;

		if(pos>=endpos) goto done;
		sf = (UI)dbuf_getu16be_p(bctx->f, &pos);
		de_dbg(c, "standard feature[%d]: %u (%s)", (int)i, sf, get_rreq_sf_name(sf));

		msk = (u64)dbuf_getint_ext(bctx->f, pos, ml, 0, 0);
		pos += (i64)ml;
		de_dbg_indent(c, 1);
		de_dbg(c, "mask: 0x%"U64_FMTx, msk);
		de_dbg_indent(c, -1);
	}

	if(pos>=endpos) goto done;
	nvf = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "num. vendor features: %d", (int)nvf);

	for(i=0; i<nvf; i++) {
		u8 ubuf[16];
		char uuid_string[50];

		if(pos>=endpos) goto done;
		dbuf_read(bctx->f, ubuf, pos, 16);
		fmtutil_render_uuid(c, ubuf, uuid_string, sizeof(uuid_string));
		de_dbg(c, "vendor feature[%d]: {%s}", (int)i, uuid_string);
		pos += 16;

		msk = (u64)dbuf_getint_ext(bctx->f, pos, ml, 0, 0);
		pos += (i64)ml;
		de_dbg_indent(c, 1);
		de_dbg(c, "mask: 0x%"U64_FMTx, msk);
		de_dbg_indent(c, -1);
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x28(%rdx), %rax
movq 0x38(%rax), %r15
movq %r15, (%rsp)
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jle 0x2c581
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rdx), %rdi
movq %rsp, %rsi
callq 0xe3f2a
movzbl %al, %r12d
leaq 0xdce8c(%rip), %rsi     # 0x109193
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
movq %r12, 0x10(%rsp)
leal -0x9(%r12), %eax
cmpb $-0x8, %al
jb 0x2c581
addq %r15, 0x8(%rsp)
movq 0x10(%rbx), %rdi
movq %rsp, %rbp
movq (%rbp), %rsi
xorl %r15d, %r15d
movq 0x10(%rsp), %r12
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xe424b
movl %r12d, %r13d
addq %r13, (%rbp)
leaq 0xdce49(%rip), %rsi     # 0x1091a2
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x10(%rbx), %rdi
movq (%rbp), %rsi
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xe424b
movq %r13, 0x18(%rsp)
addq %r13, (%rbp)
leaq 0xdce23(%rip), %rsi     # 0x1091ae
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x10(%rbx), %rdi
movq %rbp, %rsi
callq 0xe3f6e
movq %rax, %r13
leaq 0xdce0b(%rip), %rsi     # 0x1091b9
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
testq %r13, %r13
cmovleq %r15, %r13
leaq 0xdcf6f(%rip), %r15     # 0x109338
xorl %ebp, %ebp
movq (%rsp), %rax
cmpq %r13, %rbp
je 0x2c490
cmpq 0x8(%rsp), %rax
jge 0x2c581
movq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0xe3f6e
leaq 0xdcf4e(%rip), %rcx     # 0x109344
xorl %edx, %edx
cmpq $0xb, %rdx
je 0x2c410
movzbl (%rdx,%r15), %esi
cmpl %eax, %esi
je 0x2c419
incq %rdx
addq $0x4, %rcx
jmp 0x2c3f8
leaq 0xf2aca(%rip), %r8      # 0x11eee1
jmp 0x2c426
movslq (%rcx), %r8
leaq 0xdcf21(%rip), %rcx     # 0x109344
addq %rcx, %r8
movq %r14, %rdi
leaq 0xdcd91(%rip), %rsi     # 0x1091c1
movl %ebp, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xde896
movq 0x10(%rbx), %rdi
movq (%rsp), %rsi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xe424b
movq %rax, %r12
movq 0x18(%rsp), %rax
addq %rax, (%rsp)
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r14, %rdi
leaq 0xdcd6c(%rip), %rsi     # 0x1091df
movq %r12, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %rbp
jmp 0x2c3cb
cmpq 0x8(%rsp), %rax
jge 0x2c581
movq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0xe3f6e
movq %rax, %r12
leaq 0xdcd3a(%rip), %rsi     # 0x1091eb
xorl %r15d, %r15d
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
cmovleq %r15, %r12
leaq 0x20(%rsp), %r15
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x2c581
movq (%rsp), %rdx
cmpq 0x8(%rsp), %rdx
jge 0x2c581
movq 0x10(%rbx), %rdi
movq %r15, %rsi
pushq $0x10
popq %rcx
callq 0xe3cb7
movq %r14, %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rbp
movq %rbp, %rdx
pushq $0x32
popq %rcx
callq 0xec7c5
movq %r14, %rdi
leaq 0xdcced(%rip), %rsi     # 0x109204
movl %r13d, %edx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xde896
movq (%rsp), %rsi
addq $0x10, %rsi
movq %rsi, (%rsp)
movq 0x10(%rbx), %rdi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xe424b
movq %rax, %rbp
movq 0x18(%rsp), %rax
addq %rax, (%rsp)
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r14, %rdi
leaq 0xdcc7b(%rip), %rsi     # 0x1091df
movq %rbp, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %r13
jmp 0x2c4d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq