	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_crtc_compute_clock
_g4x_crtc_compute_clock:                ## @g4x_crtc_compute_clock
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_i915
	movq	%rax, %rbx
	leaq	12(%r13), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_INTEL_OUTPUT_LVDS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_intel_crtc_has_type
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rbx, %rdi
	callq	_intel_panel_use_ssc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	(%rbx), %r15d
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_4
LBB0_7:
	movq	_INTEL_OUTPUT_HDMI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_intel_crtc_has_type
	movl	$96000, %r15d                   ## imm = 0x17700
	movq	_intel_limits_g4x_hdmi@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:
	movq	_INTEL_OUTPUT_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_intel_crtc_has_type
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movq	_INTEL_OUTPUT_SDVO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_intel_crtc_has_type
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:
	movq	_intel_limits_i9xx_sdvo@GOTPCREL(%rip), %r12
	cmpl	$0, 8(%r13)
	jne	LBB0_15
	jmp	LBB0_13
LBB0_2:
	movl	$96000, %r15d                   ## imm = 0x17700
LBB0_4:
	movq	%rbx, %rdi
	callq	_intel_is_dual_link_lvds
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movq	_intel_limits_g4x_single_channel_lvds@GOTPCREL(%rip), %r12
	cmpl	$0, 8(%r13)
	jne	LBB0_15
	jmp	LBB0_13
LBB0_5:
	movq	_intel_limits_g4x_dual_channel_lvds@GOTPCREL(%rip), %r12
LBB0_12:
	cmpl	$0, 8(%r13)
	jne	LBB0_15
LBB0_13:
	movl	4(%r13), %edx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	movq	%r13, %r9
	callq	_g4x_find_best_dpll
	testl	%eax, %eax
	je	LBB0_14
LBB0_15:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_i9xx_compute_dpll
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_10:
	movq	_intel_limits_g4x_sdvo@GOTPCREL(%rip), %r12
	cmpl	$0, 8(%r13)
	jne	LBB0_15
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_OUTPUT_LVDS,4,2          ## @INTEL_OUTPUT_LVDS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"using SSC reference clock of %d kHz\n"

	.comm	_intel_limits_g4x_dual_channel_lvds,4,2 ## @intel_limits_g4x_dual_channel_lvds
	.comm	_intel_limits_g4x_single_channel_lvds,4,2 ## @intel_limits_g4x_single_channel_lvds
	.comm	_INTEL_OUTPUT_HDMI,4,2          ## @INTEL_OUTPUT_HDMI
	.comm	_INTEL_OUTPUT_ANALOG,4,2        ## @INTEL_OUTPUT_ANALOG
	.comm	_intel_limits_g4x_hdmi,4,2      ## @intel_limits_g4x_hdmi
	.comm	_INTEL_OUTPUT_SDVO,4,2          ## @INTEL_OUTPUT_SDVO
	.comm	_intel_limits_g4x_sdvo,4,2      ## @intel_limits_g4x_sdvo
	.comm	_intel_limits_i9xx_sdvo,4,2     ## @intel_limits_i9xx_sdvo
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't find PLL settings for mode!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_g4x_crtc_compute_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_crtc_compute_clock
_g4x_crtc_compute_clock:                ; @g4x_crtc_compute_clock
	.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, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_to_i915
	mov	x22, x0
	add	x0, x19, #12
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x8, _INTEL_OUTPUT_LVDS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_OUTPUT_LVDS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_crtc_has_type
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x22
	bl	_intel_panel_use_ssc
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w21, [x22]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_DEBUG_KMS
	b	LBB0_7
LBB0_3:
	mov	w21, #30464
	movk	w21, #1, lsl #16
Lloh5:
	adrp	x8, _INTEL_OUTPUT_HDMI@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INTEL_OUTPUT_HDMI@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_crtc_has_type
	cbnz	x0, LBB0_5
; %bb.4:
Lloh8:
	adrp	x8, _INTEL_OUTPUT_ANALOG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INTEL_OUTPUT_ANALOG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_crtc_has_type
	cbz	x0, LBB0_13
LBB0_5:
Lloh11:
	adrp	x0, _intel_limits_g4x_hdmi@GOTPAGE
Lloh12:
	ldr	x0, [x0, _intel_limits_g4x_hdmi@GOTPAGEOFF]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_10
	b	LBB0_9
LBB0_6:
	mov	w21, #30464
	movk	w21, #1, lsl #16
LBB0_7:
	mov	x0, x22
	bl	_intel_is_dual_link_lvds
Lloh13:
	adrp	x8, _intel_limits_g4x_dual_channel_lvds@GOTPAGE
Lloh14:
	ldr	x8, [x8, _intel_limits_g4x_dual_channel_lvds@GOTPAGEOFF]
Lloh15:
	adrp	x9, _intel_limits_g4x_single_channel_lvds@GOTPAGE
Lloh16:
	ldr	x9, [x9, _intel_limits_g4x_single_channel_lvds@GOTPAGEOFF]
LBB0_8:
	cmp	x0, #0
	csel	x0, x9, x8, eq
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_10
LBB0_9:
	ldr	w2, [x19, #4]
	mov	x1, x19
	mov	x3, x21
	mov	x4, #0
	mov	x5, x19
	bl	_g4x_find_best_dpll
	cbz	w0, LBB0_12
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_i9xx_compute_dpll
	mov	w0, #0
LBB0_11:
	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_12:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_13:
Lloh22:
	adrp	x8, _INTEL_OUTPUT_SDVO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _INTEL_OUTPUT_SDVO@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_crtc_has_type
Lloh25:
	adrp	x8, _intel_limits_g4x_sdvo@GOTPAGE
Lloh26:
	ldr	x8, [x8, _intel_limits_g4x_sdvo@GOTPAGEOFF]
Lloh27:
	adrp	x9, _intel_limits_i9xx_sdvo@GOTPAGE
Lloh28:
	ldr	x9, [x9, _intel_limits_i9xx_sdvo@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_OUTPUT_LVDS,4,2          ; @INTEL_OUTPUT_LVDS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"using SSC reference clock of %d kHz\n"

	.comm	_intel_limits_g4x_dual_channel_lvds,4,2 ; @intel_limits_g4x_dual_channel_lvds
	.comm	_intel_limits_g4x_single_channel_lvds,4,2 ; @intel_limits_g4x_single_channel_lvds
	.comm	_INTEL_OUTPUT_HDMI,4,2          ; @INTEL_OUTPUT_HDMI
	.comm	_INTEL_OUTPUT_ANALOG,4,2        ; @INTEL_OUTPUT_ANALOG
	.comm	_intel_limits_g4x_hdmi,4,2      ; @intel_limits_g4x_hdmi
	.comm	_INTEL_OUTPUT_SDVO,4,2          ; @INTEL_OUTPUT_SDVO
	.comm	_intel_limits_g4x_sdvo,4,2      ; @intel_limits_g4x_sdvo
	.comm	_intel_limits_i9xx_sdvo,4,2     ; @intel_limits_i9xx_sdvo
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't find PLL settings for mode!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_g4x_crtc_compute_clock
.subsections_via_symbols
