// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x50784(%rip), %rsi     # 0x14a2cf
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %r15, %rdi
movq %r14, %rsi
callq 0xef169
leaq 0x50782(%rip), %rsi     # 0x14a2f6
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x2(%r14), %rsi
movq %r15, %rdi
callq 0xef169
movq %rax, 0x30(%r12)
leaq 0x3cea5(%rip), %rsi     # 0x136a3d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x4(%r14), %rsi
movq %r15, %rdi
callq 0xef32a
leaq 0x50752(%rip), %rsi     # 0x14a309
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0xef3cb
cvtsi2sd %rax, %xmm0
mulsd 0x2c97c(%rip), %xmm0    # 0x126558
movsd %xmm0, 0x58(%r12)
leaq 0xc(%r14), %rsi
movq %r15, %rdi
callq 0xef3cb
cvtsi2sd %rax, %xmm1
mulsd 0x2c95c(%rip), %xmm1    # 0x126558
movsd %xmm1, 0x60(%r12)
movsd 0x58(%r12), %xmm0
leaq 0x3d161(%rip), %rsi     # 0x136d72
movq %rbx, %rdi
movb $0x2, %al
callq 0xe9226
leaq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0xef169
movq %rax, 0x38(%r12)
leaq 0x12(%r14), %rsi
movq %r15, %rdi
callq 0xef169
movq %rax, 0x40(%r12)
leaq 0x14(%r14), %rsi
movq %r15, %rdi
callq 0xef169
movq %rax, 0x48(%r12)
leaq 0x16(%r14), %rsi
movq %r15, %rdi
callq 0xef169
movq %rax, 0x50(%r12)
movl 0x38(%r12), %edx
movl 0x40(%r12), %ecx
movl 0x48(%r12), %r8d
leaq 0x506aa(%rip), %rsi     # 0x14a31f
movq %rbx, %rdi
movl %eax, %r9d
xorl %eax, %eax
callq 0xe9226
movq 0x40(%r12), %rcx
testq %rcx, %rcx
jle 0xf9c9e
movq (%r12), %rax
shlq $0x3, %rax
cqto
idivq %rcx
movq %rax, 0x18(%r12)
movq 0x10(%r12), %rax
cmpq %rax, 0x18(%r12)
jge 0xf9caf
movq %rax, 0x18(%r12)
leaq 0x18(%r14), %rsi
movq %r15, %rdi
callq 0xef32a
leaq 0x5069d(%rip), %rsi     # 0x14a35f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x1c(%r14), %rsi
movq %r15, %rdi
callq 0xef32a
movl %eax, 0x68(%r12)
leaq 0x50689(%rip), %rsi     # 0x14a36f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
addq $0x20, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xef32a
leaq 0x50677(%rip), %rsi     # 0x14a37f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe9585