	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk_iommu_enable_stall
_rk_iommu_enable_stall:                 ## @rk_iommu_enable_stall
	.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	%rdi, %r12
	callq	_rk_iommu_is_stall_active
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r12, %rdi
	callq	_rk_iommu_is_paging_enabled
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	movq	_RK_MMU_CMD_ENABLE_STALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rk_iommu_command
	movq	_RK_MMU_POLL_PERIOD_US@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_RK_MMU_POLL_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_rk_iommu_is_stall_active@GOTPCREL(%rip), %rdi
	movq	%r12, %rsi
	callq	_readx_poll_timeout
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	cmpl	$0, (%r12)
	jle	LBB0_4
## %bb.5:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movq	_RK_MMU_STATUS@GOTPCREL(%rip), %r15
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r12), %r13d
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r15), %esi
	callq	_rk_iommu_read
	movl	%r13d, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_dev_err
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
## %bb.7:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_8
LBB0_4:
	movl	%eax, %r14d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_RK_MMU_CMD_ENABLE_STALL,4,2    ## @RK_MMU_CMD_ENABLE_STALL
	.comm	_RK_MMU_POLL_PERIOD_US,4,2      ## @RK_MMU_POLL_PERIOD_US
	.comm	_RK_MMU_POLL_TIMEOUT_US,4,2     ## @RK_MMU_POLL_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enable stall request timed out, status: %#08x\n"

	.comm	_RK_MMU_STATUS,4,2              ## @RK_MMU_STATUS
	.no_dead_strip	_rk_iommu_enable_stall
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk_iommu_enable_stall
_rk_iommu_enable_stall:                 ; @rk_iommu_enable_stall
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_rk_iommu_is_stall_active
	cbz	x0, LBB0_3
LBB0_1:
	mov	w20, #0
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	bl	_rk_iommu_is_paging_enabled
	cbz	w0, LBB0_1
; %bb.4:
Lloh0:
	adrp	x8, _RK_MMU_CMD_ENABLE_STALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RK_MMU_CMD_ENABLE_STALL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rk_iommu_command
Lloh3:
	adrp	x8, _RK_MMU_POLL_PERIOD_US@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RK_MMU_POLL_PERIOD_US@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
Lloh6:
	adrp	x8, _RK_MMU_POLL_TIMEOUT_US@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RK_MMU_POLL_TIMEOUT_US@GOTPAGEOFF]
Lloh8:
	ldr	w5, [x8]
Lloh9:
	adrp	x0, _rk_iommu_is_stall_active@GOTPAGE
Lloh10:
	ldr	x0, [x0, _rk_iommu_is_stall_active@GOTPAGEOFF]
	mov	x1, x19
	bl	_readx_poll_timeout
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.5:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.6:
	mov	x23, #0
Lloh11:
	adrp	x24, _RK_MMU_STATUS@GOTPAGE
Lloh12:
	ldr	x24, [x24, _RK_MMU_STATUS@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str@PAGE
Lloh14:
	add	x21, x21, l_.str@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x23, lsl #2]
	ldr	w1, [x24]
	bl	_rk_iommu_read
	mov	x2, x0
	mov	x0, x22
	mov	x1, x21
	bl	_dev_err
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_7
	b	LBB0_2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RK_MMU_CMD_ENABLE_STALL,4,2    ; @RK_MMU_CMD_ENABLE_STALL
	.comm	_RK_MMU_POLL_PERIOD_US,4,2      ; @RK_MMU_POLL_PERIOD_US
	.comm	_RK_MMU_POLL_TIMEOUT_US,4,2     ; @RK_MMU_POLL_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enable stall request timed out, status: %#08x\n"

	.comm	_RK_MMU_STATUS,4,2              ; @RK_MMU_STATUS
	.no_dead_strip	_rk_iommu_enable_stall
.subsections_via_symbols
