	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_memrw                          ## -- Begin function memrw
	.p2align	4, 0x90
_memrw:                                 ## @memrw
	.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	(%rsi), %rcx
	movl	$0, %r14d
	movq	%rcx, %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	jle	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%rbx), %r12d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	cltq
	subq	%rax, %rsi
	callq	_ulmin
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_dev2unit
	cmpl	$128, %eax
	je	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	cmpl	$129, %eax
	jne	LBB0_5
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r12d, %rdi
	movq	_DMAP_MIN_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	jl	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_dmaplimit@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	cmpl	%eax, %r12d
	jl	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%rbx), %ecx
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movq	_UIO_READ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_kernacc
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_pmap_extract
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_16
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_dmaplimit@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %edi
	callq	_PHYS_TO_DMAP
	movslq	%eax, %rdi
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_uiomove
	movl	%eax, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %rax
	movq	%rax, 24(%rbx)
	movq	8(%rbx), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, 8(%rbx)
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jg	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_panic
	jmp	LBB0_5
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_cpu_getmaxphyaddr
	cmpl	%eax, %r12d
	jle	LBB0_21
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_5
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r12d, %edi
	callq	_pmap_mapdev
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_uiomove
	movl	%eax, %r14d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r12d, %edi
	callq	_pmap_unmapdev
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	testq	%rax, %rax
	jle	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%r14d, %r14d
	je	LBB0_2
LBB0_7:
	cmpq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movl	$0, %eax
	cmovel	%r14d, %eax
	addq	$8, %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	"memrw"

	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_DMAP_MIN_ADDRESS,4,2           ## @DMAP_MIN_ADDRESS
	.comm	_dmaplimit,4,2                  ## @dmaplimit
	.comm	_UIO_READ,4,2                   ## @UIO_READ
	.comm	_VM_PROT_READ,4,2               ## @VM_PROT_READ
	.comm	_VM_PROT_WRITE,4,2              ## @VM_PROT_WRITE
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_memrw                          ; -- Begin function memrw
	.p2align	2
_memrw:                                 ; @memrw
	.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
	ldr	x24, [x1]
	cmp	x24, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x26, _PAGE_MASK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _PAGE_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x27, _dmaplimit@GOTPAGE
Lloh5:
	ldr	x27, [x27, _dmaplimit@GOTPAGEOFF]
Lloh6:
	adrp	x28, _EFAULT@GOTPAGE
Lloh7:
	ldr	x28, [x28, _EFAULT@GOTPAGEOFF]
Lloh8:
	adrp	x21, _DMAP_MIN_ADDRESS@GOTPAGE
Lloh9:
	ldr	x21, [x21, _DMAP_MIN_ADDRESS@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, #8
	str	x8, [x19, #24]
	ldr	x8, [x19, #8]
	sub	x9, x8, #1
	str	x9, [x19, #8]
	cmp	x8, #0
	b.le	LBB0_15
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w22, #0
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	cmp	x8, #1
	ccmp	w22, #0, #0, ge
	b.ne	LBB0_20
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x0, [x8]
	cbz	x0, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w23, [x19, #16]
	ldr	x8, [x25]
	ldr	w9, [x26]
	and	w9, w9, w23
	sub	x1, x8, w9, sxtw
	bl	_ulmin
	mov	x22, x0
	mov	x0, x20
	bl	_dev2unit
	cmp	w0, #128
	b.eq	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #129
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	sxtw	x0, w23
	ldr	w8, [x21]
	cmp	w23, w8
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x27]
	add	w8, w9, w8
	cmp	w23, w8
	b.lt	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x19, #20]
Lloh10:
	adrp	x9, _UIO_READ@GOTPAGE
Lloh11:
	ldr	x9, [x9, _UIO_READ@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh13:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh15:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
	mov	x1, x22
	bl	_kernacc
	cbz	w0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh17:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh18:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_pmap_extract
	mov	x23, x0
	cbz	w0, LBB0_17
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x27]
	cmp	w23, w8
	b.ge	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_PHYS_TO_DMAP
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x0, w0
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x22
	mov	x2, x19
	bl	_uiomove
	mov	x22, x0
	b	LBB0_4
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_cpu_getmaxphyaddr
	cmp	w23, w0
	b.le	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w22, [x28]
	b	LBB0_4
LBB0_18:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x25]
	mov	x0, x23
	bl	_pmap_mapdev
	mov	x23, x0
	mov	x1, x22
	mov	x2, x19
	bl	_uiomove
	mov	x22, x0
	ldr	x1, [x25]
	mov	x0, x23
	bl	_pmap_unmapdev
	b	LBB0_4
LBB0_19:
	mov	w22, #0
	mov	x8, x24
LBB0_20:
	cmp	x8, x24
	csel	w0, w22, wzr, eq
	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
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memrw"

	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_DMAP_MIN_ADDRESS,4,2           ; @DMAP_MIN_ADDRESS
	.comm	_dmaplimit,4,2                  ; @dmaplimit
	.comm	_UIO_READ,4,2                   ; @UIO_READ
	.comm	_VM_PROT_READ,4,2               ; @VM_PROT_READ
	.comm	_VM_PROT_WRITE,4,2              ; @VM_PROT_WRITE
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
.subsections_via_symbols
