	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function ScspConvert32uto16s
LCPI0_0:
	.long	4294934528                      ## 0xffff8000
	.long	4294934528                      ## 0xffff8000
	.space	4
	.space	4
LCPI0_1:
	.long	32767                           ## 0x7fff
	.long	32767                           ## 0x7fff
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_ScspConvert32uto16s
	.p2align	4, 0x90
_ScspConvert32uto16s:                   ## @ScspConvert32uto16s
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	testq	%rcx, %rcx
	jle	LBB0_14
## %bb.1:
	cmpq	$4, %rcx
	jae	LBB0_3
## %bb.2:
	xorl	%r10d, %r10d
	jmp	LBB0_4
LBB0_3:
	leaq	(%rdx,%rcx,8), %r8
	leaq	(%rdi,%rcx,4), %rax
	cmpq	%rdx, %rax
	seta	%r11b
	leaq	(%rsi,%rcx,4), %rax
	cmpq	%rdi, %r8
	seta	%bl
	cmpq	%rdx, %rax
	seta	%r9b
	cmpq	%rsi, %r8
	seta	%r8b
	xorl	%r10d, %r10d
	testb	%bl, %r11b
	jne	LBB0_4
## %bb.5:
	andb	%r8b, %r9b
	jne	LBB0_4
## %bb.6:
	movq	%rcx, %r10
	andq	$-4, %r10
	leaq	(%rdi,%r10,4), %r8
	leaq	(%rdx,%r10,8), %r11
	leaq	(%rsi,%r10,4), %r9
	xorl	%eax, %eax
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = <4294934528,4294934528,u,u>
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = <32767,32767,u,u>
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdi,%rax,4), %xmm2            ## xmm2 = mem[0],zero
	movq	8(%rdi,%rax,4), %xmm3           ## xmm3 = mem[0],zero
	pmaxsd	%xmm0, %xmm2
	pmaxsd	%xmm0, %xmm3
	pminsd	%xmm1, %xmm2
	pminsd	%xmm1, %xmm3
	movq	(%rsi,%rax,4), %xmm4            ## xmm4 = mem[0],zero
	movq	8(%rsi,%rax,4), %xmm5           ## xmm5 = mem[0],zero
	pmaxsd	%xmm0, %xmm4
	pmaxsd	%xmm0, %xmm5
	pminsd	%xmm1, %xmm4
	punpckldq	%xmm4, %xmm2            ## xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
	pminsd	%xmm1, %xmm5
	punpckldq	%xmm5, %xmm3            ## xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
	movdqu	%xmm2, (%rdx,%rax,8)
	movdqu	%xmm3, 16(%rdx,%rax,8)
	addq	$4, %rax
	cmpq	%rax, %r10
	jne	LBB0_7
## %bb.8:
	cmpq	%rcx, %r10
	jne	LBB0_9
	jmp	LBB0_14
LBB0_4:
	movq	%rdi, %r8
	movq	%rdx, %r11
	movq	%rsi, %r9
LBB0_9:
	movq	%r10, %rdx
	notq	%rdx
	testb	$1, %cl
	je	LBB0_11
## %bb.10:
	movl	(%r8), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	movl	$-32768, %esi                   ## imm = 0x8000
	cmovll	%esi, %eax
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	movl	$32767, %edi                    ## imm = 0x7FFF
	cmovgel	%edi, %eax
	movl	%eax, (%r11)
	addq	$4, %r8
	movl	(%r9), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	cmovgel	%eax, %esi
	cmpl	$32767, %esi                    ## imm = 0x7FFF
	cmovgel	%edi, %esi
	movl	%esi, 4(%r11)
	addq	$4, %r9
	addq	$8, %r11
	orq	$1, %r10
LBB0_11:
	addq	%rcx, %rdx
	je	LBB0_14
