	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bxt_set_cdclk
_bxt_set_cdclk:                         ## @bxt_set_cdclk
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rsi), %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rsi), %r15d
	movl	%r15d, %edi
	movl	%r14d, %esi
	callq	_DIV_ROUND_CLOSEST
                                        ## kill: def $eax killed $eax def $rax
	movq	_BXT_CDCLK_CD2X_DIV_SEL_1@GOTPCREL(%rip), %rbx
	addl	$-2, %eax
	cmpl	$6, %eax
	ja	LBB0_2
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	movq	%r13, %rdi
	callq	_IS_GEMINILAKE
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_WARN
	movq	_BXT_CDCLK_CD2X_DIV_SEL_1_5@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
LBB0_4:
	movq	_BXT_CDCLK_CD2X_DIV_SEL_2@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
LBB0_2:
	xorl	%edi, %edi
	cmpl	(%r13), %r14d
	setne	%dil
	callq	_WARN_ON
	xorl	%edi, %edi
	testl	%r15d, %r15d
	setne	%dil
	callq	_WARN_ON
	jmp	LBB0_6
LBB0_5:
	movq	_BXT_CDCLK_CD2X_DIV_SEL_4@GOTPCREL(%rip), %rbx
LBB0_6:
	movl	(%rbx), %r12d
	movq	_HSW_PCODE_DE_WRITE_FREQ_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$-2147483648, %edx              ## imm = 0x80000000
	movl	$150, %ecx
	movl	$2, %r8d
	callq	_sandybridge_pcode_write_timeout
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
LBB0_9:
	movl	4(%r13), %eax
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	cmpl	%r15d, %eax
	je	LBB0_12
## %bb.11:
	movq	%r13, %rdi
	callq	_bxt_de_pll_disable
	movl	4(%r13), %eax
LBB0_12:
	cmpl	%r15d, %eax
	je	LBB0_14
## %bb.13:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_bxt_de_pll_enable
LBB0_14:
	movl	%r14d, %edi
	callq	_skl_cdclk_decimal
	movl	%eax, %ebx
	orl	%r12d, %ebx
	movq	_INVALID_PIPE@GOTPCREL(%rip), %r15
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	cmpl	%edi, (%r15)
	jne	LBB0_16
## %bb.15:
	movq	_BXT_CDCLK_CD2X_PIPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_16:
	callq	_BXT_CDCLK_CD2X_PIPE
LBB0_17:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	orl	%eax, %ebx
	xorl	%eax, %eax
	cmpl	$500000, %r14d                  ## imm = 0x7A120
	jl	LBB0_19
## %bb.18:
	movq	_BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_19:
	orl	%eax, %ebx
	movq	_CDCLK_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	%esi, (%r15)
	je	LBB0_21
## %bb.20:
	movq	%r13, %rdi
	callq	_intel_wait_for_vblank
LBB0_21:
	movq	_HSW_PCODE_DE_WRITE_FREQ_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r12), %edx
	movq	%r13, %rdi
	movl	$150, %ecx
	movl	$2, %r8d
	callq	_sandybridge_pcode_write_timeout
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	leaq	L_.str.2(%rip), %rdi
LBB0_8:
	movl	%eax, %esi
	movl	%r14d, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_23:
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_update_cdclk             ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_3
	.long	L0_0_set_4
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1,4,2   ## @BXT_CDCLK_CD2X_DIV_SEL_1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported divider\n"

	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1_5,4,2 ## @BXT_CDCLK_CD2X_DIV_SEL_1_5
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_2,4,2   ## @BXT_CDCLK_CD2X_DIV_SEL_2
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_4,4,2   ## @BXT_CDCLK_CD2X_DIV_SEL_4
	.comm	_HSW_PCODE_DE_WRITE_FREQ_REQ,4,2 ## @HSW_PCODE_DE_WRITE_FREQ_REQ
L_.str.1:                               ## @.str.1
	.asciz	"PCode CDCLK freq change notify failed (err %d, freq %d)\n"

	.comm	_INVALID_PIPE,4,2               ## @INVALID_PIPE
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ## @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_BXT_CDCLK_SSA_PRECHARGE_ENABLE,4,2 ## @BXT_CDCLK_SSA_PRECHARGE_ENABLE
	.comm	_CDCLK_CTL,4,2                  ## @CDCLK_CTL
