	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rcx
	movl	$0, %r13d
	movq	%rcx, %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	jle	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	.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), %r15d
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	%r15d, %r14d
	movslq	%r14d, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	subq	%rax, %rsi
	callq	_ulmin
	xorl	%r13d, %r13d
	testq	%rax, %rax
	je	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev2unit
	cmpl	$128, %eax
	je	LBB0_19
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %eax
	jne	LBB0_5
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r15d, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, %edi
	callq	_VIRT_IN_DMAP
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_13
	.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	%r13d, %r13d
	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_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	20(%rbx), %ecx
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movq	_UIO_READ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	_kernacc
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_pmap_extract
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_17
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %edi
	callq	_PHYS_IN_DMAP
	movl	%r15d, %edi
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_PHYS_TO_DMAP
	movslq	%eax, %rdi
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_uiomove
	movl	%eax, %r13d
	jmp	LBB0_5
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_trunc_page
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, -80(%rbp)
	leaq	-80(%rbp), %rdi
	movl	%r14d, %esi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	_uiomove_fromphys
	jmp	LBB0_5
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	.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	%r13d, %r13d
	je	LBB0_2
LBB0_7:
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	movl	$0, %eax
	cmovel	%r13d, %eax
	addq	$40, %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_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.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:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x26, [x1]
	cmp	x26, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x27, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
	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_11
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	cmp	x8, #1
	ccmp	w0, #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	w24, [x19, #16]
	ldr	w8, [x27]
	and	w23, w8, w24
	ldr	x8, [x28]
	sub	x1, x8, w23, sxtw
	bl	_ulmin
	cbz	x0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x0
	mov	x0, x20
	bl	_dev2unit
	cmp	w0, #128
	b.eq	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #129
	b.ne	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	sxtw	x25, w24
	mov	x0, x24
	bl	_VIRT_IN_DMAP
	cbz	w0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x25
	b	LBB0_16
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_panic
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x19, #20]
Lloh6:
	adrp	x9, _UIO_READ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _UIO_READ@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
Lloh9:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh11:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
	mov	x0, x25
	mov	x1, x22
	bl	_kernacc
	cbz	w0, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh13:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh14:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x24
	bl	_pmap_extract
	mov	x24, x0
	cbz	w0, LBB0_18
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_PHYS_IN_DMAP
	cbz	w0, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_PHYS_TO_DMAP
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x0, w0
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x22
	mov	x2, x19
	bl	_uiomove
	b	LBB0_4
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_trunc_page
	str	w0, [sp, #8]
	add	x8, sp, #8
	str	x8, [sp]
	mov	x0, sp
	mov	x1, x23
	mov	x2, x22
	mov	x3, x19
	bl	_uiomove_fromphys
	b	LBB0_3
LBB0_18:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh16:
	adrp	x8, _EFAULT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	b	LBB0_4
LBB0_19:
	mov	w0, #0
	mov	x8, x26
LBB0_20:
	cmp	x8, x26
	csel	w0, w0, wzr, eq
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memrw"

	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.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
