	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdev_read
_vdev_read:                             ## @vdev_read
	.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	_DEV_BSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %r14
	leaq	-1(%r14), %rax
	testl	%edx, %eax
	jne	LBB0_3
## %bb.2:
	movq	%r8, %r13
	testq	%r8, %rax
	je	LBB0_5
LBB0_3:
	movl	$-1, %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rcx, %r15
	movl	%edx, %r12d
	movq	%rsi, %rcx
	movl	(%rsi), %ebx
	movq	_DEV_GELIBOOT_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %edi
	callq	_rounddown2
	testq	%r13, %r13
	je	LBB0_15
## %bb.6:
	movl	%eax, %ecx
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, %eax
	cltd
	idivl	%r14d
	addl	%eax, %ebx
	movq	_DEV_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, %r12d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	(%rax), %r12d
	subl	%r12d, %ebx
	imull	%edi, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%edi, %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r15
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r15d
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_READ_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%ebx, %eax
	cltd
	idivl	%edi
	cmpl	%r15d, %eax
	cmovbl	%eax, %r15d
	imull	%r15d, %edi
	addl	%ebx, %edi
	movq	_DEV_GELIBOOT_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_roundup2
	cltd
	movq	_DEV_BSIZE@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movl	%eax, %r14d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %ecx
	testl	%ecx, %ecx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	jle	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%r14d, %eax
	addl	%r12d, %eax
	addl	(%rdi), %ecx
	cmpl	%ecx, %eax
	jbe	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	subl	%r12d, %ecx
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_printf
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %r14d
	subl	%r12d, %r14d
	addl	(%rdi), %r14d
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_dmadat@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax), %rsi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	callq	_drvread
	testq	%rax, %rax
	jne	LBB0_3
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rbx), %rax
	movslq	-52(%rbp), %rsi                 ## 4-byte Folded Reload
	addq	(%rax), %rsi
	movq	_DEV_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	imull	%r15d, %edx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_memcpy
	movq	_DEV_BSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	imull	%edi, %r15d
	addq	%r15, %rbx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	addl	%r14d, %r12d
	xorl	%ebx, %ebx
	subq	%r15, %r13
	jne	LBB0_7
	jmp	LBB0_4
LBB0_15:
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_DEV_BSIZE,4,2                  ## @DEV_BSIZE
	.comm	_DEV_GELIBOOT_BSIZE,4,2         ## @DEV_GELIBOOT_BSIZE
	.comm	_READ_BUF_SIZE,4,2              ## @READ_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Shortening read at %lld from %d to %lld\n"

	.comm	_dmadat,8,3                     ## @dmadat
	.no_dead_strip	_vdev_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdev_read
_vdev_read:                             ; @vdev_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x25, _DEV_BSIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DEV_BSIZE@GOTPAGEOFF]
	ldrsw	x23, [x25]
	sub	x8, x23, #1
	tst	w8, w2
	b.ne	LBB0_2
; %bb.1:
	mov	x19, x4
	tst	x8, x4
	b.eq	LBB0_4
LBB0_2:
	mov	w0, #-1
LBB0_3:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	ldr	w24, [x1]
Lloh2:
	adrp	x8, _DEV_GELIBOOT_BSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DEV_GELIBOOT_BSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x2
	bl	_rounddown2
	cbz	x19, LBB0_11
; %bb.5:
	sdiv	w8, w22, w23
	add	w9, w24, w8
	ldr	w10, [x21]
	ldr	w8, [x25]
	sdiv	w11, w0, w8
	add	w22, w10, w11
	sub	w9, w9, w22
	mul	w23, w9, w8
Lloh5:
	adrp	x27, _READ_BUF_SIZE@GOTPAGE
Lloh6:
	ldr	x27, [x27, _READ_BUF_SIZE@GOTPAGEOFF]
Lloh7:
	adrp	x28, _dmadat@GOTPAGE
Lloh8:
	ldr	x28, [x28, _dmadat@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x9, w8
	ldr	w10, [x27]
	sub	w10, w10, w23
	sdiv	w10, w10, w8
	udiv	x9, x19, x9
	cmp	w10, w9
	csel	w26, w10, w9, lo
	madd	w0, w26, w8, w23
Lloh9:
	adrp	x8, _DEV_GELIBOOT_BSIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEV_GELIBOOT_BSIZE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_roundup2
	ldr	w9, [x25]
	ldr	w8, [x21, #4]
	sdiv	w24, w0, w9
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w9, w24, w22
	ldr	w10, [x21]
	add	w8, w10, w8
	cmp	w9, w8
	b.ls	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w3, w8, w22
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	mov	x2, x24
	bl	_printf
	ldp	w9, w8, [x21]
	sub	w8, w8, w22
	add	w24, w8, w9
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x28]
	ldr	x1, [x8]
	mov	x0, x21
	mov	x2, x22
	mov	x3, x24
	bl	_drvread
	cbnz	x0, LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x28]
	ldr	x8, [x8]
	add	x1, x8, w23, sxtw
	ldr	w8, [x25]
	mul	w2, w8, w26
	mov	x0, x20
	bl	_memcpy
	mov	w23, #0
	mov	w0, #0
	ldr	w8, [x25]
	mul	w9, w8, w26
	add	x20, x20, x9
	add	w22, w24, w22
	subs	x19, x19, x9
	b.ne	LBB0_6
	b	LBB0_3
LBB0_11:
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DEV_BSIZE,4,2                  ; @DEV_BSIZE
	.comm	_DEV_GELIBOOT_BSIZE,4,2         ; @DEV_GELIBOOT_BSIZE
	.comm	_READ_BUF_SIZE,4,2              ; @READ_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Shortening read at %lld from %d to %lld\n"

	.comm	_dmadat,8,3                     ; @dmadat
	.no_dead_strip	_vdev_read
.subsections_via_symbols
