	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_dpi_bind
_mtk_dpi_bind:                          ## @mtk_dpi_bind
	.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
	movq	%rdx, %r14
	movq	%rdi, %r12
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_mtk_ddp_comp_register
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r15, %r13
	addq	$4, %r13
	movq	_DRM_MODE_ENCODER_TMDS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_mtk_dpi_encoder_funcs@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	callq	_drm_encoder_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_1:
	movl	%eax, %ebx
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_4:
	movq	_mtk_dpi_encoder_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	callq	_drm_encoder_helper_add
	movl	$1, %edi
	callq	_BIT
	movl	%eax, 4(%r15)
	movl	24(%r15), %esi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_drm_bridge_attach
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r13, %rdi
	callq	_drm_encoder_cleanup
                                        ## kill: def $ebx killed $ebx def $rbx
LBB0_6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mtk_ddp_comp_unregister
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_MTK_DPI_OUT_BIT_NUM_8BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	movq	_MTK_DPI_OUT_CHANNEL_SWAP_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	_MTK_DPI_OUT_YC_MAP_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	_MTK_DPI_COLOR_FORMAT_RGB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to register component %pOF: %d\n"

	.comm	_mtk_dpi_encoder_funcs,4,2      ## @mtk_dpi_encoder_funcs
	.comm	_DRM_MODE_ENCODER_TMDS,4,2      ## @DRM_MODE_ENCODER_TMDS
L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize decoder: %d\n"

	.comm	_mtk_dpi_encoder_helper_funcs,4,2 ## @mtk_dpi_encoder_helper_funcs
L_.str.2:                               ## @.str.2
	.asciz	"Failed to attach bridge: %d\n"

	.comm	_MTK_DPI_OUT_BIT_NUM_8BITS,4,2  ## @MTK_DPI_OUT_BIT_NUM_8BITS
	.comm	_MTK_DPI_OUT_CHANNEL_SWAP_RGB,4,2 ## @MTK_DPI_OUT_CHANNEL_SWAP_RGB
	.comm	_MTK_DPI_OUT_YC_MAP_RGB,4,2     ## @MTK_DPI_OUT_YC_MAP_RGB
	.comm	_MTK_DPI_COLOR_FORMAT_RGB,4,2   ## @MTK_DPI_COLOR_FORMAT_RGB
	.no_dead_strip	_mtk_dpi_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_dpi_bind
_mtk_dpi_bind:                          ; @mtk_dpi_bind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x22, x0
	bl	_dev_get_drvdata
	mov	x19, x0
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_ddp_comp_register
	tbnz	w0, #31, LBB0_3
; %bb.1:
	add	x23, x19, #4
Lloh0:
	adrp	x8, _DRM_MODE_ENCODER_TMDS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_ENCODER_TMDS@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x2, _mtk_dpi_encoder_funcs@GOTPAGE
Lloh4:
	ldr	x2, [x2, _mtk_dpi_encoder_funcs@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x23
	mov	x4, #0
	bl	_drm_encoder_init
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_err
	b	LBB0_6
LBB0_3:
	mov	x21, x0
	ldr	w2, [x22]
	str	x21, [sp]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_7
LBB0_4:
Lloh9:
	adrp	x1, _mtk_dpi_encoder_helper_funcs@GOTPAGE
Lloh10:
	ldr	x1, [x1, _mtk_dpi_encoder_helper_funcs@GOTPAGEOFF]
	mov	x0, x23
	bl	_drm_encoder_helper_add
	mov	w0, #1
	bl	_BIT
	str	w0, [x19, #4]
	ldr	w1, [x19, #24]
	mov	x0, x23
	mov	x2, #0
	bl	_drm_bridge_attach
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.5:
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_err
	mov	x0, x23
	bl	_drm_encoder_cleanup
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_ddp_comp_unregister
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
Lloh13:
	adrp	x8, _MTK_DPI_OUT_BIT_NUM_8BITS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MTK_DPI_OUT_BIT_NUM_8BITS@GOTPAGEOFF]
Lloh15:
	adrp	x9, _MTK_DPI_OUT_CHANNEL_SWAP_RGB@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MTK_DPI_OUT_CHANNEL_SWAP_RGB@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
Lloh19:
	adrp	x8, _MTK_DPI_OUT_YC_MAP_RGB@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MTK_DPI_OUT_YC_MAP_RGB@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _MTK_DPI_COLOR_FORMAT_RGB@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MTK_DPI_COLOR_FORMAT_RGB@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #8]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to register component %pOF: %d\n"

	.comm	_mtk_dpi_encoder_funcs,4,2      ; @mtk_dpi_encoder_funcs
	.comm	_DRM_MODE_ENCODER_TMDS,4,2      ; @DRM_MODE_ENCODER_TMDS
l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize decoder: %d\n"

	.comm	_mtk_dpi_encoder_helper_funcs,4,2 ; @mtk_dpi_encoder_helper_funcs
l_.str.2:                               ; @.str.2
	.asciz	"Failed to attach bridge: %d\n"

	.comm	_MTK_DPI_OUT_BIT_NUM_8BITS,4,2  ; @MTK_DPI_OUT_BIT_NUM_8BITS
	.comm	_MTK_DPI_OUT_CHANNEL_SWAP_RGB,4,2 ; @MTK_DPI_OUT_CHANNEL_SWAP_RGB
	.comm	_MTK_DPI_OUT_YC_MAP_RGB,4,2     ; @MTK_DPI_OUT_YC_MAP_RGB
	.comm	_MTK_DPI_COLOR_FORMAT_RGB,4,2   ; @MTK_DPI_COLOR_FORMAT_RGB
	.no_dead_strip	_mtk_dpi_bind
.subsections_via_symbols