L_.str.2:                               ## @.str.2
	.asciz	"PCode CDCLK freq set failed, (err %d, freq %d)\n"

	.no_dead_strip	_bxt_set_cdclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bxt_set_cdclk
_bxt_set_cdclk:                         ; @bxt_set_cdclk
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldp	w19, w23, [x1]
	mov	x0, x23
	mov	x1, x19
	bl	_DIV_ROUND_CLOSEST
	sub	w9, w0, #2
	cmp	w9, #6
	b.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F]
	ldr	w1, [x24]
	mov	x0, x20
	mov	w2, #-2147483648
	mov	w3, #150
	mov	w4, #2
	bl	_sandybridge_pcode_write_timeout
	cbz	w0, LBB0_8
; %bb.7:
	mov	x1, x0
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_20
LBB0_8:
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_11
; %bb.9:
	cmp	w8, w23
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_bxt_de_pll_disable
	ldr	w8, [x20, #4]
LBB0_11:
	cmp	w8, w23
	b.eq	LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, x23
	bl	_bxt_de_pll_enable
LBB0_13:
	mov	x0, x19
	bl	_skl_cdclk_decimal
	orr	w25, w0, w25
Lloh18:
	adrp	x23, _INVALID_PIPE@GOTPAGE
Lloh19:
	ldr	x23, [x23, _INVALID_PIPE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, w22
	b.ne	LBB0_15
; %bb.14:
Lloh20:
	adrp	x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	b	LBB0_16
LBB0_15:
	mov	x0, x22
	bl	_BXT_CDCLK_CD2X_PIPE
LBB0_16:
	orr	w8, w25, w0
Lloh23:
	adrp	x9, _BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	mov	w10, #41247
	movk	w10, #7, lsl #16
	cmp	w19, w10
	csel	w9, w9, wzr, gt
	orr	w1, w8, w9
Lloh26:
	adrp	x8, _CDCLK_CTL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CDCLK_CTL@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_I915_WRITE
	ldr	w8, [x23]
	cmp	w8, w22
	b.eq	LBB0_18
; %bb.17:
	mov	x0, x20
	mov	x1, x22
	bl	_intel_wait_for_vblank
LBB0_18:
	ldr	w1, [x24]
	ldr	w2, [x21, #8]
	mov	x0, x20
	mov	w3, #150
	mov	w4, #2
	bl	_sandybridge_pcode_write_timeout
	cbz	w0, LBB0_21
; %bb.19:
	mov	x1, x0
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_20:
	mov	x2, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_DRM_ERROR
LBB0_21:
	mov	x0, 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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_intel_update_cdclk
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
                                        ; -- End function
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1,4,2   ; @BXT_CDCLK_CD2X_DIV_SEL_1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported divider\n"

	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1_5,4,2 ; @BXT_CDCLK_CD2X_DIV_SEL_1_5
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_2,4,2   ; @BXT_CDCLK_CD2X_DIV_SEL_2
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_4,4,2   ; @BXT_CDCLK_CD2X_DIV_SEL_4
	.comm	_HSW_PCODE_DE_WRITE_FREQ_REQ,4,2 ; @HSW_PCODE_DE_WRITE_FREQ_REQ
l_.str.1:                               ; @.str.1
	.asciz	"PCode CDCLK freq change notify failed (err %d, freq %d)\n"

	.comm	_INVALID_PIPE,4,2               ; @INVALID_PIPE
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ; @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_BXT_CDCLK_SSA_PRECHARGE_ENABLE,4,2 ; @BXT_CDCLK_SSA_PRECHARGE_ENABLE
	.comm	_CDCLK_CTL,4,2                  ; @CDCLK_CTL
l_.str.2:                               ; @.str.2
	.asciz	"PCode CDCLK freq set failed, (err %d, freq %d)\n"

	.no_dead_strip	_bxt_set_cdclk
.subsections_via_symbols
