	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _rs_rekey
__rs_rekey:                             ## @_rs_rekey
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_rsx@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax), %rdi
	movl	$8, %r15d
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	(%r12), %rdi
	movq	(%rdi), %rdx
	addq	$8, %rdi
	movq	%rdx, %rsi
	movl	$8, %ecx
	callq	_chacha_encrypt_bytes
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.1:
	movq	_KEYSZ@GOTPCREL(%rip), %rax
	movq	_IVSZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	addl	(%rax), %esi
	movq	%r14, %rdi
	callq	_arc4_min
	testq	%rax, %rax
	je	LBB0_17
## %bb.2:
	movq	(%r12), %rcx
	movq	(%rcx), %rcx
	cmpq	$8, %rax
	jb	LBB0_3
## %bb.4:
	leaq	(%rbx,%rax,4), %rdx
	cmpq	%rdx, %rcx
	jae	LBB0_7
## %bb.5:
	leaq	(%rcx,%rax,4), %rdx
	cmpq	%rbx, %rdx
	jbe	LBB0_7
LBB0_3:
	xorl	%edx, %edx
LBB0_13:
	movq	%rdx, %r8
	notq	%r8
	addq	%rax, %r8
	movq	%rax, %rdi
	andq	$3, %rdi
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %esi
	xorl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	decq	%rdi
	jne	LBB0_14
