	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function hv_ringbuffer_write
LCPI0_0:
	.long	4                               ## 0x4
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_hv_ringbuffer_write
	.p2align	4, 0x90
_hv_ringbuffer_write:                   ## @hv_ringbuffer_write
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_1
LBB0_18:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_1:
	movq	%rsi, %r12
	movq	%rdi, %r14
	leaq	24(%rdi), %r15
	testl	%edx, %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	jle	LBB0_2
## %bb.3:
	movl	%edx, %eax
	cmpl	$9, %edx
	jae	LBB0_5
## %bb.4:
	movl	$4, %ebx
	xorl	%ecx, %ecx
	jmp	LBB0_8
LBB0_2:
	movl	$4, %ebx
	jmp	LBB0_10
LBB0_5:
	movl	%eax, %ecx
	andl	$7, %ecx
	testq	%rcx, %rcx
	movl	$8, %edx
	cmovneq	%rcx, %rdx
	movq	%rax, %rcx
	subq	%rdx, %rcx
	leaq	112(%r12), %rdx
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [4,0,0,0]
	movq	%rcx, %rsi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movd	-112(%rdx), %xmm2               ## xmm2 = mem[0],zero,zero,zero
	pinsrd	$1, -96(%rdx), %xmm2
	pinsrd	$2, -80(%rdx), %xmm2
	pinsrd	$3, -64(%rdx), %xmm2
	movd	-48(%rdx), %xmm3                ## xmm3 = mem[0],zero,zero,zero
	pinsrd	$1, -32(%rdx), %xmm3
	pinsrd	$2, -16(%rdx), %xmm3
	pinsrd	$3, (%rdx), %xmm3
	paddd	%xmm2, %xmm1
	paddd	%xmm3, %xmm0
	subq	$-128, %rdx
	addq	$-8, %rsi
	jne	LBB0_6
## %bb.7:
	paddd	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
LBB0_8:
	subq	%rcx, %rax
	shlq	$4, %rcx
	addq	%r12, %rcx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	addl	(%rcx), %ebx
	addq	$16, %rcx
	decq	%rax
	jne	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_hv_get_bytes_to_write
	cmpl	%ebx, %eax
	jle	LBB0_11
## %bb.14:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	$0, (%r14)
	movq	%r15, %rdi
	callq	_hv_get_next_write_location
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_17
## %bb.15:
	movl	%eax, %ebx
	shlq	$4, %rbx
	xorl	%r14d, %r14d
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12,%r14), %rdx
	movl	(%r12,%r14), %ecx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_hv_copyto_ringbuffer
	movl	%eax, %r13d
	addq	$16, %r14
	cmpq	%r14, %rbx
	jne	LBB0_16
LBB0_17:
	movq	%r15, %rdi
	callq	_hv_get_ring_bufferindices
	movl	%eax, -52(%rbp)
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	$4, %ecx
	callq	_hv_copyto_ringbuffer
	movl	%eax, %r12d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_virt_mb
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_hv_set_next_write_location
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_hv_signal_on_write
	cmpq	$0, 8(%r14)
	jne	LBB0_18
	jmp	LBB0_20
LBB0_11:
	incl	20(%r14)
	cmpl	$0, (%r14)
	jne	LBB0_13
## %bb.12:
	incl	16(%r14)
	movl	$1, (%r14)
LBB0_13:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_19:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function hv_ringbuffer_write
lCPI0_0:
	.long	4                               ; 0x4
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_hv_ringbuffer_write
	.p2align	2
_hv_ringbuffer_write:                   ; @hv_ringbuffer_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_20
LBB0_2:
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	add	x20, x0, #24
	cmp	w2, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w8, w22
	cmp	w22, #17
	b.hs	LBB0_6
; %bb.4:
	mov	x9, #0
	mov	w23, #4
	b	LBB0_9
LBB0_5:
	mov	w23, #4
	b	LBB0_11
LBB0_6:
	ands	x9, x8, #0xf
	mov	w10, #16
	csel	x9, x10, x9, eq
	sub	x9, x8, x9
Lloh2:
	adrp	x10, lCPI0_0@PAGE
Lloh3:
	ldr	q0, [x10, lCPI0_0@PAGEOFF]
	add	x11, x21, #128
	movi.2d	v1, #0000000000000000
	mov	x10, x9
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	x12, x11, #128
	sub	x13, x11, #64
	ld4.4s	{ v4, v5, v6, v7 }, [x12]
	ld4.4s	{ v16, v17, v18, v19 }, [x13]
	add	x12, x11, #256
	ld4.4s	{ v20, v21, v22, v23 }, [x11], #64
	ld4.4s	{ v24, v25, v26, v27 }, [x11]
	add.4s	v0, v4, v0
	add.4s	v1, v16, v1
	add.4s	v2, v20, v2
	add.4s	v3, v24, v3
	mov	x11, x12
	subs	x10, x10, #16
	b.ne	LBB0_7
; %bb.8:
	add.4s	v0, v1, v0
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w23, s0
LBB0_9:
	add	x10, x21, x9, lsl #4
	sub	x8, x8, x9
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x10], #16
	add	w23, w9, w23
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_hv_get_bytes_to_write
	cmp	w0, w23
	b.le	LBB0_17
; %bb.12:
	str	wzr, [x19]
	mov	x0, x20
	bl	_hv_get_next_write_location
	mov	x23, x0
	mov	x24, x0
	cmp	w22, #1
	b.lt	LBB0_15
; %bb.13:
	mov	w22, w22
	add	x21, x21, #8
	mov	x24, x23
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x21]
	ldur	w3, [x21, #-8]
	mov	x0, x20
	mov	x1, x24
	bl	_hv_copyto_ringbuffer
	mov	x24, x0
	add	x21, x21, #16
	subs	x22, x22, #1
	b.ne	LBB0_14
LBB0_15:
	mov	x0, x20
	bl	_hv_get_ring_bufferindices
	str	w0, [sp, #12]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x24
	mov	w3, #4
	bl	_hv_copyto_ringbuffer
	mov	x21, x0
	bl	_virt_mb
	mov	x0, x20
	mov	x1, x21
	bl	_hv_set_next_write_location
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x23
	mov	x1, x19
	bl	_hv_signal_on_write
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_1
; %bb.16:
	mov	w0, #0
	b	LBB0_21
LBB0_17:
	ldr	w8, [x19, #20]
	add	w8, w8, #1
	str	w8, [x19, #20]
	ldr	w8, [x19]
	cbnz	w8, LBB0_19
; %bb.18:
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	mov	w8, #1
	str	w8, [x19]
LBB0_19:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh4:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
