	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_in_place
_encode_in_place:                       ## @encode_in_place
	.cfi_startproc
## %bb.0:
	testq	%rdx, %rdx
	je	LBB0_28
## %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, %r13
	movq	(%rdi), %r10
	movq	16(%rdi), %r12
	movl	8(%rdi), %r11d
	cmpq	$1, %rdx
	jne	LBB0_3
## %bb.2:
	xorl	%r8d, %r8d
LBB0_21:
	movq	%r8, %rbx
	notq	%rbx
	testb	$1, %r13b
	jne	LBB0_23
## %bb.22:
                                        ## implicit-def: $eax
	addq	%r13, %rbx
	jne	LBB0_25
	jmp	LBB0_27
LBB0_3:
	leaq	-1(%r13), %r9
	movl	$8, %edx
	movq	%r9, %rax
	mulq	%rdx
	seto	%r14b
	xorl	%r8d, %r8d
	cmpb	%r11b, %r9b
	ja	LBB0_21
## %bb.4:
	cmpq	$255, %r9
	ja	LBB0_21
## %bb.5:
	leal	(%r11,%r10), %r15d
	cmpb	%r9b, %r15b
	jb	LBB0_21
## %bb.6:
	cmpq	$255, %r9
	ja	LBB0_21
## %bb.7:
	movzbl	%r11b, %ebx
	leaq	(%r12,%rbx,8), %r9
	movq	%r9, %rbx
	subq	%rax, %rbx
	cmpq	%r9, %rbx
	ja	LBB0_21
## %bb.8:
	testb	%r14b, %r14b
	jne	LBB0_21
## %bb.9:
	movzbl	%r15b, %ebx
	leaq	(%r12,%rbx,8), %r9
	movq	%r9, %rbx
	subq	%rax, %rbx
	cmpq	%r9, %rbx
	ja	LBB0_21
## %bb.10:
	testb	%r14b, %r14b
	jne	LBB0_21
## %bb.11:
	leaq	(%rsi,%r13,8), %r9
	movzbl	%r11b, %edx
	leaq	1(%rdx), %rbx
	subq	%r13, %rbx
	leaq	(%r12,%rbx,8), %r15
	leaq	(%r12,%rdx,8), %r14
	addq	$8, %r14
	leal	(%r10,%r11), %ebx
	movzbl	%bl, %ebx
	leaq	1(%rbx), %rdx
	subq	%r13, %rdx
	leaq	(%r12,%rdx,8), %rdx
	leaq	(%r12,%rbx,8), %rax
	addq	$8, %rax
	cmpq	%rsi, %r14
	seta	-41(%rbp)                       ## 1-byte Folded Spill
	cmpq	%r9, %r15
	setb	%cl
	cmpq	%rsi, %rax
	seta	%bl
	cmpq	%r9, %rdx
	setb	%r9b
	cmpq	%rax, %r15
	setb	%al
	cmpq	%r14, %rdx
	setb	%r14b
	xorl	%r8d, %r8d
	testb	%cl, -41(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_21
## %bb.12:
	andb	%r9b, %bl
	jne	LBB0_21
## %bb.13:
	andb	%r14b, %al
	jne	LBB0_21
## %bb.14:
	movq	%r13, %r8
	andq	$-2, %r8
	leaq	-2(%r8), %rax
	movq	%rax, %r9
	shrq	%r9
	incq	%r9
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	%r9, %r14
	andq	$-2, %r14
	xorl	%eax, %eax
	movl	%r11d, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r10,%rbx), %ecx
	movzbl	%cl, %ecx
	movdqu	-8(%r12,%rcx,8), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	(%rsi,%rax,8), %xmm1
	movzbl	%bl, %ecx
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	movdqu	%xmm1, -8(%r12,%rcx,8)
	movdqu	(%rsi,%rax,8), %xmm1
	psubq	%xmm0, %xmm1
	movdqu	16(%rsi,%rax,8), %xmm0
	movdqu	%xmm1, (%rsi,%rax,8)
	leal	-2(%rbx), %r15d
	leal	-2(%r10,%rbx), %ecx
	movzbl	%cl, %ecx
	movdqu	-8(%r12,%rcx,8), %xmm1
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	movzbl	%r15b, %ecx
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	%xmm0, -8(%r12,%rcx,8)
	movdqu	16(%rsi,%rax,8), %xmm0
	psubq	%xmm1, %xmm0
	movdqu	%xmm0, 16(%rsi,%rax,8)
	addq	$4, %rax
	addl	$-4, %ebx
	addq	$-2, %r14
	jne	LBB0_17
## %bb.18:
	testb	$1, %r9b
	je	LBB0_20
LBB0_19:
	movl	%r11d, %ecx
	subl	%eax, %ecx
	leal	(%r10,%rcx), %ebx
	movzbl	%bl, %ebx
	movdqu	-8(%r12,%rbx,8), %xmm0
	pshufd	$78, %xmm0, %xmm0               ## xmm0 = xmm0[2,3,0,1]
	movdqu	(%rsi,%rax,8), %xmm1
	movzbl	%cl, %ecx
	pshufd	$78, %xmm1, %xmm1               ## xmm1 = xmm1[2,3,0,1]
	movdqu	%xmm1, -8(%r12,%rcx,8)
	movdqu	(%rsi,%rax,8), %xmm1
	psubq	%xmm0, %xmm1
	movdqu	%xmm1, (%rsi,%rax,8)
LBB0_20:
	subl	%r8d, %r11d
	movl	%r11d, %eax
	cmpq	%r13, %r8
	jne	LBB0_21
	jmp	LBB0_27
