// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %rdi, %r12
movq (%rdi), %r13
movq 0x10(%rdi), %rbp
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x49484451, %ecx       # imm = 0x49484451
jg 0x5f0db
cmpl $0x464f524d, %ecx       # imm = 0x464F524D
je 0x5f190
cmpl $0x49444154, %ecx       # imm = 0x49444154
jne 0x5f34a
cmpb $0x0, 0x28(%rbp)
je 0x5f23e
movl 0x20(%rbp), %edx
cmpl $0x8, %edx
je 0x5f059
cmpl $0x6, %edx
je 0x5f04a
cmpl $0x3, %edx
jne 0x5f243
cmpl $0x8, 0x24(%rbp)
je 0x5f063
cmpl $0x8, %edx
je 0x5f059
cmpl $0x6, %edx
jne 0x5f243
cmpl $0x4, 0x24(%rbp)
je 0x5f063
cmpl $0x8, %edx
jne 0x5f243
cmpl $0x8, 0x24(%rbp)
jne 0x5f243
movq (%rbp), %rsi
movq 0x10(%rbp), %rdx
movq %r13, %rdi
callq 0xf241d
testl %eax, %eax
je 0x5f23e
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rcx
movq %r13, %rdi
movl $0x3, %r8d
callq 0xf2ce6
movq %rax, %r15
movl 0x20(%rbp), %eax
cmpl $0x8, %eax
movq %r15, 0x48(%rsp)
je 0x5f391
cmpl $0x6, %eax
je 0x5f35e
cmpl $0x3, %eax
jne 0x5f25a
cmpb $0x0, 0x29(%rbp)
je 0x5f571
leaq 0xb85ae(%rip), %rsi     # 0x11767a
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x5f25a
cmpl $0x49484452, %ecx       # imm = 0x49484452
je 0x5f1a1
cmpl $0x504c5445, %ecx       # imm = 0x504C5445
jne 0x5f34a
movq 0x18(%r12), %rdi
movq 0x40(%rax), %rsi
callq 0xef169
movq %rax, %r15
movq 0x18(%r12), %rdi
movq %r12, %rbx
movq 0x128(%r12), %rax
movq 0x40(%rax), %rsi
addq $0x2, %rsi
callq 0xef169
movq %rax, %r12
leaq 0xec0fe(%rip), %rsi     # 0x14b229
movq %r13, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0xff, %r15
jg 0x5f181
testq %r12, %r12
jle 0x5f181
movq 0x18(%rbx), %rdi
movq 0x128(%rbx), %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 0xf328f
movl $0x1, 0x130(%rbx)
jmp 0x5f34a
movl $0x1, 0x134(%r12)
jmp 0x5f34a
movq 0x40(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpq $0xa, 0x48(%rax)
jl 0x5f33e
movb $0x1, 0x28(%rbp)
movq 0x18(%r12), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef193
movq %rax, (%rbp)
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef193
movq %rax, 0x18(%rbp)
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef193
movq %rax, 0x10(%rbp)
movq (%rbp), %rsi
movq %r13, %rdi
movq %rax, %rdx
callq 0xe9b05
movl 0x18(%rbp), %edx
leaq 0xc3df6(%rip), %rsi     # 0x123000
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef193
movl %eax, 0x20(%rbp)
leal -0x1(%rax), %ecx
cmpl $0x9, %ecx
ja 0x5f267
movl %ecx, %ecx
leaq 0xc3e6b(%rip), %rdx     # 0x1230a0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x5f26e
xorl %r15d, %r15d
jmp 0x5f25a
movl 0x24(%rbp), %ecx
leaq 0xc3d12(%rip), %rsi     # 0x122f5f
xorl %r15d, %r15d
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %r15, %rdi
callq 0xf28d4
jmp 0x5f33e
leaq 0xccbfb(%rip), %rcx     # 0x12be69
leaq 0xc3d99(%rip), %rsi     # 0x12300e
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r12), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef193
movl %eax, 0x24(%rbp)
leaq 0xb9d7d(%rip), %rsi     # 0x119017
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpl $0x3, 0x20(%rbp)
jne 0x5f31f
movq 0x128(%r12), %rax
cmpq $0xe, 0x48(%rax)
jl 0x5f31f
movq 0x18(%r12), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef14d
movb %al, 0x29(%rbp)
movzbl %al, %edx
leaq 0xc3d43(%rip), %rsi     # 0x12301d
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
movq $-0x3, %rbx
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef14d
movb %al, 0x2d(%rbp,%rbx)
incq %rbx
jne 0x5f2eb
movzbl 0x2a(%rbp), %edx
movzbl 0x2b(%rbp), %ecx
movzbl 0x2c(%rbp), %r8d
leaq 0xc3d16(%rip), %rsi     # 0x12302b
movq %r13, %rdi
xorl %eax, %eax
callq 0xe9226
movl 0x24(%rbp), %ecx
cmpq $0x8, %rcx
je 0x5f32d
cmpl $0x4, %ecx
jne 0x5f33e
movq 0x18(%rbp), %rax
shlq $0x3, %rax
cqto
idivq %rcx
movq %rax, 0x8(%rbp)
movl $0x1, 0x130(%r12)
movl $0x1, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r12), %rdi
movq 0x128(%r12), %rax
movq 0x40(%rax), %rsi
movl 0x24(%rbp), %edx
movq 0x18(%rbp), %rcx
addq $0x30, %rbp
movl $0x0, (%rsp)
movq %rbp, %r8
movq %r15, %r9
callq 0xf35b8
jmp 0x5f726
cmpl $0x8, 0x24(%rbp)
jne 0x5f25a
movq 0x10(%rbp), %rsi
movq %rbp, 0x18(%rsp)
imulq (%rbp), %rsi
movq %r13, 0x40(%rsp)
movq %r13, %rdi
movl $0x1, %edx
callq 0xf0faf
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0xf0e3f
movq %r12, 0x30(%rsp)
movq 0x128(%r12), %rax
movq 0x40(%rax), %rcx
leaq 0x8(%rsp), %rbp
movq %rcx, (%rbp)
addq 0x48(%rax), %rcx
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %rcx, 0x38(%rsp)
movl $0x3, %r14d
movq 0x18(%rsp), %rax
cmpq 0x10(%rax), %r13
jge 0x5f509
cmpq %rcx, 0x8(%rsp)
jge 0x5f43a
movq 0x30(%rsp), %rbx
movq 0x18(%rbx), %rdi
movq %rbp, %rsi
callq 0xef14d
movl %eax, %r15d
xorl %r14d, %r14d
testb %al, %al
js 0x5f44f
movl $0x1, %ebp
xorl %ebx, %ebx
jmp 0x5f4a6
movl $0x4, %r14d
movl $0x1, %eax
movq %rax, 0x20(%rsp)
jmp 0x5f509
movq 0x18(%rbx), %rdi
movq %rbp, %rsi
callq 0xef14d
cmpb $0x2, %al
jb 0x5f46a
movzbl %al, %ebp
xorl %ebx, %ebx
movb $0x1, %cl
xorl %eax, %eax
jmp 0x5f4a2
testb %al, %al
je 0x5f491
xorl %ebx, %ebx
movq 0x40(%rsp), %rdi
leaq 0xc3b49(%rip), %rsi     # 0x122fc5
xorl %eax, %eax
callq 0xe9df7
movl $0x4, %eax
xorl %ecx, %ecx
movq 0x50(%rsp), %rbp
jmp 0x5f4a2
movq 0x18(%rsp), %rax
movq (%rax), %rbp
subq %r12, %rbp
xorl %eax, %eax
movb $0x1, %bl
movb $0x1, %cl
testb %cl, %cl
je 0x5f514
andb $0x7f, %r15b
leaq (%r12,%rbp), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, %rdx
subq %r12, %rdx
cmpq %rcx, %rax
movl $0x1, %eax
movq 0x20(%rsp), %rcx
cmovgl %eax, %ecx
movq %rcx, 0x20(%rsp)
cmovgq %rdx, %rbp
movzbl %r15b, %esi
movq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0xf14bd
movq %rbp, 0x50(%rsp)
addq %rbp, %r12
movzbl %bl, %eax
addq %rax, %r13
testb %al, %al
movl $0x0, %eax
cmovneq %rax, %r12
movq 0x38(%rsp), %rcx
leaq 0x8(%rsp), %rbp
testl %r14d, %r14d
je 0x5f3fa
jmp 0x5f51e
movq %rbp, 0x50(%rsp)
movl %eax, %r14d
jmp 0x5f4ff
addl $-0x3, %r14d
cmpl $0x1, %r14d
ja 0x5f6d6
movq 0x10(%rsp), %rdi
callq 0xf0ea4
cmpl $0x0, 0x20(%rsp)
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %rbx
movq 0x48(%rsp), %r15
je 0x5f55f
leaq 0xc3a92(%rip), %rsi     # 0x122fe5
movq 0x40(%rsp), %rdi
xorl %eax, %eax
callq 0xe9df7
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
setle %al
jmp 0x5f6e5
movq %r13, 0x40(%rsp)
cmpq $0x0, 0x10(%rbp)
jle 0x5f6bc
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
movq %r12, 0x30(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x128(%r12), %rax
movq 0x18(%rbp), %rcx
imulq %r14, %rcx
addq 0x40(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpq $0x0, 0x8(%rbp)
jle 0x5f6af
movb 0x2c(%rbp), %al
movb %al, 0x10(%rsp)
movb 0x2a(%rbp), %bl
movb 0x2b(%rbp), %al
movb %al, 0x38(%rsp)
xorl %r13d, %r13d
movq %r14, 0x20(%rsp)
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef14d
movl %eax, %r14d
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0xef14d
movzbl %r14b, %ecx
movl %ecx, %edx
andl $0xf, %edx
leaq 0xc3a93(%rip), %rsi     # 0x123090
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, 0x50(%rsp)
shrl $0x4, %ecx
movb 0x38(%rsp), %dl
addb (%rcx,%rsi), %dl
movb %dl, 0x38(%rsp)
movzbl %dl, %r12d
shrl $0x4, %eax
movb 0x10(%rsp), %cl
addb (%rax,%rsi), %cl
movq %r15, %r14
movb %cl, 0x10(%rsp)
movzbl %cl, %r15d
movl %r12d, %esi
movl %r15d, %edx
leaq 0x2c(%rsp), %rcx
callq 0x5f737
movl 0x2c(%rsp), %ecx
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq 0x20(%rsp), %rdx
callq 0xf2afd
movl 0x50(%rsp), %edi
movl %r12d, %esi
movq 0x30(%rsp), %r12
movl %r15d, %edx
movq %r14, %r15
movq 0x20(%rsp), %r14
leaq 0x2c(%rsp), %rcx
callq 0x5f737
movl 0x2c(%rsp), %ecx
leaq 0x1(%r13), %rsi
movq %rbp, %rdi
movq 0x18(%rsp), %rbp
movq %r14, %rdx
callq 0xf2afd
addq $0x2, %r13
cmpq 0x8(%rbp), %r13
jl 0x5f5d0
incq %r14
cmpq 0x10(%rbp), %r14
jl 0x5f593
leaq 0xc38c7(%rip), %rsi     # 0x122f8a
movq 0x40(%rsp), %rdi
xorl %eax, %eax
callq 0xe9ef5
movq 0x48(%rsp), %r15
jmp 0x5f726
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %rbx
movq 0x48(%rsp), %r15
testb $0x1, %al
je 0x5f6f8
movq 0x10(%rsp), %rdi
callq 0xf0b13
jmp 0x5f25a
movl 0x24(%rbx), %edx
movq (%rbx), %rcx
addq $0x30, %rbx
movl $0x0, (%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %r8
movq %r15, %r9
callq 0xf35b8
movq %r14, %rdi
callq 0xf0b13
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xf2923
jmp 0x5f25a