// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/apple2-dsk.c
// Function: do_moof_INFO
static void do_moof_INFO(deark *c, struct de_iffctx *ictx,
	const struct de_iffchunkctx *chunkctx)
{
	u8 b;
	i64 n;
	i64 pos = chunkctx->dpos;
	de_ucstring *s = NULL;

	if(chunkctx->dlen<44) return;
	b = dbuf_getbyte_p(ictx->f, &pos);
	de_dbg(c, "INFO chunk version: %d", (int)b);
	b = dbuf_getbyte_p(ictx->f, &pos);
	de_dbg(c, "disk type: %d (%s)", (int)b, get_moof_disk_type_name(b));
	b = dbuf_getbyte_p(ictx->f, &pos);
	de_dbg(c, "write protected: %d", (int)b);
	b = dbuf_getbyte_p(ictx->f, &pos);
	de_dbg(c, "synchronized: %d", (int)b);
	b = dbuf_getbyte_p(ictx->f, &pos);
	de_dbg(c, "optimal timing bit: %d", (int)b);

	s = ucstring_create(c);
	dbuf_read_to_ucstring(ictx->f, pos, 32, s, 0, DE_ENCODING_UTF8);
	ucstring_strip_trailing_spaces(s);
	de_dbg(c, "creator: \"%s\"", ucstring_getpsz(s));
	pos += 32;
	pos++; // padding
	n = dbuf_getu16le_p(ictx->f, &pos);
	de_dbg(c, "largest track: %d blocks", (int)n);
	n = dbuf_getu16le_p(ictx->f, &pos);
	de_dbg(c, "flux block: %d", (int)n);
	n = dbuf_getu16le_p(ictx->f, &pos);
	de_dbg(c, "largest flux track: %d blocks", (int)n);

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x2c, 0x48(%rax)
jge 0x3bd78
jmp 0x3bf6b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %edx
leaq 0x1668f9(%rip), %rsi    # 0x1a2694
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movzbl -0x19(%rbp), %eax
movl %eax, -0x44(%rbp)
movzbl -0x19(%rbp), %edi
callq 0x3c0f0
movq -0x50(%rbp), %rdi
movl -0x44(%rbp), %edx
movq %rax, %rcx
leaq 0x1668cc(%rip), %rsi    # 0x1a26ab
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %edx
leaq 0x1668b5(%rip), %rsi    # 0x1a26be
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %edx
leaq 0x16689f(%rip), %rsi    # 0x1a26d2
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %edx
leaq 0x166886(%rip), %rsi    # 0x1a26e3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rcx
movl $0x20, %edx
xorl %r8d, %r8d
movl $0x2, %r9d
callq 0x1669f0
movq -0x38(%rbp), %rdi
callq 0x171360
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x172500
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x16683e(%rip), %rsi    # 0x1a26fa
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x166807(%rip), %rsi    # 0x1a2708
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x1667f3(%rip), %rsi    # 0x1a2721
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x1667d5(%rip), %rsi    # 0x1a2730
movb $0x0, %al
callq 0x15b0d0
movq -0x38(%rbp), %rdi
callq 0x171750
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)