	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_and_encode
_copy_and_encode:                       ## @copy_and_encode
	.cfi_startproc
## %bb.0:
	testq	%rcx, %rcx
	je	LBB0_19
## %bb.1:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r8
	movq	(%rdi), %r10
	movq	16(%rdi), %r11
	movl	8(%rdi), %r14d
	cmpq	$1, %rcx
	jne	LBB0_5
LBB0_2:
	xorl	%r13d, %r13d
LBB0_3:
	movq	%r13, %rdx
	notq	%rdx
	testb	$1, %cl
	jne	LBB0_15
## %bb.4:
                                        ## implicit-def: $eax
	addq	%rcx, %rdx
	jne	LBB0_16
	jmp	LBB0_18
LBB0_5:
	leaq	-1(%rcx), %r9
	movl	$8, %edx
	movq	%r9, %rax
	mulq	%rdx
	seto	%r15b
	xorl	%r13d, %r13d
	cmpb	%r14b, %r9b
	ja	LBB0_3
## %bb.6:
	cmpq	$255, %r9
	ja	LBB0_3
## %bb.7:
	leal	(%r14,%r10), %r12d
	cmpb	%r9b, %r12b
	jb	LBB0_3
## %bb.8:
	cmpq	$255, %r9
	ja	LBB0_3
## %bb.9:
	movzbl	%r14b, %ebx
	leaq	(%r11,%rbx,8), %r9
	movq	%r9, %rbx
	subq	%rax, %rbx
	cmpq	%r9, %rbx
	ja	LBB0_3
## %bb.10:
	testb	%r15b, %r15b
	jne	LBB0_3
## %bb.11:
	movzbl	%r12b, %ebx
	leaq	(%r11,%rbx,8), %r9
	movq	%r9, %rbx
	subq	%rax, %rbx
	cmpq	%r9, %rbx
	ja	LBB0_3
## %bb.12:
	testb	%r15b, %r15b
	jne	LBB0_3
## %bb.13:
	leal	(%r10,%r14), %eax
	movzbl	%al, %eax
	leaq	(%r11,%rax,8), %rax
	movzbl	%r14b, %edx
	leaq	(%r11,%rdx,8), %rdx
	subq	%rdx, %rax
	cmpq	$16, %rax
	jb	LBB0_2
## %bb.20:
	movq	%rcx, %r13
	andq	$-2, %r13
	leaq	-2(%r13), %rax
	movq	%rax, %r9
	shrq	%r9
	incq	%r9
	testq	%rax, %rax
	je	LBB0_26
## %bb.21:
	movq	%r9, %r15
	andq	$-2, %r15
	xorl	%r12d, %r12d
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r10,%rbx), %eax
	movzbl	%al, %eax
	movdqu	-8(%r11,%rax,8), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	(%rsi,%r12,8), %xmm1
	movzbl	%bl, %eax
	pshufd	$78, %xmm1, %xmm2               ## xmm2 = xmm1[2,3,0,1]
	movdqu	%xmm2, -8(%r11,%rax,8)
	psubq	%xmm0, %xmm1
	movdqu	%xmm1, (%r8,%r12,8)
	leal	-2(%rbx), %edx
	leal	-2(%r10,%rbx), %eax
	movzbl	%al, %eax
	movdqu	-8(%r11,%rax,8), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	16(%rsi,%r12,8), %xmm1
	movzbl	%dl, %eax
	pshufd	$78, %xmm1, %xmm2               ## xmm2 = xmm1[2,3,0,1]
	movdqu	%xmm2, -8(%r11,%rax,8)
	psubq	%xmm0, %xmm1
	movdqu	%xmm1, 16(%r8,%r12,8)
	addq	$4, %r12
	addl	$-4, %ebx
	addq	$-2, %r15
	jne	LBB0_22
## %bb.23:
	testb	$1, %r9b
	je	LBB0_25
LBB0_24:
	movl	%r14d, %eax
	subl	%r12d, %eax
	leal	(%r10,%rax), %ebx
	movzbl	%bl, %ebx
	movdqu	-8(%r11,%rbx,8), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	(%rsi,%r12,8), %xmm1
	movzbl	%al, %eax
	pshufd	$78, %xmm1, %xmm2               ## xmm2 = xmm1[2,3,0,1]
	movdqu	%xmm2, -8(%r11,%rax,8)
	psubq	%xmm0, %xmm1
	movdqu	%xmm1, (%r8,%r12,8)
LBB0_25:
	subl	%r13d, %r14d
	movl	%r14d, %eax
	cmpq	%rcx, %r13
	jne	LBB0_3
	jmp	LBB0_18
LBB0_15:
	leal	(%r10,%r14), %eax
	movzbl	%al, %r9d
	movq	(%rsi,%r13,8), %r15
	leal	-1(%r14), %eax
	movq	%r15, %r12
	subq	(%r11,%r9,8), %r12
	movzbl	%r14b, %ebx
	movq	%r15, (%r11,%rbx,8)
	movq	%r12, (%r8,%r13,8)
	orq	$1, %r13
	movl	%eax, %r14d
	addq	%rcx, %rdx
	je	LBB0_18
LBB0_16:
	movl	%r14d, %eax
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r10,%rax), %ebx
	movzbl	%bl, %r14d
	movq	(%rsi,%r13,8), %rbx
	leal	-1(%rax), %r9d
	movzbl	%al, %r15d
	movq	%rbx, %rdx
	subq	(%r11,%r14,8), %rdx
	movq	%rbx, (%r11,%r15,8)
	movq	%rdx, (%r8,%r13,8)
	leal	(%r10,%rax), %edx
	decl	%edx
	movzbl	%dl, %r14d
	movq	8(%rsi,%r13,8), %rdx
	addl	$-2, %eax
	movzbl	%r9b, %r9d
	movq	%rdx, %rbx
	subq	(%r11,%r14,8), %rbx
	movq	%rdx, (%r11,%r9,8)
	movq	%rbx, 8(%r8,%r13,8)
	addq	$2, %r13
	cmpq	%r13, %rcx
	jne	LBB0_17
LBB0_18:
	movl	%eax, 8(%rdi)
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
LBB0_19:
	retq
LBB0_26:
	xorl	%r12d, %r12d
	testb	$1, %r9b
	jne	LBB0_24
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_copy_and_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_and_encode
_copy_and_encode:                       ; @copy_and_encode
	.cfi_startproc
; %bb.0:
	cbz	x3, LBB0_16
; %bb.1:
	ldr	x8, [x0]
	ldr	x9, [x0, #16]
	ldr	w11, [x0, #8]
	cmp	x3, #4
	b.lo	LBB0_11
; %bb.2:
	mov	x10, #0
	sub	x13, x3, #1
	and	w14, w13, #0xff
	cmp	xzr, x13, lsr #61
	cset	w12, ne
	cmp	w14, w11, uxtb
	b.hi	LBB0_12
; %bb.3:
	cmp	x13, #255
	b.hi	LBB0_12
; %bb.4:
	add	w14, w11, w8
	and	w15, w14, #0xff
	cmp	w15, w13, uxtb
	b.lo	LBB0_12
; %bb.5:
	cmp	x13, #255
	b.hi	LBB0_12
; %bb.6:
	add	x15, x9, w11, uxtb #3
	lsl	x13, x13, #3
	sub	x16, x15, x13
	cmp	x16, x15
	b.hi	LBB0_12
; %bb.7:
	tbnz	w12, #0, LBB0_12
; %bb.8:
	add	x14, x9, w14, uxtb #3
	sub	x13, x14, x13
	cmp	x13, x14
	b.hi	LBB0_12
; %bb.9:
	tbnz	w12, #0, LBB0_12
; %bb.10:
	add	w10, w8, w11
	lsl	w10, w10, #3
	and	x10, x10, #0x7f8
	add	x10, x10, x9
	lsl	w12, w11, #3
	and	x12, x12, #0x7f8
	add	x12, x9, x12
	sub	x10, x10, x12
	cmp	x10, #32
	b.hs	LBB0_17
LBB0_11:
	mov	x10, #0
LBB0_12:
	mov	x12, x11
LBB0_13:
	sub	x11, x3, x10
	lsl	x13, x10, #3
	add	x10, x2, x13
	add	x13, x1, x13
	mov	x14, x12
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w8, w14
	and	x12, x12, #0xff
	ldr	x15, [x9, x12, lsl #3]
	ldr	x16, [x13], #8
	and	w12, w14, #0xff
	str	x16, [x9, w12, uxtw #3]
	sub	w12, w14, #1
	sub	x14, x16, x15
	str	x14, [x10], #8
	mov	x14, x12
	subs	x11, x11, #1
	b.ne	LBB0_14
LBB0_15:
	str	w12, [x0, #8]
LBB0_16:
	ret
LBB0_17:
	and	x10, x3, #0xfffffffffffffffc
	sub	w12, w11, w10
	add	x13, x1, #16
	add	x14, x2, #16
	mov	x15, x10
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	w16, w8, w11
	add	x16, x9, w16, uxtb #3
	ldur	q0, [x16, #-8]
	ext.16b	v0, v0, v0, #8
	ldur	q1, [x16, #-24]
	ext.16b	v1, v1, v1, #8
	ldp	q2, q3, [x13, #-16]
	and	w16, w11, #0xff
	add	x16, x9, w16, uxtw #3
	ext.16b	v4, v2, v2, #8
	stur	q4, [x16, #-8]
	ext.16b	v4, v3, v3, #8
	stur	q4, [x16, #-24]
	sub.2d	v0, v2, v0
	sub.2d	v1, v3, v1
	stp	q0, q1, [x14, #-16]
	add	x13, x13, #32
	add	x14, x14, #32
	sub	w11, w11, #4
	sub	x15, x15, #4
	cbnz	x15, LBB0_18
; %bb.19:
	cmp	x10, x3
	b.ne	LBB0_13
	b	LBB0_15
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_copy_and_encode
.subsections_via_symbols
