	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_dp_drm_encoder_enable
_rockchip_dp_drm_encoder_enable:        ## @rockchip_dp_drm_encoder_enable
	.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	%rsi, %rbx
	movq	%rdi, %r15
	callq	_to_dp
	movq	%rax, %r14
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_rockchip_dp_drm_get_new_crtc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_drm_atomic_get_old_crtc_state
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	cmpq	$0, (%rax)
	jne	LBB0_8
LBB0_3:
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_drm_of_encoder_active_endpoint_id
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	setne	%al
	movq	8(%r14), %rdi
	movq	16(%r14), %rcx
	leaq	L_.str.2(%rip), %rsi
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rsi, %rdx
	movzbl	%al, %eax
	movl	4(%rcx,%rax,4), %ebx
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_DEBUG
	movl	(%r14), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movl	24(%r14), %edi
	movq	16(%r14), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	8(%r14), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
LBB0_7:
	movl	(%r14), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clk_disable_unprepare          ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	8(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEV_ERROR                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vop %s output to dp\n"

L_.str.1:                               ## @.str.1
	.asciz	"LIT"

L_.str.2:                               ## @.str.2
	.asciz	"BIG"

L_.str.3:                               ## @.str.3
	.asciz	"failed to enable grfclk %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Could not write to GRF: %d\n"

	.no_dead_strip	_rockchip_dp_drm_encoder_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_dp_drm_encoder_enable
_rockchip_dp_drm_encoder_enable:        ; @rockchip_dp_drm_encoder_enable
	.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	x21, x1
	mov	x20, x0
	bl	_to_dp
	mov	x19, x0
	mov	x0, x20
	mov	x1, x21
	bl	_rockchip_dp_drm_get_new_crtc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x1, x0
	mov	x0, x21
	bl	_drm_atomic_get_old_crtc_state
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x0]
	cbnz	x8, LBB0_8
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_drm_of_encoder_active_endpoint_id
	tbnz	w0, #31, LBB0_8
; %bb.4:
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh2:
	adrp	x9, l_.str.2@PAGE
Lloh3:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w0, #0
	csel	x2, x9, x8, eq
	mov	w8, #8
	mov	w9, #4
	csel	x8, x9, x8, eq
	ldp	x0, x9, [x19, #8]
	ldr	w20, [x9, x8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_DEBUG
	ldr	w0, [x19]
	bl	_clk_prepare_enable
	tbnz	w0, #31, LBB0_9
; %bb.5:
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	mov	x2, x20
	bl	_regmap_write
	cbz	w0, LBB0_7
; %bb.6:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x1, l_.str.4@PAGE
Lloh7:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_DRM_DEV_ERROR
LBB0_7:
	ldr	w0, [x19]
	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	_clk_disable_unprepare
LBB0_8:
	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
LBB0_9:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@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	_DRM_DEV_ERROR
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vop %s output to dp\n"

l_.str.1:                               ; @.str.1
	.asciz	"LIT"

l_.str.2:                               ; @.str.2
	.asciz	"BIG"

l_.str.3:                               ; @.str.3
	.asciz	"failed to enable grfclk %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Could not write to GRF: %d\n"

	.no_dead_strip	_rockchip_dp_drm_encoder_enable
.subsections_via_symbols
