// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/mmm.c
// Function: my_mmm_chunk_handler
static int my_mmm_chunk_handler(struct de_iffctx *ictx)
{
	deark *c = ictx->c;
	struct mmm_ctx *d = (struct mmm_ctx*)ictx->userdata;
	i64 dpos, dlen;

	dpos = ictx->chunkctx->dpos;
	dlen = ictx->chunkctx->dlen;

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

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

	ictx->handled = 1;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_Ver_:
	case CODE_ver:
		if(d->pass==1) {
			do_mmm_ver(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_CFTC:
	case CODE_cftc:
		if(d->pass==1) {
			do_mmm_cftc(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_CLUT:
	case CODE_clut:
		if(d->pass==1 || d->pass==100) {
			do_mmm_clut(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_DIB:
	case CODE_dib:
		if(d->pass==1) {
			d->dib_count++;
		}
		else if(d->pass==2 && !d->suppress_dib_pass2) {
			do_mmm_dib(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_snd:
		if(d->pass==2) {
			do_mmm_snd(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_CURS:
		if(d->pass==2) {
			do_mmm_CURS(c, d, ictx, dpos, dlen);
		}
		break;
	case CODE_McNm:
	case CODE_mcnm:
		if(d->pass==1) {
			do_mmm_mcnm(c, d, ictx, dpos, dlen);
		}
		break;
	default:
		if(d->pass==1) {
			// Make sure the default behavior only happens in one of the passes
			// (e.g. hexdump if the debug level is set high enough).
			ictx->handled = 0;
		}
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
subl $0x52494646, %eax       # imm = 0x52494646
jne 0xde483
jmp 0xde470
movq -0x10(%rbp), %rax
movl $0x1, 0x134(%rax)
jmp 0xde6b6
movq -0x10(%rbp), %rax
cmpl $0x1, 0x64(%rax)
je 0xde492
jmp 0xde6b6
movq -0x10(%rbp), %rax
movl $0x1, 0x130(%rax)
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x43465443, %eax       # imm = 0x43465443
je 0xde58d
jmp 0xde4be
movl -0x34(%rbp), %eax
subl $0x434c5554, %eax       # imm = 0x434C5554
je 0xde5b4
jmp 0xde4ce
movl -0x34(%rbp), %eax
subl $0x43555253, %eax       # imm = 0x43555253
je 0xde653
jmp 0xde4de
movl -0x34(%rbp), %eax
subl $0x44494220, %eax       # imm = 0x44494220
je 0xde5e4
jmp 0xde4ee
movl -0x34(%rbp), %eax
subl $0x4d634e6d, %eax       # imm = 0x4D634E6D
je 0xde677
jmp 0xde4fe
movl -0x34(%rbp), %eax
subl $0x5665722e, %eax       # imm = 0x5665722E
je 0xde566
jmp 0xde50a
movl -0x34(%rbp), %eax
subl $0x63667463, %eax       # imm = 0x63667463
je 0xde58d
jmp 0xde516
movl -0x34(%rbp), %eax
subl $0x636c7574, %eax       # imm = 0x636C7574
je 0xde5b4
jmp 0xde526
movl -0x34(%rbp), %eax
subl $0x64696220, %eax       # imm = 0x64696220
je 0xde5e4
jmp 0xde536
movl -0x34(%rbp), %eax
subl $0x6d636e6d, %eax       # imm = 0x6D636E6D
je 0xde677
jmp 0xde546
movl -0x34(%rbp), %eax
subl $0x736e6420, %eax       # imm = 0x736E6420
je 0xde62f
jmp 0xde556
movl -0x34(%rbp), %eax
subl $0x76657220, %eax       # imm = 0x76657220
jne 0xde69b
jmp 0xde566
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xde588
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xde830
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xde5af
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xde880
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
je 0xde5c6
movq -0x20(%rbp), %rax
cmpl $0x64, (%rax)
jne 0xde5df
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xde9b0
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xde5fc
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0xde62a
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xde628
movq -0x20(%rbp), %rax
cmpb $0x0, 0x11(%rax)
jne 0xde628
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xdec00
jmp 0xde62a
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xde651
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xdf040
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xde675
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xdf340
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xde699
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xdf5b0
jmp 0xde6b4
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xde6b2
movq -0x10(%rbp), %rax
movl $0x0, 0x130(%rax)
jmp 0xde6b4
jmp 0xde6b6
movq -0x20(%rbp), %rax
cmpb $0x0, 0x10(%rax)
je 0xde6c9
movl $0x0, -0x4(%rbp)
jmp 0xde6d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)