	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_copy_pages                ## -- Begin function pmap_copy_pages
	.p2align	4, 0x90
_pmap_copy_pages:                       ## @pmap_copy_pages
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movq	%rcx, %r12
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r13
	xorl	%eax, %eax
	callq	_sched_pin
	xorl	%eax, %eax
	callq	_get_pcpu
	movq	24(%rax), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	32(%rax), %r15
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%rax), %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_mtx_lock
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_pte2_load
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_panic
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_pte2_load
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_4:
	testl	%r14d, %r14d
	jle	LBB0_7
## %bb.5:
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -128(%rbp)                ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shrq	%cl, %rbx
	movl	(%r13,%rbx,4), %ebx
	movq	_PAGE_MASK@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	andq	-80(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	subq	%rcx, %rsi
	movl	%r14d, %edi
	callq	_min
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movq	%r12, %rdx
	shrq	%cl, %rdx
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movl	(%rcx,%rdx,4), %r13d
	movq	(%r15), %r15
	andq	%r12, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	subq	%r15, %rsi
	movl	%eax, %edi
	callq	_min
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	%ebx, %edi
	callq	_VM_PAGE_TO_PHYS
	movl	%eax, %r14d
	movq	_PTE2_NM@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PTE2_AP_KR@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%ebx, %edi
	callq	_vm_page_pte2_attr
	movl	%r14d, %edi
	movl	%r12d, %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_PTE2_KERN_NG
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_pte2_store
	movq	(%rbx), %rdi
	callq	_tlb_flush_local
	movl	%r13d, %edi
	callq	_VM_PAGE_TO_PHYS
	movl	%eax, %r12d
	movq	_PTE2_AP_KRW@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r13d, %edi
	callq	_vm_page_pte2_attr
	movl	%r12d, %edi
	movl	%r14d, %esi
	movq	-128(%rbp), %r12                ## 8-byte Reload
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	movl	%eax, %edx
	callq	_PTE2_KERN_NG
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_pte2_store
	movq	8(%rbx), %rdi
	callq	_tlb_flush_local
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	addq	(%rbx), %rsi
	addq	8(%rbx), %r15
	movq	%r15, %rdi
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	-120(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdx
	callq	_memmove
	movslq	%r15d, %rax
	addq	%rax, %rbx
	addq	%rax, %r12
	subl	%eax, %r14d
	jg	LBB0_6
LBB0_7:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pte2_clear
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rdi
	callq	_tlb_flush
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_pte2_clear
	movq	8(%rbx), %rdi
	callq	_tlb_flush
	xorl	%eax, %eax
	callq	_sched_unpin
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmap_copy_pages: CMAP1 busy"

L_.str.1:                               ## @.str.1
	.asciz	"pmap_copy_pages: CMAP2 busy"

	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PTE2_AP_KR,4,2                 ## @PTE2_AP_KR
	.comm	_PTE2_NM,4,2                    ## @PTE2_NM
	.comm	_PTE2_AP_KRW,4,2                ## @PTE2_AP_KRW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_copy_pages                ; -- Begin function pmap_copy_pages
	.p2align	2
_pmap_copy_pages:                       ; @pmap_copy_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	mov	x25, x1
	mov	x23, x0
	bl	_sched_pin
	bl	_get_pcpu
	mov	x26, x0
	ldp	x19, x27, [x0, #24]
	add	x0, x0, #16
	str	x0, [sp]                        ; 8-byte Folded Spill
	bl	_mtx_lock
	mov	x0, x27
	bl	_pte2_load
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
LBB0_2:
	mov	x0, x19
	bl	_pte2_load
	cbz	x0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_4:
	cmp	w21, #1
	b.lt	LBB0_7
; %bb.5:
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
Lloh4:
	adrp	x24, _PAGE_SHIFT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x8, [x24]
	lsr	x8, x25, x8
	ldr	w19, [x23, x8, lsl #2]
Lloh6:
	adrp	x23, _PAGE_MASK@GOTPAGE
Lloh7:
	ldr	x23, [x23, _PAGE_MASK@GOTPAGEOFF]
	ldr	x8, [x23]
	and	x9, x8, x25
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
Lloh8:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x8, [x28]
	sub	x1, x8, x9
	mov	x0, x21
	bl	_min
	ldr	x8, [x24]
	lsr	x8, x22, x8
	ldr	w24, [x20, x8, lsl #2]
	ldr	x8, [x23]
	and	x9, x8, x22
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	ldr	x8, [x28]
	sub	x1, x8, x9
	bl	_min
	mov	x28, x0
	mov	x0, x19
	bl	_VM_PAGE_TO_PHYS
	mov	x20, x27
	mov	x27, x26
	mov	x26, x0
Lloh10:
	adrp	x8, _PTE2_AP_KR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PTE2_AP_KR@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _PTE2_NM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PTE2_NM@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w23, w9, w8
	mov	x0, x19
	bl	_vm_page_pte2_attr
	mov	x2, x0
	mov	x0, x26
	mov	x26, x27
	mov	x27, x20
	mov	x1, x23
	bl	_PTE2_KERN_NG
	mov	x1, x0
	mov	x0, x20
	bl	_pte2_store
	ldr	x0, [x26]
	bl	_tlb_flush_local
	mov	x0, x24
	bl	_VM_PAGE_TO_PHYS
	mov	x19, x0
Lloh16:
	adrp	x8, _PTE2_AP_KRW@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PTE2_AP_KRW@GOTPAGEOFF]
Lloh18:
	ldr	w23, [x8]
	mov	x0, x24
	bl	_vm_page_pte2_attr
	mov	x2, x0
	mov	x0, x19
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	mov	x1, x23
	ldr	x23, [sp, #8]                   ; 8-byte Folded Reload
	bl	_PTE2_KERN_NG
	mov	x1, x0
	mov	x0, x19
	bl	_pte2_store
	ldr	x0, [x26, #8]
	bl	_tlb_flush_local
	ldp	x8, x9, [x26]
	ldr	x10, [sp, #40]                  ; 8-byte Folded Reload
	add	x1, x8, x10
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	add	x0, x9, x8
	ldr	x20, [sp, #16]                  ; 8-byte Folded Reload
	mov	x2, x28
	bl	_memmove
	sxtw	x8, w28
	add	x25, x25, x8
	add	x22, x22, x8
	sub	w21, w21, w28
	cmp	w21, #0
	b.gt	LBB0_6
LBB0_7:
	mov	x0, x27
	bl	_pte2_clear
	ldr	x0, [x26]
	bl	_tlb_flush
	mov	x0, x19
	bl	_pte2_clear
	ldr	x0, [x26, #8]
	bl	_tlb_flush
	bl	_sched_unpin
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_mtx_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmap_copy_pages: CMAP1 busy"

l_.str.1:                               ; @.str.1
	.asciz	"pmap_copy_pages: CMAP2 busy"

	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PTE2_AP_KR,4,2                 ; @PTE2_AP_KR
	.comm	_PTE2_NM,4,2                    ; @PTE2_NM
	.comm	_PTE2_AP_KRW,4,2                ; @PTE2_AP_KRW
.subsections_via_symbols
