// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/bmff.c
// Function: do_box_ihdr
static void do_box_ihdr(deark *c, lctx *d, struct de_boxesctx *bctx)
{
	i64 w, h, n;
	u8 b;
	struct de_boxdata *curbox = bctx->curbox;
	i64 pos = curbox->payload_pos;
	char tmps[80];

	if(curbox->payload_len<14) return;
	h = dbuf_getu32be_p(bctx->f, &pos);
	w = dbuf_getu32be_p(bctx->f, &pos);
	de_dbg_dimensions(c, w, h);

	n = dbuf_getu16be_p(bctx->f, &pos);
	de_dbg(c, "number of components: %d", (int)n);

	b = dbuf_getbyte_p(bctx->f, &pos);
	if(b==255) {
		de_strlcpy(tmps, "various", sizeof(tmps));
	}
	else {
		de_snprintf(tmps, sizeof(tmps), "%u bits/comp., %ssigned",
			(unsigned int)(1+(b&0x7f)), (b&0x80)?"":"un");
	}
	de_dbg(c, "bits-per-component code: %u (%s)", (unsigned int)b, tmps);

	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "compression type: %u (%s)", (unsigned int)b,
		get_jpeg2000_cmpr_name(c, d, b));

	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "colorspace-is-unknown flag: %d", (int)b);
	b = dbuf_getbyte_p(bctx->f, &pos);
	de_dbg(c, "has-IPR: %d", (int)b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq $0xe, 0x40(%rax)
jge 0x3932f
jmp 0x394dc
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x15bba0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165210
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x168b85(%rip), %rsi    # 0x1a1f15
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0xff, %eax
jne 0x393d0
leaq -0xa0(%rbp), %rdi
leaq 0x168b6a(%rip), %rsi    # 0x1a1f2e
movl $0x50, %edx
callq 0x15aa30
jmp 0x39413
leaq -0xa0(%rbp), %rdi
movzbl -0x31(%rbp), %ecx
andl $0x7f, %ecx
addl $0x1, %ecx
movzbl -0x31(%rbp), %edx
andl $0x80, %edx
leaq 0x16620d(%rip), %r8     # 0x19f5ff
leaq 0x1977d7(%rip), %rax    # 0x1d0bd0
cmpl $0x0, %edx
cmovneq %rax, %r8
movl $0x50, %esi
leaq 0x168b2a(%rip), %rdx    # 0x1a1f36
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %edx
leaq -0xa0(%rbp), %rcx
leaq 0x168b25(%rip), %rsi    # 0x1a1f4e
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movzbl -0x31(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzbl -0x31(%rbp), %edx
callq 0x3a220
movq -0xb0(%rbp), %rdi
movl -0xa4(%rbp), %edx
movq %rax, %rcx
leaq 0x168aee(%rip), %rsi    # 0x1a1f6f
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %edx
leaq 0x168ade(%rip), %rsi    # 0x1a1f89
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %edx
leaq 0x168ad3(%rip), %rsi    # 0x1a1fa8
movb $0x0, %al
callq 0x15b0d0
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)