## %bb.12:
	subq	%r10, %rcx
	xorl	%edx, %edx
	movl	$-32768, %esi                   ## imm = 0x8000
	movl	$32767, %edi                    ## imm = 0x7FFF
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r8,%rdx,4), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	cmovll	%esi, %eax
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	cmovgel	%edi, %eax
	movl	%eax, (%r11,%rdx,8)
	movl	(%r9,%rdx,4), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	cmovll	%esi, %eax
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	cmovgel	%edi, %eax
	movl	%eax, 4(%r11,%rdx,8)
	movl	4(%r8,%rdx,4), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	cmovll	%esi, %eax
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	cmovgel	%edi, %eax
	movl	%eax, 8(%r11,%rdx,8)
	movl	4(%r9,%rdx,4), %eax
	cmpl	$-32767, %eax                   ## imm = 0x8001
	cmovll	%esi, %eax
	cmpl	$32767, %eax                    ## imm = 0x7FFF
	cmovgel	%edi, %eax
	movl	%eax, 12(%r11,%rdx,8)
	addq	$2, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_13
LBB0_14:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ScspConvert32uto16s            ; -- Begin function ScspConvert32uto16s
	.p2align	2
_ScspConvert32uto16s:                   ; @ScspConvert32uto16s
	.cfi_startproc
; %bb.0:
	cmp	x3, #1
	b.lt	LBB0_11
; %bb.1:
	cmp	x3, #8
	b.hs	LBB0_3
; %bb.2:
	mov	x11, #0
	b	LBB0_8
LBB0_3:
	mov	x11, #0
	add	x9, x2, x3, lsl #3
	lsl	x8, x3, #2
	add	x10, x0, x8
	add	x8, x1, x8
	cmp	x8, x2
	ccmp	x9, x1, #0, hi
	cset	w8, hi
	cmp	x9, x0
	ccmp	x10, x2, #0, hi
	b.hi	LBB0_8
; %bb.4:
	tbnz	w8, #0, LBB0_8
; %bb.5:
	and	x11, x3, #0xfffffffffffffff8
	lsl	x10, x11, #2
	add	x8, x0, x10
	add	x9, x2, x11, lsl #3
	add	x10, x1, x10
	add	x12, x1, #16
	add	x13, x2, #32
	add	x14, x0, #16
	mvni.4s	v0, #127, msl #8
	movi.4s	v1, #127, msl #8
	mov	x15, x11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q2, q3, [x14, #-16]
	smax.4s	v2, v2, v0
	smax.4s	v3, v3, v0
	smin.4s	v4, v2, v1
	ldp	q2, q6, [x12, #-16]
	smax.4s	v2, v2, v0
	smin.4s	v5, v2, v1
	smin.4s	v2, v3, v1
	sub	x16, x13, #32
	st2.4s	{ v4, v5 }, [x16]
	smax.4s	v4, v6, v0
	smin.4s	v3, v4, v1
	st2.4s	{ v2, v3 }, [x13]
	add	x12, x12, #32
	add	x13, x13, #64
	add	x14, x14, #32
	subs	x15, x15, #8
	b.ne	LBB0_6
; %bb.7:
	cmp	x11, x3
	b.ne	LBB0_9
	b	LBB0_11
LBB0_8:
	mov	x8, x0
	mov	x9, x2
	mov	x10, x1
LBB0_9:
	sub	x11, x3, x11
	mov	w12, #-32768
	mov	w13, #32767
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x8], #4
	cmn	w14, #8, lsl #12                ; =32768
	csel	w14, w14, w12, gt
	cmp	w14, w13
	csel	w14, w14, w13, lt
	str	w14, [x9]
	ldr	w14, [x10], #4
	cmn	w14, #8, lsl #12                ; =32768
	csel	w14, w14, w12, gt
	cmp	w14, w13
	csel	w14, w14, w13, lt
	str	w14, [x9, #4]
	add	x9, x9, #8
	subs	x11, x11, #1
	b.ne	LBB0_10
LBB0_11:
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
