// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xf40b0
movl $0x1a, %ecx
cqto
idivq %rcx
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0xc8044(%rip), %rsi     # 0x1bf7a0
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xf7951
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %edx
movq -0x18(%rbp), %rax
movl (%rax), %ecx
leaq 0xc8034(%rip), %rsi     # 0x1bf7c1
xorl %eax, %eax
callq 0x15b0d0
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movl $0x1a, %edx
callq 0xf3380
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x68(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3de0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
subq $0x8, %rax
ja 0xf786f
movq -0x60(%rbp), %rax
leaq 0xc6fe7(%rip), %rcx     # 0x1be7d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc7fdb(%rip), %rax     # 0x1bf7dc
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc7fe4(%rip), %rax     # 0x1bf7f2
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc7ffa(%rip), %rax     # 0x1bf815
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc8012(%rip), %rax     # 0x1bf83a
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc8019(%rip), %rax     # 0x1bf84e
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc802d(%rip), %rax     # 0x1bf86f
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc8043(%rip), %rax     # 0x1bf892
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xb7480(%rip), %rax     # 0x1aecdc
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc8038(%rip), %rax     # 0x1bf8a1
movq %rax, -0x58(%rbp)
jmp 0xf787a
leaq 0xc03b7(%rip), %rax     # 0x1b7c2d
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %edx
movq -0x58(%rbp), %rcx
leaq 0xc8027(%rip), %rsi     # 0x1bf8b3
xorl %eax, %eax
callq 0x15b0d0
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
testq %rax, %rax
je 0xf78ba
jmp 0xf78a2
movq -0x70(%rbp), %rax
subq $0x3, %rax
je 0xf78ba
jmp 0xf78ae
movq -0x70(%rbp), %rax
subq $0x8, %rax
je 0xf78f0
jmp 0xf7924
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rsi
callq 0xf3de0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0xc7fe6(%rip), %rsi     # 0x1bf8cd
movb $0x0, %al
callq 0x15b0d0
jmp 0xf7924
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rsi
callq 0xf3de0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movl %eax, %edx
leaq 0xbee17(%rip), %rsi     # 0x1b6734
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1a, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xf776b
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)