// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/qtif.c
// Function: do_read_idsc
static int do_read_idsc(deark *c, lctx *d, i64 pos, i64 len)
{
	int retval = 0;

	if(len<8) goto done;

	d->idsc_found = 1;

	d->idsc_size = de_getu32be(pos);
	de_dbg(c, "idsc size: %d", (int)d->idsc_size);

	dbuf_read_fourcc(c->infile, pos+4, &d->cmpr4cc, 4, 0x0);
	de_dbg(c, "compression type: \"%s\"", d->cmpr4cc.id_dbgstr);

	if(len<86) goto done;
	if(d->idsc_size<86) goto done;

	d->width = de_getu16be(pos+32);
	d->height = de_getu16be(pos+34);
	d->hres = dbuf_fmtutil_read_fixed_16_16(c->infile, pos+36);
	d->vres = dbuf_fmtutil_read_fixed_16_16(c->infile, pos+40);
	de_dbg(c, "dpi: %.2f"DE_CHAR_TIMES"%.2f", d->hres, d->vres);
	d->idat_data_size = de_getu32be(pos+44);
	de_dbg(c, "reported data size: %d", (int)d->idat_data_size);
	if(d->idat_data_size>c->infile->len) d->idat_data_size=0;
	d->bitdepth = de_getu16be(pos+82);
	d->palette_id = de_getu16be(pos+84);
	de_dbg(c, "dimensions: %d"DE_CHAR_TIMES"%d, bitdepth: %d, palette: %d", (int)d->width,
		(int)d->height, (int)d->bitdepth, (int)d->palette_id);
	retval = 1;
done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x8, -0x20(%rbp)
jge 0x11e35b
jmp 0x11e58a
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165470
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
leaq 0xa77e7(%rip), %rsi     # 0x1c5b7e
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
movq -0x10(%rbp), %rdx
addq $0x30, %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x30, %rdx
addq $0x10, %rdx
leaq 0xa7829(%rip), %rsi     # 0x1c5c03
movb $0x0, %al
callq 0x15b0d0
cmpq $0x56, -0x20(%rbp)
jge 0x11e3ed
jmp 0x11e58a
movq -0x10(%rbp), %rax
cmpq $0x56, 0x20(%rax)
jge 0x11e3fd
jmp 0x11e58a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x22, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x24, %rsi
callq 0x173ea0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x28, %rsi
callq 0x173ea0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x88(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movsd 0x80(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x88(%rax), %xmm1
leaq 0xa459c(%rip), %rsi     # 0x1c2a3e
movb $0x2, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2c, %rsi
callq 0x165470
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0xa76ae(%rip), %rsi     # 0x1c5b8c
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x11e507
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x52, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x54, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movl %eax, %r8d
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movl %eax, %r9d
leaq 0xa7627(%rip), %rsi     # 0x1c5ba3
movb $0x0, %al
callq 0x15b0d0
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)