// File: /workspace/github_c_makefile_star2_O3/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 0x8df5d(%rip), %rsi     # 0x132e6e
callq 0xeb125
movl $0x58, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
movl $0x1, (%rax)
movq $0x2, 0x18(%rax)
movq $0x4, 0x20(%rax)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb220
movl %eax, 0x8(%r14)
movb $0x1, 0x14(%r14)
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
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 0xeef43
movq %rax, %r12
addq $0x2, (%r15)
leaq 0x8fbdf(%rip), %rsi     # 0x134b6f
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x2, %r12
jne 0xa50b0
movq (%r15), %r12
movq 0x10(%r15), %rcx
movq %rcx, (%rsp)
leaq 0x4(%r12), %r13
movq %r13, (%r15)
movq %r13, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
leaq 0x8fc2d(%rip), %rsi     # 0x134bf8
movq %rbx, %rdi
movl %r13d, %edx
movq %r13, 0x10(%rsp)
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %r13, %rsi
callq 0xeef43
leaq 0x6(%r12), %rbp
leaq 0x8fc01(%rip), %rsi     # 0x134c07
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq %rbp, %rsi
callq 0xeeff3
movq %rax, %rbp
leaq 0xa(%r12), %r13
leaq 0x8fbeb(%rip), %rsi     # 0x134c1c
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
testq %rbp, %rbp
movl $0x0, %eax
cmovgq %rbp, %rax
movq %r12, 0x8(%rsp)
addq %r12, %rax
addq $0xa, %rax
movq (%rsp), %r12
cmpq %r12, %rax
cmovgeq %r12, %rax
leaq 0x30(%rsp), %rdx
movq %r13, 0x8(%rdx)
movq %r13, (%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xab151
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %r12, %rcx
xorl %edx, %edx
movq 0x10(%rsp), %r12
movq %rcx, %rax
subq %r12, %rax
jle 0xa50cc
movq 0x8(%rsp), %rdx
addq %rbp, %rdx
addq $0xa, %rdx
cmpq %rcx, %rdx
jle 0xa50c9
movq %rax, %rdx
jmp 0xa50cc
leaq 0x8fa9b(%rip), %rsi     # 0x134b52
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9295
jmp 0xa5231
subq %r12, %rdx
addq (%r15), %rdx
movq %rdx, (%r15)
leaq 0x8faa7(%rip), %rsi     # 0x134b80
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq (%r15), %rsi
callq 0xeeff3
movq %rax, %r12
addq $0x4, (%r15)
leaq 0x8fa7f(%rip), %rsi     # 0x134b8d
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq %r12, (%rsp)
testq %r12, %r12
js 0xa5224
incq (%rsp)
xorl %r13d, %r13d
movq (%r15), %rcx
movq 0x10(%r15), %rax
cmpq %rax, %rcx
jge 0xa5224
movq 0x8(%r15), %rdx
cmpq %rdx, %rcx
cmovgq %rcx, %rdx
subq %rdx, %rax
cmpq $0x4, %rax
jl 0xa5224
movq %rbx, %rdi
leaq 0x8fa41(%rip), %rsi     # 0x134ba2
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movl 0x4(%r14), %edx
movq (%r15), %rsi
callq 0xeeff3
movq %rax, %rbp
addq $0x4, (%r15)
movq %rbx, %rdi
leaq 0x8fa19(%rip), %rsi     # 0x134bb2
movl %ebp, %edx
xorl %eax, %eax
callq 0xe8617
movq (%r15), %rax
movq 0x10(%r15), %rcx
testq %rbp, %rbp
movl $0x0, %edx
cmovgq %rbp, %rdx
addq %rax, %rdx
cmpq %rcx, %rdx
cmovgeq %rcx, %rdx
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq %rdx, 0x28(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdx
movl $0x1, %ecx
leaq 0x8f9db(%rip), %r8      # 0x134bc3
callq 0xa7748
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl $0x1, %ecx
leaq 0x8f9dd(%rip), %r8      # 0x134bdf
callq 0xa7748
addq %rbp, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
incq %r13
cmpq %r13, (%rsp)
jne 0xa512f
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe8be2
movq %rbx, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe8be2