// File: /workspace/github_c_makefile_star2_O1/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 0x7345a
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 0xef32a
leaq 0xad9bc(%rip), %rsi     # 0x120c2b
movq %r14, %rdi
movq %rax, 0x8(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0xc(%r15), %rsi
movq 0x18(%r14), %rdi
callq 0xef32a
movq %rax, %r12
leaq 0xb3ae4(%rip), %rsi     # 0x126d7b
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r12, 0x20(%rsp)
cmpq $0xc, %r12
jl 0x7344c
cmpq $0x0, 0x8(%rsp)
jle 0x7344c
addq $0x10, %r15
xorl %ecx, %ecx
movq %rbx, 0x18(%rsp)
movq 0x18(%rbx), %rax
addq 0x10(%rbx), %rax
cmpq %rax, %r15
jg 0x7344c
movq %r14, %rdi
leaq 0xb3aa6(%rip), %rsi     # 0x126d8b
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x10(%rbx), %rbp
movq %r14, %rdi
callq 0xf6870
movq %rax, %r12
movq 0x18(%r14), %rdi
movl $0x2, %edx
movq %r15, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf01b0
movq %r12, %rdi
callq 0xf74bd
movq %r14, %rdi
leaq 0xb3a59(%rip), %rsi     # 0x126d9d
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xf6883
movq 0x18(%r14), %rdi
leaq 0x2(%r15), %rsi
movl $0x2, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xf01b0
movq %r12, %rdi
callq 0xf74bd
movq %r14, %rdi
leaq 0xb3a2b(%rip), %rsi     # 0x126db1
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xf6883
movq 0x18(%r14), %rdi
leaq 0x4(%r15), %rsi
callq 0xef32a
movq %rax, %rbx
movq 0x18(%r14), %rdi
leaq 0x8(%r15), %rsi
callq 0xef32a
movq %rax, %r13
movq %r14, %rdi
leaq 0xb3a02(%rip), %rsi     # 0x126dc4
movq %rbp, %rdx
movq %rax, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xe9226
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 0xf0203
movq %r12, %rdi
callq 0xf68c1
movq %r12, %rdi
callq 0xf74bd
movq %r14, %rdi
leaq 0xcbd90(%rip), %rsi     # 0x13f1a5
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
callq 0xf6bb0
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x10(%rsp), %rcx
addq 0x20(%rsp), %r15
incq %rcx
cmpq %rcx, 0x8(%rsp)
jne 0x732ca
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq