	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_mmu_invalidate_cache_range
_goya_mmu_invalidate_cache_range:       ## @goya_mmu_invalidate_cache_range
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	_HW_CAP_MMU@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	je	LBB0_6
## %bb.2:
	cmpq	$0, 8(%rbx)
	jne	LBB0_3
## %bb.4:
	movq	_MMU_CONFIG_TIMEOUT_USEC@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r15d
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_mmSTLB_CACHE_INV@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_RREG32
	movq	_STLB_CACHE_INV_PRODUCER_INDEX_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	incl	%ecx
	movzbl	%cl, %esi
	movl	(%r12), %edi
	movq	_STLB_CACHE_INV_INDEX_MASK_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%eax, %esi
	callq	_WREG32
	movq	_mmSTLB_INV_CONSUMER_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	%r15d, %r9d
	callq	_hl_poll_timeout
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_notice_ratelimited         ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_CAP_MMU,4,2                 ## @HW_CAP_MMU
	.comm	_GOYA_PLDM_MMU_TIMEOUT_USEC,4,2 ## @GOYA_PLDM_MMU_TIMEOUT_USEC
	.comm	_MMU_CONFIG_TIMEOUT_USEC,4,2    ## @MMU_CONFIG_TIMEOUT_USEC
	.comm	_mmSTLB_CACHE_INV,4,2           ## @mmSTLB_CACHE_INV
	.comm	_STLB_CACHE_INV_PRODUCER_INDEX_MASK,4,2 ## @STLB_CACHE_INV_PRODUCER_INDEX_MASK
	.comm	_STLB_CACHE_INV_INDEX_MASK_MASK,4,2 ## @STLB_CACHE_INV_INDEX_MASK_MASK
	.comm	_mmSTLB_INV_CONSUMER_INDEX,4,2  ## @mmSTLB_INV_CONSUMER_INDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout when waiting for MMU cache invalidation\n"

	.no_dead_strip	_goya_mmu_invalidate_cache_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_mmu_invalidate_cache_range
_goya_mmu_invalidate_cache_range:       ; @goya_mmu_invalidate_cache_range
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	w1, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _HW_CAP_MMU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HW_CAP_MMU@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_4
; %bb.2:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _MMU_CONFIG_TIMEOUT_USEC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMU_CONFIG_TIMEOUT_USEC@GOTPAGEOFF]
Lloh5:
	adrp	x10, _GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPAGE
Lloh6:
	ldr	x10, [x10, _GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w20, [x8]
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
Lloh7:
	adrp	x22, _mmSTLB_CACHE_INV@GOTPAGE
Lloh8:
	ldr	x22, [x22, _mmSTLB_CACHE_INV@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_RREG32
Lloh9:
	adrp	x8, _STLB_CACHE_INV_PRODUCER_INDEX_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STLB_CACHE_INV_PRODUCER_INDEX_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	add	w8, w8, #1
	and	w9, w8, #0xff
	ldr	w8, [x22]
Lloh12:
	adrp	x10, _STLB_CACHE_INV_INDEX_MASK_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _STLB_CACHE_INV_INDEX_MASK_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	and	w10, w10, w0
	orr	w1, w10, w9
	mov	x0, x8
	bl	_WREG32
Lloh15:
	adrp	x8, _mmSTLB_INV_CONSUMER_INDEX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mmSTLB_INV_CONSUMER_INDEX@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	mov	x5, x20
	bl	_hl_poll_timeout
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	cbz	w20, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dev_notice_ratelimited
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_CAP_MMU,4,2                 ; @HW_CAP_MMU
	.comm	_GOYA_PLDM_MMU_TIMEOUT_USEC,4,2 ; @GOYA_PLDM_MMU_TIMEOUT_USEC
	.comm	_MMU_CONFIG_TIMEOUT_USEC,4,2    ; @MMU_CONFIG_TIMEOUT_USEC
	.comm	_mmSTLB_CACHE_INV,4,2           ; @mmSTLB_CACHE_INV
	.comm	_STLB_CACHE_INV_PRODUCER_INDEX_MASK,4,2 ; @STLB_CACHE_INV_PRODUCER_INDEX_MASK
	.comm	_STLB_CACHE_INV_INDEX_MASK_MASK,4,2 ; @STLB_CACHE_INV_INDEX_MASK_MASK
	.comm	_mmSTLB_INV_CONSUMER_INDEX,4,2  ; @mmSTLB_INV_CONSUMER_INDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout when waiting for MMU cache invalidation\n"

	.no_dead_strip	_goya_mmu_invalidate_cache_range
.subsections_via_symbols
