// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rdi, %rbx
movq (%rdx), %rax
movq 0x10(%rdx), %r13
cmpq %r13, %rax
jge 0xa8d36
movq %rdx, %r14
movq %rsi, %r15
movq 0x8(%rdx), %rcx
cmpq %rcx, %rax
cmovgq %rax, %rcx
subq %rcx, %r13
movabsq $0x4ec4ec4ec4ec4ec5, %rcx # imm = 0x4EC4EC4EC4EC4EC5
movq %r13, %rax
imulq %rcx
movq %rdx, %r12
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x3, %r12
addq %rax, %r12
leaq 0x8b18d(%rip), %rsi     # 0x133d59
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x1a, %r13
jl 0xa8d57
xorl %r13d, %r13d
movl (%r14), %ecx
movq %rbx, %rdi
leaq 0x8b187(%rip), %rsi     # 0x133d7a
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r14), %rbp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeef43
cmpq $0x8, %rax
ja 0xa8d21
addq $0x2, %rbp
leaq 0x8a186(%rip), %rcx     # 0x132db8
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0x8b16b(%rip), %rcx     # 0x133dab
leaq 0x8b14e(%rip), %r8      # 0x133d95
jmpq *%rdx
leaq 0x8b17e(%rip), %rcx     # 0x133dce
jmp 0xa8cad
leaq 0x8b1ae(%rip), %rcx     # 0x133e07
jmp 0xa8cad
leaq 0x8b191(%rip), %r8      # 0x133df3
movq %rbx, %rdi
leaq 0x8b200(%rip), %rsi     # 0x133e6c
movl %eax, %edx
movq %r8, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeef43
movq %rbx, %rdi
leaq 0x8b1f4(%rip), %rsi     # 0x133e86
jmp 0xa8cf9
leaq 0x7a65d(%rip), %rcx     # 0x1232f8
jmp 0xa8cad
leaq 0x8b184(%rip), %rcx     # 0x133e28
jmp 0xa8cad
leaq 0x8b19e(%rip), %rcx     # 0x133e4b
movq %rbx, %rdi
leaq 0x8b1b5(%rip), %rsi     # 0x133e6c
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
jmp 0xa8d02
movq %rbx, %rdi
leaq 0x8b1a0(%rip), %rsi     # 0x133e6c
movl $0x8, %edx
leaq 0x8b182(%rip), %rcx     # 0x133e5a
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeef43
movq %rbx, %rdi
leaq 0x8202b(%rip), %rsi     # 0x12ad24
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
addq $0x1a, (%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
incq %r13
cmpq %r13, %r12
jne 0xa8be6
jmp 0xa8d57
movq %rbx, %rdi
leaq 0x8b141(%rip), %rsi     # 0x133e6c
movl %eax, %edx
leaq 0x8341d(%rip), %rcx     # 0x12c151
jmp 0xa8cb9
leaq 0x8b01c(%rip), %rsi     # 0x133d59
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe8617
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq