	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reorder_pixels_scalar
_reorder_pixels_scalar:                 ## @reorder_pixels_scalar
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$2, %edx
	jl	LBB0_19
## %bb.1:
	movl	%edx, %r9d
	shrl	$31, %r9d
	addl	%edx, %r9d
	sarl	%r9d
	movslq	%r9d, %rax
	leaq	(%rsi,%rax,4), %r11
	leal	-1(%rax), %r8d
	xorl	%edx, %edx
	cmpl	$3, %r8d
	jae	LBB0_2
LBB0_12:
	movl	%r9d, %eax
	subl	%edx, %eax
	movl	%edx, %r8d
	notl	%r8d
	addl	%r9d, %r8d
	testb	$3, %al
	je	LBB0_16
## %bb.13:
	movl	%r9d, %eax
	subb	%dl, %al
	movzbl	%al, %r10d
	andl	$3, %r10d
	shlq	$2, %r10
	xorl	%ebx, %ebx
	movq	%rdi, %rcx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rax
	movl	(%rsi,%rbx), %ecx
	movl	%ecx, (%rdi,%rbx,2)
	movl	(%r11,%rbx), %ecx
	movl	%ecx, 4(%rdi,%rbx,2)
	incl	%edx
	leaq	(%rdi,%rbx,2), %rcx
	addq	$8, %rcx
	addq	$4, %rbx
	cmpl	%ebx, %r10d
	jne	LBB0_14
## %bb.15:
	addq	$8, %rax
	addq	%rbx, %r11
	addq	%rbx, %rsi
	movq	%rax, %rdi
LBB0_16:
	cmpl	$3, %r8d
	jb	LBB0_19
## %bb.17:
	subl	%edx, %r9d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,4), %ecx
	movl	%ecx, (%rdi,%rax,8)
	movl	(%r11,%rax,4), %ecx
	movl	%ecx, 4(%rdi,%rax,8)
	movl	4(%rsi,%rax,4), %ecx
	movl	%ecx, 8(%rdi,%rax,8)
	movl	4(%r11,%rax,4), %ecx
	movl	%ecx, 12(%rdi,%rax,8)
	movl	8(%rsi,%rax,4), %ecx
	movl	%ecx, 16(%rdi,%rax,8)
	movl	8(%r11,%rax,4), %ecx
	movl	%ecx, 20(%rdi,%rax,8)
	movl	12(%rsi,%rax,4), %ecx
	movl	%ecx, 24(%rdi,%rax,8)
	movl	12(%r11,%rax,4), %ecx
	movl	%ecx, 28(%rdi,%rax,8)
	addq	$4, %rax
	cmpl	%eax, %r9d
	jne	LBB0_18
	jmp	LBB0_19
LBB0_2:
	leaq	(%rdi,%r8,8), %rbx
	addq	$8, %rbx
	leaq	(%rax,%r8), %rcx
	leaq	(%rsi,%rcx,4), %rcx
	addq	$4, %rcx
	leaq	(%rsi,%r8,4), %r10
	addq	$4, %r10
	cmpq	%rdi, %rcx
	seta	%r14b
	cmpq	%rbx, %r11
	setb	%r15b
	cmpq	%rdi, %r10
	seta	%cl
	cmpq	%rsi, %rbx
	seta	%bl
	testb	%r15b, %r14b
	jne	LBB0_12
## %bb.3:
	andb	%bl, %cl
	jne	LBB0_12
## %bb.4:
	incq	%r8
	movq	%r8, %rdx
	andq	$-4, %rdx
	leaq	-4(%rdx), %rcx
	movq	%rcx, %r10
	shrq	$2, %r10
	incq	%r10
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.6:
	movq	%r10, %rcx
	andq	$-2, %rcx
	leaq	(%rsi,%rax,4), %rbx
	addq	$24, %rbx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movsd	(%rsi,%rax,4), %xmm0            ## xmm0 = mem[0],zero
	movsd	8(%rsi,%rax,4), %xmm1           ## xmm1 = mem[0],zero
	movsd	-24(%rbx,%rax,4), %xmm2         ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm0                    ## xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
	movsd	-16(%rbx,%rax,4), %xmm2         ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm1                    ## xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
	movups	%xmm0, (%rdi,%rax,8)
	movups	%xmm1, 16(%rdi,%rax,8)
	movsd	16(%rsi,%rax,4), %xmm0          ## xmm0 = mem[0],zero
	movsd	24(%rsi,%rax,4), %xmm1          ## xmm1 = mem[0],zero
	movsd	-8(%rbx,%rax,4), %xmm2          ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm0                    ## xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
	movsd	(%rbx,%rax,4), %xmm2            ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm1                    ## xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
	movups	%xmm0, 32(%rdi,%rax,8)
	movups	%xmm1, 48(%rdi,%rax,8)
	addq	$8, %rax
	addq	$-2, %rcx
	jne	LBB0_7
