// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/asf.c
// Function: handler_FileProperties
static void handler_FileProperties(deark *c, lctx *d, struct handler_params *hp)
{
	i64 pos = hp->dpos;
	i64 create_date;
	i64 x;
	unsigned int flags;
	u8 guid_raw[16];
	char guid_string[50];
	char buf[64];

	if(hp->dlen<80) return;

	// Some fields before the 'flags' field depend on it, so look ahead at it.
	flags = (unsigned int)de_getu32le(pos+64);

	read_and_render_guid(c->infile, guid_raw, pos, guid_string, sizeof(guid_string));
	de_dbg(c, "file id: {%s}", guid_string);
	pos += 16;

	if(!(flags&0x1)) {
		x = de_geti64le(pos);
		de_dbg(c, "file size: %"I64_FMT, x);
	}
	pos += 8;

	create_date = de_geti64le(pos);
	de_dbg(c, "creation date: %"I64_FMT" (%s)", create_date,
		format_date(create_date, buf, sizeof(buf)));
	pos += 8;

	if(!(flags&0x1)) {
		x = de_geti64le(pos);
		de_dbg(c, "data packets count: %"I64_FMT, x);
	}
	pos += 8;

	if(!(flags&0x1)) {
		x = de_geti64le(pos);
		de_dbg(c, "play duration: %"I64_FMT" (%s)", x, format_duration(x, buf, sizeof(buf)));
	}
	pos += 8;

	if(!(flags&0x1)) {
		x = de_geti64le(pos);
		de_dbg(c, "send duration: %"I64_FMT" (%s)", x, format_duration(x, buf, sizeof(buf)));
	}
	pos += 8;

	x = de_geti64le(pos);
	de_dbg(c, "preroll: %"I64_FMT, x);
	pos += 8;

	// Already read, above.
	de_dbg(c, "flags: 0x%08x", flags);
	pos += 4;

	x = de_getu32le_p(&pos);
	de_dbg(c, "min data packet size: %u", (unsigned int)x);

	x = de_getu32le_p(&pos);
	de_dbg(c, "max data packet size: %u", (unsigned int)x);

	x = de_getu32le_p(&pos);
	de_dbg(c, "max bitrate: %u bits/sec", (unsigned int)x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x50, 0x18(%rax)
jge 0x22fa3
jmp 0x232bc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x40, %rsi
callq 0x165540
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x50(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x90(%rbp), %rcx
movl $0x32, %r8d
callq 0x22de0
movq -0x8(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq 0x17b4a7(%rip), %rsi    # 0x19e496
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x23038
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x17f4e9(%rip), %rsi    # 0x1a251a
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x28(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x40, %edx
callq 0x24830
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
movq %rax, %rcx
leaq 0x17b408(%rip), %rsi    # 0x19e4a4
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x230e5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x17b3de(%rip), %rsi    # 0x19e4bc
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x2315b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x30(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x40, %edx
callq 0x24890
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rdx
movq %rax, %rcx
leaq 0x17b380(%rip), %rsi    # 0x19e4d4
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x231d1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x30(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x40, %edx
callq 0x24890
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movq %rax, %rcx
leaq 0x17b322(%rip), %rsi    # 0x19e4ec
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1657e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x17b303(%rip), %rsi    # 0x19e504
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x18ee5c(%rip), %rsi    # 0x1b207e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x17b2b6(%rip), %rsi    # 0x19e511
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x17b2a2(%rip), %rsi    # 0x19e52a
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x165580
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x17b28e(%rip), %rsi    # 0x19e543
movb $0x0, %al
callq 0x15b0d0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)