	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_read2                      ## -- Begin function kvm_read2
	.p2align	4, 0x90
_kvm_read2:                             ## @kvm_read2
	.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
	je	LBB0_4
## %bb.1:
	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_12
## %bb.2:
	cmpq	$0, (%r14)
	je	LBB0_12
## %bb.3:
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	__kvm_err
	movl	$-1, %r12d
	jmp	LBB0_21
LBB0_4:
	movq	%r12, %rax
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.5:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>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_16
## %bb.7:                               ##   in Loop: Header=BB0_6 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_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_17
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	cmpl	%ebx, %r14d
	cmovgel	%ebx, %r14d
	movl	4(%r15), %edi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_read
	testl	%eax, %eax
	js	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %ecx
	addq	%rcx, %r12
	addl	%eax, %r13d
	subq	%rcx, %rbx
	jne	LBB0_6
	jmp	LBB0_20
LBB0_12:
	movl	16(%r15), %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_read
	testl	%eax, %eax
	js	LBB0_15
## %bb.13:
	movl	%eax, %r12d
	cmpl	%ebx, %eax
	jge	LBB0_21
## %bb.14:
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	__kvm_err
	jmp	LBB0_21
LBB0_15:
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	__kvm_syserr
LBB0_16:
	movl	$-1, %r12d
	jmp	LBB0_21
LBB0_17:
	movq	__PATH_MEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	jmp	LBB0_19
LBB0_18:
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
LBB0_19:
	callq	__kvm_syserr
LBB0_20:
	subl	-56(%rbp), %r12d                ## 4-byte Folded Reload
LBB0_21:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid address (0x%jx)"

L_.str.1:                               ## @.str.1
	.asciz	"kvm_read"

L_.str.2:                               ## @.str.2
	.asciz	"short read"

	.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_read2                      ; -- Begin function kvm_read2
	.p2align	2
_kvm_read2:                             ; @kvm_read2
	.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
	cbz	x0, LBB0_5
; %bb.1:
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_12
; %bb.2:
	ldr	w0, [x19, #16]
	mov	x1, x20
	mov	x2, x21
	bl	_read
	tbnz	w0, #31, LBB0_13
; %bb.3:
	mov	x20, x0
	cmp	w0, w21
	b.ge	LBB0_19
; %bb.4:
	ldr	w1, [x19]
Lloh2:
	adrp	x2, l_.str.2@PAGE
Lloh3:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	__kvm_err
	b	LBB0_19
LBB0_5:
	mov	x23, x20
	cbz	x21, LBB0_18
; %bb.6:
Lloh4:
	adrp	x25, _errno@GOTPAGE
Lloh5:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
	mov	x23, x20
LBB0_7:                                 ; =>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_14
; %bb.8:                                ;   in Loop: Header=BB0_7 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_15
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w24, w21
	csel	w2, w24, w21, lt
	ldr	w0, [x19, #4]
	mov	x1, x23
	bl	_read
	tbnz	w0, #31, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cbz	w0, LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w8, w0
	add	x23, x23, x8
	add	w22, w0, w22
	subs	x21, x21, x8
	b.ne	LBB0_7
	b	LBB0_18
LBB0_12:
	str	x22, [sp]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	__kvm_err
	mov	w20, #-1
	b	LBB0_19
LBB0_13:
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	__kvm_syserr
LBB0_14:
	mov	w20, #-1
	b	LBB0_19
LBB0_15:
Lloh10:
	adrp	x8, __PATH_MEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, __PATH_MEM@GOTPAGEOFF]
Lloh12:
	ldr	x2, [x8]
	mov	x0, x19
	mov	w1, #0
	b	LBB0_17
LBB0_16:
	ldr	w1, [x19]
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
LBB0_17:
	bl	__kvm_syserr
LBB0_18:
	sub	w20, w23, w20
LBB0_19:
	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 AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid address (0x%jx)"

l_.str.1:                               ; @.str.1
	.asciz	"kvm_read"

l_.str.2:                               ; @.str.2
	.asciz	"short read"

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