// File: /workspace/github_c_makefile_star2_O2/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, %rbp
movq (%rdi), %r13
movq 0x10(%rdi), %r12
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x504c5445, %ecx       # imm = 0x504C5445
je 0x5bd56
cmpl $0x49444154, %ecx       # imm = 0x49444154
je 0x5bbef
cmpl $0x49484452, %ecx       # imm = 0x49484452
je 0x5bcae
cmpl $0x464f524d, %ecx       # imm = 0x464F524D
jne 0x5bf08
movl $0x1, 0x134(%rbp)
jmp 0x5bf08
cmpb $0x0, 0x28(%r12)
je 0x5bde3
movl 0x20(%r12), %edx
movl 0x24(%r12), %ecx
cmpl $0x8, %edx
je 0x5bc1c
cmpl $0x6, %edx
je 0x5be91
cmpl $0x3, %edx
jne 0x5be9a
cmpl $0x8, %ecx
jne 0x5be9a
movq (%r12), %rsi
movq 0x10(%r12), %rdx
movq %r13, %rdi
callq 0xe6be1
testl %eax, %eax
je 0x5bde3
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
pushq $0x3
popq %r8
movq %r13, %rdi
callq 0xe746f
movq %rax, 0x8(%rsp)
movl 0x20(%r12), %eax
cmpl $0x8, %eax
movq %rbp, 0x40(%rsp)
movq %r12, 0x38(%rsp)
movq %r13, 0x30(%rsp)
je 0x5bf50
cmpl $0x6, %eax
je 0x5bf1a
cmpl $0x3, %eax
jne 0x5c07f
cmpb $0x0, 0x29(%r12)
je 0x5c089
leaq 0xae9eb(%rip), %rsi     # 0x10a68a
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x5c07f
movq 0x40(%rax), %rcx
movq %rcx, 0x18(%rsp)
cmpq $0xa, 0x48(%rax)
jl 0x5befe
movb $0x1, 0x28(%r12)
movq 0x18(%rbp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0xe3f6e
movq %rax, (%r12)
movq 0x18(%rbp), %rdi
movq %r14, %rsi
callq 0xe3f6e
movq %rax, 0x18(%r12)
movq 0x18(%rbp), %rdi
movq %r14, %rsi
callq 0xe3f6e
movq %rax, 0x10(%r12)
movq (%r12), %rsi
movq %r13, %rdi
movq %rax, %rdx
callq 0xdf038
movl 0x18(%r12), %edx
leaq 0xba30e(%rip), %rsi     # 0x116028
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbp), %rdi
movq %r14, %rsi
callq 0xe3f6e
movl %eax, 0x20(%r12)
leal -0x1(%rax), %ecx
cmpl $0x9, %ecx
ja 0x5bdeb
movl %ecx, %ecx
leaq 0xba376(%rip), %rdx     # 0x1160c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmp 0x5bdf2
movq 0x18(%rbp), %rdi
movq 0x40(%rax), %rsi
callq 0xe3f46
movq %rax, %r14
movq 0x18(%rbp), %rdi
movq 0x128(%rbp), %rax
movq 0x40(%rax), %rsi
addq $0x2, %rsi
callq 0xe3f46
movq %rax, %r15
leaq 0xe25c8(%rip), %rsi     # 0x13e350
movq %r13, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0xff, %r14
jg 0x5befe
testq %r15, %r15
jle 0x5befe
movq 0x18(%rbp), %rdi
movq 0x128(%rbp), %rax
movq 0x40(%rax), %rsi
addq $0x4, %rsi
leaq (%r12,%r14,4), %r8
addq $0x30, %r8
movl $0x100, %r9d            # imm = 0x100
subq %r14, %r9
andl $0x0, (%rsp)
pushq $0x3
popq %rcx
movq %r15, %rdx
callq 0xe7963
jmp 0x5befe
xorl %r12d, %r12d
jmp 0x5beae
leaq 0xc30ef(%rip), %rcx     # 0x11eee1
leaq 0xba23d(%rip), %rsi     # 0x116036
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe3f6e
movl %eax, 0x24(%r12)
leaq 0xb0228(%rip), %rsi     # 0x10c047
movq %r13, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl $0x3, 0x20(%r12)
jne 0x5bedb
movq 0x128(%rbp), %rax
cmpq $0xe, 0x48(%rax)
jl 0x5bedb
movq 0x18(%rbp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0xe3f2a
movb %al, 0x29(%r12)
movzbl %al, %edx
leaq 0xba1dc(%rip), %rsi     # 0x116045
xorl %ebx, %ebx
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
cmpq $0x3, %rbx
je 0x5beb8
movq 0x18(%rbp), %rdi
movq %r14, %rsi
callq 0xe3f2a
movb %al, 0x2a(%r12,%rbx)
incq %rbx
jmp 0x5be75
cmpl $0x4, %ecx
je 0x5bc25
leaq 0xba0e6(%rip), %rsi     # 0x115f87
xorl %r12d, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %r12, %rdi
callq 0xe7084
jmp 0x5befe
movzbl 0x2a(%r12), %edx
movzbl 0x2b(%r12), %ecx
movzbl 0x2c(%r12), %r8d
leaq 0xba182(%rip), %rsi     # 0x116053
movq %r13, %rdi
xorl %eax, %eax
callq 0xde896
movl 0x24(%r12), %ecx
cmpq $0x8, %rcx
je 0x5beeb
cmpl $0x4, %ecx
jne 0x5befe
movq 0x18(%r12), %rax
shlq $0x3, %rax
cqto
idivq %rcx
movq %rax, 0x8(%r12)
movl $0x1, 0x130(%rbp)
pushq $0x1
popq %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbp), %rdi
movq 0x128(%rbp), %rax
movq 0x40(%rax), %rsi
movl 0x24(%r12), %edx
movq 0x18(%r12), %rcx
addq $0x30, %r12
andl $0x0, (%rsp)
movq %r12, %r8
movq 0x8(%rsp), %r12
movq %r12, %r9
callq 0xe7cbc
jmp 0x5c251
cmpl $0x8, 0x24(%r12)
jne 0x5c07f
movq 0x10(%r12), %rsi
imulq (%r12), %rsi
pushq $0x1
popq %rdx
movq %r13, %rdi
callq 0xe59cd
movq %rax, %r14
movq %rax, %rdi
callq 0xe589c
movq 0x128(%rbp), %rax
movq 0x40(%rax), %rcx
leaq 0x18(%rsp), %rbx
movq %rcx, (%rbx)
addq 0x48(%rax), %rcx
movq %rcx, 0x48(%rsp)
movl $0x0, 0x10(%rsp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r14, 0x28(%rsp)
cmpq 0x10(%r12), %r15
jge 0x5c1e9
movq 0x48(%rsp), %rax
cmpq %rax, 0x18(%rsp)
movq 0x8(%rsp), %r12
jge 0x5c1fa
movq 0x18(%rbp), %rdi
movq %rbx, %rsi
callq 0xe3f2a
movl %eax, %r14d
movq %rbp, %rax
movb $0x1, %bpl
testb %r14b, %r14b
js 0x5bfea
pushq $0x1
popq %rax
jmp 0x5c014
movq 0x18(%rax), %rdi
movq %rbx, %rsi
callq 0xe3f2a
cmpb $0x2, %al
jb 0x5bfff
movzbl %al, %eax
jmp 0x5c014
testb %al, %al
jne 0x5c26f
movq 0x38(%rsp), %rax
movq (%rax), %rax
subq %r13, %rax
xorl %ebp, %ebp
andb $0x7f, %r14b
leaq (%rax,%r13), %rcx
movq 0x38(%rsp), %r12
movq (%r12), %rdx
movq %rdx, %rbx
subq %r13, %rbx
cmpq %rdx, %rcx
movl 0x10(%rsp), %ecx
pushq $0x1
popq %rdx
cmovgl %edx, %ecx
movl %ecx, 0x10(%rsp)
cmovleq %rax, %rbx
movzbl %r14b, %esi
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe5e40
addq %r13, %rbx
movl %ebp, %eax
xorb $0x1, %al
movzbl %al, %eax
addq %rax, %r15
testb %bpl, %bpl
movl $0x0, %eax
cmoveq %rax, %rbx
movq %rbx, %r13
movq 0x40(%rsp), %rbp
leaq 0x18(%rsp), %rbx
jmp 0x5bfab
movq 0x8(%rsp), %r12
jmp 0x5beae
xorl %edx, %edx
cmpq 0x10(%r12), %rdx
jge 0x5c1d1
movq 0x128(%rbp), %rax
movq 0x18(%r12), %rcx
movq %rdx, 0x50(%rsp)
imulq %rdx, %rcx
addq 0x40(%rax), %rcx
movq %rcx, 0x18(%rsp)
movb 0x2a(%r12), %r15b
movb 0x2b(%r12), %al
movb %al, 0x48(%rsp)
movb 0x2c(%r12), %al
movb %al, 0x28(%rsp)
xorl %eax, %eax
cmpq 0x8(%r12), %rax
jge 0x5c1ba
movq 0x40(%rsp), %rbx
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %r14
movq %rax, 0x10(%rsp)
movq %r14, %rsi
callq 0xe3f2a
movl %eax, %r12d
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3f2a
movzbl %r12b, %ecx
movl %ecx, %edx
andl $0xf, %edx
leaq 0xb9f9e(%rip), %rsi     # 0x1160b0
addb (%rdx,%rsi), %r15b
movzbl %r15b, %edi
movzbl %al, %eax
movl %eax, %edx
andl $0xf, %edx
movb (%rdx,%rsi), %r15b
addb %dil, %r15b
movzbl %r15b, %r14d
shrl $0x4, %ecx
movb 0x48(%rsp), %dl
addb (%rcx,%rsi), %dl
movb %dl, 0x48(%rsp)
movzbl %dl, %ebx
shrl $0x4, %eax
movb 0x28(%rsp), %cl
addb (%rax,%rsi), %cl
movb %cl, 0x28(%rsp)
movzbl %cl, %ebp
movl %ebx, %esi
movl %ebp, %edx
leaq 0x24(%rsp), %rcx
callq 0x5c294
movl 0x24(%rsp), %ecx
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq 0x50(%rsp), %r12
movq %r12, %rdx
callq 0xe7287
movl %r14d, %edi
movq 0x38(%rsp), %r14
movl %ebx, %esi
movl %ebp, %edx
leaq 0x24(%rsp), %rcx
callq 0x5c294
movl 0x24(%rsp), %ecx
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %r14, %r12
callq 0xe7287
movq 0x10(%rsp), %rax
addq $0x2, %rax
jmp 0x5c0cd
movq 0x50(%rsp), %rdx
incq %rdx
movq 0x40(%rsp), %rbp
movq 0x30(%rsp), %r13
jmp 0x5c08b
leaq 0xb9dda(%rip), %rsi     # 0x115fb2
movq %r13, %rdi
xorl %eax, %eax
callq 0xdf37f
movq 0x8(%rsp), %r12
jmp 0x5c251
movq 0x30(%rsp), %rbx
movq 0x8(%rsp), %r12
movl 0x10(%rsp), %r15d
jmp 0x5c203
pushq $0x1
popq %r15
movq 0x30(%rsp), %rbx
movq %r14, %rdi
callq 0xe58e8
testl %r15d, %r15d
je 0x5c221
leaq 0xb9df6(%rip), %rsi     # 0x11600d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
cmpq $0x0, 0x18(%r14)
movq 0x38(%rsp), %r8
jle 0x5c262
movl 0x24(%r8), %edx
movq (%r8), %rcx
addq $0x30, %r8
andl $0x0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %r9
callq 0xe7cbc
movq %r14, %rdi
callq 0xe5591
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xe70b7
jmp 0x5beae
movq %r14, %rdi
callq 0xe5591
jmp 0x5beae
leaq 0xb9d77(%rip), %rsi     # 0x115fed
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x40(%rsp), %rbp
movq 0x28(%rsp), %r14
jmp 0x5c1f3