// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/pict.c
// Function: decode_pixdata
static int decode_pixdata(deark *c, lctx *d, struct fmtutil_macbitmap_info *bi, i64 pos)
{
	int retval = 0;

	de_dbg_indent(c, 1);

	if(bi->npwidth==0 || bi->height==0) {
		de_warn(c, "Ignoring zero-size bitmap (%d"DE_CHAR_TIMES"%d)",
			(int)bi->npwidth, (int)bi->height);
		goto done;
	}
	if(!de_good_image_dimensions(c, bi->npwidth, bi->height)) goto done;

	if(bi->pixelsize!=1 && bi->pixelsize!=2 && bi->pixelsize!=4 && bi->pixelsize!=8 &&
		bi->pixelsize!=16 && bi->pixelsize!=24 && bi->pixelsize!=32)
	{
		de_err(c, "%d bits/pixel images are not supported", (int)bi->pixelsize);
		goto done;
	}
	if((bi->uses_pal && bi->pixeltype!=0) || (!bi->uses_pal && bi->pixeltype!=16)) {
		de_err(c, "Pixel type %d is not supported", (int)bi->pixeltype);
		goto done;
	}
	if(bi->cmpcount!=1 && bi->cmpcount!=3 && bi->cmpcount!=4) {
		de_err(c, "Component count %d is not supported", (int)bi->cmpcount);
		goto done;
	}
	if(bi->cmpsize!=1 && bi->cmpsize!=2 && bi->cmpsize!=4 && bi->cmpsize!=5 &&
		bi->cmpsize!=8)
	{
		de_err(c, "%d-bit components are not supported", (int)bi->cmpsize);
		goto done;
	}
	if(bi->packing_type!=0 && bi->packing_type!=1 && bi->packing_type!=3 && bi->packing_type!=4) {
		de_err(c, "Packing type %d is not supported", (int)bi->packing_type);
		goto done;
	}
	if((bi->uses_pal &&
		(bi->packing_type==0 || bi->packing_type==1) &&
		(bi->pixelsize==1 || bi->pixelsize==2 || bi->pixelsize==4 || bi->pixelsize==8) &&
		bi->cmpcount==1 && bi->cmpsize==bi->pixelsize) ||
		(!bi->uses_pal && (bi->packing_type==1 || bi->packing_type==3) && bi->pixelsize==16
			&& bi->cmpcount==3 && bi->cmpsize==5) ||
		(!bi->uses_pal && bi->packing_type==1 && bi->pixelsize==16 && bi->cmpcount==3 && bi->cmpsize==5) ||
		(!bi->uses_pal && bi->packing_type==4 && bi->pixelsize==32 && bi->cmpcount==3 && bi->cmpsize==8) ||
		(!bi->uses_pal && bi->packing_type==4 && bi->pixelsize==32 && bi->cmpcount==4 && bi->cmpsize==8))
	{
		;
	}
	else {
		de_err(c, "This type of image is not supported");
		goto done;
	}

	if(bi->cmpcount==4) {
		de_warn(c, "This image might have transparency, which is not supported.");
	}

	decode_bitmap(c, d, bi, pos);

done:
	de_dbg_indent(c, -1);
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x108283
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1082ae
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %ecx
leaq 0xba5dc(%rip), %rsi     # 0x1c287e
movb $0x0, %al
callq 0x15bc10
jmp 0x10860d
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
callq 0x16a850
cmpl $0x0, %eax
jne 0x1082d1
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpq $0x1, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x2, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x4, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x8, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x10, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x18, 0x40(%rax)
je 0x10833f
movq -0x18(%rbp), %rax
cmpq $0x20, 0x40(%rax)
je 0x10833f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, %edx
leaq 0xba56e(%rip), %rsi     # 0x1c28a1
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x108354
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x108369
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x10838a
movq -0x18(%rbp), %rax
cmpq $0x10, 0x38(%rax)
je 0x10838a
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %edx
leaq 0xba54a(%rip), %rsi     # 0x1c28c8
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpq $0x1, 0x48(%rax)
je 0x1083cc
movq -0x18(%rbp), %rax
cmpq $0x3, 0x48(%rax)
je 0x1083cc
movq -0x18(%rbp), %rax
cmpq $0x4, 0x48(%rax)
je 0x1083cc
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl %eax, %edx
leaq 0xba527(%rip), %rsi     # 0x1c28e7
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpq $0x1, 0x50(%rax)
je 0x108424
movq -0x18(%rbp), %rax
cmpq $0x2, 0x50(%rax)
je 0x108424
movq -0x18(%rbp), %rax
cmpq $0x4, 0x50(%rax)
je 0x108424
movq -0x18(%rbp), %rax
cmpq $0x5, 0x50(%rax)
je 0x108424
movq -0x18(%rbp), %rax
cmpq $0x8, 0x50(%rax)
je 0x108424
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl %eax, %edx
leaq 0xba4f3(%rip), %rsi     # 0x1c290b
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x108471
movq -0x18(%rbp), %rax
cmpq $0x1, 0x30(%rax)
je 0x108471
movq -0x18(%rbp), %rax
cmpq $0x3, 0x30(%rax)
je 0x108471
movq -0x18(%rbp), %rax
cmpq $0x4, 0x30(%rax)
je 0x108471
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
leaq 0xba4ca(%rip), %rsi     # 0x1c292f
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x1084de
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x108491
movq -0x18(%rbp), %rax
cmpq $0x1, 0x30(%rax)
jne 0x1084de
movq -0x18(%rbp), %rax
cmpq $0x1, 0x40(%rax)
je 0x1084bd
movq -0x18(%rbp), %rax
cmpq $0x2, 0x40(%rax)
je 0x1084bd
movq -0x18(%rbp), %rax
cmpq $0x4, 0x40(%rax)
je 0x1084bd
movq -0x18(%rbp), %rax
cmpq $0x8, 0x40(%rax)
jne 0x1084de
movq -0x18(%rbp), %rax
cmpq $0x1, 0x48(%rax)
jne 0x1084de
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x40(%rcx), %rax
je 0x1085c5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x108523
movq -0x18(%rbp), %rax
cmpq $0x1, 0x30(%rax)
je 0x1084fe
movq -0x18(%rbp), %rax
cmpq $0x3, 0x30(%rax)
jne 0x108523
movq -0x18(%rbp), %rax
cmpq $0x10, 0x40(%rax)
jne 0x108523
movq -0x18(%rbp), %rax
cmpq $0x3, 0x48(%rax)
jne 0x108523
movq -0x18(%rbp), %rax
cmpq $0x5, 0x50(%rax)
je 0x1085c5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x108559
movq -0x18(%rbp), %rax
cmpq $0x1, 0x30(%rax)
jne 0x108559
movq -0x18(%rbp), %rax
cmpq $0x10, 0x40(%rax)
jne 0x108559
movq -0x18(%rbp), %rax
cmpq $0x3, 0x48(%rax)
jne 0x108559
movq -0x18(%rbp), %rax
cmpq $0x5, 0x50(%rax)
je 0x1085c5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x10858f
movq -0x18(%rbp), %rax
cmpq $0x4, 0x30(%rax)
jne 0x10858f
movq -0x18(%rbp), %rax
cmpq $0x20, 0x40(%rax)
jne 0x10858f
movq -0x18(%rbp), %rax
cmpq $0x3, 0x48(%rax)
jne 0x10858f
movq -0x18(%rbp), %rax
cmpq $0x8, 0x50(%rax)
je 0x1085c5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x1085c7
movq -0x18(%rbp), %rax
cmpq $0x4, 0x30(%rax)
jne 0x1085c7
movq -0x18(%rbp), %rax
cmpq $0x20, 0x40(%rax)
jne 0x1085c7
movq -0x18(%rbp), %rax
cmpq $0x4, 0x48(%rax)
jne 0x1085c7
movq -0x18(%rbp), %rax
cmpq $0x8, 0x50(%rax)
jne 0x1085c7
jmp 0x1085db
movq -0x8(%rbp), %rdi
leaq 0xb868d(%rip), %rsi     # 0x1c0c5f
movb $0x0, %al
callq 0x15bfb0
jmp 0x10860d
movq -0x18(%rbp), %rax
cmpq $0x4, 0x48(%rax)
jne 0x1085f8
movq -0x8(%rbp), %rdi
leaq 0xba35f(%rip), %rsi     # 0x1c2950
movb $0x0, %al
callq 0x15bc10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x108630
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)