// File: /workspace/github_c_makefile_star2_O2/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 0x86cd0(%rip), %rsi     # 0x125b96
callq 0xe07f7
pushq $0x58
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r14
movl $0x1, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9f9fe
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
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
movq %r15, %rsi
callq 0x9feb0
movq %rax, %r12
leaq 0x88976(%rip), %rsi     # 0x127897
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
cmpq $0x2, %r12
jne 0x9f025
movq (%r15), %rdx
movq 0x10(%r15), %rax
addq $0x4, %rdx
movq %rdx, (%r15)
leaq 0x18(%rsp), %r12
movq %rdx, 0x8(%r12)
movq %rdx, (%r12)
movq %rax, 0x10(%r12)
leaq 0x889c0(%rip), %rsi     # 0x127920
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %r12, %rsi
callq 0x9feb0
leaq 0x889a3(%rip), %rsi     # 0x12792f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %r12, %rsi
callq 0x9fe70
movq %rax, %rbp
leaq 0x88992(%rip), %rsi     # 0x127944
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
testq %rbp, %rbp
movl $0x0, %eax
cmovgq %rbp, %rax
movq %r12, %rcx
movq (%r12), %r12
movq 0x10(%rcx), %r13
addq %r12, %rax
cmpq %r13, %rax
cmovgeq %r13, %rax
leaq 0x30(%rsp), %rdx
movq %r12, 0x8(%rdx)
movq %r12, (%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa4a1f
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
xorl %edx, %edx
leaq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %r13, %rcx
subq %rax, %rcx
jle 0x9f044
addq %rbp, %r12
cmpq %r13, %r12
jle 0x9f03e
movq %rcx, %rdx
jmp 0x9f044
leaq 0x8884e(%rip), %rsi     # 0x12787a
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xdf2a5
jmp 0x9f193
subq %rax, %r12
movq %r12, %rdx
addq (%r15), %rdx
movq %rdx, (%r15)
leaq 0x88857(%rip), %rsi     # 0x1278a8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r14, (%rsp)
movl 0x4(%r14), %edx
movq %r15, %rsi
callq 0x9fe70
leaq 0x88834(%rip), %rsi     # 0x1278b5
movq %rbx, %rdi
movq %rax, 0x8(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
xorl %r14d, %r14d
pushq $0x1
popq %r13
cmpq 0x8(%rsp), %r14
jg 0x9f184
movq %r15, %rdi
callq 0x9ff2f
cmpq $0x4, %rax
jl 0x9f184
movl (%r15), %ecx
movq %rbx, %rdi
leaq 0x88807(%rip), %rsi     # 0x1278ca
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
movq %r14, 0x10(%rsp)
movl %r13d, %esi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq (%rsp), %r14
movl 0x4(%r14), %edx
movq %r15, %rsi
callq 0x9fe70
movq %rax, %r12
movq %rbx, %rdi
leaq 0x887dc(%rip), %rsi     # 0x1278da
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
testq %r12, %r12
movl $0x0, %eax
cmovgq %r12, %rax
movq (%r15), %rcx
movq 0x10(%r15), %rdx
addq %rcx, %rax
cmpq %rdx, %rax
cmovgeq %rdx, %rax
movq %rcx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdx
movl %r13d, %ecx
leaq 0x8879f(%rip), %r8      # 0x1278eb
callq 0xa147d
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %r14
movq %rbp, %rdx
movl %r13d, %ecx
leaq 0x8879e(%rip), %r8      # 0x127907
callq 0xa147d
addq %r12, (%r15)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %r14
jmp 0x9f099
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movq (%rsp), %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xded32
movq %rbx, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xded32