	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moea64_pte_insert_native
_moea64_pte_insert_native:              ## @moea64_pte_insert_native
	.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, %r14
	leaq	-48(%rbp), %rbx
	movq	%rsi, %rdi
	movq	%rbx, %rsi
	callq	_moea64_pte_from_pvo
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rdi
	callq	_rw_rlock
	movq	(%r14), %rsi
	andq	$-8, %rsi
	movq	%rsi, (%r14)
	movq	_LPTE_VALID@GOTPCREL(%rip), %r13
	movq	_LPTE_WIRED@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	orl	(%r13), %edx
	movq	_LPTE_LOCKED@GOTPCREL(%rip), %r12
	orl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_moea64_insert_to_pteg_native
	cmpq	$-1, %rax
	jne	LBB0_1
## %bb.2:
	movq	_PVO_HID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%eax, 8(%r14)
	movq	_LPTE_HID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%eax, -48(%rbp)
	movq	_moea64_pteg_mask@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$3, %eax
	movslq	%eax, %rsi
	xorq	(%r14), %rsi
	movq	%rsi, (%r14)
	movl	(%r15), %edx
	orl	(%r13), %edx
	orl	(%r12), %edx
	leaq	-48(%rbp), %rdi
	callq	_moea64_insert_to_pteg_native
	cmpq	$-1, %rax
	je	LBB0_3
LBB0_1:
	movq	%rax, %rbx
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rdi
	callq	_rw_runlock
LBB0_8:
	movq	%rbx, (%r14)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_PVO_HID@GOTPCREL(%rip), %r13
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rdi
	callq	_rw_try_upgrade
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_rw_runlock
	movq	%rbx, %rdi
	callq	_rw_wlock
LBB0_5:
	movq	(%r14), %rsi
	movl	(%r12), %edx
	orl	(%r15), %edx
	leaq	-48(%rbp), %rdi
	callq	_moea64_insert_to_pteg_native
	cmpq	$-1, %rax
	je	LBB0_7
## %bb.6:
	movq	%rax, %rbx
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	jmp	LBB0_8
LBB0_7:
	movl	(%r13), %eax
	xorl	%eax, 8(%r14)
	movq	_LPTE_HID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%eax, -48(%rbp)
	movq	_moea64_pteg_mask@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$3, %eax
	movslq	%eax, %rsi
	xorq	(%r14), %rsi
	movq	%rsi, (%r14)
	movl	(%r12), %edx
	orl	(%r15), %edx
	leaq	-48(%rbp), %rdi
	callq	_moea64_insert_to_pteg_native
	movq	%rax, %rbx
	movq	_moea64_eviction_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	cmpq	$-1, %rbx
	jne	LBB0_8
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_panic
	movl	$-1, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_moea64_eviction_lock,4,2       ## @moea64_eviction_lock
	.comm	_LPTE_VALID,4,2                 ## @LPTE_VALID
	.comm	_LPTE_WIRED,4,2                 ## @LPTE_WIRED
	.comm	_LPTE_LOCKED,4,2                ## @LPTE_LOCKED
	.comm	_PVO_HID,4,2                    ## @PVO_HID
	.comm	_LPTE_HID,4,2                   ## @LPTE_HID
	.comm	_moea64_pteg_mask,4,2           ## @moea64_pteg_mask
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"moea64_pte_insert: overflow"

	.no_dead_strip	_moea64_pte_insert_native
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moea64_pte_insert_native
_moea64_pte_insert_native:              ; @moea64_pte_insert_native
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x1
	add	x1, sp, #8
	mov	x0, x19
	bl	_moea64_pte_from_pvo
Lloh0:
	adrp	x0, _moea64_eviction_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _moea64_eviction_lock@GOTPAGEOFF]
	bl	_rw_rlock
	ldr	x8, [x19]
	and	x1, x8, #0xfffffffffffffff8
	str	x1, [x19]
Lloh2:
	adrp	x26, _LPTE_VALID@GOTPAGE
