// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/asf.c
// Function: handler_StreamProperties
static void handler_StreamProperties(deark *c, lctx *d, struct handler_params *hp)
{
	i64 pos = hp->dpos;
	i64 x;
	i64 tsdlen, ecdlen;
	unsigned int flags;
	u8 stream_type[16];
	u8 ec_type[16];
	char stream_type_string[50];
	char ec_type_string[50];
	char buf[64];

	if(hp->dlen<54) return;

	read_and_render_guid(c->infile, stream_type, pos,
		stream_type_string, sizeof(stream_type_string));
	de_dbg(c, "stream type: {%s} (%s)", stream_type_string, get_uuid_name(stream_type));
	pos += 16;

	read_and_render_guid(c->infile, ec_type, pos, ec_type_string, sizeof(ec_type_string));
	de_dbg(c, "error correction type: {%s} (%s)", ec_type_string, get_uuid_name(ec_type));
	pos += 16;

	x = de_geti64le(pos);
	de_dbg(c, "time offset: %"I64_FMT" (%s)", x, format_duration(x, buf, sizeof(buf)));
	pos += 8;

	tsdlen = de_getu32le_p(&pos);
	ecdlen = de_getu32le_p(&pos);

	flags = (unsigned int)de_getu16le_p(&pos);
	de_dbg(c, "flags: 0x%08x", flags);
	de_dbg_indent(c, 1);
	de_dbg(c, "stream number: %u", (unsigned int)(flags&0x7f));
	de_dbg_indent(c, -1);

	pos += 4; // reserved

	if(tsdlen) {
		de_dbg(c, "[%d bytes of type-specific data at %"I64_FMT"]", (int)tsdlen, pos);
		de_dbg_indent(c, 1);
		de_dbg_hexdump(c, c->infile, pos, tsdlen, 256, NULL, 0x1);
		de_dbg_indent(c, -1);
		pos += tsdlen;
	}
	if(ecdlen) {
		de_dbg(c, "[%d bytes of error correction data at %"I64_FMT"]", (int)ecdlen, pos);
		de_dbg_indent(c, 1);
		de_dbg_hexdump(c, c->infile, pos, ecdlen, 256, NULL, 0x1);
		de_dbg_indent(c, -1);
		pos += ecdlen;
	}
}

// Assembly:
cmpq $0x36, 0x18(%rdx)
jl 0x1e3ce
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf0, %rsp
movq %rdi, %rbx
movq 0x10(%rdx), %r14
movq 0x18(%rdi), %rdi
leaq 0x20(%rsp), %r15
leaq 0x70(%rsp), %r12
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x1decd
movq %r15, %rdi
callq 0x1f682
leaq 0xe7290(%rip), %rsi     # 0x10548d
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
leaq 0x10(%r14), %rdx
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r15
leaq 0x30(%rsp), %r12
movq %r15, %rsi
movq %r12, %rcx
callq 0x1decd
movq %r15, %rdi
callq 0x1f682
leaq 0xe726b(%rip), %rsi     # 0x1054a4
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xde896
leaq 0x20(%r14), %rsi
movq 0x18(%rbx), %rdi
callq 0xe418b
movq %rax, %r15
leaq 0xb0(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x1f658
leaq 0xe7252(%rip), %rsi     # 0x1054c5
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0xde896
addq $0x28, %r14
leaq 0x8(%rsp), %r12
movq %r14, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe40bf
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, %r13
leaq 0xfb36a(%rip), %rsi     # 0x11962e
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
andl $0x7f, %r13d
leaq 0xe71f4(%rip), %rsi     # 0x1054db
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq (%r12), %rcx
addq $0x4, %rcx
movq %rcx, (%r12)
testq %r15, %r15
je 0x1e36b
leaq 0xe71d6(%rip), %rsi     # 0x1054ed
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rsi
movq 0x8(%rsp), %rdx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xded3a
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
addq 0x8(%rsp), %r15
movq %r15, 0x8(%rsp)
movq %r15, %rcx
testq %r14, %r14
je 0x1e3be
leaq 0xe719e(%rip), %rsi     # 0x105515
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rsi
movq 0x8(%rsp), %rdx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rcx
xorl %r9d, %r9d
callq 0xded3a
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq