	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_bridge_attach
_mtk_hdmi_bridge_attach:                ## @mtk_hdmi_bridge_attach
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_hdmi_ctx_from_bridge
	movq	%rax, %r14
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%r14, %rbx
	addq	$16, %rbx
	movq	_DRM_MODE_CONNECTOR_HDMIA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_mtk_hdmi_connector_funcs@GOTPCREL(%rip), %rdx
	movq	%rbx, %rsi
	callq	_drm_connector_init
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r12d
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	_mtk_hdmi_connector_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_drm_connector_helper_add
	movq	_DRM_CONNECTOR_POLL_HPD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	$1, 16(%r14)
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_drm_connector_attach_encoder
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movq	8(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.6:
	movq	(%r15), %rdi
	movq	%r15, %rdx
	callq	_drm_bridge_attach
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r12d
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movl	%r12d, %edx
	callq	_dev_err
LBB0_9:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r14), %edx
	movl	4(%r14), %edi
	movq	_mtk_hdmi_hpd_event@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mtk_cec_set_hpd_event
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_mtk_hdmi_connector_funcs,4,2   ## @mtk_hdmi_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_HDMIA,4,2   ## @DRM_MODE_CONNECTOR_HDMIA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize connector: %d\n"

	.comm	_mtk_hdmi_connector_helper_funcs,4,2 ## @mtk_hdmi_connector_helper_funcs
	.comm	_DRM_CONNECTOR_POLL_HPD,4,2     ## @DRM_CONNECTOR_POLL_HPD
L_.str.1:                               ## @.str.1
	.asciz	"Failed to attach connector to encoder: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to attach external bridge: %d\n"

	.comm	_mtk_hdmi_hpd_event,4,2         ## @mtk_hdmi_hpd_event
	.no_dead_strip	_mtk_hdmi_bridge_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function mtk_hdmi_bridge_attach
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_mtk_hdmi_bridge_attach:                ; @mtk_hdmi_bridge_attach
	.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	x20, x0
	bl	_hdmi_ctx_from_bridge
	mov	x19, x0
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x22, x19, #16
Lloh0:
	adrp	x8, _DRM_MODE_CONNECTOR_HDMIA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_CONNECTOR_HDMIA@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x2, _mtk_hdmi_connector_funcs@GOTPAGE
Lloh4:
	ldr	x2, [x2, _mtk_hdmi_connector_funcs@GOTPAGEOFF]
	mov	x1, x22
	bl	_drm_connector_init
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_2:
Lloh7:
	adrp	x1, _mtk_hdmi_connector_helper_funcs@GOTPAGE
Lloh8:
	ldr	x1, [x1, _mtk_hdmi_connector_helper_funcs@GOTPAGEOFF]
	mov	x0, x22
	bl	_drm_connector_helper_add
Lloh9:
	adrp	x8, _DRM_CONNECTOR_POLL_HPD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DRM_CONNECTOR_POLL_HPD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #24]
Lloh12:
	adrp	x8, lCPI0_0@PAGE
Lloh13:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #16]
	ldr	x1, [x20]
	mov	x0, x22
	bl	_drm_connector_attach_encoder
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_4:
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_9
; %bb.5:
	ldr	x0, [x20]
	mov	x2, x20
	bl	_drm_bridge_attach
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	mov	x2, x21
	bl	_dev_err
LBB0_8:
	mov	x0, x21
	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:
Lloh18:
	adrp	x8, _mtk_hdmi_hpd_event@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mtk_hdmi_hpd_event@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldp	w2, w0, [x19]
	bl	_mtk_cec_set_hpd_event
	mov	w21, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_mtk_hdmi_connector_funcs,4,2   ; @mtk_hdmi_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_HDMIA,4,2   ; @DRM_MODE_CONNECTOR_HDMIA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize connector: %d\n"

	.comm	_mtk_hdmi_connector_helper_funcs,4,2 ; @mtk_hdmi_connector_helper_funcs
	.comm	_DRM_CONNECTOR_POLL_HPD,4,2     ; @DRM_CONNECTOR_POLL_HPD
l_.str.1:                               ; @.str.1
	.asciz	"Failed to attach connector to encoder: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to attach external bridge: %d\n"

	.comm	_mtk_hdmi_hpd_event,4,2         ; @mtk_hdmi_hpd_event
	.no_dead_strip	_mtk_hdmi_bridge_attach
.subsections_via_symbols
