	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_dfe_dse_state_check
_mtk_dfe_dse_state_check:               ## @mtk_dfe_dse_state_check
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_DFE_THR_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movl	%eax, %edi
	callq	_MTK_DFSE_RING_ID
	movq	_MTK_DFSE_IDLE@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_2
## %bb.1:
	movq	_DSE_THR_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movl	%eax, %edi
	callq	_MTK_DFSE_RING_ID
	cmpq	(%r15), %rax
	je	LBB0_3
LBB0_2:
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_3:
	movq	_DFE_THR_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_writel
	movq	_DSE_THR_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	xorl	%edi, %edi
	callq	_writel
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DFE_THR_STAT,8,3               ## @DFE_THR_STAT
	.comm	_MTK_DFSE_IDLE,8,3              ## @MTK_DFSE_IDLE
	.comm	_DSE_THR_STAT,8,3               ## @DSE_THR_STAT
	.comm	_DFE_THR_CTRL,8,3               ## @DFE_THR_CTRL
	.comm	_DSE_THR_CTRL,8,3               ## @DSE_THR_CTRL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_mtk_dfe_dse_state_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_dfe_dse_state_check
_mtk_dfe_dse_state_check:               ; @mtk_dfe_dse_state_check
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _DFE_THR_STAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DFE_THR_STAT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	bl	_MTK_DFSE_RING_ID
Lloh6:
	adrp	x21, _MTK_DFSE_IDLE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _MTK_DFSE_IDLE@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _DSE_THR_STAT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DSE_THR_STAT@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	bl	_MTK_DFSE_RING_ID
	ldr	x8, [x21]
	cmp	x0, x8
	ccmp	w20, #0, #4, ne
	b.ne	LBB0_4
LBB0_2:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _DFE_THR_CTRL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DFE_THR_CTRL@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19]
Lloh14:
	adrp	x9, _DSE_THR_CTRL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DSE_THR_CTRL@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	mov	w0, #0
	b	LBB0_5
LBB0_3:
	cbz	w20, LBB0_2
LBB0_4:
Lloh17:
	adrp	x8, _EBUSY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DFE_THR_STAT,8,3               ; @DFE_THR_STAT
	.comm	_MTK_DFSE_IDLE,8,3              ; @MTK_DFSE_IDLE
	.comm	_DSE_THR_STAT,8,3               ; @DSE_THR_STAT
	.comm	_DFE_THR_CTRL,8,3               ; @DFE_THR_CTRL
	.comm	_DSE_THR_CTRL,8,3               ; @DSE_THR_CTRL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_mtk_dfe_dse_state_check
.subsections_via_symbols
