	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc_stream_enable
_tc_stream_enable:                      ## @tc_stream_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	16(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_tc_test_pattern@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_2
## %bb.1:
	movl	12(%rbx), %edi
	callq	_clk_get_rate
	imull	$1000, 8(%rbx), %edx            ## imm = 0x3E8
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_tc_pxl_pll_en
	testl	%eax, %eax
	jne	LBB0_12
LBB0_2:
	leaq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_tc_set_video_mode
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:
	movq	%rbx, %rdi
	callq	_tc_stream_clock_calc
	testl	%eax, %eax
	jne	LBB0_12
## %bb.4:
	movq	_VID_MN_GEN@GOTPCREL(%rip), %rax
	movq	_DP_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	orl	(%rax), %r14d
	movq	_DP_LINK_CAP_ENHANCED_FRAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%rbx), %eax
	je	LBB0_6
## %bb.5:
	movq	_EF_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	orl	%eax, %r14d
	movl	(%rbx), %edi
	movq	_DP0CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%r14d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_12
## %bb.7:
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	movq	_VID_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movl	(%rbx), %edi
	movl	(%r12), %esi
	movl	%r14d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_8
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_DP0_AUDSRC_NO_INPUT@GOTPCREL(%rip), %rax
	cmpq	$0, (%r15)
	jne	LBB0_9
## %bb.10:
	movq	_DP0_VIDSRC_DPI_RX@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_9:
	movq	_DP0_VIDSRC_COLOR_BAR@GOTPCREL(%rip), %rcx
LBB0_11:
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%rbx), %edi
	movq	_SYSCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enable video stream\n"

	.comm	_tc_test_pattern,8,3            ## @tc_test_pattern
	.comm	_VID_MN_GEN,4,2                 ## @VID_MN_GEN
	.comm	_DP_EN,4,2                      ## @DP_EN
	.comm	_DP_LINK_CAP_ENHANCED_FRAMING,4,2 ## @DP_LINK_CAP_ENHANCED_FRAMING
	.comm	_EF_EN,4,2                      ## @EF_EN
	.comm	_DP0CTL,4,2                     ## @DP0CTL
	.comm	_VID_EN,4,2                     ## @VID_EN
	.comm	_DP0_AUDSRC_NO_INPUT,4,2        ## @DP0_AUDSRC_NO_INPUT
	.comm	_DP0_VIDSRC_COLOR_BAR,4,2       ## @DP0_VIDSRC_COLOR_BAR
	.comm	_DP0_VIDSRC_DPI_RX,4,2          ## @DP0_VIDSRC_DPI_RX
	.comm	_SYSCTRL,4,2                    ## @SYSCTRL
	.no_dead_strip	_tc_stream_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc_stream_enable
_tc_stream_enable:                      ; @tc_stream_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	x19, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh2:
	adrp	x21, _tc_test_pattern@GOTPAGE
Lloh3:
	ldr	x21, [x21, _tc_test_pattern@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #12]
	bl	_clk_get_rate
	mov	x1, x0
	ldr	w8, [x19, #8]
	mov	w9, #1000
	mul	w2, w8, w9
	mov	x0, x19
	bl	_tc_pxl_pll_en
	cbnz	w0, LBB0_6
LBB0_2:
	add	x1, x19, #8
	mov	x0, x19
	bl	_tc_set_video_mode
	cbnz	w0, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_tc_stream_clock_calc
	cbnz	w0, LBB0_6
; %bb.4:
Lloh4:
	adrp	x8, _VID_MN_GEN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VID_MN_GEN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _DP_EN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DP_EN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _DP_LINK_CAP_ENHANCED_FRAMING@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DP_LINK_CAP_ENHANCED_FRAMING@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	ldp	w0, w10, [x19]
	tst	w9, w10
Lloh13:
	adrp	x9, _EF_EN@GOTPAGE
Lloh14:
	ldr	x9, [x9, _EF_EN@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w20, w8, w9
Lloh16:
	adrp	x22, _DP0CTL@GOTPAGE
Lloh17:
	ldr	x22, [x22, _DP0CTL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, x20
	bl	_regmap_write
	cbnz	w0, LBB0_6
; %bb.5:
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
Lloh18:
	adrp	x8, _VID_EN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VID_EN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w2, w8, w20
	ldr	w0, [x19]
	ldr	w1, [x22]
	bl	_regmap_write
	cbz	w0, LBB0_7
LBB0_6:
	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_7:
Lloh21:
	adrp	x8, _DP0_AUDSRC_NO_INPUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DP0_AUDSRC_NO_INPUT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _DP0_VIDSRC_DPI_RX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DP0_VIDSRC_DPI_RX@GOTPAGEOFF]
Lloh26:
	adrp	x10, _DP0_VIDSRC_COLOR_BAR@GOTPAGE
Lloh27:
	ldr	x10, [x10, _DP0_VIDSRC_COLOR_BAR@GOTPAGEOFF]
	ldr	x11, [x21]
	cmp	x11, #0
	csel	x9, x9, x10, eq
	ldr	w9, [x9]
	orr	w2, w9, w8
	ldr	w0, [x19]
Lloh28:
	adrp	x8, _SYSCTRL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SYSCTRL@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	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	_regmap_write
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enable video stream\n"

	.comm	_tc_test_pattern,8,3            ; @tc_test_pattern
	.comm	_VID_MN_GEN,4,2                 ; @VID_MN_GEN
	.comm	_DP_EN,4,2                      ; @DP_EN
	.comm	_DP_LINK_CAP_ENHANCED_FRAMING,4,2 ; @DP_LINK_CAP_ENHANCED_FRAMING
	.comm	_EF_EN,4,2                      ; @EF_EN
	.comm	_DP0CTL,4,2                     ; @DP0CTL
	.comm	_VID_EN,4,2                     ; @VID_EN
	.comm	_DP0_AUDSRC_NO_INPUT,4,2        ; @DP0_AUDSRC_NO_INPUT
	.comm	_DP0_VIDSRC_COLOR_BAR,4,2       ; @DP0_VIDSRC_COLOR_BAR
	.comm	_DP0_VIDSRC_DPI_RX,4,2          ; @DP0_VIDSRC_DPI_RX
	.comm	_SYSCTRL,4,2                    ; @SYSCTRL
	.no_dead_strip	_tc_stream_enable
.subsections_via_symbols