LBB0_15:
	cmpq	$3, %r8
	jb	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %esi
	xorl	%esi, (%rcx,%rdx,4)
	movl	4(%rbx,%rdx,4), %esi
	xorl	%esi, 4(%rcx,%rdx,4)
	movl	8(%rbx,%rdx,4), %esi
	xorl	%esi, 8(%rcx,%rdx,4)
	movl	12(%rbx,%rdx,4), %esi
	xorl	%esi, 12(%rcx,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_16
	jmp	LBB0_17
LBB0_7:
	movq	%rax, %rdx
	andq	$-8, %rdx
	leaq	-8(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.8:
	movq	%r8, %rdi
	andq	$-2, %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rbx,%rsi,4), %xmm0
	movups	16(%rbx,%rsi,4), %xmm1
	movups	(%rcx,%rsi,4), %xmm2
	xorps	%xmm0, %xmm2
	movups	16(%rcx,%rsi,4), %xmm0
	xorps	%xmm1, %xmm0
	movups	32(%rcx,%rsi,4), %xmm1
	movups	48(%rcx,%rsi,4), %xmm3
	movups	%xmm2, (%rcx,%rsi,4)
	movups	%xmm0, 16(%rcx,%rsi,4)
	movups	32(%rbx,%rsi,4), %xmm0
	xorps	%xmm1, %xmm0
	movups	48(%rbx,%rsi,4), %xmm1
	xorps	%xmm3, %xmm1
	movups	%xmm0, 32(%rcx,%rsi,4)
	movups	%xmm1, 48(%rcx,%rsi,4)
	addq	$16, %rsi
	addq	$-2, %rdi
	jne	LBB0_9
## %bb.10:
	testb	$1, %r8b
	je	LBB0_12
LBB0_11:
	movups	(%rbx,%rsi,4), %xmm0
	movups	16(%rbx,%rsi,4), %xmm1
	movups	(%rcx,%rsi,4), %xmm2
	xorps	%xmm0, %xmm2
	movups	16(%rcx,%rsi,4), %xmm0
	xorps	%xmm1, %xmm0
	movups	%xmm2, (%rcx,%rsi,4)
	movups	%xmm0, 16(%rcx,%rsi,4)
LBB0_12:
	cmpq	%rdx, %rax
	jne	LBB0_13
LBB0_17:
	movq	(%r12), %rax
	movq	(%rax), %rdi
	movq	_KEYSZ@GOTPCREL(%rip), %rbx
	movq	_IVSZ@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	addl	(%rbx), %esi
	callq	__rs_init
	movq	(%r12), %rax
	movq	(%rax), %rdi
	movl	(%r14), %edx
	addl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_memset
	movl	(%rbx), %eax
	addl	(%r14), %eax
	subl	%eax, %r15d
	movq	_rs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r15d, (%rax)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	xorl	%esi, %esi
	testb	$1, %r8b
	jne	LBB0_11
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_rsx,8,3                        ## @rsx
	.comm	_KEYSZ,4,2                      ## @KEYSZ
	.comm	_IVSZ,4,2                       ## @IVSZ
	.comm	_rs,8,3                         ## @rs
	.no_dead_strip	__rs_rekey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _rs_rekey
__rs_rekey:                             ; @_rs_rekey
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _rsx@GOTPAGE
Lloh1:
	ldr	x22, [x22, _rsx@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x0, [x8]
	mov	w21, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x0, [x22]
	ldr	x1, [x0], #8
	mov	x2, x1
	mov	w3, #8
	bl	_chacha_encrypt_bytes
Lloh2:
	adrp	x23, _KEYSZ@GOTPAGE
Lloh3:
	ldr	x23, [x23, _KEYSZ@GOTPAGEOFF]
Lloh4:
	adrp	x24, _IVSZ@GOTPAGE
Lloh5:
	ldr	x24, [x24, _IVSZ@GOTPAGEOFF]
	cbz	x19, LBB0_10
; %bb.1:
	ldr	w8, [x23]
	ldr	w9, [x24]
	add	w1, w9, w8
	mov	x0, x20
	bl	_arc4_min
	cbz	x0, LBB0_10
; %bb.2:
	ldr	x8, [x22]
	ldr	x8, [x8]
	cmp	x0, #16
	b.lo	LBB0_7
; %bb.3:
	lsl	x9, x0, #2
	add	x10, x8, x9
	add	x9, x19, x9
	cmp	x8, x9
	ccmp	x10, x19, #0, lo
	b.hi	LBB0_7
; %bb.4:
	and	x9, x0, #0xfffffffffffffff0
	add	x10, x19, #32
	add	x11, x8, #32
	mov	x12, x9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x10, #-32]
	ldp	q2, q3, [x10], #64
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11]
	eor.16b	v0, v4, v0
	eor.16b	v1, v5, v1
	eor.16b	v2, v6, v2
	eor.16b	v3, v7, v3
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x12, x12, #16
	b.ne	LBB0_5
; %bb.6:
	cmp	x0, x9
	b.ne	LBB0_8
	b	LBB0_10
LBB0_7:
	mov	x9, #0
LBB0_8:
	sub	x10, x0, x9
	lsl	x9, x9, #2
	add	x8, x8, x9
	add	x9, x19, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	ldr	w12, [x8]
	eor	w11, w12, w11
	str	w11, [x8], #4
	subs	x10, x10, #1
	b.ne	LBB0_9
LBB0_10:
	ldr	x8, [x22]
	ldr	x0, [x8]
	ldr	w8, [x23]
	ldr	w9, [x24]
	add	w1, w9, w8
	bl	__rs_init
	ldr	x8, [x22]
	ldr	x0, [x8]
	ldr	w8, [x23]
	ldr	w9, [x24]
	add	w2, w9, w8
	mov	w1, #0
	bl	_memset
	ldr	w8, [x23]
	ldr	w9, [x24]
	add	w8, w8, w9
	sub	w8, w21, w8
Lloh6:
	adrp	x9, _rs@GOTPAGE
Lloh7:
	ldr	x9, [x9, _rs@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	w8, [x9]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_rsx,8,3                        ; @rsx
	.comm	_KEYSZ,4,2                      ; @KEYSZ
	.comm	_IVSZ,4,2                       ; @IVSZ
	.comm	_rs,8,3                         ; @rs
	.no_dead_strip	__rs_rekey
.subsections_via_symbols
