	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vce_v2_0_stop
_vce_v2_0_stop:                         ## @vce_v2_0_stop
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_vce_v2_0_lmi_clean
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
	jmp	LBB0_8
LBB0_2:
	movq	%rbx, %rdi
	callq	_vce_v2_0_wait_for_idle
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_INFO
	jmp	LBB0_8
LBB0_4:
	movq	_mmVCE_LMI_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$256, %esi                      ## imm = 0x100
	movl	$-257, %edx                     ## imm = 0xFEFF
	callq	_WREG32_P
	movl	$100, %ebx
	movq	_mmVCE_LMI_STATUS@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_RREG32
	testl	$576, %eax                      ## imm = 0x240
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_mdelay
	decl	%ebx
	jne	LBB0_5
LBB0_7:
	movq	_mmVCE_VCPU_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	movl	$-524290, %edx                  ## imm = 0xFFF7FFFE
	callq	_WREG32_P
	movq	_mmVCE_SOFT_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	movl	$-2, %edx
	callq	_WREG32_P
	movq	_mmVCE_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
LBB0_8:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vce is not idle \n"

L_.str.1:                               ## @.str.1
	.asciz	"VCE is busy, Can't set clock gating"

	.comm	_mmVCE_LMI_CTRL2,4,2            ## @mmVCE_LMI_CTRL2
	.comm	_mmVCE_LMI_STATUS,4,2           ## @mmVCE_LMI_STATUS
	.comm	_mmVCE_VCPU_CNTL,4,2            ## @mmVCE_VCPU_CNTL
	.comm	_mmVCE_SOFT_RESET,4,2           ## @mmVCE_SOFT_RESET
	.comm	_mmVCE_STATUS,4,2               ## @mmVCE_STATUS
	.no_dead_strip	_vce_v2_0_stop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vce_v2_0_stop
_vce_v2_0_stop:                         ; @vce_v2_0_stop
	.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
	bl	_vce_v2_0_lmi_clean
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
	b	LBB0_8
LBB0_2:
	mov	x0, x19
	bl	_vce_v2_0_wait_for_idle
	cbz	x0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_INFO
	b	LBB0_8
LBB0_4:
Lloh4:
	adrp	x8, _mmVCE_LMI_CTRL2@GOTPAGE
Lloh5:
	ldr	x8, [x8, _mmVCE_LMI_CTRL2@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	w1, #256
	mov	w2, #-257
	bl	_WREG32_P
	mov	w19, #100
Lloh7:
	adrp	x20, _mmVCE_LMI_STATUS@GOTPAGE
Lloh8:
	ldr	x20, [x20, _mmVCE_LMI_STATUS@GOTPAGEOFF]
	mov	w21, #576
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_RREG32
	tst	w0, w21
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1
	bl	_mdelay
	subs	w19, w19, #1
	b.ne	LBB0_5
LBB0_7:
Lloh9:
	adrp	x8, _mmVCE_VCPU_CNTL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _mmVCE_VCPU_CNTL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	w1, #0
	mov	w2, #65534
	movk	w2, #65527, lsl #16
	bl	_WREG32_P
Lloh12:
	adrp	x8, _mmVCE_SOFT_RESET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mmVCE_SOFT_RESET@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w1, #1
	mov	w2, #-2
	bl	_WREG32_P
Lloh15:
	adrp	x8, _mmVCE_STATUS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mmVCE_STATUS@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
LBB0_8:
	mov	w0, #0
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vce is not idle \n"

l_.str.1:                               ; @.str.1
	.asciz	"VCE is busy, Can't set clock gating"

	.comm	_mmVCE_LMI_CTRL2,4,2            ; @mmVCE_LMI_CTRL2
	.comm	_mmVCE_LMI_STATUS,4,2           ; @mmVCE_LMI_STATUS
	.comm	_mmVCE_VCPU_CNTL,4,2            ; @mmVCE_VCPU_CNTL
	.comm	_mmVCE_SOFT_RESET,4,2           ; @mmVCE_SOFT_RESET
	.comm	_mmVCE_STATUS,4,2               ; @mmVCE_STATUS
	.no_dead_strip	_vce_v2_0_stop
.subsections_via_symbols
