	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bxt_sanitize_cdclk
_bxt_sanitize_cdclk:                    ## @bxt_sanitize_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_intel_update_cdclk
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_intel_dump_cdclk_state
	cmpl	$0, (%rbx)
	je	LBB0_5
## %bb.1:
	movl	4(%rbx), %eax
	cmpl	8(%rbx), %eax
	je	LBB0_5
## %bb.2:
	movq	_CDCLK_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	_BXT_CDCLK_CD2X_PIPE_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	notl	%r14d
	andl	%eax, %r14d
	movq	_BXT_CDCLK_CD2X_DIV_SEL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	%r14d, %r15d
	movl	4(%rbx), %edi
	callq	_skl_cdclk_decimal
	xorl	%ecx, %ecx
	cmpl	$500000, 4(%rbx)                ## imm = 0x7A120
	jl	LBB0_4
## %bb.3:
	movq	_BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	orl	%ecx, %eax
	orl	%eax, %r15d
	cmpl	%r15d, %r14d
	je	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	movq	%rax, (%rbx)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Current CDCLK"

	.comm	_CDCLK_CTL,4,2                  ## @CDCLK_CTL
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ## @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_MASK,4,2 ## @BXT_CDCLK_CD2X_DIV_SEL_MASK
	.comm	_BXT_CDCLK_SSA_PRECHARGE_ENABLE,4,2 ## @BXT_CDCLK_SSA_PRECHARGE_ENABLE
L_.str.1:                               ## @.str.1
	.asciz	"Sanitizing cdclk programmed by pre-os\n"

	.no_dead_strip	_bxt_sanitize_cdclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bxt_sanitize_cdclk
_bxt_sanitize_cdclk:                    ; @bxt_sanitize_cdclk
	.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, x0
	bl	_intel_update_cdclk
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_intel_dump_cdclk_state
	ldr	w8, [x19]
	cbz	w8, LBB0_3
; %bb.1:
	ldp	w8, w9, [x19, #4]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _CDCLK_CTL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CDCLK_CTL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_I915_READ
Lloh5:
	adrp	x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	bic	w20, w0, w8
Lloh8:
	adrp	x8, _BXT_CDCLK_CD2X_DIV_SEL_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_DIV_SEL_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w21, w20, w8
	ldr	w0, [x19, #4]
	bl	_skl_cdclk_decimal
	orr	w8, w0, w21
	ldr	w9, [x19, #4]
Lloh11:
	adrp	x10, _BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _BXT_CDCLK_SSA_PRECHARGE_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	mov	w11, #41247
	movk	w11, #7, lsl #16
	cmp	w9, w11
	csel	w9, w10, wzr, gt
	orr	w8, w8, w9
	cmp	w20, w8
	b.eq	LBB0_4
LBB0_3:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	movi	d0, #0x000000ffffffff
	str	d0, [x19]
LBB0_4:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Current CDCLK"

	.comm	_CDCLK_CTL,4,2                  ; @CDCLK_CTL
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ; @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_MASK,4,2 ; @BXT_CDCLK_CD2X_DIV_SEL_MASK
	.comm	_BXT_CDCLK_SSA_PRECHARGE_ENABLE,4,2 ; @BXT_CDCLK_SSA_PRECHARGE_ENABLE
l_.str.1:                               ; @.str.1
	.asciz	"Sanitizing cdclk programmed by pre-os\n"

	.no_dead_strip	_bxt_sanitize_cdclk
.subsections_via_symbols
