// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iff.c
// Function: my_rgfx_chunk_handler
static int my_rgfx_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	struct rgfx_ctx *d = (struct rgfx_ctx*)ictx->userdata;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_FORM:
		ictx->is_std_container = 1;
		goto done;
	}

	if(ictx->level != 1) goto done;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_RBOD:
		do_RGFX_RBOD(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RCOL:
		do_RGFX_RCOL(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RGHD:
		do_RGFX_RGHD(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_RSCM:
		do_RGFX_RSCM(c, d, ictx);
		ictx->handled = 1;
		break;
	}

done:
	if(d->errflag) return 0;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %r13
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x464f524d, %ecx       # imm = 0x464F524D
jne 0x78339
movl $0x1, 0x134(%rbx)
jmp 0x78658
cmpl $0x1, 0x64(%rbx)
jne 0x78658
movq (%rbx), %r14
cmpl $0x52474843, %ecx       # imm = 0x52474843
jg 0x783e0
cmpl $0x52424f44, %ecx       # imm = 0x52424F44
je 0x78428
cmpl $0x52434f4c, %ecx       # imm = 0x52434F4C
jne 0x78658
movq 0x18(%rbx), %rsi
movq 0x40(%rax), %rcx
movq 0x48(%rax), %rax
movb $0x1, 0x3(%r13)
leaq 0x8(%rcx), %r10
cmpq $0x308, %rax            # imm = 0x308
cmovneq %rcx, %r10
movabsq $0x5555555555555556, %rcx # imm = 0x5555555555555556
imulq %rcx
movq %rdx, %rcx
shrq $0x3f, %rcx
addq %rdx, %rcx
movl $0x100, %eax            # imm = 0x100
cmpq %rax, %rcx
cmovgeq %rax, %rcx
leaq 0x48(%r13), %r9
subq $0x8, %rsp
movl $0x1, %r15d
movl $0x3, %r8d
movq %r14, %rdi
movq %r10, %rdx
pushq $0x0
pushq %r15
pushq %rax
callq 0xf2cb1
addq $0x20, %rsp
movl %r15d, 0x130(%rbx)
jmp 0x78658
cmpl $0x52474844, %ecx       # imm = 0x52474844
je 0x7845c
cmpl $0x5253434d, %ecx       # imm = 0x5253434D
jne 0x78658
cmpq $0x4, 0x48(%rax)
jl 0x7864e
movq 0x18(%rbx), %rdi
movq 0x40(%rax), %rsi
callq 0xeed0d
movl %eax, 0x24(%r13)
leaq 0xb05f5(%rip), %rsi     # 0x128a0c
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
jmp 0x7864e
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xe8a1c
cmpb $0x0, 0x4(%r13)
je 0x78544
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf228d
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0xe8a25
jmp 0x7864e
cmpq $0x34, 0x48(%rax)
jl 0x7864e
movq 0x40(%rax), %rax
addq $0x8, %rax
leaq 0x20(%rsp), %r15
movq %rax, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x10(%r13)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x18(%r13)
movq 0x10(%r13), %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0xe8f88
addq $0x8, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x28(%r13)
leaq 0xabcdb(%rip), %rsi     # 0x12419c
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x30(%r13)
leaq 0xb04e3(%rip), %rsi     # 0x1289c7
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movq %rax, 0x38(%r13)
leaq 0xb04ce(%rip), %rsi     # 0x1289d5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed31
movl %eax, 0x8(%r13)
cmpl $0x2, %eax
ja 0x78606
movl %eax, %ecx
andl $0x3, %ecx
leaq 0xb02b8(%rip), %rdx     # 0x1287f0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x7860d
movb $0x1, 0x4(%r13)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %r14, %rdi
callq 0xf1db1
testl %eax, %eax
je 0x78440
cmpl $0x0, 0x8(%r13)
je 0x78673
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x40(%r13)
leaq 0xaa68f(%rip), %rsi     # 0x122c12
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x80(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xfa1dc
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq 0x128(%rbx), %rax
movups 0x40(%rax), %xmm0
movups %xmm0, 0x8(%r15)
movq 0x40(%r13), %rax
movq %rax, (%r12)
cmpl $0x1, 0x8(%r13)
jne 0x78691
leaq 0x80(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0xfbaac
jmp 0x786a9
leaq 0xb3b44(%rip), %rcx     # 0x12c151
leaq 0xb03d0(%rip), %rsi     # 0x1289e4
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x20(%rsp), %rsi
addq $0x8, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xeed31
movl %eax, 0x20(%r13)
leaq 0xb03bc(%rip), %rsi     # 0x1289f9
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movb $0x1, 0x2(%r13)
movl $0x1, 0x130(%rbx)
xorl %eax, %eax
cmpb $0x0, (%r13)
sete %al
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x18(%rbx), %rdi
movq 0x128(%rbx), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
callq 0xf1388
movq %rax, 0x40(%r13)
jmp 0x786d8
leaq 0xa846c(%rip), %rcx     # 0x120b04
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xfa21a
cmpl $0x0, 0x20(%rsp)
je 0x786cb
leaq 0x30(%rsp), %rdx
leaq 0x9bb65(%rip), %rsi     # 0x114221
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9295
movb $0x1, (%r13)
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
cmpb $0x0, (%r13)
jne 0x78440
movl 0x20(%r13), %eax
cmpl $0x2, %eax
je 0x78708
cmpl $0x1, %eax
jne 0x78769
cmpq $0x8, 0x28(%r13)
jne 0x78769
cmpq $0x8, 0x30(%r13)
jne 0x78769
cmpb $0x0, 0x3(%r13)
jne 0x78716
jmp 0x78769
cmpq $0x18, 0x28(%r13)
jne 0x78769
cmpq $0x18, 0x30(%r13)
jne 0x78769
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %r14, %rdi
movl $0x3, %ecx
callq 0xf266a
movq %rax, %r15
movq 0x28(%r13), %rax
cmpq $0x18, %rax
je 0x78782
cmpq $0x8, %rax
jne 0x78443
movq 0x38(%r13), %rcx
movq 0x40(%r13), %rdi
leaq 0x48(%r13), %r8
subq $0x8, %rsp
movl $0x8, %edx
xorl %esi, %esi
movq %r15, %r9
pushq $0x0
callq 0xf2f79
addq $0x10, %rsp
jmp 0x7879c
leaq 0x9efaa(%rip), %rsi     # 0x11771a
xorl %r15d, %r15d
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x78443
movq 0x38(%r13), %rdx
movq 0x40(%r13), %rdi
movl $0x3, %ecx
xorl %esi, %esi
movq %r15, %r8
xorl %r9d, %r9d
callq 0xf3279
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
jmp 0x78443
nopl (%rax)