// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/wri.c
// Function: do_picture_header
static void do_picture_header(deark *c, lctx *d, struct para_info *pinfo,
	struct picctx_struct *picctx)
{
	i64 pos1 = pinfo->thisparapos;
	i64 pos = pos1;
	i64 n1, n2;

	// (The initial "mm" / "storage type" field has already been read.)

	if(picctx->mm==WRI_STG_METAFILE) {
		pos = pos1+2;
		n1 = de_getu16le_p(&pos);
		n2 = de_getu16le_p(&pos);
		de_dbg(c, "xExt,yExt: %d"DE_CHAR_TIMES"%d twips", (int)n1, (int)n2);
	}

	if(picctx->mm==WRI_STG_OLE) {
		// This field seems important, but we don't use it, because the OLE
		// FormatID field is sufficient.
		picctx->ole_objectType = (unsigned int)de_getu16le(pos1+6);
		de_dbg(c, "objectType: %u (%s)", picctx->ole_objectType,
			get_objecttype1_name(picctx->ole_objectType));
	}

	pos = pos1+8;
	n1 = de_getu16le_p(&pos);
	de_dbg(c, "dxaOffset: %d twips", (int)n1);
	n1 = de_getu16le_p(&pos);
	n2 = de_getu16le_p(&pos);
	de_dbg(c, "dxaSize,dyaSize: %d"DE_CHAR_TIMES"%d twips", (int)n1, (int)n2);

	if(picctx->mm==WRI_STG_BITMAP) {
		de_dbg(c, "[DDB header at %"I64_FMT"]", pos1+16);
	}

	if(picctx->mm==WRI_STG_OLE) {
		picctx->ole_dwDataSize = de_getu32le(pos1+16);
		de_dbg(c, "dwDataSize: %d", (int)picctx->ole_dwDataSize);
		n1 = de_getu32le(pos1+24);
		de_dbg(c, "dwObjNum: 0x%08x", (unsigned int)n1);
	}

	picctx->cbHeader = de_getu16le(pos1+30);
	de_dbg(c, "header size: %d", (int)picctx->cbHeader);

	if(picctx->mm==WRI_STG_METAFILE || picctx->mm==WRI_STG_BITMAP) {
		picctx->cbSize = de_getu32le(pos1+32);
		de_dbg(c, "data size: %d", (int)picctx->cbSize);
	}

	pos = pos1+36;
	n1 = de_getu16le_p(&pos);
	n2 = de_getu16le_p(&pos);
	de_dbg(c, "scaling factor x,y: %d,%d", (int)n1, (int)n2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x88, (%rax)
jne 0x13d0cb
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movl %eax, %ecx
leaq 0x905c0(%rip), %rsi     # 0x1cd684
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpl $0xe4, (%rax)
jne 0x13d12b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x6, %rsi
callq 0x165280
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x13d7a0
movq -0x50(%rbp), %rdi
movl -0x44(%rbp), %edx
movq %rax, %rcx
leaq 0x90578(%rip), %rsi     # 0x1cd69c
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x90553(%rip), %rsi     # 0x1cd6b0
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movl %eax, %ecx
leaq 0x9051f(%rip), %rsi     # 0x1cd6c4
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpl $0xe3, (%rax)
jne 0x13d1d2
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
addq $0x10, %rdx
leaq 0x90517(%rip), %rsi     # 0x1cd6e2
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpl $0xe4, (%rax)
jne 0x13d24b
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x10, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
leaq 0x904e3(%rip), %rsi     # 0x1cd6f6
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x18, %rsi
callq 0x165540
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0x904c1(%rip), %rsi     # 0x1cd705
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x1e, %rsi
callq 0x165280
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
leaq 0x75e8e(%rip), %rsi     # 0x1b310e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
cmpl $0x88, (%rax)
je 0x13d29f
movq -0x20(%rbp), %rax
cmpl $0xe3, (%rax)
jne 0x13d2db
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x20, %rsi
callq 0x165540
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %edx
leaq 0x617a5(%rip), %rsi     # 0x19ea79
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x24, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movl %eax, %ecx
leaq 0x903ee(%rip), %rsi     # 0x1cd716
movb $0x0, %al
callq 0x15b0d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)