// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/psd.c
// Function: do_asl_patterns_and_styles
static void do_asl_patterns_and_styles(deark *c, lctx *d, zztype *zz)
{
	zztype czz;
	i64 num_styles;
	i64 style_idx;
	i64 style_len;

	zz->pos += 4; // 8BSL signature

	zz_init(&czz, zz);
	do_asl_patterns(c, d, &czz);
	zz->pos += zz_used(&czz);

	de_dbg(c, "styles at %d", (int)zz->pos);
	de_dbg_indent(c, 1);

	num_styles = psd_getu32zz(zz);
	de_dbg(c, "number of styles: %d", (int)num_styles);

	for(style_idx=0; style_idx<=num_styles; style_idx++) {
		if(zz_avail(zz)<4) break;

		de_dbg(c, "style[%d] at %d", (int)style_idx, (int)zz->pos);
		de_dbg_indent(c, 1);

		style_len = psd_getu32zz(zz);
		de_dbg(c, "style length: %d", (int)style_len);

		zz_init_with_len(&czz, zz, style_len);
		read_descriptor(c, d, &czz, 1, " (for style identification)");
		read_descriptor(c, d, &czz, 1, " (for style information)");

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

	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), %rcx
addq $0x4, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xf3580
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xfc380
leaq -0x30(%rbp), %rdi
callq 0xf3820
movq %rax, %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0xc43ad(%rip), %rsi     # 0x1c05c7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq 0xc4378(%rip), %rsi     # 0x1c05d4
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jg 0xfc368
movq -0x18(%rbp), %rdi
callq 0xf40b0
cmpq $0x4, %rax
jge 0xfc28d
jmp 0xfc368
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0xc4342(%rip), %rsi     # 0x1c05e9
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xf3330
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %edx
leaq 0xc4310(%rip), %rsi     # 0x1c05f9
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0xf3380
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x1, %ecx
leaq 0xc42f1(%rip), %r8      # 0x1c060a
callq 0xf5b50
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl $0x1, %ecx
leaq 0xc42f0(%rip), %r8      # 0x1c0626
callq 0xf5b50
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xfc26b
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)