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

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_FORM:
		ictx->is_std_container = 1;
		break;
	case CODE_IDAT:
		do_cdi_imag_IDAT(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_IHDR:
		do_cdi_imag_IHDR(c, d, ictx);
		ictx->handled = 1;
		break;
	case CODE_PLTE:
		do_cdi_imag_PLTE(c, d, ictx);
		ictx->handled = 1;
		break;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq (%rdi), %r13
movq 0x10(%rdi), %rbp
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x49484451, %ecx       # imm = 0x49484451
jg 0x5efda
cmpl $0x464f524d, %ecx       # imm = 0x464F524D
je 0x5f087
cmpl $0x49444154, %ecx       # imm = 0x49444154
jne 0x5f23b
cmpb $0x0, 0x28(%rbp)
je 0x5f130
movl 0x20(%rbp), %edx
movl 0x24(%rbp), %ecx
cmpl $0x8, %edx
je 0x5ef4d
cmpl $0x6, %edx
je 0x5f20c
cmpl $0x3, %edx
jne 0x5f215
cmpl $0x8, %ecx
jne 0x5f215
movq (%rbp), %rsi
movq 0x10(%rbp), %rdx
movq %r13, %rdi
callq 0xf1db1
testl %eax, %eax
je 0x5f130
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq %r13, %rdi
movl $0x3, %r8d
callq 0xf26a5
movq %rax, 0x20(%rsp)
movl 0x20(%rbp), %eax
cmpl $0x8, %eax
movq %r14, 0x58(%rsp)
movq %rbp, 0x38(%rsp)
movq %r13, 0x40(%rsp)
je 0x5f285
cmpl $0x6, %eax
je 0x5f24f
cmpl $0x3, %eax
jne 0x5f5ad
cmpb $0x0, 0x29(%rbp)
je 0x5f3d0
leaq 0xb874f(%rip), %rsi     # 0x11771a
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x5f5ad
cmpl $0x49484452, %ecx       # imm = 0x49484452
je 0x5f097
cmpl $0x504c5445, %ecx       # imm = 0x504C5445
jne 0x5f23b
movq 0x18(%r14), %rdi
movq 0x40(%rax), %rsi
callq 0xeeb67
movq %rax, %r15
movq 0x18(%r14), %rdi
movq 0x128(%r14), %rax
movq 0x40(%rax), %rsi
addq $0x2, %rsi
callq 0xeeb67
movq %rax, %r12
leaq 0xec7fc(%rip), %rsi     # 0x14b820
movq %r13, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0xff, %r15
jg 0x5f230
testq %r12, %r12
jle 0x5f230
movq 0x18(%r14), %rdi
movq 0x128(%r14), %rax
movq 0x40(%rax), %rsi
addq $0x4, %rsi
leaq 0x30(,%r15,4), %r8
addq %rbp, %r8
movl $0x100, %r9d            # imm = 0x100
subq %r15, %r9
movl $0x0, (%rsp)
movl $0x3, %ecx
movq %r12, %rdx
callq 0xf2c4e
jmp 0x5f230
movl $0x1, 0x134(%r14)
jmp 0x5f23b
movq 0x40(%rax), %rcx
movq %rcx, 0x18(%rsp)
cmpq $0xa, 0x48(%rax)
jl 0x5f230
movb $0x1, 0x28(%rbp)
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0xeeb91
movq %rax, (%rbp)
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeb91
movq %rax, 0x18(%rbp)
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeb91
movq %rax, 0x10(%rbp)
movq (%rbp), %rsi
movq %r13, %rdi
movq %rax, %rdx
callq 0xe8f88
movl 0x18(%rbp), %edx
leaq 0xc40eb(%rip), %rsi     # 0x1231e8
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeb91
movl %eax, 0x20(%rbp)
leal -0x1(%rax), %ecx
cmpl $0x9, %ecx
ja 0x5f137
movl %ecx, %ecx
leaq 0xc4159(%rip), %rdx     # 0x123280
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x5f13e
xorl %ebx, %ebx
jmp 0x5f228
leaq 0xcd013(%rip), %rcx     # 0x12c151
leaq 0xc40b1(%rip), %rsi     # 0x1231f6
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %rsi
callq 0xeeb91
movl %eax, 0x24(%rbp)
leaq 0xb9fce(%rip), %rsi     # 0x119137
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl $0x3, 0x20(%rbp)
jne 0x5f1eb
movq 0x128(%r14), %rax
cmpq $0xe, 0x48(%rax)
jl 0x5f1eb
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0xeeb4b
movb %al, 0x29(%rbp)
movzbl %al, %edx
leaq 0xc405e(%rip), %rsi     # 0x123205
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8617
movq $-0x3, %rbx
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeb4b
movb %al, 0x2d(%rbp,%rbx)
incq %rbx
jne 0x5f1b8
movzbl 0x2a(%rbp), %edx
movzbl 0x2b(%rbp), %ecx
movzbl 0x2c(%rbp), %r8d
leaq 0xc4032(%rip), %rsi     # 0x123213
movq %r13, %rdi
xorl %eax, %eax
callq 0xe8617
movl 0x24(%rbp), %ecx
cmpq $0x8, %rcx
je 0x5f1f9
cmpl $0x4, %ecx
jne 0x5f230
movq 0x18(%rbp), %rax
shlq $0x3, %rax
cqto
idivq %rcx
movq %rax, 0x8(%rbp)
jmp 0x5f230
cmpl $0x4, %ecx
je 0x5ef56
leaq 0xc3f2b(%rip), %rsi     # 0x123147
xorl %ebx, %ebx
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
callq 0xf228d
movl $0x1, 0x130(%r14)
movl $0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %rdi
movq 0x128(%r14), %rax
movq 0x40(%rax), %rsi
movq %rbp, %r8
movl 0x24(%rbp), %edx
movq 0x18(%rbp), %rcx
addq $0x30, %r8
movl $0x0, (%rsp)
movq 0x20(%rsp), %rbx
movq %rbx, %r9
callq 0xf2f79
jmp 0x5f594
cmpl $0x8, 0x24(%rbp)
jne 0x5f5ad
movq 0x10(%rbp), %rsi
imulq (%rbp), %rsi
movq %r13, %rdi
movl $0x1, %edx
callq 0xf09c5
movq %rax, %r15
movq %rax, %rdi
callq 0xf0855
movq 0x128(%r14), %rax
movq 0x40(%rax), %rcx
movq %rcx, 0x18(%rsp)
cmpq $0x0, 0x10(%rbp)
jle 0x5f534
movq %r15, 0x28(%rsp)
addq 0x48(%rax), %rcx
leaq 0x18(%rsp), %rbx
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rcx, 0x48(%rsp)
cmpq %rcx, 0x18(%rsp)
jge 0x5f53e
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0xeeb4b
movl %eax, %ebp
movl $0x1, %eax
movb $0x1, %cl
movl %ecx, 0x14(%rsp)
testb %bpl, %bpl
jns 0x5f340
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0xeeb4b
cmpb $0x2, %al
jb 0x5f325
movzbl %al, %eax
jmp 0x5f340
testb %al, %al
jne 0x5f5b7
movq 0x38(%rsp), %rax
movq (%rax), %rax
subq %r13, %rax
movl $0x0, 0x14(%rsp)
andb $0x7f, %bpl
leaq (%rax,%r13), %rcx
movq 0x38(%rsp), %rdi
movq (%rdi), %rdx
movq %rdx, %r14
subq %r13, %r14
cmpq %rdx, %rcx
movl $0x1, %ecx
cmovgl %ecx, %r12d
cmovleq %rax, %r14
movzbl %bpl, %esi
movq %rdi, %rbx
movq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0xf0eba
addq %r13, %r14
movl 0x14(%rsp), %ecx
movl %ecx, %eax
xorb $0x1, %al
movzbl %al, %eax
addq %rax, %r15
testb %cl, %cl
movl $0x0, %eax
cmoveq %rax, %r14
movq %r14, %r13
movq %rbx, %rbp
cmpq 0x10(%rbx), %r15
movq 0x58(%rsp), %r14
movq 0x48(%rsp), %rcx
leaq 0x18(%rsp), %rbx
jl 0x5f2e7
movq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xf08ba
testl %r12d, %r12d
jne 0x5f54b
jmp 0x5f55e
movq 0x10(%rbp), %rcx
testq %rcx, %rcx
jle 0x5f51c
movq 0x8(%rbp), %rax
xorl %edi, %edi
movq 0x128(%r14), %rdx
movq 0x18(%rbp), %rsi
imulq %rdi, %rsi
addq 0x40(%rdx), %rsi
movq %rsi, 0x18(%rsp)
testq %rax, %rax
jle 0x5f510
movb 0x2c(%rbp), %al
movb %al, 0x14(%rsp)
movb 0x2a(%rbp), %bl
movb 0x2b(%rbp), %r13b
xorl %r12d, %r12d
movq %rdi, 0x60(%rsp)
movq 0x18(%r14), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
callq 0xeeb4b
movl %eax, %ebp
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0xeeb4b
movzbl %bpl, %ecx
movl %ecx, %edx
andl $0xf, %edx
leaq 0xc3e27(%rip), %rsi     # 0x123270
addb (%rdx,%rsi), %bl
movzbl %bl, %edi
movzbl %al, %eax
movl %eax, %edx
andl $0xf, %edx
movb (%rdx,%rsi), %bl
addb %dil, %bl
movzbl %bl, %edx
movl %edx, 0x48(%rsp)
shrl $0x4, %ecx
addb (%rcx,%rsi), %r13b
movb %r13b, 0x28(%rsp)
movzbl %r13b, %r15d
shrl $0x4, %eax
movb 0x14(%rsp), %cl
addb (%rax,%rsi), %cl
movb %cl, 0x14(%rsp)
movzbl %cl, %edx
movl %edx, 0x54(%rsp)
movl %r15d, %esi
leaq 0x34(%rsp), %r13
movq %r13, %rcx
callq 0x5f5d4
movl 0x34(%rsp), %ecx
movq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq 0x60(%rsp), %rbp
movq %rbp, %rdx
callq 0xf24ba
movl 0x48(%rsp), %edi
movq 0x38(%rsp), %rax
movl %r15d, %esi
movq %rax, %r15
movl 0x54(%rsp), %edx
movq %r13, %rcx
movb 0x28(%rsp), %r13b
callq 0x5f5d4
movl 0x34(%rsp), %ecx
leaq 0x1(%r12), %rsi
movq %r14, %rdi
movq 0x58(%rsp), %r14
movq %rbp, %rdx
callq 0xf24ba
movq 0x8(%r15), %rax
addq $0x2, %r12
cmpq %rax, %r12
jl 0x5f41a
movq %r15, %rbp
movq 0x10(%r15), %rcx
movq 0x40(%rsp), %r13
movq 0x60(%rsp), %rdi
incq %rdi
cmpq %rcx, %rdi
jl 0x5f3e3
leaq 0xc3c4f(%rip), %rsi     # 0x123172
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9393
movq 0x20(%rsp), %rbx
jmp 0x5f594
movq %r15, %rdi
callq 0xf08ba
jmp 0x5f55e
movq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xf08ba
leaq 0xc3c7b(%rip), %rsi     # 0x1231cd
movq 0x40(%rsp), %rdi
xorl %eax, %eax
callq 0xe9295
cmpq $0x0, 0x18(%r15)
jle 0x5f5a5
movq %rbp, %r8
movl 0x24(%rbp), %edx
movq (%rbp), %rcx
addq $0x30, %r8
movl $0x0, (%rsp)
movq %r15, %rdi
xorl %esi, %esi
movq 0x20(%rsp), %rbx
movq %rbx, %r9
callq 0xf2f79
movq %r15, %rdi
callq 0xf052b
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf22dc
jmp 0x5f228
movq %r15, %rdi
callq 0xf052b
movq 0x20(%rsp), %rbx
jmp 0x5f228
leaq 0xc3bef(%rip), %rsi     # 0x1231ad
movq 0x40(%rsp), %rdi
xorl %eax, %eax
callq 0xe9295
movq 0x38(%rsp), %rbp
jmp 0x5f3b5