	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_output_dsi_enable
_mtk_output_dsi_enable:                 ## @mtk_output_dsi_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpl	$0, (%rdi)
	je	LBB0_1
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	callq	_mtk_dsi_poweron
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	%rbx, %rdi
	callq	_mtk_dsi_set_mode
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_mtk_dsi_clk_hs_mode
	movq	%rbx, %rdi
	callq	_mtk_dsi_start
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_drm_panel_enable
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	%rbx, %rdi
	callq	_mtk_dsi_stop
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_mtk_dsi_poweroff               ## TAILCALL
LBB0_6:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_4:
	movl	$1, (%rbx)
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to power on dsi\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to enable the panel\n"

	.no_dead_strip	_mtk_output_dsi_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_output_dsi_enable
_mtk_output_dsi_enable:                 ; @mtk_output_dsi_enable
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cbz	w8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x0
	bl	_mtk_dsi_poweron
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_mtk_dsi_set_mode
	mov	w20, #1
	mov	x0, x19
	mov	w1, #1
	bl	_mtk_dsi_clk_hs_mode
	mov	x0, x19
	bl	_mtk_dsi_start
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_7
; %bb.4:
	bl	_drm_panel_enable
	cbz	x0, LBB0_7
; %bb.5:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_mtk_dsi_stop
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mtk_dsi_poweroff
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_DRM_ERROR
LBB0_7:
	str	w20, [x19]
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to power on dsi\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to enable the panel\n"

	.no_dead_strip	_mtk_output_dsi_enable
.subsections_via_symbols
