	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcde_dsi_bridge_mode_set
_mcde_dsi_bridge_mode_set:              ## @mcde_dsi_bridge_mode_set
	.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	%rsi, %r14
	callq	_bridge_to_mcde_dsi
	movq	%rax, %rbx
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movslq	(%r14), %rcx
	imulq	$1000, %rcx, %r8                ## imm = 0x3E8
	movl	24(%rbx), %edi
	movslq	8(%r14), %rdx
	movl	4(%r14), %ecx
	movq	_MIPI_DSI_MODE_VIDEO@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	andl	(%rax), %esi
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %r9
	cmoveq	%rax, %r9
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movq	8(%rbx), %rax
	movq	8(%rax), %rsi
	movq	16(%rax), %r15
	testq	%rsi, %rsi
	jne	LBB0_3
## %bb.2:
	movq	_DSI_DEFAULT_LP_FREQ_HZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_3:
	testq	%r15, %r15
	jne	LBB0_5
## %bb.4:
	movq	_DSI_DEFAULT_HS_FREQ_HZ@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_5:
	movl	40(%rbx), %edi
	callq	_clk_round_rate
	movq	%rax, 32(%rbx)
	movl	40(%rbx), %edi
	movq	%rax, %rsi
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	24(%rbx), %edi
	movq	32(%rbx), %rdx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movl	28(%rbx), %edi
	movq	%r15, %rsi
	callq	_clk_round_rate
	movq	%rax, 16(%rbx)
	movl	28(%rbx), %edi
	movq	%rax, %rsi
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	24(%rbx), %edi
	movq	16(%rbx), %rdx
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:
	movl	40(%rbx), %edi
	callq	_clk_prepare_enable
	movl	24(%rbx), %edi
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_17:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_11:
	movq	32(%rbx), %rdx
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_12:
	movl	28(%rbx), %edi
	callq	_clk_prepare_enable
	movl	24(%rbx), %edi
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
LBB0_14:
	movq	16(%rbx), %rdx
	leaq	L_.str.9(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_15:
	movq	8(%rbx), %rax
	movl	(%r12), %ecx
	testl	%ecx, (%rax)
	je	LBB0_16
## %bb.18:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mcde_dsi_setup_video_mode      ## TAILCALL
LBB0_16:
	movq	_DSI_CMD_MODE_CTL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	movq	_DSI_CMD_MODE_CTL_IF1_ID_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%r14), %rsi
	addq	(%rbx), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no DSI device attached to encoder!\n"

L_.str.1:                               ## @.str.1
	.asciz	"set DSI master to %dx%d %lu Hz %s mode\n"

	.comm	_MIPI_DSI_MODE_VIDEO,4,2        ## @MIPI_DSI_MODE_VIDEO
L_.str.2:                               ## @.str.2
	.asciz	"VIDEO"

L_.str.3:                               ## @.str.3
	.asciz	"CMD"

	.comm	_DSI_DEFAULT_LP_FREQ_HZ,8,3     ## @DSI_DEFAULT_LP_FREQ_HZ
	.comm	_DSI_DEFAULT_HS_FREQ_HZ,8,3     ## @DSI_DEFAULT_HS_FREQ_HZ
L_.str.4:                               ## @.str.4
	.asciz	"failed to set LP clock rate %lu Hz\n"

L_.str.5:                               ## @.str.5
	.asciz	"failed to set HS clock rate %lu Hz\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed to enable LP clock\n"

L_.str.7:                               ## @.str.7
	.asciz	"DSI LP clock rate %lu Hz\n"

L_.str.8:                               ## @.str.8
	.asciz	"failed to enable HS clock\n"

L_.str.9:                               ## @.str.9
	.asciz	"DSI HS clock rate %lu Hz\n"

	.comm	_DSI_CMD_MODE_CTL,8,3           ## @DSI_CMD_MODE_CTL
	.comm	_DSI_CMD_MODE_CTL_IF1_ID_MASK,4,2 ## @DSI_CMD_MODE_CTL_IF1_ID_MASK
	.no_dead_strip	_mcde_dsi_bridge_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcde_dsi_bridge_mode_set
