// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/asf.c
// Function: handler_CodecList
static void handler_CodecList(deark *c, lctx *d, struct handler_params *hp)
{
	i64 numentries;
	i64 k;
	i64 pos;

	if(hp->dlen<20) return;
	numentries = de_getu32le(hp->dpos+16);
	de_dbg(c, "number of codec entries: %d", (int)numentries);

	pos = hp->dpos+20;
	for(k=0; k<numentries; k++) {
		i64 bytes_consumed = 0;
		int ret;

		if(pos >= hp->dpos + hp->dlen) break;
		ret = do_codec_entry(c, d, pos, hp->dpos+hp->dlen-pos, &bytes_consumed);
		if(!ret || (bytes_consumed<8)) break;
		pos += bytes_consumed;
	}
}

// Assembly:
cmpq $0x14, 0x18(%rdx)
jl 0x1e712
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x10(%rdx), %rsi
addq $0x10, %rsi
callq 0xe409f
movq %rax, %r13
leaq 0xe7175(%rip), %rsi     # 0x1055fb
movq %rbx, 0x18(%rsp)
xorl %ebx, %ebx
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rbp
addq $0x14, %rbp
testq %r13, %r13
cmovleq %rbx, %r13
movq 0x18(%rsp), %rbx
subq $0x1, %r13
jb 0x1e704
movq 0x18(%rbx), %r12
addq 0x10(%rbx), %r12
subq %rbp, %r12
jle 0x1e704
movq %r13, 0x30(%rsp)
movq %rbp, 0x10(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0xdebae
movq %r14, %rdi
leaq 0xe7128(%rip), %rsi     # 0x105617
movq %rbp, 0x28(%rsp)
movq %rbp, %rdx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movl $0x0, %r15d
movl $0x0, %ebp
movl $0x0, %r13d
cmpq $0x8, %r12
jl 0x1e6ca
movq 0x18(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe3fc4
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x1e55c
cmpl $0x2, %eax
je 0x1e553
leaq 0x10099c(%rip), %rcx    # 0x11eee1
cmpl $0x1, %eax
jne 0x1e563
leaq 0x101518(%rip), %rcx    # 0x11fa69
jmp 0x1e563
leaq 0x101520(%rip), %rcx    # 0x11fa7a
jmp 0x1e563
leaq 0xe6f19(%rip), %rcx     # 0x10547c
movq %r14, %rdi
leaq 0xe71a5(%rip), %rsi     # 0x105712
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%r14), %rdi
leaq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0xe3fc4
movq %rax, %rbx
movq %r14, %rdi
callq 0xeac74
movq %rax, %r13
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rsi
addq %rbx, %rbx
pushq $0x3
popq %r15
movl %r15d, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rbx, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %r13, %rdi
callq 0xeacc0
movq %r13, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0xf6fe5(%rip), %rsi     # 0x1155bb
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq %rbx, 0x10(%rsp)
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0xe3fc4
movq %rax, %rbx
movq %r14, %rdi
callq 0xeac74
movq %rax, %rbp
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rsi
addq %rbx, %rbx
movl %r15d, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rbx, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xe4ced
movq %rbp, %rdi
callq 0xeacc0
movq %rbp, %rdi
callq 0xeb7e4
movq %r14, %rdi
leaq 0xfc6f8(%rip), %rsi     # 0x11ad34
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq %rbx, 0x10(%rsp)
movq 0x18(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe3fc4
movq %rax, %rbx
testq %rax, %rax
jle 0x1e6b3
movq 0x10(%rsp), %rcx
movq %r14, %rdi
leaq 0xe6fba(%rip), %rsi     # 0x10562a
movl %ebx, %edx
xorl %eax, %eax
callq 0xde896
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%r14), %rsi
movq 0x10(%rsp), %rdx
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %r14, %rdi
movq %rbx, %rcx
xorl %r9d, %r9d
callq 0xded3a
movq %r14, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
movq 0x10(%rsp), %r15
addq %rbx, %r15
movq %r15, 0x10(%rsp)
subq 0x28(%rsp), %r15
movq 0x18(%rsp), %rbx
movl 0x24(%rsp), %esi
movq %r14, %rdi
callq 0xdebb7
movq %r13, %rdi
callq 0xeaf3c
movq %rbp, %rdi
callq 0xeaf3c
cmpq $0x8, %r12
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %rbp
jl 0x1e704
cmpq $0x8, %r15
jl 0x1e704
addq %r15, %rbp
jmp 0x1e4b3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq