// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x18(%rsp)
cmpq $0x14, 0x18(%rdx)
jl 0x1ec63
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
addq $0x10, %rsi
callq 0xeed61
movq %rax, %r13
leaq 0xf3c2b(%rip), %rsi     # 0x11261b
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
testq %r13, %r13
jle 0x1ec63
movq 0x18(%rsp), %rax
movq 0x10(%rax), %r12
addq $0x14, %r12
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r15
addq 0x10(%rax), %r15
subq %r12, %r15
jle 0x1ec63
movq %r13, 0x30(%rsp)
movq %r12, 0x10(%rsp)
movq %r14, %rdi
leaq 0x24(%rsp), %rsi
callq 0xe8a1c
movq %r14, %rdi
leaq 0xf3bed(%rip), %rsi     # 0x112637
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x0, %ebp
movl $0x0, %r13d
movl $0x0, %ebx
cmpq $0x8, %r15
jl 0x1ec2a
movq 0x18(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x1eab3
cmpl $0x2, %eax
je 0x1eaaa
leaq 0x10d6b5(%rip), %rcx    # 0x12c151
cmpl $0x1, %eax
jne 0x1eaba
leaq 0x10e231(%rip), %rcx    # 0x12ccd9
jmp 0x1eaba
leaq 0x10e239(%rip), %rcx    # 0x12ccea
jmp 0x1eaba
leaq 0xf39e2(%rip), %rcx     # 0x11249c
movq %r14, %rdi
leaq 0xf3c6e(%rip), %rsi     # 0x112732
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
leaq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0xeebeb
movq %rax, %rbx
movq %r14, %rdi
callq 0xf6410
movq %rax, %r13
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rsi
addq %rbx, %rbx
movl $0x3, %eax
movl %eax, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rbx, %rdx
movq %r13, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r13, %rdi
callq 0xf6461
movq %r13, 0x28(%rsp)
movq %r13, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0x103c49(%rip), %rsi    # 0x12277b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %rbx, 0x10(%rsp)
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0xeebeb
movq %rax, %rbx
movq %r14, %rdi
callq 0xf6410
movq %rax, %r13
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rsi
addq %rbx, %rbx
movl $0x3, %eax
movl %eax, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rbx, %rdx
movq %r13, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r13, %rdi
callq 0xf6461
movq %r13, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0x1093d8(%rip), %rsi    # 0x127f74
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %rbx, 0x10(%rsp)
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0xeebeb
movq %rax, %rbx
testq %rax, %rax
jle 0x1ec15
movq 0x10(%rsp), %rcx
movq %r14, %rdi
leaq 0xf3a7c(%rip), %rsi     # 0x11264a
movl %ebx, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
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 0xe8bea
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%rsp), %rbp
addq %rbx, %rbp
movq %rbp, 0x10(%rsp)
subq %r12, %rbp
movq 0x28(%rsp), %rbx
movl 0x24(%rsp), %esi
movq %r14, %rdi
callq 0xe8a25
movq %rbx, %rdi
callq 0xf6753
movq %r13, %rdi
callq 0xf6753
cmpq $0x8, %r15
movq 0x30(%rsp), %r13
jl 0x1ec63
cmpq $0x8, %rbp
jl 0x1ec63
addq %rbp, %r12
decq %r13
jne 0x1ea13
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq