// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/psd.c
// Function: do_pathinfo
static void do_pathinfo(deark *c, lctx *d, zztype *zz)
{
	i64 num_records;
	i64 i;

	num_records = zz_avail(zz) / 26;
	de_dbg(c, "calculated number of records: %d", (int)num_records);
	for(i=0; i<num_records; i++) {
		zztype czz;
		i64 t;
		i64 x;
		const char *name;

		de_dbg(c, "path data record[%d] at %d", (int)i, (int)zz->pos);
		zz_init_with_len(&czz, zz, 26);
		de_dbg_indent(c, 1);

		t = psd_getu16zz(&czz);
		switch(t) {
		case 0: name="Closed subpath length"; break;
		case 1: name="Closed subpath Bezier knot, linked"; break;
		case 2: name="Closed subpath Bezier knot, unlinked"; break;
		case 3: name="Open subpath length"; break;
		case 4: name="Open subpath Bezier knot, linked"; break;
		case 5: name="Open subpath Bezier knot, unlinked"; break;
		case 6: name="Path fill rule"; break;
		case 7: name="Clipboard"; break;
		case 8: name="Initial fill rule"; break;
		default: name="?"; break;
		}
		de_dbg(c, "path record type: %d (%s)", (int)t, name);

		switch(t) {
		case 0: case 3:
			x = psd_getu16zz(&czz);
			de_dbg(c, "number of Bezier knot records: %d", (int)x);
			break;
		case 8:
			x = psd_getu16zz(&czz);
			de_dbg(c, "value: %d", (int)x);
			break;
		}

		zz->pos += 26;
		de_dbg_indent(c, -1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x9ff2f
pushq $0x1a
popq %rcx
cqto
idivq %rcx
movq %rax, %r12
leaq 0x8440b(%rip), %rsi     # 0x126a81
xorl %r13d, %r13d
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
cmovleq %r13, %r12
leaq 0x83424(%rip), %r13     # 0x125ab8
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0xa27f4
movl (%rbx), %ecx
movq %r15, %rdi
leaq 0x843f7(%rip), %rsi     # 0x126aa2
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1a(%rax), %rdx
cmpq %rcx, %rdx
cmovlq %rdx, %rcx
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
movq %rcx, 0x10(%rsp)
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
movq %rsp, %rsi
callq 0x9feb0
cmpq $0x8, %rax
ja 0xa27df
movslq (%r13,%rax,4), %rdx
addq %r13, %rdx
leaq 0x843cb(%rip), %rcx     # 0x126ad3
leaq 0x843ae(%rip), %r8      # 0x126abd
jmpq *%rdx
leaq 0x843de(%rip), %rcx     # 0x126af6
jmp 0xa2775
leaq 0x8440e(%rip), %rcx     # 0x126b2f
jmp 0xa2775
leaq 0x843f1(%rip), %r8      # 0x126b1b
movq %r15, %rdi
leaq 0x84460(%rip), %rsi     # 0x126b94
movl %eax, %edx
movq %r8, %rcx
xorl %eax, %eax
callq 0xde896
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
movq %rsp, %rsi
callq 0x9feb0
movq %r15, %rdi
leaq 0x84454(%rip), %rsi     # 0x126bae
jmp 0xa27bf
leaq 0x739d5(%rip), %rcx     # 0x116138
jmp 0xa2775
leaq 0x843e4(%rip), %rcx     # 0x126b50
jmp 0xa2775
leaq 0x843fe(%rip), %rcx     # 0x126b73
movq %r15, %rdi
leaq 0x84415(%rip), %rsi     # 0x126b94
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
jmp 0xa27c8
movq %r15, %rdi
leaq 0x84400(%rip), %rsi     # 0x126b94
pushq $0x8
popq %rdx
leaq 0x843e4(%rip), %rcx     # 0x126b82
xorl %eax, %eax
callq 0xde896
movq 0x18(%r15), %rdi
movl 0x4(%r14), %edx
movq %rsp, %rsi
callq 0x9feb0
movq %r15, %rdi
leaq 0x7b2f5(%rip), %rsi     # 0x11dab4
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
addq $0x1a, (%rbx)
movq %r15, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %rbp
jmp 0xa2696
movq %r15, %rdi
leaq 0x843ab(%rip), %rsi     # 0x126b94
movl %eax, %edx
leaq 0x7c6ef(%rip), %rcx     # 0x11eee1
jmp 0xa2781
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq