	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function planarize_s16
_planarize_s16:                         ## @planarize_s16
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.1:
	cmpq	$4, %rdx
	jae	LBB0_3
## %bb.2:
	xorl	%eax, %eax
LBB0_12:
	movq	%rax, %r8
	notq	%r8
	testb	$1, %dl
	je	LBB0_14
## %bb.13:
	movl	(%rsi,%rax,8), %ecx
	movl	%ecx, (%rdi,%rax,4)
	movl	4(%rsi,%rax,8), %r9d
	leaq	(%rax,%rdx), %rcx
	movl	%r9d, (%rdi,%rcx,4)
	orq	$1, %rax
LBB0_14:
	addq	%rdx, %r8
	je	LBB0_17
## %bb.15:
	leaq	(%rdi,%rdx,4), %r8
	addq	$4, %r8
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,8), %ecx
	movl	%ecx, (%rdi,%rax,4)
	movl	4(%rsi,%rax,8), %ecx
	movl	%ecx, -4(%r8,%rax,4)
	movl	8(%rsi,%rax,8), %ecx
	movl	%ecx, 4(%rdi,%rax,4)
	movl	12(%rsi,%rax,8), %ecx
	movl	%ecx, (%r8,%rax,4)
	addq	$2, %rax
	cmpq	%rax, %rdx
	jne	LBB0_16
	jmp	LBB0_17
LBB0_3:
	leaq	(%rdi,%rdx,4), %rax
	leaq	(%rdi,%rdx,8), %r8
	leaq	(%rsi,%rdx,8), %rcx
	cmpq	%rcx, %rax
	setb	%r9b
	cmpq	%rsi, %r8
	seta	%r10b
	cmpq	%rdi, %rcx
	seta	%cl
	cmpq	%rsi, %rax
	seta	%r8b
	xorl	%eax, %eax
	testb	%r10b, %r9b
	jne	LBB0_12
## %bb.4:
	andb	%r8b, %cl
	jne	LBB0_12
## %bb.5:
	movq	%rdx, %rax
	andq	$-4, %rax
	leaq	-4(%rax), %rcx
	movq	%rcx, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.7:
	movq	%r8, %r9
	andq	$-2, %r9
	leaq	16(%rdi), %r10
	leaq	(%rdi,%rdx,4), %r11
	addq	$16, %r11
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rsi,%rcx,8), %xmm0
	movups	16(%rsi,%rcx,8), %xmm1
	movaps	%xmm0, %xmm2
	shufps	$136, %xmm1, %xmm2              ## xmm2 = xmm2[0,2],xmm1[0,2]
	shufps	$221, %xmm1, %xmm0              ## xmm0 = xmm0[1,3],xmm1[1,3]
	movups	%xmm2, -16(%r10,%rcx,4)
	movups	%xmm0, -16(%r11,%rcx,4)
	movups	32(%rsi,%rcx,8), %xmm0
	movups	48(%rsi,%rcx,8), %xmm1
	movaps	%xmm0, %xmm2
	shufps	$136, %xmm1, %xmm2              ## xmm2 = xmm2[0,2],xmm1[0,2]
	shufps	$221, %xmm1, %xmm0              ## xmm0 = xmm0[1,3],xmm1[1,3]
	movups	%xmm2, (%r10,%rcx,4)
	movups	%xmm0, (%r11,%rcx,4)
	addq	$8, %rcx
	addq	$-2, %r9
	jne	LBB0_8
## %bb.9:
	testb	$1, %r8b
	je	LBB0_11
LBB0_10:
	movups	(%rsi,%rcx,8), %xmm0
	movups	16(%rsi,%rcx,8), %xmm1
	movaps	%xmm0, %xmm2
	shufps	$136, %xmm1, %xmm2              ## xmm2 = xmm2[0,2],xmm1[0,2]
	shufps	$221, %xmm1, %xmm0              ## xmm0 = xmm0[1,3],xmm1[1,3]
	movups	%xmm2, (%rdi,%rcx,4)
	addq	%rdx, %rcx
	movups	%xmm0, (%rdi,%rcx,4)
LBB0_11:
	cmpq	%rdx, %rax
	jne	LBB0_12
LBB0_17:
	popq	%rbp
	retq
LBB0_6:
	xorl	%ecx, %ecx
	testb	$1, %r8b
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_planarize_s16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function planarize_s16
_planarize_s16:                         ; @planarize_s16
	.cfi_startproc
; %bb.0:
	cbz	x2, LBB0_10
; %bb.1:
	cmp	x2, #8
	b.hs	LBB0_3
; %bb.2:
	mov	x8, #0
	b	LBB0_8
LBB0_3:
	mov	x8, #0
	add	x10, x0, x2, lsl #2
	lsl	x11, x2, #3
	add	x12, x1, x11
	cmp	x12, x0
	ccmp	x10, x1, #0, hi
	cset	w9, hi
	add	x11, x0, x11
	cmp	x11, x1
	ccmp	x10, x12, #2, hi
	b.lo	LBB0_8
; %bb.4:
	tbnz	w9, #0, LBB0_8
; %bb.5:
	and	x8, x2, #0xfffffffffffffff8
	add	x9, x1, #32
	lsl	x10, x2, #2
	mov	x11, x8
	mov	x12, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x9, #32
	ld2.4s	{ v0, v1 }, [x13]
	ld2.4s	{ v2, v3 }, [x9]
	stp	q0, q2, [x12]
	add	x13, x12, x10
	stp	q1, q3, [x13]
	add	x9, x9, #64
	add	x12, x12, #32
	subs	x11, x11, #8
	b.ne	LBB0_6
; %bb.7:
	cmp	x8, x2
	b.eq	LBB0_10
LBB0_8:
	sub	x9, x2, x8
	add	x10, x8, x2
	add	x10, x0, x10, lsl #2
	add	x11, x0, x8, lsl #2
	add	x8, x1, x8, lsl #3
	add	x8, x8, #4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w12, [x8, #-4]
	str	w12, [x11], #4
	ldr	w12, [x8], #8
	str	w12, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_9
LBB0_10:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_planarize_s16
.subsections_via_symbols
