	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moea64_insert_to_pteg_native
_moea64_insert_to_pteg_native:          ## @moea64_insert_to_pteg_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_mftb
	movl	%eax, %r12d
	leal	7(%r12), %eax
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	andl	$-8, %eax
	subl	%eax, %r12d
	movslq	%r12d, %r13
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	addq	%rbx, %r13
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %esi
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.1:
	leal	1(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:
	leal	2(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.3:
	leal	3(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	leal	4(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.5:
	leal	5(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:
	leal	6(%r12), %eax
	movl	%eax, %ecx
	sarb	$7, %cl
	shrb	$5, %cl
	addb	%al, %cl
	andb	$-8, %cl
	subb	%cl, %al
	movsbq	%al, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r13, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	decl	%r12d
	andl	$7, %r12d
	addq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	movq	_moea64_pteg_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r12, %r15
	shlq	$4, %r15
	addq	%rbx, %r15
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_atomic_pte_lock
	movq	%r12, %r13
	testq	%rax, %rax
	je	LBB0_8
LBB0_9:
	movq	%rbx, %r14
	movl	-44(%rbp), %eax
	movq	_LPTE_VALID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.10:
	movq	_LPTE_WIRED@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movl	-44(%rbp), %ebx
	movq	_ADDR_SR_SHFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_ADDR_API_SHFT64@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subl	%eax, %ecx
	movl	%ebx, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edx
	movq	_LPTE_HID@GOTPCREL(%rip), %rcx
	movq	%r13, %rsi
	shrq	$3, %rsi
	testl	%ebx, (%rcx)
	je	LBB0_12
## %bb.11:
	movq	_moea64_pteg_mask@GOTPCREL(%rip), %rcx
	movl	%edx, %edx
	xorq	%rdx, %rsi
	xorq	(%rcx), %rsi
	jmp	LBB0_13
LBB0_12:
	movl	%edx, %ecx
	xorq	%rcx, %rsi
LBB0_13:
	movq	_ADDR_PIDX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_ADDR_PIDX_SHFT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shrq	%cl, %rdx
	andq	%rsi, %rdx
	movq	_LPTE_AVPN_MASK@GOTPCREL(%rip), %rsi
	andl	(%rsi), %ebx
	subl	%ecx, %eax
	movl	%eax, %ecx
	shll	%cl, %ebx
	orl	%edx, %ebx
	xorl	%eax, %eax
	callq	_PTESYNC
	movl	%ebx, %edi
	callq	_TLBIE
	movq	_moea64_pte_valid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	-1(%rdi), %ecx
	movl	%ecx, (%rax)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_STAT_MOEA64
	movq	_moea64_pte_overflow@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	1(%rdi), %ecx
	movl	%ecx, (%rax)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_STAT_MOEA64
LBB0_14:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rdi
	callq	_htobe64
	movq	%r13, %rcx
	shlq	$4, %rcx
	movq	%rax, 8(%r14,%rcx)
	xorl	%eax, %eax
	callq	_EIEIO
	movq	(%rbx), %rdi
	callq	_htobe64
	movq	%rax, (%r15)
	xorl	%eax, %eax
	callq	_PTESYNC
	movq	_moea64_pte_valid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	1(%rdi), %ecx
	movl	%ecx, (%rax)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_STAT_MOEA64
LBB0_15:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	$-1, %r13
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_moea64_pteg_table,8,3          ## @moea64_pteg_table
	.comm	_LPTE_VALID,4,2                 ## @LPTE_VALID
	.comm	_LPTE_WIRED,4,2                 ## @LPTE_WIRED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unmapped wired entry"

	.comm	_ADDR_SR_SHFT,4,2               ## @ADDR_SR_SHFT
	.comm	_ADDR_API_SHFT64,8,3            ## @ADDR_API_SHFT64
	.comm	_LPTE_HID,4,2                   ## @LPTE_HID
	.comm	_moea64_pteg_mask,8,3           ## @moea64_pteg_mask
	.comm	_ADDR_PIDX,8,3                  ## @ADDR_PIDX
	.comm	_ADDR_PIDX_SHFT,8,3             ## @ADDR_PIDX_SHFT
	.comm	_LPTE_AVPN_MASK,4,2             ## @LPTE_AVPN_MASK
	.comm	_moea64_pte_valid,4,2           ## @moea64_pte_valid
	.comm	_moea64_pte_overflow,4,2        ## @moea64_pte_overflow
	.no_dead_strip	_moea64_insert_to_pteg_native
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moea64_insert_to_pteg_native
_moea64_insert_to_pteg_native:          ; @moea64_insert_to_pteg_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	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_mftb
	negs	w8, w0
	and	w8, w8, #0x7
	and	w9, w0, #0x7
	csneg	w26, w9, w8, mi
	add	x20, x23, w26, sxtw
Lloh0:
	adrp	x25, _moea64_pteg_table@GOTPAGE
Lloh1:
	ldr	x25, [x25, _moea64_pteg_table@GOTPAGEOFF]
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.1:
	add	w8, w26, #1
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.2:
	add	w8, w26, #2
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.3:
	add	w8, w26, #3
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.4:
	add	w8, w26, #4
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.5:
	add	w8, w26, #5
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.6:
	add	w8, w26, #6
	sxtb	w9, w8
	ubfx	w9, w9, #12, #3
	add	w9, w8, w9
	and	w9, w9, #0xf8
	sub	w8, w8, w9
	add	x20, x23, w8, sxtb
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbnz	x0, LBB0_8
; %bb.7:
	sub	w8, w26, #1
	and	w8, w8, #0x7
	add	x20, x8, x23
	ldr	x24, [x25]
	add	x21, x24, x20, lsl #4
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_atomic_pte_lock
	cbz	x0, LBB0_15
LBB0_8:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _LPTE_VALID@GOTPAGE
Lloh3:
	ldr	x9, [x9, _LPTE_VALID@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x23, _moea64_pte_valid@GOTPAGE
Lloh6:
	ldr	x23, [x23, _moea64_pte_valid@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.9:
Lloh7:
	adrp	x9, _LPTE_WIRED@GOTPAGE
Lloh8:
	ldr	x9, [x9, _LPTE_WIRED@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh12:
	adrp	x8, _ADDR_SR_SHFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ADDR_SR_SHFT@GOTPAGEOFF]
	ldr	w9, [sp, #12]
Lloh14:
	ldr	w10, [x8]
Lloh15:
	adrp	x8, _ADDR_API_SHFT64@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ADDR_API_SHFT64@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	sub	w10, w10, w8
	asr	w10, w9, w10
Lloh18:
	adrp	x11, _LPTE_HID@GOTPAGE
Lloh19:
	ldr	x11, [x11, _LPTE_HID@GOTPAGEOFF]
Lloh20:
	ldr	w12, [x11]
	lsr	x11, x20, #3
	tst	w12, w9
	b.eq	LBB0_11
; %bb.10:
Lloh21:
	adrp	x12, _moea64_pteg_mask@GOTPAGE
Lloh22:
	ldr	x12, [x12, _moea64_pteg_mask@GOTPAGEOFF]
Lloh23:
	ldr	x12, [x12]
	eor	x10, x11, x10
	eor	x11, x10, x12
	b	LBB0_12
LBB0_11:
	eor	x11, x11, x10
LBB0_12:
Lloh24:
	adrp	x10, _ADDR_PIDX@GOTPAGE
Lloh25:
	ldr	x10, [x10, _ADDR_PIDX@GOTPAGEOFF]
Lloh26:
	ldr	x12, [x10]
Lloh27:
	adrp	x10, _ADDR_PIDX_SHFT@GOTPAGE
Lloh28:
	ldr	x10, [x10, _ADDR_PIDX_SHFT@GOTPAGEOFF]
Lloh29:
	ldr	x10, [x10]
	lsr	x12, x12, x10
	and	x11, x12, x11
Lloh30:
	adrp	x12, _LPTE_AVPN_MASK@GOTPAGE
Lloh31:
	ldr	x12, [x12, _LPTE_AVPN_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w12, [x12]
	and	w9, w12, w9
	sub	w8, w8, w10
	lsl	w8, w9, w8
	orr	w22, w8, w11
	bl	_PTESYNC
	mov	x0, x22
	bl	_TLBIE
	ldr	w0, [x23]
	sub	w8, w0, #1
	str	w8, [x23]
	bl	_STAT_MOEA64
Lloh33:
	adrp	x8, _moea64_pte_overflow@GOTPAGE
Lloh34:
	ldr	x8, [x8, _moea64_pte_overflow@GOTPAGEOFF]
	ldr	w0, [x8]
	add	w9, w0, #1
	str	w9, [x8]
	bl	_STAT_MOEA64
LBB0_13:
	ldr	x0, [x19, #8]
	bl	_htobe64
	add	x8, x24, x20, lsl #4
	str	x0, [x8, #8]
	bl	_EIEIO
	ldr	x0, [x19]
	bl	_htobe64
	str	x0, [x21]
	bl	_PTESYNC
	ldr	w0, [x23]
	add	w8, w0, #1
	str	w8, [x23]
	bl	_STAT_MOEA64
LBB0_14:
	mov	x0, x20
	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_15:
	mov	x20, #-1
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_moea64_pteg_table,8,3          ; @moea64_pteg_table
	.comm	_LPTE_VALID,4,2                 ; @LPTE_VALID
	.comm	_LPTE_WIRED,4,2                 ; @LPTE_WIRED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unmapped wired entry"

	.comm	_ADDR_SR_SHFT,4,2               ; @ADDR_SR_SHFT
	.comm	_ADDR_API_SHFT64,8,3            ; @ADDR_API_SHFT64
	.comm	_LPTE_HID,4,2                   ; @LPTE_HID
	.comm	_moea64_pteg_mask,8,3           ; @moea64_pteg_mask
	.comm	_ADDR_PIDX,8,3                  ; @ADDR_PIDX
	.comm	_ADDR_PIDX_SHFT,8,3             ; @ADDR_PIDX_SHFT
	.comm	_LPTE_AVPN_MASK,4,2             ; @LPTE_AVPN_MASK
	.comm	_moea64_pte_valid,4,2           ; @moea64_pte_valid
	.comm	_moea64_pte_overflow,4,2        ; @moea64_pte_overflow
	.no_dead_strip	_moea64_insert_to_pteg_native
.subsections_via_symbols
