// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/rodraw.c
// Function: do_object_sequence
static int do_object_sequence(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;

	d->nesting_level++;
	if(d->nesting_level>16) goto done;

	while(1) {
		struct objinfo oi;

		de_zeromem(&oi, sizeof(struct objinfo));
		oi.objpos = pos;
		if((oi.objpos+24) > (pos1+len)) break;
		oi.objtype = (u32)de_getu32le_p(&pos);
		oi.objsize = de_getu32le_p(&pos);
		if(oi.objsize<8 || (oi.objpos+oi.objsize)>(pos1+len)) {
			de_err(c, "Bad object size (%u) at %"I64_FMT, (unsigned int)oi.objsize, oi.objpos);
			goto done;
		}

		get_objtype_info(&oi);

		de_dbg(c, "object at %"I64_FMT", type=%u (%s), len=%"I64_FMT, oi.objpos,
			oi.objtype, oi.tyname, oi.objsize);

		if(oi.hasbbox) {
			pos += 16;
		}
		oi.dpos = pos;
		oi.dlen = oi.objpos+oi.objsize - oi.dpos;
		if(oi.dlen<0) goto done_obj;

		de_dbg_indent(c, 1);
		do_object(c, d, &oi);
		de_dbg_indent(c, -1);

done_obj:
		pos = oi.objpos + oi.objsize;
	}

done:
	d->nesting_level--;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movq %rdx, (%rsp)
movl 0x8(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8(%rsi)
cmpl $0xf, %eax
jg 0xe3835
movq %rdx, %rbp
movq %rsi, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
cmpq $0x18, %r15
jl 0xe382b
movq %rdi, %r14
addq %rbp, %r15
movq 0x18(%r14), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0xeed83
movq %rax, %r13
movl %r13d, 0x10(%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0xeed83
movq %rax, 0x18(%rsp)
cmpq $0x8, %rax
jl 0xe3815
movq %rax, %r12
addq %rbp, %r12
cmpq %r15, %r12
jg 0xe3815
cmpl $0xd, %r13d
ja 0xe36c5
movl %r13d, %ecx
leaq 0x62052(%rip), %rdx     # 0x1456f4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
leaq 0x620fc(%rip), %r9      # 0x1457ac
leaq 0x49644(%rip), %r8      # 0x12ccfb
jmpq *%rcx
leaq 0x4fb9f(%rip), %r8      # 0x13325f
jmp 0xe374c
cmpl $0x10065, %r13d         # imm = 0x10065
jne 0xe36d7
leaq 0x6212a(%rip), %r9      # 0x1457ff
jmp 0xe36de
leaq 0x48a73(%rip), %r9      # 0x12c151
movq %r9, 0x38(%rsp)
movq %r14, %rdi
leaq 0x6209a(%rip), %rsi     # 0x145787
movq %rbp, %rdx
movl %r13d, %ecx
movq %r9, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rbp
jmp 0xe377f
leaq 0x620b8(%rip), %r8      # 0x1457c5
jmp 0xe374c
leaq 0x620a1(%rip), %r8      # 0x1457b7
jmp 0xe374c
leaq 0x620d9(%rip), %r8      # 0x1457f8
jmp 0xe374c
leaq 0x620a7(%rip), %r8      # 0x1457cf
jmp 0xe374c
leaq 0x4458a(%rip), %r8      # 0x127cbb
jmp 0xe374c
leaq 0x620b2(%rip), %r8      # 0x1457ec
jmp 0xe374c
leaq 0x62098(%rip), %r8      # 0x1457db
jmp 0xe374c
leaq 0x459e7(%rip), %r8      # 0x129133
movq %r8, 0x38(%rsp)
movl $0x1, 0x14(%rsp)
movq %r14, %rdi
leaq 0x62024(%rip), %rsi     # 0x145787
movq %rbp, %rdx
movl %r13d, %ecx
movq %rax, %r9
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rbp
addq $0x10, %rbp
movq %rbp, (%rsp)
movq %rbp, 0x28(%rsp)
movq %r12, %rbx
subq %rbp, %rbx
movq %rbx, 0x30(%rsp)
js 0xe37e7
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpl $0x5, %r13d
je 0xe37cd
cmpl $0xd, %r13d
je 0xe37cd
cmpl $0x6, %r13d
jne 0xe37da
addq $0xc, %rbp
addq $-0xc, %rbx
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0xe35fb
jmp 0xe37da
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0xe3847
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %r12, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, 0x20(%rsp)
leaq 0x18(%r12), %rax
movq %r12, %rbp
cmpq %r15, %rax
jle 0xe3651
jmp 0xe382b
leaq 0x61f4f(%rip), %rsi     # 0x14576b
movq %r14, %rdi
movl %eax, %edx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xe9295
movq 0x8(%rsp), %rsi
movl 0x8(%rsi), %eax
decl %eax
movl %eax, 0x8(%rsi)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq