	.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
	cmpq	$0, (%rsi)
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	L_.str(%rip), %r13
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	movq	32(%r15), %r12
	cmpq	$0, (%r12)
	je	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_dev2unit
	movq	_CDEV_MINOR_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	notq	%rbx
	andq	16(%r15), %rbx
	movq	_dump_avail@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	$8, %rax
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=2
	addq	$16, %rax
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-8(%rax), %rcx
	testq	%rcx, %rcx
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpq	$0, (%rax)
	je	LBB0_26
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=2
	cmpq	%rcx, %rbx
	jl	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=2
	cmpq	(%rax), %rbx
	jge	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_tmppt_lock@GOTPCREL(%rip), %rdi
	callq	_sx_xlock
	movq	__tmppt@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	%rbx, %rsi
	callq	_pmap_kenter
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%r15), %rcx
	andq	%rax, %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rsi
	movslq	8(%r12), %rdx
	andq	%rax, %rdx
	movq	%rsi, %rdi
	subq	%rdx, %rdi
	movslq	%ecx, %rbx
	subq	%rbx, %rsi
	callq	_min
	movq	(%r12), %rsi
	movq	%rax, %rdi
	callq	_min
	shll	$2, %ebx
	addl	(%r13), %ebx
	movl	%ebx, %edi
	movl	%eax, %esi
	movq	%r15, %rdx
	callq	_uiomove
	movl	%eax, %ebx
	movq	(%r13), %rdi
	leaq	L_.str(%rip), %r13
	movl	$1, %esi
	callq	_pmap_qremove
	movq	_tmppt_lock@GOTPCREL(%rip), %rdi
	callq	_sx_xunlock
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$16, %r12
	movq	%r12, 32(%r15)
	movq	8(%r15), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, 8(%r15)
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jg	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_panic
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_dev2unit
	xorl	%ebx, %ebx
	movq	_CDEV_MINOR_KMEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %r13
	movq	16(%r15), %rdi
	callq	_trunc_page
	movq	%rax, %rbx
	movq	16(%r15), %rdi
	addq	%r13, %rdi
	callq	_round_page
	cmpq	%rax, %rbx
	jge	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r12
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_pmap_extract
	testq	%rax, %rax
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=2
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	%rax, %rbx
	cmpq	%r12, %rbx
	jl	LBB0_19
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r15), %rcx
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movq	_UIO_READ@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
LBB0_24:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r15), %edi
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_kernacc
	testl	%eax, %eax
	je	LBB0_20
## %bb.25:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r15), %edi
	movl	%r13d, %esi
	movq	%r15, %rdx
	callq	_uiomove
	movl	%eax, %ebx
	leaq	L_.str(%rip), %r13
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, (%r15)
	jle	LBB0_28
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%ebx, %ebx
	je	LBB0_3
	jmp	LBB0_28
LBB0_26:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_28
LBB0_20:
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %ebx
LBB0_28:
	movl	%ebx, %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	_CDEV_MINOR_MEM,8,3             ## @CDEV_MINOR_MEM
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_dump_avail,8,3                 ## @dump_avail
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_tmppt_lock,4,2                 ## @tmppt_lock
	.comm	__tmppt,8,3                     ## @_tmppt
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_CDEV_MINOR_KMEM,8,3            ## @CDEV_MINOR_KMEM
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.comm	_EFAULT,4,2                     ## @EFAULT
	.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
.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	x8, [x1]
	cmp	x8, #1
	b.lt	LBB0_23
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x26, _CDEV_MINOR_MEM@GOTPAGE
Lloh1:
	ldr	x26, [x26, _CDEV_MINOR_MEM@GOTPAGEOFF]
Lloh2:
	adrp	x25, l_.str@PAGE
Lloh3:
	add	x25, x25, l_.str@PAGEOFF
Lloh4:
	adrp	x27, _PAGE_MASK@GOTPAGE
Lloh5:
	ldr	x27, [x27, _PAGE_MASK@GOTPAGEOFF]
Lloh6:
	adrp	x21, _dump_avail@GOTPAGE
Lloh7:
	ldr	x21, [x21, _dump_avail@GOTPAGEOFF]
Lloh8:
	adrp	x22, _kernel_pmap@GOTPAGE
Lloh9:
	ldr	x22, [x22, _kernel_pmap@GOTPAGEOFF]
Lloh10:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh11:
	ldr	x28, [x28, _PAGE_SIZE@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_21
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w23, #0
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	cmp	x8, #1
	ccmp	w23, #0, #0, ge
	b.ne	LBB0_26
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_9 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, [x26]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x27]
	bic	x23, x8, x9
	ldr	x8, [x21]
	add	x8, x8, #8
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x8, x8, #16
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	x9, [x8, #-8]
	cbnz	x9, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x10, [x8]
	cbz	x10, LBB0_22
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=2
	cmp	x23, x9
	b.lt	LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x9, [x8]
	cmp	x23, x9
	b.ge	LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x25
	mov	x25, x22
Lloh12:
	adrp	x0, _tmppt_lock@GOTPAGE
Lloh13:
	ldr	x0, [x0, _tmppt_lock@GOTPAGEOFF]
	bl	_sx_xlock
Lloh14:
	adrp	x22, __tmppt@GOTPAGE
Lloh15:
	ldr	x22, [x22, __tmppt@GOTPAGEOFF]
	ldr	x0, [x22]
	mov	x1, x23
	bl	_pmap_kenter
	ldr	w0, [x25]
	ldr	x1, [x22]
	bl	_pmap_tlb_flush
	ldr	x8, [x19, #16]
	ldr	x9, [x27]
	and	x23, x9, x8
	ldrsw	x8, [x28]
	ldrsw	x10, [x24, #8]
	and	x9, x10, x9
	sub	x0, x8, x9
	sub	x1, x8, w23, sxtw
	bl	_min
	ldr	x1, [x24]
	bl	_min
	mov	x1, x0
	ldr	w8, [x22]
	add	w0, w8, w23, lsl #2
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x19
	bl	_uiomove
	mov	x23, x0
	ldr	x0, [x22]
	mov	w1, #1
	bl	_pmap_qremove
Lloh16:
	adrp	x0, _tmppt_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _tmppt_lock@GOTPAGEOFF]
	mov	x22, x25
	mov	x25, x21
Lloh18:
	adrp	x21, _dump_avail@GOTPAGE
Lloh19:
	ldr	x21, [x21, _dump_avail@GOTPAGEOFF]
	bl	_sx_xunlock
	b	LBB0_4
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_dev2unit
Lloh20:
	adrp	x8, _CDEV_MINOR_KMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CDEV_MINOR_KMEM@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x26
	mov	x26, x27
	mov	x27, x25
	ldr	x23, [x24]
	ldr	x0, [x19, #16]
	bl	_trunc_page
	mov	x24, x0
	ldr	x8, [x19, #16]
	add	x0, x8, x23
	bl	_round_page
	cmp	x24, x0
	b.ge	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x0
LBB0_17:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x22]
	mov	x1, x24
	bl	_pmap_extract
	cbz	x0, LBB0_24
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=2
	ldrsw	x8, [x28]
	add	x24, x24, x8
	cmp	x24, x25
	b.lt	LBB0_17
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #24]
Lloh23:
	adrp	x9, _UIO_READ@GOTPAGE
Lloh24:
	ldr	x9, [x9, _UIO_READ@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh26:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh27:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh28:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w2, [x8]
	mov	x1, x23
	bl	_kernacc
	cbz	w0, LBB0_24
; %bb.20:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x27
	ldr	w0, [x19, #16]
	mov	x1, x23
	mov	x2, x19
	bl	_uiomove
	mov	x23, x0
	mov	x27, x26
	mov	x26, x21
Lloh30:
	adrp	x21, _dump_avail@GOTPAGE
Lloh31:
	ldr	x21, [x21, _dump_avail@GOTPAGEOFF]
	b	LBB0_4
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x25
	bl	_panic
	b	LBB0_3
LBB0_22:
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_25
LBB0_23:
	mov	w23, #0
	b	LBB0_26
LBB0_24:
Lloh34:
	adrp	x8, _EFAULT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_25:
	ldr	w23, [x8]
LBB0_26:
	mov	x0, x23
	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	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.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,8,3                  ; @PAGE_MASK
	.comm	_dump_avail,8,3                 ; @dump_avail
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_tmppt_lock,4,2                 ; @tmppt_lock
	.comm	__tmppt,8,3                     ; @_tmppt
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_CDEV_MINOR_KMEM,8,3            ; @CDEV_MINOR_KMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.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
.subsections_via_symbols