LBB0_23:
	leal	(%r10,%r11), %eax
	movzbl	%al, %eax
	movq	(%r12,%rax,8), %r9
	movq	(%rsi,%r8,8), %r14
	leal	-1(%r11), %eax
	movzbl	%r11b, %ecx
	movq	%r14, (%r12,%rcx,8)
	subq	%r9, (%rsi,%r8,8)
	orq	$1, %r8
	movl	%eax, %r11d
	addq	%r13, %rbx
	je	LBB0_27
LBB0_25:
	movl	%r11d, %eax
	.p2align	4, 0x90
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r10,%rax), %ecx
	movzbl	%cl, %ecx
	movq	(%r12,%rcx,8), %rcx
	movq	(%rsi,%r8,8), %rbx
	leal	-1(%rax), %r9d
	movzbl	%al, %edx
	movq	%rbx, (%r12,%rdx,8)
	subq	%rcx, (%rsi,%r8,8)
	leal	(%r10,%rax), %ecx
	decl	%ecx
	movzbl	%cl, %ecx
	movq	(%r12,%rcx,8), %rcx
	movq	8(%rsi,%r8,8), %rdx
	movzbl	%r9b, %ebx
	movq	%rdx, (%r12,%rbx,8)
	subq	%rcx, 8(%rsi,%r8,8)
	addl	$-2, %eax
	addq	$2, %r8
	cmpq	%r8, %r13
	jne	LBB0_26
LBB0_27:
	movl	%eax, 8(%rdi)
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
LBB0_28:
	retq
LBB0_15:
	xorl	%eax, %eax
	testb	$1, %r9b
	jne	LBB0_19
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_encode_in_place
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_in_place
_encode_in_place:                       ; @encode_in_place
	.cfi_startproc
; %bb.0:
	cbz	x2, LBB0_7
; %bb.1:
	ldr	x8, [x0]
	ldr	x9, [x0, #16]
	ldr	w11, [x0, #8]
	cmp	x2, #4
	b.hs	LBB0_8
; %bb.2:
	mov	x10, #0
LBB0_3:
	mov	x12, x11
LBB0_4:
	sub	x11, x2, x10
	add	x10, x1, x10, lsl #3
	mov	x13, x12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	w12, w8, w13
	and	x12, x12, #0xff
	ldr	x14, [x9, x12, lsl #3]
	ldr	x15, [x10]
	sub	w12, w13, #1
	and	w13, w13, #0xff
	str	x15, [x9, w13, uxtw #3]
	ldr	x13, [x10]
	sub	x13, x13, x14
	str	x13, [x10], #8
	mov	x13, x12
	subs	x11, x11, #1
	b.ne	LBB0_5
LBB0_6:
	str	w12, [x0, #8]
LBB0_7:
	ret
LBB0_8:
	mov	x10, #0
	sub	x13, x2, #1
	and	w14, w13, #0xff
	cmp	xzr, x13, lsr #61
	cset	w12, ne
	cmp	w14, w11, uxtb
	b.hi	LBB0_3
; %bb.9:
	cmp	x13, #255
	b.hi	LBB0_3
; %bb.10:
	add	w14, w11, w8
	and	w15, w14, #0xff
	cmp	w15, w13, uxtb
	b.lo	LBB0_3
; %bb.11:
	cmp	x13, #255
	b.hi	LBB0_3
; %bb.12:
	add	x15, x9, w11, uxtb #3
	lsl	x13, x13, #3
	sub	x16, x15, x13
	cmp	x16, x15
	b.hi	LBB0_3
; %bb.13:
	tbnz	w12, #0, LBB0_3
; %bb.14:
	add	x14, x9, w14, uxtb #3
	sub	x13, x14, x13
	cmp	x13, x14
	b.hi	LBB0_3
; %bb.15:
	tbnz	w12, #0, LBB0_3
; %bb.16:
	mov	x10, #0
	add	x14, x1, x2, lsl #3
	and	x12, x11, #0xff
	add	x13, x12, #1
	sub	x12, x13, x2
	add	x15, x9, x12, lsl #3
	add	w12, w8, w11
	and	x12, x12, #0xff
	add	x12, x12, #1
	sub	x16, x12, x2
	add	x16, x9, x16, lsl #3
	add	x17, x9, x12, lsl #3
	cmp	x17, x1
	ccmp	x16, x14, #2, hi
	cset	w12, lo
	cmp	x15, x17
	add	x17, x9, x13, lsl #3
	ccmp	x16, x17, #2, lo
	cset	w13, lo
	cmp	x15, x14
	ccmp	x17, x1, #0, lo
	b.hi	LBB0_3
; %bb.17:
	tbnz	w12, #0, LBB0_3
; %bb.18:
	tbnz	w13, #0, LBB0_3
; %bb.19:
	and	x10, x2, #0xfffffffffffffffc
	sub	w12, w11, w10
	add	x13, x1, #16
	mov	x14, x10
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	add	w15, w8, w11
	add	x15, x9, w15, uxtb #3
	ldur	q0, [x15, #-8]
	ext.16b	v0, v0, v0, #8
	ldur	q1, [x15, #-24]
	ext.16b	v1, v1, v1, #8
	ldp	q2, q3, [x13, #-16]
	and	w15, w11, #0xff
	add	x15, x9, w15, uxtw #3
	ext.16b	v4, v2, v2, #8
	stur	q4, [x15, #-8]
	ext.16b	v4, v3, v3, #8
	stur	q4, [x15, #-24]
	sub.2d	v0, v2, v0
	sub.2d	v1, v3, v1
	stp	q0, q1, [x13, #-16]
	add	x13, x13, #32
	sub	w11, w11, #4
	sub	x14, x14, #4
	cbnz	x14, LBB0_20
; %bb.21:
	cmp	x10, x2
	b.ne	LBB0_4
	b	LBB0_6
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_encode_in_place
.subsections_via_symbols
