	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function komeda_crtc_prepare
_komeda_crtc_prepare:                   ## @komeda_crtc_prepare
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rax
	movq	(%rax), %r13
	movq	16(%rdi), %r12
	movl	(%rdi), %edi
	callq	_to_kcrtc_st
	movq	%rax, %r14
	leaq	4(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	(%r13), %r15d
	movl	(%r12), %edi
	callq	_BIT
	movl	%eax, %ebx
	orl	%r15d, %ebx
	xorl	%edi, %edi
	cmpl	(%r13), %ebx
	sete	%dil
	callq	_WARN_ON
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movl	(%r13), %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%r12d, %r15d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_4:
	movl	%ebx, (%r13)
	movq	_KOMEDA_MODE_DUAL_DISP@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_9
## %bb.5:
	movl	8(%r13), %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_komeda_crtc_get_aclk
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_7:
	movl	8(%r13), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_9:
	movl	4(%r12), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	imull	$1000, (%rax), %esi             ## imm = 0x3E8
	callq	_clk_set_rate
	testl	%eax, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_11
## %bb.10:
	movl	(%r12), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_11:
	movl	4(%r12), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r14d
	movl	(%r12), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%r14d, %r15d
LBB0_13:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %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	"failed to change opmode: 0x%x -> 0x%x.\n,"

	.comm	_KOMEDA_MODE_DUAL_DISP,4,2      ## @KOMEDA_MODE_DUAL_DISP
L_.str.1:                               ## @.str.1
	.asciz	"failed to set aclk.\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to enable aclk.\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to set pxlclk for pipe%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to enable pxl clk for pipe%d.\n"

	.no_dead_strip	_komeda_crtc_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function komeda_crtc_prepare
_komeda_crtc_prepare:                   ; @komeda_crtc_prepare
	.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
	ldp	x8, x24, [x0, #8]
	ldr	x21, [x8]
	ldr	w0, [x0]
	bl	_to_kcrtc_st
	mov	x20, x0
	add	x19, x21, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w22, [x21]
	ldr	w0, [x24]
	bl	_BIT
	orr	w23, w0, w22
	ldr	w8, [x21]
	cmp	w23, w8
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_14
LBB0_2:
	ldr	x8, [x21, #16]
	ldr	x8, [x8]
	mov	x0, x21
	mov	x1, x23
	blr	x8
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w8, [x21]
	stp	x8, x23, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_13
LBB0_4:
	str	w23, [x21]
Lloh2:
	adrp	x8, _KOMEDA_MODE_DUAL_DISP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KOMEDA_MODE_DUAL_DISP@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w23, w8
	b.eq	LBB0_9
; %bb.5:
	ldr	w22, [x21, #8]
	mov	x0, x20
	bl	_komeda_crtc_get_aclk
	mov	x1, x0
	mov	x0, x22
	bl	_clk_set_rate
	cbz	w0, LBB0_7
; %bb.6:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_7:
	ldr	w0, [x21, #8]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_9
; %bb.8:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
LBB0_9:
	ldr	w0, [x24, #4]
	ldr	w8, [x20]
	mov	w9, #1000
	mul	w1, w8, w9
	bl	_clk_set_rate
	cbz	w0, LBB0_11
; %bb.10:
	ldr	w8, [x24]
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
LBB0_11:
	ldr	w0, [x24, #4]
	bl	_clk_prepare_enable
	mov	x22, x0
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w8, [x24]
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_13:
	bl	_DRM_ERROR
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to change opmode: 0x%x -> 0x%x.\n,"

	.comm	_KOMEDA_MODE_DUAL_DISP,4,2      ; @KOMEDA_MODE_DUAL_DISP
l_.str.1:                               ; @.str.1
	.asciz	"failed to set aclk.\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to enable aclk.\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to set pxlclk for pipe%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to enable pxl clk for pipe%d.\n"

	.no_dead_strip	_komeda_crtc_prepare
.subsections_via_symbols
