// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_run_ps_styles
static void de_run_ps_styles(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	zztype *zz = NULL;
	i64 asl_ver;

	de_declare_fmt(c, "Photoshop Styles");

	d = de_malloc(c, sizeof(lctx));
	d->version = 1;
	init_version_specific_info(c, d);

	zz = de_malloc(c, sizeof(zztype));
	zz_init_absolute(zz, 0, c->infile->len);

	asl_ver = psd_getu16zz(zz);
	de_dbg(c, "file version: %d", (int)asl_ver);
	if(asl_ver!=2) {
		de_err(c, "Unsupported Photoshop Styles file version: %d", (int)asl_ver);
		goto done;
	}

	do_asl_patterns_and_styles(c, d, zz);

done:
	de_free(c, zz);
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x8d1d1(%rip), %rsi     # 0x132a76
callq 0xeb6d6
movl $0x58, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa64c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq 0x18(%rbx), %rdi
movq 0x18(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rax, 0x10(%r15)
movl 0x4(%r14), %edx
xorl %esi, %esi
callq 0xef570
movq %rax, %r12
addq $0x2, (%r15)
leaq 0x8ee70(%rip), %rsi     # 0x134777
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x2, %r12
jne 0xa5a35
movq (%r15), %r12
movq 0x10(%r15), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x4(%r12), %r13
movq %r13, (%r15)
movq %r13, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x8eeb8(%rip), %rsi     # 0x134800
movq %rbx, %rdi
movl %r13d, %edx
movq %r13, 0x28(%rsp)
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %r13, %rsi
callq 0xef570
leaq 0x6(%r12), %rbp
movq %rbp, 0x10(%rsp)
leaq 0x8ee87(%rip), %rsi     # 0x13480f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %rbp, %rsi
callq 0xef614
movq %rax, %rbp
leaq 0xa(%r12), %r13
movq %r13, 0x10(%rsp)
leaq 0x8ee6c(%rip), %rsi     # 0x134824
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
testq %rbp, %rbp
movl $0x0, %eax
cmovgq %rbp, %rax
addq %r12, %rax
addq $0xa, %rax
movq 0x8(%rsp), %rcx
cmpq %rcx, %rax
cmovgeq %rcx, %rax
leaq 0x30(%rsp), %rdx
movq %r13, 0x8(%rdx)
movq %r13, (%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xabc2d
addq %rbp, %r12
addq $0xa, %r12
movq %r12, 0x10(%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rcx
xorl %edx, %edx
movq %rcx, %rax
subq %rsi, %rax
jle 0xa5a54
cmpq %rcx, %r12
jle 0xa5a4e
movq %rax, %rdx
jmp 0xa5a54
leaq 0x8ed1e(%rip), %rsi     # 0x13475a
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9df7
jmp 0xa5bc0
subq %rsi, %r12
movq %r12, %rdx
addq (%r15), %rdx
movq %rdx, (%r15)
leaq 0x8ed27(%rip), %rsi     # 0x134788
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq (%r15), %rsi
callq 0xef614
movq %rax, %r12
addq $0x4, (%r15)
leaq 0x8ecff(%rip), %rsi     # 0x134795
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %r12, 0x8(%rsp)
testq %r12, %r12
js 0xa5bb3
incq 0x8(%rsp)
xorl %r13d, %r13d
movq (%r15), %rcx
movq 0x10(%r15), %rdx
movq %rdx, %rax
subq %rcx, %rax
jle 0xa5ad9
movq 0x8(%r15), %rsi
cmpq %rsi, %rcx
jge 0xa5adb
subq %rsi, %rdx
movq %rdx, %rax
jmp 0xa5adb
xorl %eax, %eax
cmpq $0x4, %rax
jl 0xa5bb3
movq %rbx, %rdi
leaq 0x8ecbb(%rip), %rsi     # 0x1347aa
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq (%r15), %rsi
callq 0xef614
movq %rax, %rbp
addq $0x4, (%r15)
movq %rbx, %rdi
leaq 0x8ec93(%rip), %rsi     # 0x1347ba
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
testq %rbp, %rbp
movl $0x0, %eax
cmovgq %rbp, %rax
movq (%r15), %rcx
movq 0x10(%r15), %rdx
addq %rcx, %rax
cmpq %rdx, %rax
cmovgeq %rdx, %rax
movq %rcx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdx
movl $0x1, %ecx
leaq 0x8ec55(%rip), %r8      # 0x1347cb
callq 0xa8173
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl $0x1, %ecx
leaq 0x8ec57(%rip), %r8      # 0x1347e7
callq 0xa8173
addq %rbp, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
incq %r13
cmpq %r13, 0x8(%rsp)
jne 0xa5ab9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9752
movq %rbx, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9752