	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function mtk_dpi_set_display_mode
LCPI0_0:
	.long	16                              ## 0x10
	.long	4064                            ## 0xfe0
	.long	16                              ## 0x10
	.long	4064                            ## 0xfe0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_mtk_dpi_set_display_mode:              ## @mtk_dpi_set_display_mode
	.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
	subq	$248, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movl	$0, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movl	$0, -80(%rbp)
	movaps	%xmm0, -176(%rbp)
	movl	$0, -160(%rbp)
	movaps	%xmm0, -208(%rbp)
	movl	$0, -192(%rbp)
	movups	%xmm0, -116(%rbp)
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movq	32(%rdi), %rax
	movl	4(%rsi), %edi
	callq	*(%rax)
	movl	%eax, %r12d
	leaq	-144(%rbp), %rsi
	movq	%r14, %rdi
	callq	_drm_display_mode_to_videomode
	movl	-144(%rbp), %ecx
	movl	%ecx, %ebx
	imull	%r12d, %ebx
	movl	16(%r13), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_dbg
	movl	24(%r13), %edi
	movq	%rbx, %rsi
	callq	_clk_set_rate
	movl	24(%r13), %edi
	callq	_clk_get_rate
	movq	%rax, %r15
	movl	%r12d, %ecx
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_3
LBB0_1:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_3:
	movl	%eax, -144(%rbp)
	movl	20(%r13), %edi
	movl	%eax, %esi
	callq	_clk_set_rate
	movl	20(%r13), %edi
	callq	_clk_get_rate
	movl	%eax, -144(%rbp)
	movl	16(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_dev_dbg
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [16,4064,16,4064]
	movaps	%xmm0, -288(%rbp)
	movq	_MTK_DPI_POLARITY_FALLING@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, -240(%rbp)
	movq	_MTK_DPI_POLARITY_RISING@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%rdx, -248(%rbp)
	movq	_DISPLAY_FLAGS_HSYNC_HIGH@GOTPCREL(%rip), %rsi
	movl	-140(%rbp), %eax
	movl	(%rsi), %esi
	andl	%eax, %esi
	movq	%rcx, %rsi
	cmoveq	%rdx, %rsi
	movq	_DISPLAY_FLAGS_VSYNC_HIGH@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	andl	%eax, %edi
	movl	-124(%rbp), %edi
	cmoveq	%rdx, %rcx
	movq	%rsi, -256(%rbp)
	movq	%rcx, -264(%rbp)
	movl	-108(%rbp), %ecx
	movl	%ecx, -220(%rbp)
	movq	-116(%rbp), %rcx
	movq	%rcx, -228(%rbp)
	movl	$0, -232(%rbp)
	movl	-120(%rbp), %ecx
	movl	%ecx, -52(%rbp)
	movl	%edi, -56(%rbp)
	movl	-128(%rbp), %ecx
	movl	%ecx, -60(%rbp)
	movl	$0, -64(%rbp)
	movq	_DISPLAY_FLAGS_INTERLACED@GOTPCREL(%rip), %rbx
	movq	_DRM_MODE_FLAG_3D_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	andl	(%r14), %ecx
	testl	%eax, (%rbx)
	je	LBB0_7
## %bb.4:
	movl	-48(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -96(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -92(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -88(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -84(%rbp)
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.5:
	movl	-48(%rbp), %eax
	movl	%eax, -160(%rbp)
	movups	-64(%rbp), %xmm0
	movaps	%xmm0, -176(%rbp)
	movaps	%xmm0, -208(%rbp)
	movl	%eax, -192(%rbp)
	movl	$1, -96(%rbp)
	movl	$1, -208(%rbp)
	jmp	LBB0_9
LBB0_7:
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.8:
	movl	-48(%rbp), %eax
	movl	%eax, -160(%rbp)
	movups	-64(%rbp), %xmm0
	movaps	%xmm0, -176(%rbp)
	jmp	LBB0_9
LBB0_6:
	movl	$1, -96(%rbp)
LBB0_9:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_mtk_dpi_sw_reset
	leaq	-264(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_pol
	leaq	-232(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_hsync
	leaq	-64(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_vsync_lodd
	leaq	-176(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_vsync_rodd
	leaq	-96(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_vsync_leven
	leaq	-208(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_vsync_reven
	movl	(%r15), %eax
	xorl	%esi, %esi
	andl	(%r14), %eax
	setne	%sil
	movq	%r13, %rdi
	callq	_mtk_dpi_config_3d
	movl	(%rbx), %eax
	xorl	%esi, %esi
	andl	-140(%rbp), %eax
	setne	%sil
	movq	%r13, %rdi
	callq	_mtk_dpi_config_interface
	movl	(%rbx), %eax
	andl	-140(%rbp), %eax
	setne	%cl
	movl	-136(%rbp), %edx
	movl	-132(%rbp), %esi
	sarl	%cl, %edx
	movq	%r13, %rdi
	callq	_mtk_dpi_config_fb_size
	leaq	-288(%rbp), %rsi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_channel_limit
	movl	12(%r13), %esi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_bit_num
	movl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_channel_swap
	movl	4(%r13), %esi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_yc_map
	movl	(%r13), %esi
	movq	%r13, %rdi
	callq	_mtk_dpi_config_color_format
	movq	%r13, %rdi
	callq	_mtk_dpi_config_2n_h_fre
	movq	%r13, %rdi
	callq	_mtk_dpi_config_disable_edge
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_mtk_dpi_sw_reset
	xorl	%eax, %eax
	addq	$248, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Want PLL %lu Hz, pixel clock %lu Hz\n"

L_.str.1:                               ## @.str.1
	.asciz	"Got  PLL %lu Hz, pixel clock %lu Hz\n"

	.comm	_MTK_DPI_POLARITY_FALLING,8,3   ## @MTK_DPI_POLARITY_FALLING
	.comm	_MTK_DPI_POLARITY_RISING,8,3    ## @MTK_DPI_POLARITY_RISING
	.comm	_DISPLAY_FLAGS_HSYNC_HIGH,4,2   ## @DISPLAY_FLAGS_HSYNC_HIGH
	.comm	_DISPLAY_FLAGS_VSYNC_HIGH,4,2   ## @DISPLAY_FLAGS_VSYNC_HIGH
	.comm	_DISPLAY_FLAGS_INTERLACED,4,2   ## @DISPLAY_FLAGS_INTERLACED
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ## @DRM_MODE_FLAG_3D_MASK
	.no_dead_strip	_mtk_dpi_set_display_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function mtk_dpi_set_display_mode
lCPI0_0:
	.long	16                              ; 0x10
	.long	4064                            ; 0xfe0
	.long	16                              ; 0x10
	.long	4064                            ; 0xfe0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_mtk_dpi_set_display_mode:              ; @mtk_dpi_set_display_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #304
	.cfi_def_cfa_offset 304
	stp	x24, x23, [sp, #240]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #256]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #272]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #288]            ; 16-byte Folded Spill
	add	x29, sp, #288
	.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, x1
	mov	x19, x0
	add	x23, sp, #144
	str	wzr, [sp, #160]
	stp	xzr, xzr, [sp, #112]
	str	wzr, [sp, #128]
	stp	xzr, xzr, [sp, #80]
	str	wzr, [sp, #96]
	stp	xzr, xzr, [sp, #48]
	str	wzr, [sp, #64]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #28]
	stp	q0, q0, [sp]
	ldr	x8, [x0, #32]
	ldr	x8, [x8]
	ldr	w0, [x1, #4]
	blr	x8
	mov	x21, x0
	mov	x1, sp
	mov	x0, x20
	bl	_drm_display_mode_to_videomode
	ldr	w3, [sp]
	mul	w22, w3, w21
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
	ldr	w0, [x19, #24]
	mov	x1, x22
	bl	_clk_set_rate
	ldr	w0, [x19, #24]
	bl	_clk_get_rate
	mov	x22, x0
	mov	w8, w21
	udiv	x8, x0, x8
	str	w8, [sp]
	ldr	w0, [x19, #20]
	and	x1, x8, #0xffffffff
	bl	_clk_set_rate
	ldr	w0, [x19, #20]
	bl	_clk_get_rate
	mov	x3, x0
	str	w3, [sp]
	ldr	w0, [x19, #16]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_dbg
Lloh4:
	adrp	x8, lCPI0_0@PAGE
Lloh5:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
Lloh6:
	adrp	x8, _MTK_DPI_POLARITY_FALLING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTK_DPI_POLARITY_FALLING@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _MTK_DPI_POLARITY_RISING@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MTK_DPI_POLARITY_RISING@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	w10, [sp, #4]
Lloh12:
	adrp	x11, _DISPLAY_FLAGS_HSYNC_HIGH@GOTPAGE
Lloh13:
	ldr	x11, [x11, _DISPLAY_FLAGS_HSYNC_HIGH@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w11, w10
	csel	x11, x9, x8, eq
Lloh15:
	adrp	x12, _DISPLAY_FLAGS_VSYNC_HIGH@GOTPAGE
Lloh16:
	ldr	x12, [x12, _DISPLAY_FLAGS_VSYNC_HIGH@GOTPAGEOFF]
Lloh17:
	ldr	w12, [x12]
	tst	w12, w10
	stur	q0, [x29, #-64]
	stp	x9, x8, [x29, #-80]
	csel	x8, x9, x8, eq
	stp	x8, x11, [x29, #-96]
	ldr	w8, [sp, #36]
	ldur	d0, [sp, #28]
	stur	d0, [x23, #28]
	stur	w8, [x29, #-108]
	stur	wzr, [x29, #-120]
	ldr	w8, [sp, #24]
	ldr	d0, [sp, #16]
	stur	d0, [x23, #4]
	str	w8, [sp, #156]
	str	wzr, [sp, #144]
Lloh18:
	adrp	x21, _DISPLAY_FLAGS_INTERLACED@GOTPAGE
Lloh19:
	ldr	x21, [x21, _DISPLAY_FLAGS_INTERLACED@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh20:
	adrp	x22, _DRM_MODE_FLAG_3D_MASK@GOTPAGE
Lloh21:
	ldr	x22, [x22, _DRM_MODE_FLAG_3D_MASK@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w8, w9, w8
	ldr	w9, [x21]
	tst	w9, w10
	b.eq	LBB0_3
; %bb.1:
	ldr	q0, [sp, #144]
	str	q0, [sp, #112]
	ldr	w9, [sp, #160]
	str	w9, [sp, #128]
	cbz	w8, LBB0_5
; %bb.2:
	ldr	q0, [sp, #144]
	str	q0, [sp, #80]
	ldr	w8, [sp, #160]
	str	w8, [sp, #96]
	str	q0, [sp, #48]
	mov	w9, #1
	str	w9, [sp, #112]
	str	w8, [sp, #64]
	str	w9, [sp, #48]
	b	LBB0_6
LBB0_3:
	cbz	w8, LBB0_6
; %bb.4:
	ldr	q0, [sp, #144]
	str	q0, [sp, #80]
	ldr	w8, [sp, #160]
	str	w8, [sp, #96]
	b	LBB0_6
LBB0_5:
	mov	w8, #1
	str	w8, [sp, #112]
LBB0_6:
	mov	x0, x19
	mov	w1, #1
	bl	_mtk_dpi_sw_reset
	sub	x1, x29, #96
	mov	x0, x19
	bl	_mtk_dpi_config_pol
	sub	x1, x29, #120
	mov	x0, x19
	bl	_mtk_dpi_config_hsync
	add	x1, sp, #144
	mov	x0, x19
	bl	_mtk_dpi_config_vsync_lodd
	add	x1, sp, #80
	mov	x0, x19
	bl	_mtk_dpi_config_vsync_rodd
	add	x1, sp, #112
	mov	x0, x19
	bl	_mtk_dpi_config_vsync_leven
	add	x1, sp, #48
	mov	x0, x19
	bl	_mtk_dpi_config_vsync_reven
	ldr	w8, [x20]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w1, ne
	mov	x0, x19
	bl	_mtk_dpi_config_3d
	ldr	w8, [sp, #4]
	ldr	w9, [x21]
	tst	w9, w8
	cset	w1, ne
	mov	x0, x19
	bl	_mtk_dpi_config_interface
	ldr	w8, [x21]
	ldp	w9, w10, [sp, #4]
	tst	w8, w9
	cset	w8, ne
	ldr	w1, [sp, #12]
	asr	w2, w10, w8
	mov	x0, x19
	bl	_mtk_dpi_config_fb_size
	sub	x1, x29, #64
	mov	x0, x19
	bl	_mtk_dpi_config_channel_limit
	ldr	w1, [x19, #12]
	mov	x0, x19
	bl	_mtk_dpi_config_bit_num
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_mtk_dpi_config_channel_swap
	ldr	w1, [x19, #4]
	mov	x0, x19
	bl	_mtk_dpi_config_yc_map
	ldr	w1, [x19]
	mov	x0, x19
	bl	_mtk_dpi_config_color_format
	mov	x0, x19
	bl	_mtk_dpi_config_2n_h_fre
	mov	x0, x19
	bl	_mtk_dpi_config_disable_edge
	mov	x0, x19
	mov	w1, #0
	bl	_mtk_dpi_sw_reset
	mov	w0, #0
	ldp	x29, x30, [sp, #288]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #272]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #256]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #240]            ; 16-byte Folded Reload
	add	sp, sp, #304
	ret
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdrp	Lloh4, Lloh6
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Want PLL %lu Hz, pixel clock %lu Hz\n"

l_.str.1:                               ; @.str.1
	.asciz	"Got  PLL %lu Hz, pixel clock %lu Hz\n"

	.comm	_MTK_DPI_POLARITY_FALLING,8,3   ; @MTK_DPI_POLARITY_FALLING
	.comm	_MTK_DPI_POLARITY_RISING,8,3    ; @MTK_DPI_POLARITY_RISING
	.comm	_DISPLAY_FLAGS_HSYNC_HIGH,4,2   ; @DISPLAY_FLAGS_HSYNC_HIGH
	.comm	_DISPLAY_FLAGS_VSYNC_HIGH,4,2   ; @DISPLAY_FLAGS_VSYNC_HIGH
	.comm	_DISPLAY_FLAGS_INTERLACED,4,2   ; @DISPLAY_FLAGS_INTERLACED
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ; @DRM_MODE_FLAG_3D_MASK
	.no_dead_strip	_mtk_dpi_set_display_mode
.subsections_via_symbols
