	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_write                      ## -- Begin function kvm_write
	.p2align	4, 0x90
_kvm_write:                             ## @kvm_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
	movq	%rcx, %rbx
	movq	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %r15
	callq	_ISALIVE
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	cmpl	$0, 20(%r15)
	je	LBB0_17
LBB0_2:
	movq	%r15, %rdi
	callq	_ISALIVE
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	$0, (%r14)
	movl	16(%r15), %edi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_lseek
	cmpl	$-1, %eax
	jne	LBB0_14
## %bb.4:
	cmpq	$0, (%r14)
	je	LBB0_14
## %bb.5:
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
	movl	$-1, %r12d
	jmp	LBB0_24
LBB0_6:
	movq	%r12, %rax
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_23
## %bb.7:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	%r15, %rdi
	movl	%r13d, %esi
	leaq	-44(%rbp), %rdx
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_19
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r14d
	movq	_errno@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movl	4(%r15), %edi
	movl	-44(%rbp), %esi
	xorl	%edx, %edx
	callq	_lseek
	cmpl	$-1, %eax
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%ebx, %r14d
	cmovgel	%ebx, %r14d
	movl	4(%r15), %edi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_write
	testl	%eax, %eax
	js	LBB0_21
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	je	LBB0_23
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %ecx
	addq	%rcx, %r12
	addl	%eax, %r13d
	subq	%rcx, %rbx
	jne	LBB0_8
	jmp	LBB0_23
LBB0_14:
	movl	16(%r15), %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_write
	testl	%eax, %eax
	js	LBB0_18
## %bb.15:
	movl	%eax, %r12d
	movl	%eax, %eax
	cmpq	%rbx, %rax
	jae	LBB0_24
## %bb.16:
	movl	(%r15), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	__kvm_err
	jmp	LBB0_24
LBB0_17:
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	__kvm_err
	movl	$-1, %r12d
	jmp	LBB0_24
LBB0_18:
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	__kvm_syserr
LBB0_19:
	movl	$-1, %r12d
	jmp	LBB0_24
LBB0_20:
	movq	__PATH_MEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	jmp	LBB0_22
LBB0_21:
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
LBB0_22:
	callq	__kvm_syserr
LBB0_23:
	subl	-56(%rbp), %r12d                ## 4-byte Folded Reload
LBB0_24:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kvm_write not implemented for dead kernels"

	.comm	_errno,8,3                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"invalid address (%lx)"

L_.str.2:                               ## @.str.2
	.asciz	"kvm_write"

L_.str.3:                               ## @.str.3
	.asciz	"short write"

	.comm	__PATH_MEM,8,3                  ## @_PATH_MEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_write                      ; -- Begin function kvm_write
	.p2align	2
_kvm_write:                             ; @kvm_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_ISALIVE
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_15
LBB0_2:
	mov	x0, x19
	bl	_ISALIVE
	cbz	x0, LBB0_7
; %bb.3:
Lloh0:
	adrp	x23, _errno@GOTPAGE
Lloh1:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
	str	xzr, [x23]
	ldr	w0, [x19, #16]
	mov	x1, x22
	mov	w2, #0
	bl	_lseek
	ldr	x8, [x23]
	cmn	w0, #1
	ccmp	x8, #0, #4, eq
	b.ne	LBB0_14
; %bb.4:
	ldr	w0, [x19, #16]
	mov	x1, x20
	mov	x2, x21
	bl	_write
	tbnz	w0, #31, LBB0_17
; %bb.5:
	mov	x20, x0
	mov	w8, w0
	cmp	x8, x21
	b.hs	LBB0_23
; %bb.6:
	ldr	w1, [x19]
Lloh2:
	adrp	x2, l_.str.3@PAGE
Lloh3:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	__kvm_err
	b	LBB0_23
LBB0_7:
	mov	x23, x20
	cbz	x21, LBB0_22
; %bb.8:
Lloh4:
	adrp	x25, _errno@GOTPAGE
Lloh5:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
	mov	x23, x20
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x22
	blr	x8
	cbz	w0, LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x24, x0
	str	xzr, [x25]
	ldr	w0, [x19, #4]
	ldr	w1, [sp, #12]
	mov	w2, #0
	bl	_lseek
	ldr	x8, [x25]
	cmn	w0, #1
	ccmp	x8, #0, #4, eq
	b.ne	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w24, w21
	csel	w2, w24, w21, lt
	ldr	w0, [x19, #4]
	mov	x1, x23
	bl	_write
	tbnz	w0, #31, LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	cbz	w0, LBB0_22
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, w0
	add	x23, x23, x8
	add	w22, w0, w22
	subs	x21, x21, x8
	b.ne	LBB0_9
	b	LBB0_22
LBB0_14:
	str	x22, [sp]
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	b	LBB0_16
LBB0_15:
	ldr	w1, [x19]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
LBB0_16:
	bl	__kvm_err
	mov	w20, #-1
	b	LBB0_23
LBB0_17:
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	__kvm_syserr
LBB0_18:
	mov	w20, #-1
	b	LBB0_23
LBB0_19:
Lloh12:
	adrp	x8, __PATH_MEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, __PATH_MEM@GOTPAGEOFF]
Lloh14:
	ldr	x2, [x8]
	mov	x0, x19
	mov	w1, #0
	b	LBB0_21
LBB0_20:
	ldr	w1, [x19]
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
LBB0_21:
	bl	__kvm_syserr
LBB0_22:
	sub	w20, w23, w20
LBB0_23:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kvm_write not implemented for dead kernels"

	.comm	_errno,8,3                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"invalid address (%lx)"

l_.str.2:                               ; @.str.2
	.asciz	"kvm_write"

l_.str.3:                               ; @.str.3
	.asciz	"short write"

	.comm	__PATH_MEM,8,3                  ; @_PATH_MEM
.subsections_via_symbols
