	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hvc_write
_hvc_write:                             ## @hvc_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.3:
	cmpq	$0, (%r14)
	jle	LBB0_4
## %bb.5:
	movl	%edx, %ebx
	movq	%rsi, %r12
	leaq	24(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 8(%r14)
	jle	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_hvc_push
LBB0_7:
	testl	%ebx, %ebx
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_8
## %bb.9:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r14), %edi
	movl	16(%r14), %r13d
	subl	%edi, %r13d
	testl	%r13d, %r13d
	jle	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%ebx, %r13d
	cmovael	%ebx, %r13d
	addl	20(%r14), %edi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_memcpy
	addq	%r13, %r12
	addq	%r13, 8(%r14)
	addl	%r13d, %r15d
	movq	%r14, %rdi
	callq	_hvc_push
	subl	%r13d, %ebx
	jg	LBB0_10
	jmp	LBB0_12
LBB0_1:
	movq	_EPIPE@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_8:
	xorl	%r15d, %r15d
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	cmpq	$0, 8(%r14)
	je	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	callq	_hvc_kick
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPIPE,4,2                      ## @EPIPE
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_hvc_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hvc_write
_hvc_write:                             ; @hvc_write
	.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
	ldr	x19, [x0]
	cbz	x19, LBB0_8
; %bb.1:
	ldr	x8, [x19]
	cmp	x8, #0
	b.le	LBB0_9
; %bb.2:
	mov	x20, x2
	mov	x21, x1
	add	x22, x19, #24
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_hvc_push
LBB0_4:
	cmp	w20, #1
	b.lt	LBB0_11
; %bb.5:
	mov	w23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19, #16]
	ldr	w8, [x19, #8]
	sub	w9, w9, w8
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, w20
	csel	w24, w9, w20, lo
	ldr	w9, [x19, #20]
	add	w0, w9, w8
	mov	x1, x21
	mov	x2, x24
	bl	_memcpy
	sub	w20, w20, w24
	add	x21, x21, x24
	ldr	x8, [x19, #8]
	add	x8, x8, x24
	str	x8, [x19, #8]
	add	w23, w24, w23
	mov	x0, x19
	bl	_hvc_push
	cmp	w20, #0
	b.gt	LBB0_6
	b	LBB0_12
LBB0_8:
Lloh0:
	adrp	x8, _EPIPE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPIPE@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_11:
	mov	w23, #0
LBB0_12:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_14
; %bb.13:
	bl	_hvc_kick
LBB0_14:
	mov	x0, x23
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EPIPE,4,2                      ; @EPIPE
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_hvc_write
.subsections_via_symbols
