// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/fmtutil.c
// Function: fmtutil_macbitmap_read_pixmap_only_fields
void fmtutil_macbitmap_read_pixmap_only_fields(deark *c, dbuf *f, struct fmtutil_macbitmap_info *bi,
	i64 pos)
{
	i64 pixmap_version;
	i64 pack_size;
	i64 plane_bytes;
	i64 n;

	de_dbg(c, "additional PixMap header fields, at %d", (int)pos);
	de_dbg_indent(c, 1);

	pixmap_version = dbuf_getu16be(f, pos+0);
	de_dbg(c, "pixmap version: %d", (int)pixmap_version);

	bi->packing_type = dbuf_getu16be(f, pos+2);
	de_dbg(c, "packing type: %d", (int)bi->packing_type);

	pack_size = dbuf_getu32be(f, pos+4);
	de_dbg(c, "pixel data length: %d", (int)pack_size);

	bi->hdpi = pict_read_fixed(f, pos+8);
	bi->vdpi = pict_read_fixed(f, pos+12);
	de_dbg(c, "dpi: %.2f"DE_CHAR_TIMES"%.2f", bi->hdpi, bi->vdpi);

	bi->pixeltype = dbuf_getu16be(f, pos+16);
	bi->pixelsize = dbuf_getu16be(f, pos+18);
	bi->cmpcount = dbuf_getu16be(f, pos+20);
	bi->cmpsize = dbuf_getu16be(f, pos+22);
	de_dbg(c, "pixel type=%d, bits/pixel=%d, components/pixel=%d, bits/comp=%d",
		(int)bi->pixeltype, (int)bi->pixelsize, (int)bi->cmpcount, (int)bi->cmpsize);

	if(bi->pixelsize>0) {
		bi->pdwidth = (bi->rowbytes*8)/bi->pixelsize;
	}
	if(bi->pdwidth < bi->npwidth) {
		bi->pdwidth = bi->npwidth;
	}

	plane_bytes = dbuf_getu32be(f, pos+24);
	de_dbg(c, "plane bytes: %d", (int)plane_bytes);

	bi->pmTable = (u32)dbuf_getu32be(f, pos+28);
	de_dbg(c, "pmTable: 0x%08x", (unsigned int)bi->pmTable);

	n = dbuf_getu32be(f, pos+32);
	de_dbg(c, "pmReserved: 0x%08x", (unsigned int)n);

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x60766(%rip), %rsi     # 0x1d632f
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x0, %rsi
callq 0x1651d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x60752(%rip), %rsi     # 0x1d6356
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %edx
leaq 0x4cacd(%rip), %rsi     # 0x1c2709
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165470
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x60700(%rip), %rsi     # 0x1d6369
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x175e70
movq -0x18(%rbp), %rax
movsd %xmm0, 0x58(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x175e70
movq -0x18(%rbp), %rax
movsd %xmm0, 0x60(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movsd 0x58(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd 0x60(%rax), %xmm1
leaq 0x4cd7d(%rip), %rsi     # 0x1c2a3e
movb $0x2, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x12, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x14, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x16, %rsi
callq 0x1651d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl %eax, %r8d
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl %eax, %r9d
leaq 0x60612(%rip), %rsi     # 0x1d637f
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jle 0x175d9f
movq -0x18(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
movq -0x18(%rbp), %rcx
cqto
idivq 0x40(%rcx)
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x175dc1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x18, %rsi
callq 0x165470
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x605d8(%rip), %rsi     # 0x1d63bf
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x1c, %rsi
callq 0x165470
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x68(%rax), %edx
leaq 0x605b5(%rip), %rsi     # 0x1d63cf
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x20, %rsi
callq 0x165470
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0x60598(%rip), %rsi     # 0x1d63df
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)