_mcde_dsi_bridge_mode_set:              ; @mcde_dsi_bridge_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	bl	_bridge_to_mcde_dsi
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_7
; %bb.1:
	mov	w9, #1000
	ldp	w10, w11, [x20]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	mul	x9, x10, x9
	ldr	w0, [x19, #24]
	ldrsw	x2, [x20, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x22, _MIPI_DSI_MODE_VIDEO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MIPI_DSI_MODE_VIDEO@GOTPAGEOFF]
	ldr	w10, [x22]
Lloh2:
	adrp	x12, l_.str.2@PAGE
Lloh3:
	add	x12, x12, l_.str.2@PAGEOFF
Lloh4:
	adrp	x13, l_.str.3@PAGE
Lloh5:
	add	x13, x13, l_.str.3@PAGEOFF
	tst	w10, w8
	csel	x8, x13, x12, eq
	stp	x9, x8, [sp, #8]
	str	x11, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
Lloh8:
	adrp	x8, _DSI_DEFAULT_LP_FREQ_HZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DSI_DEFAULT_LP_FREQ_HZ@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh10:
	ldr	x8, [x8]
	ldp	x10, x9, [x9, #8]
	cmp	x10, #0
	csel	x1, x8, x10, eq
Lloh11:
	adrp	x8, _DSI_DEFAULT_HS_FREQ_HZ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DSI_DEFAULT_HS_FREQ_HZ@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x9, #0
	csel	x21, x8, x9, eq
	ldr	w0, [x19, #40]
	bl	_clk_round_rate
	mov	x1, x0
	str	x0, [x19, #32]
	ldr	w0, [x19, #40]
	bl	_clk_set_rate
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #32]
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
LBB0_3:
	ldr	w0, [x19, #28]
	mov	x1, x21
	bl	_clk_round_rate
	mov	x1, x0
	str	x0, [x19, #16]
	ldr	w0, [x19, #28]
	bl	_clk_set_rate
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #16]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
LBB0_5:
	ldr	w0, [x19, #40]
	bl	_clk_prepare_enable
	mov	x8, x0
	ldr	w0, [x19, #24]
	cbz	w8, LBB0_8
; %bb.6:
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_7:
	ldr	w0, [x19, #24]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	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
	add	sp, sp, #80
	b	_dev_err
LBB0_8:
	ldr	x2, [x19, #32]
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_info
LBB0_9:
	ldr	w0, [x19, #28]
	bl	_clk_prepare_enable
	mov	x8, x0
	ldr	w0, [x19, #24]
	cbz	w8, LBB0_11
; %bb.10:
Lloh24:
	adrp	x1, l_.str.8@PAGE
Lloh25:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_11:
	ldr	x2, [x19, #16]
Lloh26:
	adrp	x1, l_.str.9@PAGE
Lloh27:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_dev_info
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	x1, x20
	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
	add	sp, sp, #80
	b	_mcde_dsi_setup_video_mode
LBB0_14:
	ldr	x8, [x19]
Lloh28:
	adrp	x20, _DSI_CMD_MODE_CTL@GOTPAGE
Lloh29:
	ldr	x20, [x20, _DSI_CMD_MODE_CTL@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh30:
	adrp	x8, _DSI_CMD_MODE_CTL_IF1_ID_MASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DSI_CMD_MODE_CTL_IF1_ID_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	bic	w0, w0, w8
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	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
	add	sp, sp, #80
	b	_writel
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no DSI device attached to encoder!\n"

l_.str.1:                               ; @.str.1
	.asciz	"set DSI master to %dx%d %lu Hz %s mode\n"

	.comm	_MIPI_DSI_MODE_VIDEO,4,2        ; @MIPI_DSI_MODE_VIDEO
l_.str.2:                               ; @.str.2
	.asciz	"VIDEO"

l_.str.3:                               ; @.str.3
	.asciz	"CMD"

	.comm	_DSI_DEFAULT_LP_FREQ_HZ,8,3     ; @DSI_DEFAULT_LP_FREQ_HZ
	.comm	_DSI_DEFAULT_HS_FREQ_HZ,8,3     ; @DSI_DEFAULT_HS_FREQ_HZ
l_.str.4:                               ; @.str.4
	.asciz	"failed to set LP clock rate %lu Hz\n"

l_.str.5:                               ; @.str.5
	.asciz	"failed to set HS clock rate %lu Hz\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed to enable LP clock\n"

l_.str.7:                               ; @.str.7
	.asciz	"DSI LP clock rate %lu Hz\n"

l_.str.8:                               ; @.str.8
	.asciz	"failed to enable HS clock\n"

l_.str.9:                               ; @.str.9
	.asciz	"DSI HS clock rate %lu Hz\n"

	.comm	_DSI_CMD_MODE_CTL,8,3           ; @DSI_CMD_MODE_CTL
	.comm	_DSI_CMD_MODE_CTL_IF1_ID_MASK,4,2 ; @DSI_CMD_MODE_CTL_IF1_ID_MASK
	.no_dead_strip	_mcde_dsi_bridge_mode_set
.subsections_via_symbols
