// File: /workspace/github_c_makefile_star2_O2/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 0x6eff9
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r12
movq %rdi, %r14
movq 0x10(%rsi), %r15
leaq 0x8(%r15), %rsi
movq 0x18(%rdi), %rdi
callq 0xe404f
leaq 0xa4cb6(%rip), %rsi     # 0x113c63
movq %r14, %rdi
movq %rax, %rbx
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
leaq 0xc(%r15), %rsi
movq 0x18(%r14), %rdi
callq 0xe404f
movq %rax, %r13
leaq 0xaadd8(%rip), %rsi     # 0x119dab
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq %r13, 0x18(%rsp)
cmpq $0xc, %r13
jge 0x6effa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
testq %rbx, %rbx
cmovleq %rax, %rbx
movq %rbx, 0x20(%rsp)
addq $0x18, %r15
xorl %ecx, %ecx
movq %r12, 0x10(%rsp)
cmpq %rcx, 0x20(%rsp)
je 0x6efeb
leaq -0x8(%r15), %rbx
movq 0x18(%r12), %rax
addq 0x10(%r12), %rax
cmpq %rax, %rbx
jg 0x6efeb
movq %r14, %rdi
leaq 0xaad84(%rip), %rsi     # 0x119dbb
movq %rcx, 0x8(%rsp)
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $0x1
popq %r13
movl %r13d, %esi
callq 0xdeba7
movq 0x10(%r12), %rbp
movq %r14, %rdi
callq 0xeac74
movq %rax, %r12
movq 0x18(%r14), %rdi
movq %rbx, %rsi
pushq $0x2
popq %rbx
movq %rbx, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0xe4c9a
movq %r12, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0xaad36(%rip), %rsi     # 0x119dcd
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
callq 0xeac85
movq 0x18(%r14), %rdi
leaq -0x6(%r15), %rsi
movq %rbx, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0xe4c9a
movq %r12, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0xaad0d(%rip), %rsi     # 0x119de1
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
callq 0xeac85
movq 0x18(%r14), %rdi
leaq -0x4(%r15), %rsi
callq 0xe404f
movq %rax, %rbx
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xe404f
movq %rax, %r13
movq %r14, %rdi
leaq 0xaace5(%rip), %rsi     # 0x119df4
movq %rbp, %rdx
movq %rax, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xde896
movq 0x18(%r14), %rdi
addq %rbp, %r13
movl $0x4, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r13, %rsi
movq %rbx, %rdx
movq %r12, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r12, %rdi
callq 0xeacc0
movq %r12, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0xc3118(%rip), %rsi     # 0x132275
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
movq 0x10(%rsp), %r12
callq 0xeaf3c
movq %r14, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq 0x8(%rsp), %rcx
incq %rcx
addq 0x18(%rsp), %r15
jmp 0x6f013