## %bb.8:
	testb	$1, %r10b
	je	LBB0_10
LBB0_9:
	movsd	(%rsi,%rax,4), %xmm0            ## xmm0 = mem[0],zero
	movsd	8(%rsi,%rax,4), %xmm1           ## xmm1 = mem[0],zero
	movsd	(%r11,%rax,4), %xmm2            ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm0                    ## xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
	movsd	8(%r11,%rax,4), %xmm2           ## xmm2 = mem[0],zero
	unpcklps	%xmm2, %xmm1                    ## xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
	leaq	(,%rax,8), %rcx
	orq	$16, %rcx
	movups	%xmm0, (%rdi,%rax,8)
	movups	%xmm1, (%rdi,%rcx)
LBB0_10:
	cmpq	%rdx, %r8
	jne	LBB0_11
LBB0_19:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	(%rdi,%rdx,8), %rdi
	leaq	(%r11,%rdx,4), %r11
	leaq	(%rsi,%rdx,4), %rsi
	jmp	LBB0_12
LBB0_5:
	xorl	%eax, %eax
	testb	$1, %r10b
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_reorder_pixels_scalar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reorder_pixels_scalar
_reorder_pixels_scalar:                 ; @reorder_pixels_scalar
	.cfi_startproc
; %bb.0:
	cmp	w2, #0
	cinc	w8, w2, lt
	cmp	w2, #2
	b.lt	LBB0_11
; %bb.1:
	asr	w9, w8, #1
	add	x8, x1, w9, sxtw #2
	sub	w10, w9, #1
	cmp	w10, #7
	b.hs	LBB0_3
; %bb.2:
	mov	w11, #0
	b	LBB0_8
LBB0_3:
	mov	w11, #0
	sxtw	x14, w9
	add	x12, x0, w10, uxtw #3
	add	x13, x12, #8
	add	x12, x14, x10
	add	x12, x1, x12, lsl #2
	add	x15, x12, #4
	add	x12, x1, w10, uxtw #2
	add	x12, x12, #4
	cmp	x12, x0
	ccmp	x13, x1, #0, hi
	cset	w12, hi
	cmp	x8, x13
	ccmp	x15, x0, #0, lo
	b.hi	LBB0_8
; %bb.4:
	tbnz	w12, #0, LBB0_8
; %bb.5:
	add	x13, x10, #1
	and	x11, x13, #0x1fffffff8
	add	x10, x0, x11, lsl #3
	lsl	x12, x11, #2
	add	x8, x8, x12
	add	x12, x1, x12
	lsl	x14, x14, #2
	add	x15, x0, #32
	mov	x16, x11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x17, x1, x14
	ldp	q0, q2, [x1], #32
	ldp	q1, q3, [x17]
	sub	x17, x15, #32
	st2.4s	{ v0, v1 }, [x17]
	st2.4s	{ v2, v3 }, [x15]
	add	x15, x15, #64
	subs	x16, x16, #8
	b.ne	LBB0_6
; %bb.7:
	cmp	x13, x11
	b.ne	LBB0_9
	b	LBB0_11
LBB0_8:
	mov	x10, x0
	mov	x12, x1
LBB0_9:
	sub	w9, w9, w11
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x12], #4
	str	w11, [x10]
	ldr	w11, [x8], #4
	str	w11, [x10, #4]
	add	x10, x10, #8
	subs	w9, w9, #1
	b.ne	LBB0_10
LBB0_11:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_reorder_pixels_scalar
.subsections_via_symbols
