	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk_iommu_force_reset
_rk_iommu_force_reset:                  ## @rk_iommu_force_reset
	.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
	xorl	%eax, %eax
	cmpq	$0, 16(%rdi)
	je	LBB0_1
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r12
	cmpl	$0, (%rdi)
	jle	LBB0_6
## %bb.2:
	movq	_DTE_ADDR_DUMMY@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	xorl	%ebx, %ebx
	movq	_RK_MMU_DTE_ADDR@GOTPCREL(%rip), %r13
	movq	_RK_DTE_PT_ADDRESS_MASK@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r13), %esi
	callq	_rk_iommu_write
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r13), %esi
	callq	_rk_iommu_read
	movl	(%r15), %edx
	movl	(%r14), %ecx
	andl	%edx, %ecx
	cmpl	%ecx, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_6:
	movq	_RK_MMU_CMD_FORCE_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rk_iommu_command
	movq	_rk_iommu_is_reset_done@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RK_MMU_FORCE_RESET_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_RK_MMU_POLL_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r12, %rsi
	callq	_readx_poll_timeout
	movl	%eax, %r15d
	testl	%eax, %eax
	movl	$0, %eax
	je	LBB0_8
## %bb.7:
	movl	4(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %eax
	jmp	LBB0_8
LBB0_5:
	movl	4(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_RK_MMU_DTE_ADDR,4,2            ## @RK_MMU_DTE_ADDR
	.comm	_DTE_ADDR_DUMMY,4,2             ## @DTE_ADDR_DUMMY
	.comm	_RK_DTE_PT_ADDRESS_MASK,4,2     ## @RK_DTE_PT_ADDRESS_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error during raw reset. MMU_DTE_ADDR is not functioning\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_RK_MMU_CMD_FORCE_RESET,4,2     ## @RK_MMU_CMD_FORCE_RESET
	.comm	_rk_iommu_is_reset_done,4,2     ## @rk_iommu_is_reset_done
	.comm	_RK_MMU_FORCE_RESET_TIMEOUT_US,4,2 ## @RK_MMU_FORCE_RESET_TIMEOUT_US
	.comm	_RK_MMU_POLL_TIMEOUT_US,4,2     ## @RK_MMU_POLL_TIMEOUT_US
L_.str.1:                               ## @.str.1
	.asciz	"FORCE_RESET command timed out\n"

	.no_dead_strip	_rk_iommu_force_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk_iommu_force_reset
_rk_iommu_force_reset:                  ; @rk_iommu_force_reset
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_3
; %bb.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	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x20, #0
Lloh0:
	adrp	x21, _DTE_ADDR_DUMMY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DTE_ADDR_DUMMY@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh2:
	adrp	x22, _RK_MMU_DTE_ADDR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RK_MMU_DTE_ADDR@GOTPAGEOFF]
Lloh4:
	adrp	x23, _RK_DTE_PT_ADDRESS_MASK@GOTPAGE
Lloh5:
	ldr	x23, [x23, _RK_DTE_PT_ADDRESS_MASK@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	lsl	x24, x20, #2
	ldr	w0, [x8, x24]
	ldr	w1, [x22]
	bl	_rk_iommu_write
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x24]
	ldr	w1, [x22]
	bl	_rk_iommu_read
	ldr	w2, [x21]
	ldr	w8, [x23]
	and	w8, w8, w2
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_5
LBB0_7:
Lloh6:
	adrp	x8, _RK_MMU_CMD_FORCE_RESET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RK_MMU_CMD_FORCE_RESET@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rk_iommu_command
Lloh9:
	adrp	x8, _rk_iommu_is_reset_done@GOTPAGE
Lloh10:
	ldr	x8, [x8, _rk_iommu_is_reset_done@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _RK_MMU_FORCE_RESET_TIMEOUT_US@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RK_MMU_FORCE_RESET_TIMEOUT_US@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
Lloh15:
	adrp	x8, _RK_MMU_POLL_TIMEOUT_US@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RK_MMU_POLL_TIMEOUT_US@GOTPAGEOFF]
Lloh17:
	ldr	w5, [x8]
	mov	x1, x19
	bl	_readx_poll_timeout
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.8:
	ldr	w0, [x19, #4]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_2
LBB0_9:
	ldr	w0, [x19, #4]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh22:
	adrp	x8, _EFAULT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_2
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RK_MMU_DTE_ADDR,4,2            ; @RK_MMU_DTE_ADDR
	.comm	_DTE_ADDR_DUMMY,4,2             ; @DTE_ADDR_DUMMY
	.comm	_RK_DTE_PT_ADDRESS_MASK,4,2     ; @RK_DTE_PT_ADDRESS_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error during raw reset. MMU_DTE_ADDR is not functioning\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_RK_MMU_CMD_FORCE_RESET,4,2     ; @RK_MMU_CMD_FORCE_RESET
	.comm	_rk_iommu_is_reset_done,4,2     ; @rk_iommu_is_reset_done
	.comm	_RK_MMU_FORCE_RESET_TIMEOUT_US,4,2 ; @RK_MMU_FORCE_RESET_TIMEOUT_US
	.comm	_RK_MMU_POLL_TIMEOUT_US,4,2     ; @RK_MMU_POLL_TIMEOUT_US
l_.str.1:                               ; @.str.1
	.asciz	"FORCE_RESET command timed out\n"

	.no_dead_strip	_rk_iommu_force_reset
.subsections_via_symbols
