	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rsi)
	jle	LBB0_28
## %bb.1:
	movq	%rsi, %r13
	movq	%rdi, %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	32(%r13), %r12
	cmpq	$0, (%r12)
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_dev2unit
	movq	_CDEV_MINOR_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r13), %ebx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r15d
	andl	%ebx, %r15d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andl	8(%r12), %eax
	cltq
	movq	%rsi, %rdi
	subq	%rax, %rdi
	movslq	%r15d, %rax
	subq	%rax, %rsi
	callq	_min
	movq	(%r12), %rsi
	movq	%rax, %rdi
	callq	_min
	movq	%rax, %r12
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_mem_valid
	testq	%rax, %rax
	jne	LBB0_29
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_hw_direct_map@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_pmap_dev_direct_mapped
	testl	%eax, %eax
	je	LBB0_22
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_trunc_page
	movq	%rax, -56(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, -48(%rbp)
	leaq	-48(%rbp), %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_uiomove_fromphys
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	$16, %r12
	movq	%r12, 32(%r13)
	movq	8(%r13), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, 8(%r13)
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jg	LBB0_25
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_panic
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_dev2unit
	xorl	%ebx, %ebx
	movq	_CDEV_MINOR_KMEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_25
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%r13), %edi
	movq	_VM_MIN_KERNEL_ADDRESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jl	LBB0_27
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_virtual_end@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jg	LBB0_27
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_trunc_page
	movq	%rax, %rbx
	movslq	16(%r13), %rdi
	addq	(%r12), %rdi
	callq	_round_page
	cmpl	%ebx, %eax
	jle	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r15d
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_pmap_extract
	testq	%rax, %rax
	je	LBB0_29
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	movslq	%ebx, %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	cmpl	%ebx, %r15d
	jg	LBB0_16
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%r13), %rcx
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movq	_UIO_READ@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %edx
	movslq	16(%r13), %rbx
	movq	(%r12), %rsi
	movq	%rbx, %rdi
	callq	_kernacc
	movq	_FALSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_29
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rsi
	movq	%rbx, %rdi
	jmp	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_PHYS_TO_DMAP
	movq	%rax, %rdi
	movq	%r12, %rsi
LBB0_23:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdx
	callq	_uiomove
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, (%r13)
	jle	LBB0_30
## %bb.26:                              ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	je	LBB0_2
	jmp	LBB0_30
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_DMAP_TO_PHYS
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_28:
	xorl	%ebx, %ebx
	jmp	LBB0_30
LBB0_29:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_30:
	movl	%ebx, %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	"memrw"

	.comm	_CDEV_MINOR_MEM,8,3             ## @CDEV_MINOR_MEM
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_hw_direct_map,8,3              ## @hw_direct_map
	.comm	_CDEV_MINOR_KMEM,8,3            ## @CDEV_MINOR_KMEM
	.comm	_VM_MIN_KERNEL_ADDRESS,4,2      ## @VM_MIN_KERNEL_ADDRESS
	.comm	_virtual_end,4,2                ## @virtual_end
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.comm	_UIO_READ,8,3                   ## @UIO_READ
	.comm	_VM_PROT_READ,4,2               ## @VM_PROT_READ
	.comm	_VM_PROT_WRITE,4,2              ## @VM_PROT_WRITE
	.comm	_FALSE,8,3                      ## @FALSE
.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	x8, [x1]
	cmp	x8, #1
	b.lt	LBB0_24
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _CDEV_MINOR_MEM@GOTPAGE
Lloh1:
	ldr	x25, [x25, _CDEV_MINOR_MEM@GOTPAGEOFF]
Lloh2:
	adrp	x26, _PAGE_MASK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _PAGE_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
Lloh6:
	adrp	x28, _hw_direct_map@GOTPAGE
Lloh7:
	ldr	x28, [x28, _hw_direct_map@GOTPAGEOFF]
Lloh8:
	adrp	x21, _kernel_pmap@GOTPAGE
Lloh9:
	ldr	x21, [x21, _kernel_pmap@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x24, #16
	str	x8, [x19, #32]
	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	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_26
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	ldr	x24, [x19, #32]
	ldr	x8, [x24]
	cbz	x8, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_dev2unit
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w22, [x19, #16]
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_dev2unit
Lloh10:
	adrp	x8, _CDEV_MINOR_KMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CDEV_MINOR_KMEM@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #16]
Lloh13:
	adrp	x8, _VM_MIN_KERNEL_ADDRESS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VM_MIN_KERNEL_ADDRESS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _virtual_end@GOTPAGE
Lloh17:
	ldr	x9, [x9, _virtual_end@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w0, w8
	ccmp	w0, w9, #0, ge
	b.le	LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_DMAP_TO_PHYS
	mov	x22, x0
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x26]
	and	w23, w8, w22
	ldr	x9, [x27]
	ldr	w10, [x24, #8]
	and	w8, w8, w10
	sub	x0, x9, w8, sxtw
	sub	x1, x9, w23, sxtw
	bl	_min
	ldr	x1, [x24]
	bl	_min
	mov	x24, x0
	mov	x0, x22
	mov	x1, x24
	bl	_mem_valid
	cbnz	x0, LBB0_25
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x28]
	cbz	x8, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x24
	bl	_pmap_dev_direct_mapped
	cbz	w0, LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_trunc_page
	add	x8, sp, #8
	stp	x8, x0, [sp]
	mov	x0, sp
	mov	x1, x23
	mov	x2, x24
	mov	x3, x19
	bl	_uiomove_fromphys
	b	LBB0_4
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_PHYS_TO_DMAP
	mov	x1, x24
	b	LBB0_23
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_trunc_page
	mov	x22, x0
	ldrsw	x8, [x19, #16]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_round_page
	cmp	w0, w22
	b.le	LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
LBB0_19:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x21]
	mov	x1, x22
	bl	_pmap_extract
	cbz	x0, LBB0_25
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	ldr	x8, [x27]
	add	x22, x8, w22, sxtw
	cmp	w23, w22
	b.gt	LBB0_19
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #24]
Lloh21:
	adrp	x9, _UIO_READ@GOTPAGE
Lloh22:
	ldr	x9, [x9, _UIO_READ@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh24:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh26:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
	ldrsw	x22, [x19, #16]
	ldr	x1, [x24]
	mov	x0, x22
	bl	_kernacc
Lloh28:
	adrp	x8, _FALSE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_25
; %bb.22:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x24]
	mov	x0, x22
LBB0_23:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x2, x19
	bl	_uiomove
	b	LBB0_4
LBB0_24:
	mov	w0, #0
	b	LBB0_26
LBB0_25:
Lloh31:
	adrp	x8, _EFAULT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
LBB0_26:
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memrw"

	.comm	_CDEV_MINOR_MEM,8,3             ; @CDEV_MINOR_MEM
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_hw_direct_map,8,3              ; @hw_direct_map
	.comm	_CDEV_MINOR_KMEM,8,3            ; @CDEV_MINOR_KMEM
	.comm	_VM_MIN_KERNEL_ADDRESS,4,2      ; @VM_MIN_KERNEL_ADDRESS
	.comm	_virtual_end,4,2                ; @virtual_end
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.comm	_UIO_READ,8,3                   ; @UIO_READ
	.comm	_VM_PROT_READ,4,2               ; @VM_PROT_READ
	.comm	_VM_PROT_WRITE,4,2              ; @VM_PROT_WRITE
	.comm	_FALSE,8,3                      ; @FALSE
.subsections_via_symbols
