// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/ebml.c
// Function: do_element_sequence
static int do_element_sequence(deark *c, lctx *d, i64 pos1, i64 len)
{
	int ret;
	int retval = 0;
	i64 pos = pos1;
	int saved_indent_level;

	// TODO:
	// From the EBML spec:
	// "data that is not part of an EBML Element is permitted to be present
	// within a Master Element if unknownsizeallowed is enabled within the
	// definition for that Master Element. In this case, the EBML Reader
	// should skip data until a valid Element ID of the same EBMLParentPath or
	// the next upper level Element Path of the Master Element is found."
	//
	// We do not support this. We can't even detect it, so our parser will go
	// off the rails. How do you even support it efficiently? What kind of
	// psychopath designs a format like this? It's incredibly fragile (a new
	// format version that defines a new optional element will completely
	// break backward compatibility), and its abstractions are leaking all
	// over the place.

	d->level++;
	de_dbg_indent_save(c, &saved_indent_level);
	if(d->level > 16) goto done;
	if(len==0) { retval = 1; goto done; }

	de_dbg(c, "element sequence at %"I64_FMT", max_len=%"I64_FMT, pos1, len);
	de_dbg_indent(c, 1);

	while(1) {
		i64 ele_len = 0;
		if(pos >= pos1+len) {
			break;
		}
		ret = do_element(c, d, pos, pos1+len-pos, &ele_len);
		if(!ret) goto done;
		if(ele_len<1) goto done;

		pos += ele_len;
	}
	retval = 1;

done:
	de_dbg_indent_restore(c, saved_indent_level);
	d->level--;
	return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
incl (%rsi)
leaq 0x3c(%rsp), %rsi
callq 0xe958c
movq %rbx, 0x20(%rsp)
cmpl $0x11, (%rbx)
setge %al
testq %r13, %r13
sete %cl
orb %al, %cl
je 0x413b1
movl 0x3c(%rsp), %esi
movq %r14, %rdi
callq 0xe9595
movq 0x20(%rsp), %rax
decl (%rax)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd9671(%rip), %rsi     # 0x11aa29
movq %r14, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
addq %r12, %r13
leaq 0x4(%rsp), %r15
movq %r13, 0x60(%rsp)
movq %r13, %rbx
subq %r12, %rbx
jle 0x41675
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xe958c
movq %r14, %rdi
leaq 0xd9646(%rip), %rsi     # 0x11aa4e
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r14), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq 0x41865
cmpl $0x1, %eax
jne 0x41465
movq 0x68(%rsp), %rdx
xorl %r15d, %r15d
leaq 0x13e3c4(%rip), %rax    # 0x17f810
cmpq %rdx, 0x8(%r15,%rax)
je 0x41483
addq $0x20, %r15
cmpq $0xd80, %r15            # imm = 0xD80
jne 0x4144c
xorl %r15d, %r15d
jmp 0x41486
movq %r14, %rdi
leaq 0xd95fb(%rip), %rsi     # 0x11aa6a
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9df7
movb $0x1, %bpl
xorl %ebx, %ebx
jmp 0x41664
addq %rax, %r15
testq %r15, %r15
je 0x41494
movq 0x10(%r15), %rcx
testq %rcx, %rcx
jne 0x4149b
leaq 0xea9ce(%rip), %rcx     # 0x12be69
testq %r15, %r15
je 0x414aa
movb (%r15), %al
movq %rax, 0x28(%rsp)
jmp 0x414b3
movq $0x0, 0x28(%rsp)
movq %r14, %rdi
leaq 0xd95d1(%rip), %rsi     # 0x11aa8e
xorl %eax, %eax
callq 0xe9226
movq 0x20(%rsp), %rax
cmpl $0x0, 0x4(%rax)
je 0x41557
movq 0x10(%rsp), %r13
movq %r13, %rbp
subq %r12, %rbp
cmpq $0x8, %rbp
jg 0x41557
movq %r12, 0x18(%rsp)
movq %r14, %rdi
callq 0xf6870
movq %rax, %rbx
testq %rbp, %rbp
leaq 0xd9acc(%rip), %r12     # 0x11afca
jle 0x4152e
movq 0x18(%rsp), %rbp
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0xef0d5
movzbl %al, %ecx
movq %rbx, %rdi
movl $0x5, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0xf6ab0
incq %rbp
cmpq %rbp, %r13
jne 0x41505
movq %rbx, %rdi
callq 0xf7557
movq %r14, %rdi
leaq 0xd9a91(%rip), %rsi     # 0x11afd1
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xf6bb0
movq 0x18(%rsp), %r12
movq 0x18(%r14), %rdi
movq 0x60(%rsp), %r13
movq %r13, %rcx
subq 0x10(%rsp), %rcx
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x41865
movl %eax, %ebx
cmpl $0x2, %eax
je 0x415a6
cmpl $0x1, %ebx
jne 0x41646
movq 0x30(%rsp), %rcx
movl $0x50, %esi
leaq 0x70(%rsp), %rdi
leaq 0xe8014(%rip), %rdx     # 0x1295b1
xorl %eax, %eax
callq 0xe8d67
jmp 0x415ce
movq 0x18(%r14), %rax
movq 0x18(%rax), %rax
subq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x50, %edx
leaq 0x70(%rsp), %rdi
leaq 0xd0ec3(%rip), %rsi     # 0x11248c
callq 0xe8ded
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %rax
decl %eax
leaq 0xea888(%rip), %r8      # 0x12be69
cmpb $0x7, %al
ja 0x415f6
movzbl %al, %eax
leaq 0xd93f5(%rip), %rcx     # 0x11a9e4
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
movq %r14, %rdi
leaq 0xd94c5(%rip), %rsi     # 0x11aac5
movq %rbp, %rdx
leaq 0x70(%rsp), %rcx
xorl %eax, %eax
callq 0xe9226
cmpl $0x2, %ebx
jne 0x41627
movq %r14, %rdi
leaq 0xd94c5(%rip), %rsi     # 0x11aae3
xorl %eax, %eax
callq 0xe9df7
jmp 0x4165a
movq 0x30(%rsp), %r8
leaq (%r8,%rbp), %rbx
movq 0x18(%r14), %rax
cmpq 0x18(%rax), %rbx
jle 0x41698
movq %r14, %rdi
leaq 0xd94d9(%rip), %rsi     # 0x11ab1d
jmp 0x41650
movq %r14, %rdi
leaq 0xd944d(%rip), %rsi     # 0x11aa9d
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9df7
movb $0x1, %bpl
xorl %ebx, %ebx
leaq 0x4(%rsp), %r15
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0xe9595
testb %bpl, %bpl
je 0x41679
xorl %eax, %eax
jmp 0x4168b
testq %rbx, %rbx
setg %al
movl $0x0, %ecx
cmovleq %rcx, %rbx
addq %rbx, %r12
testb %al, %al
jne 0x413e2
jmp 0x4138c
movb $0x1, %al
testq %r15, %r15
je 0x416be
movl (%r15), %ecx
btl $0x9, %ecx
jb 0x416be
movb $0x1, %dl
btl $0x8, %ecx
movb $0x1, %sil
jae 0x416c3
cmpl $0x2, (%r14)
setge %dl
movl %edx, %esi
jmp 0x416c3
xorl %edx, %edx
movb $0x1, %sil
testq %r15, %r15
setne %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x416d8
cmpq $0x0, 0x18(%r15)
sete %al
movb $0x1, 0x18(%rsp)
testb %cl, %cl
je 0x416f2
cmpq $0x0, 0x18(%r15)
je 0x416f2
testb $0x8, 0x1(%r15)
sete 0x18(%rsp)
testb %al, %al
movq %r8, 0x8(%rsp)
jne 0x4173e
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %rbp, 0x40(%rsp)
movq %r8, 0x48(%rsp)
movq %r14, %rdi
movb %sil, 0x3(%rsp)
movq 0x20(%rsp), %rsi
movl %edx, 0x38(%rsp)
leaq 0x40(%rsp), %rdx
callq *0x18(%r15)
movb 0x3(%rsp), %sil
movl 0x38(%rsp), %edx
movq 0x8(%rsp), %r8
testb %dl, %dl
je 0x41777
movzbl 0x28(%rsp), %eax
decl %eax
cmpl $0x7, %eax
ja 0x417e7
leaq 0xd926b(%rip), %rcx     # 0x11a9c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq %r8, %rcx
callq 0x4134e
jmp 0x417e2
testb %sil, %sil
jne 0x417e7
movq %r14, %rdi
leaq 0xd93be(%rip), %rsi     # 0x11ab44
xorl %eax, %eax
callq 0xe9226
jmp 0x417e2
movq %r14, %rdi
movq %rbp, %rsi
movq %r8, %rdx
movl $0x401, %ecx            # imm = 0x401
jmp 0x417cd
movq %r14, %rdi
movq %rbp, %rsi
movq %r8, %rdx
callq 0x41a54
jmp 0x417e2
movq %r14, %rdi
movq %rbp, %rsi
movq %r8, %rdx
callq 0x41929
jmp 0x417e2
movq %r14, %rdi
movq %rbp, %rsi
movq %r8, %rdx
movl $0x2, %ecx
callq 0x419e4
jmp 0x417e2
movq %r14, %rdi
movq %rbp, %rsi
movq %r8, %rdx
callq 0x419a8
movq 0x8(%rsp), %r8
cmpb $0x0, 0x18(%rsp)
jne 0x4181f
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %rbp, 0x40(%rsp)
movq %r8, 0x48(%rsp)
movb $0x1, 0x50(%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq *0x18(%r15)
movq %rbx, 0x10(%rsp)
subq %r12, %rbx
xorl %ebp, %ebp
jmp 0x4165f