Lloh3:
	ldr	x26, [x26, _LPTE_VALID@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh4:
	adrp	x21, _LPTE_WIRED@GOTPAGE
Lloh5:
	ldr	x21, [x21, _LPTE_WIRED@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w8, w9, w8
Lloh6:
	adrp	x22, _LPTE_LOCKED@GOTPAGE
Lloh7:
	ldr	x22, [x22, _LPTE_LOCKED@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w2, w8, w9
	add	x0, sp, #8
	bl	_moea64_insert_to_pteg_native
	cmn	x0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x23, _PVO_HID@GOTPAGE
Lloh9:
	ldr	x23, [x23, _PVO_HID@GOTPAGEOFF]
	ldr	w8, [x23]
	ldr	w9, [x19, #8]
	eor	w8, w9, w8
Lloh10:
	adrp	x24, _LPTE_HID@GOTPAGE
Lloh11:
	ldr	x24, [x24, _LPTE_HID@GOTPAGEOFF]
	str	w8, [x19, #8]
	ldr	w8, [x24]
	ldr	w9, [sp, #8]
	eor	w8, w9, w8
Lloh12:
	adrp	x25, _moea64_pteg_mask@GOTPAGE
Lloh13:
	ldr	x25, [x25, _moea64_pteg_mask@GOTPAGEOFF]
	str	w8, [sp, #8]
	ldr	w8, [x25]
	lsl	w8, w8, #3
	sxtw	x8, w8
	ldr	x9, [x19]
	eor	x1, x9, x8
	str	x1, [x19]
	ldr	w8, [x26]
	ldr	w9, [x21]
	orr	w8, w9, w8
	ldr	w9, [x22]
	orr	w2, w8, w9
	add	x0, sp, #8
	bl	_moea64_insert_to_pteg_native
	cmn	x0, #1
	b.eq	LBB0_5
LBB0_2:
	mov	x20, x0
Lloh14:
	adrp	x0, _moea64_eviction_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _moea64_eviction_lock@GOTPAGEOFF]
	bl	_rw_runlock
LBB0_3:
	mov	w0, #0
	str	x20, [x19]
LBB0_4:
	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
	add	sp, sp, #96
	ret
LBB0_5:
Lloh16:
	adrp	x0, _moea64_eviction_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _moea64_eviction_lock@GOTPAGEOFF]
	bl	_rw_try_upgrade
	cbnz	w0, LBB0_7
; %bb.6:
Lloh18:
	adrp	x20, _moea64_eviction_lock@GOTPAGE
Lloh19:
	ldr	x20, [x20, _moea64_eviction_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_rw_runlock
	mov	x0, x20
	bl	_rw_wlock
LBB0_7:
	ldr	x1, [x19]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	add	x0, sp, #8
	bl	_moea64_insert_to_pteg_native
	cmn	x0, #1
	b.eq	LBB0_9
; %bb.8:
	mov	x20, x0
Lloh20:
	adrp	x0, _moea64_eviction_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, _moea64_eviction_lock@GOTPAGEOFF]
	bl	_rw_wunlock
	b	LBB0_3
LBB0_9:
	ldr	w8, [x23]
	ldr	w9, [x19, #8]
	eor	w8, w9, w8
	str	w8, [x19, #8]
	ldr	w8, [x24]
	ldr	w9, [sp, #8]
	eor	w8, w9, w8
	str	w8, [sp, #8]
	ldr	w8, [x25]
	lsl	w8, w8, #3
	sxtw	x8, w8
	ldr	x9, [x19]
	eor	x1, x9, x8
	str	x1, [x19]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	add	x0, sp, #8
	bl	_moea64_insert_to_pteg_native
	mov	x20, x0
Lloh22:
	adrp	x0, _moea64_eviction_lock@GOTPAGE
Lloh23:
	ldr	x0, [x0, _moea64_eviction_lock@GOTPAGEOFF]
	bl	_rw_wunlock
	cmn	x20, #1
	b.ne	LBB0_3
; %bb.10:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
	mov	w0, #-1
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_moea64_eviction_lock,4,2       ; @moea64_eviction_lock
	.comm	_LPTE_VALID,4,2                 ; @LPTE_VALID
	.comm	_LPTE_WIRED,4,2                 ; @LPTE_WIRED
	.comm	_LPTE_LOCKED,4,2                ; @LPTE_LOCKED
	.comm	_PVO_HID,4,2                    ; @PVO_HID
	.comm	_LPTE_HID,4,2                   ; @LPTE_HID
	.comm	_moea64_pteg_mask,4,2           ; @moea64_pteg_mask
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"moea64_pte_insert: overflow"

	.no_dead_strip	_moea64_pte_insert_native
.subsections_via_symbols
