// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_mluc
static void typedec_mluc(deark *c, struct typedec_params *p)
{
	i64 pos = p->pos1;
	i64 num_recs;
	i64 recsize;
	i64 rec_array_startpos;
	i64 rec;

	if(p->len<12) goto done;
	pos += 8;

	num_recs = de_getu32be(pos);
	de_dbg(c, "number of records: %u", (UI)num_recs);
	pos += 4;

	recsize = de_getu32be(pos);
	de_dbg(c, "record size: %u", (UI)recsize);
	if(recsize<12) goto done;
	pos += 4;

	rec_array_startpos = pos;

	for(rec=0; rec<num_recs; rec++) {
		if(rec_array_startpos+rec*recsize > p->pos1+p->len) break;

		de_dbg(c, "record #%u at %"I64_FMT, (UI)rec, pos);
		de_dbg_indent(c, 1);
		do_mluc_record(c, p->d, p->pos1, pos, recsize);
		de_dbg_indent(c, -1);
		pos += recsize;
	}

done:
	;
}

// Assembly:
cmpq $0xc, 0x18(%rsi)
jl 0x7319f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %r15
leaq 0x8(%r15), %rsi
movq 0x18(%rdi), %rdi
callq 0xeed0d
leaq 0xadd9f(%rip), %rsi     # 0x120d53
movq %r14, %rdi
movq %rax, 0x8(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0xc(%r15), %rsi
movq 0x18(%r14), %rdi
callq 0xeed0d
movq %rax, %r12
leaq 0xb3fcf(%rip), %rsi     # 0x126fab
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq %r12, 0x20(%rsp)
cmpq $0xc, %r12
jl 0x73191
cmpq $0x0, 0x8(%rsp)
jle 0x73191
addq $0x10, %r15
xorl %ecx, %ecx
movq %rbx, 0x18(%rsp)
movq 0x18(%rbx), %rax
addq 0x10(%rbx), %rax
cmpq %rax, %r15
jg 0x73191
movq %r14, %rdi
leaq 0xb3f91(%rip), %rsi     # 0x126fbb
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x10(%rbx), %rbp
movq %r14, %rdi
callq 0xf6410
movq %rax, %r12
movq 0x18(%r14), %rdi
movl $0x2, %edx
movq %r15, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefbd7
movq %r12, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0xb3f44(%rip), %rsi     # 0x126fcd
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xf6423
movq 0x18(%r14), %rdi
leaq 0x2(%r15), %rsi
movl $0x2, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xefbd7
movq %r12, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0xb3f16(%rip), %rsi     # 0x126fe1
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xf6423
movq 0x18(%r14), %rdi
leaq 0x4(%r15), %rsi
callq 0xeed0d
movq %rax, %rbx
movq 0x18(%r14), %rdi
leaq 0x8(%r15), %rsi
callq 0xeed0d
movq %rax, %r13
movq %r14, %rdi
leaq 0xb3eed(%rip), %rsi     # 0x126ff4
movq %rbp, %rdx
movq %rax, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
addq %rbp, %r13
movl $0x4, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r13, %rsi
movq %rbx, %rdx
movq 0x18(%rsp), %rbx
movq %r12, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r12, %rdi
callq 0xf6461
movq %r12, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0xcc44b(%rip), %rsi     # 0x13f5a5
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xf6753
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%rsp), %rcx
addq 0x20(%rsp), %r15
incq %rcx
cmpq %rcx, 0x8(%rsp)
jne 0x7300f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq