// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/epocimage.c
// Function: do_sketch_section
static void do_sketch_section(deark *c, lctx *d, i64 pos1)
{
	i64 pos;
	i64 paint_data_section_start;
	i64 s_s_w, s_s_h;
	i64 x1, x2;

	pos = pos1;

	// 18-byte header
	de_dbg(c, "sketch section at %"I64_FMT, pos);
	de_dbg_indent(c, 1);

	s_s_w = de_getu16le(pos);
	s_s_h = de_getu16le(pos+2);
	de_dbg(c, "sketch section dimensions: %d"DE_CHAR_TIMES"%d", (int)s_s_w, (int)s_s_h);

	pos += 18;

	// The image itself
	paint_data_section_start = pos;
	do_read_and_write_paint_data_section(c, d, paint_data_section_start);

	// Some data follows the image, but it doesn't seem to be important,
	// so we don't have to read it before calling
	// do_read_and_write_paint_data_section() to convert the image.

	pos = paint_data_section_start + d->last_paint_data_section_size;
	x1 = de_getu16le(pos);
	x2 = de_getu16le(pos+2);
	de_dbg(c, "magnification: %u"DE_CHAR_TIMES"%u", (UI)x1, (UI)x2);
	x1 = de_getu32le(pos+4);
	x2 = de_getu32le(pos+8);
	de_dbg(c, "left, right cut: %u, %u", (UI)x1, (UI)x2);
	x1 = de_getu32le(pos+12);
	x2 = de_getu32le(pos+16);
	de_dbg(c, "top, bottom cut: %u, %u", (UI)x1, (UI)x2);

	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x14abba(%rip), %rsi    # 0x1a7da5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165280
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0x14ab76(%rip), %rsi    # 0x1a7dbb
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x12, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x5d390
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
addq 0x8(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165280
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movl %eax, %ecx
leaq 0x14ab17(%rip), %rsi    # 0x1a7ddd
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165540
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x165540
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movl %eax, %ecx
leaq 0x14aadd(%rip), %rsi    # 0x1a7df3
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0xc, %rsi
callq 0x165540
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x165540
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movl %eax, %ecx
leaq 0x14aaa5(%rip), %rsi    # 0x1a7e0b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)