// File: /workspace/github_c_makefile_star2_O1/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 0x786de
movl $0x1, 0x134(%rbx)
jmp 0x78a09
cmpl $0x1, 0x64(%rbx)
jne 0x78a09
movq (%rbx), %r14
cmpl $0x52474843, %ecx       # imm = 0x52474843
jg 0x78785
cmpl $0x52424f44, %ecx       # imm = 0x52424F44
je 0x787cd
cmpl $0x52434f4c, %ecx       # imm = 0x52434F4C
jne 0x78a09
movb $0x1, 0x3(%r13)
movq 0x40(%rax), %rcx
movq 0x48(%rax), %rax
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
movq 0x18(%rbx), %rsi
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 0xf32f2
addq $0x20, %rsp
movl %r15d, 0x130(%rbx)
jmp 0x78a09
cmpl $0x52474844, %ecx       # imm = 0x52474844
je 0x78801
cmpl $0x5253434d, %ecx       # imm = 0x5253434D
jne 0x78a09
cmpq $0x4, 0x48(%rax)
jl 0x789ff
movq 0x18(%rbx), %rdi
movq 0x40(%rax), %rsi
callq 0xef32a
movl %eax, 0x24(%r13)
leaq 0xb0020(%rip), %rsi     # 0x1287dc
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
jmp 0x789ff
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xe958c
cmpb $0x0, 0x4(%r13)
je 0x788ee
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf28d4
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0xe9595
jmp 0x789ff
movq 0x40(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpq $0x34, 0x48(%rax)
jl 0x789ff
addq $0x8, %rcx
leaq 0x8(%rsp), %r15
movq %rcx, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x10(%r13)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x18(%r13)
movq 0x10(%r13), %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0xe9b05
addq $0x8, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x28(%r13)
leaq 0xab70f(%rip), %rsi     # 0x123f7a
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x30(%r13)
leaq 0xaff09(%rip), %rsi     # 0x128797
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movq %rax, 0x38(%r13)
leaq 0xafef4(%rip), %rsi     # 0x1287a5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef34e
movl %eax, 0x8(%r13)
cmpl $0x2, %eax
ja 0x789b7
movl %eax, %ecx
andl $0x3, %ecx
leaq 0xafcde(%rip), %rdx     # 0x1285c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x789be
movb $0x1, 0x4(%r13)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %r14, %rdi
callq 0xf241d
testl %eax, %eax
je 0x787e5
cmpl $0x0, 0x8(%r13)
je 0x78a24
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf0faf
movq %rax, 0x40(%r13)
leaq 0xaa0dd(%rip), %rsi     # 0x122a0a
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
movl $0x1, %esi
callq 0xe9585
leaq 0x80(%rsp), %r15
leaq 0x68(%rsp), %r12
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xfa6e0
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq 0x128(%rbx), %rax
movq 0x40(%rax), %rcx
movq %rcx, 0x8(%r15)
movq 0x48(%rax), %rax
movq %rax, 0x10(%r15)
movq 0x40(%r13), %rax
movq %rax, (%r12)
cmpl $0x1, 0x8(%r13)
jne 0x78a42
leaq 0x80(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0xfc05f
jmp 0x78a5a
leaq 0xb34ab(%rip), %rcx     # 0x12be69
leaq 0xafdef(%rip), %rsi     # 0x1287b4
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x8(%rsp), %rsi
addq $0x8, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xef34e
movl %eax, 0x20(%r13)
leaq 0xafddb(%rip), %rsi     # 0x1287c9
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
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 0xf1988
movq %rax, 0x40(%r13)
jmp 0x78a89
leaq 0xa7f93(%rip), %rcx     # 0x1209dc
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xfa71e
cmpl $0x0, 0x8(%rsp)
je 0x78a7c
leaq 0x18(%rsp), %rdx
leaq 0x9b704(%rip), %rsi     # 0x114171
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9df7
movb $0x1, (%r13)
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
xorl %r15d, %r15d
cmpb $0x0, (%r13)
jne 0x787e8
movl 0x20(%r13), %ecx
movb $0x1, %al
cmpl $0x2, %ecx
je 0x78acb
cmpl $0x1, %ecx
jne 0x78ae3
cmpq $0x8, 0x28(%r13)
jne 0x78ac6
cmpq $0x8, 0x30(%r13)
jne 0x78ac6
cmpb $0x0, 0x3(%r13)
je 0x78ac6
movl $0x3, %r15d
xorl %eax, %eax
jmp 0x78ae3
cmpl $0x2, %ecx
jne 0x78ae3
cmpq $0x18, 0x28(%r13)
jne 0x78ae3
xorl %ecx, %ecx
cmpq $0x18, 0x30(%r13)
setne %al
sete %cl
leal (%rcx,%rcx,2), %r15d
testb %al, %al
je 0x78b00
leaq 0x9eb8c(%rip), %rsi     # 0x11767a
xorl %r15d, %r15d
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x787e8
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %r14, %rdi
movl %r15d, %ecx
callq 0xf2cab
movq %rax, %r15
movq 0x28(%r13), %rax
cmpq $0x18, %rax
je 0x78b51
cmpq $0x8, %rax
jne 0x787e8
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 0xf35b8
addq $0x10, %rsp
jmp 0x78b6b
movq 0x38(%r13), %rdx
movq 0x40(%r13), %rdi
movl $0x3, %ecx
xorl %esi, %esi
movq %r15, %r8
xorl %r9d, %r9d
callq 0xf38d9
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x787e8