// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/psd.c
// Function: hrsrc_slices
static void hrsrc_slices(deark *c, lctx *d, zztype *zz, const struct rsrc_info *ri)
{
	i64 sver;

	if(zz_avail(zz)<4) return;
	sver = psd_getu32(zz->pos);
	de_dbg(c, "slices resource format version: %d", (int)sver);

	if(sver==6) {
		do_slices_v6(c, d, zz);
	}
	else if(sver==7 || sver==8) {
		do_slices_v7_8(c, d, zz);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq (%rdx), %rsi
movq 0x10(%rdx), %rax
cmpq %rax, %rsi
jge 0xa6fb5
movq %rdx, %rbx
movq 0x8(%rdx), %rcx
cmpq %rcx, %rsi
cmovgq %rsi, %rcx
subq %rcx, %rax
cmpq $0x4, %rax
jl 0xa6fb5
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movl 0x4(%r15), %edx
callq 0xeeff3
movq %rax, %r12
leaq 0x8cceb(%rip), %rsi     # 0x1338b6
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x6, %r12
jne 0xa6f59
addq $0x4, (%rbx)
leaq 0x8ccec(%rip), %rcx     # 0x1338d9
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xa76cc
movq (%rbx), %rax
cmpq 0x10(%rbx), %rax
jge 0xa6f8f
movq %r14, %rdi
callq 0xf6410
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0xa7614
movq %r12, 0x8(%rsp)
movq %r12, %rdi
callq 0xf70f6
leaq 0x8ccb4(%rip), %rsi     # 0x1338ec
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jge 0xa6fab
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
callq 0xeeff3
movq %rax, %r12
addq $0x4, (%rbx)
leaq 0x8cc9d(%rip), %rsi     # 0x13390a
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq (%rbx), %rcx
movq %r12, 0x28(%rsp)
testq %r12, %r12
jle 0xa6f37
xorl %eax, %eax
movq %rbx, 0x30(%rsp)
cmpq 0x10(%rbx), %rcx
jge 0xa6f93
movq %r14, %rdi
leaq 0x8cc9d(%rip), %rsi     # 0x133943
movq %rax, 0x38(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movl $0x1, %esi
callq 0xe8a15
movq (%rbx), %r12
movq 0x10(%rbx), %rax
movq %r12, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq %r14, %rdi
callq 0xf6410
movq %rax, %r13
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
movq %r12, %rsi
callq 0xeeff3
leaq 0x4(%r12), %rbp
movq %r14, %rdi
leaq 0x84061(%rip), %rsi     # 0x12ad5d
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeeff3
leaq 0x8(%r12), %rbp
movq %r14, %rdi
leaq 0x8cc51(%rip), %rsi     # 0x133975
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeeff3
movq %rax, %rbx
leaq 0xc(%r12), %rbp
movq %rbp, 0x10(%rsp)
movq %r14, %rdi
leaq 0x8cc2e(%rip), %rsi     # 0x133982
movl %ebx, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x1, %rbx
jne 0xa6d8f
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
movq %rbp, %rsi
callq 0xeeff3
addq $0x10, %r12
movq %r12, 0x10(%rsp)
movq %r14, %rdi
leaq 0x8cc07(%rip), %rsi     # 0x13398d
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x10(%rsp), %rbp
movq %rbp, %rcx
callq 0xa7614
cmpq $0x0, 0x10(%r13)
jle 0xa6dc8
movq %r13, %rdi
callq 0xf705c
movq %r14, %rdi
leaq 0x7b9bd(%rip), %rsi     # 0x12277b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r13, %rdi
callq 0xf6423
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
movq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0xeeff3
addq $0x4, %r12
movq %r14, %rdi
leaq 0x8d784(%rip), %rsi     # 0x134577
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
xorl %ebx, %ebx
leaq (%r12,%rbx), %rsi
movq 0x18(%r14), %rdi
movl 0x4(%r15), %edx
callq 0xef033
movq %rax, 0x40(%rsp,%rbx,2)
addq $0x4, %rbx
cmpq $0x10, %rbx
jne 0xa6dfe
addq %rbx, %r12
movq %r12, 0x10(%rsp)
movl 0x40(%rsp), %ecx
movl 0x48(%rsp), %r8d
movl 0x50(%rsp), %r9d
movl 0x58(%rsp), %eax
movl %eax, (%rsp)
movq %r14, %rdi
leaq 0x8cb1c(%rip), %rsi     # 0x133961
leaq 0x7c520(%rip), %rdx     # 0x12336c
xorl %eax, %eax
callq 0xe8617
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa7614
movq %r13, %rdi
callq 0xf6423
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa7614
movq %r13, %rdi
callq 0xf6423
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa7614
movq %r13, %rdi
callq 0xf6423
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa7614
movq %r13, %rdi
callq 0xf6423
incq 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa7614
movq %r13, %rdi
callq 0xf6423
movq 0x10(%rsp), %rbx
movq 0x20(%rsp), %r12
addq $0xc, %rbx
movq %rbx, 0x10(%rsp)
movq %r13, %rdi
callq 0xf6753
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x18(%rsp), %rax
movq %r12, %rcx
subq %rax, %rcx
jle 0xa6f17
cmpq %r12, %rbx
jg 0xa6f19
subq %rax, %rbx
movq %rbx, %rcx
jmp 0xa6f19
xorl %ecx, %ecx
movq 0x30(%rsp), %rbx
addq (%rbx), %rcx
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
incq %rax
cmpq 0x28(%rsp), %rax
jne 0xa6c92
cmpq 0x10(%rbx), %rcx
jge 0xa6fab
leaq 0x8ca0f(%rip), %r8      # 0x133953
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0xa7748
jmp 0xa6fab
addq $-0x7, %r12
cmpq $0x1, %r12
ja 0xa6fb5
addq $0x4, (%rbx)
leaq 0x9e142(%rip), %r8      # 0x1450b0
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa7748
xorl %edi, %edi
jmp 0xa6fb0
leaq 0x8c985(%rip), %rsi     # 0x13391f
movq %r14, %rdi
movq 0x28(%rsp), %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
movq 0x8(%rsp), %rdi
callq 0xf6753
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq