	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_timestamp_frequency
_read_timestamp_frequency:              ## @read_timestamp_frequency
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jg	LBB0_2
## %bb.1:
	movl	(%rbx), %ecx
	leal	15(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$4, %eax
	jmp	LBB0_13
LBB0_2:
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	movl	%eax, %ecx
	movl	$12500, %eax                    ## imm = 0x30D4
	cmpl	$9, %ecx
	jge	LBB0_3
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	cmpl	$9, %eax
	jg	LBB0_6
## %bb.4:
	movq	_CTC_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movl	%eax, %r14d
	movq	_CTC_SOURCE_PARAMETER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	movq	_CTC_SOURCE_DIVIDE_LOGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_14
## %bb.5:
	movq	%rbx, %rdi
	callq	_IS_GEN9_LP
	testq	%rax, %rax
	movl	$24000, %ecx                    ## imm = 0x5DC0
	movl	$19200, %eax                    ## imm = 0x4B00
	cmovel	%ecx, %eax
	movq	_CTC_SHIFT_PARAMETER_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r14d
	movq	_CTC_SHIFT_PARAMETER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %r14d
	movb	$3, %cl
	subb	%r14b, %cl
	shrl	%cl, %eax
	jmp	LBB0_13
LBB0_6:
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	cmpl	$12, %eax
	jg	LBB0_12
## %bb.7:
	movq	_CTC_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	_CTC_SOURCE_PARAMETER_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_CTC_SOURCE_DIVIDE_LOGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
LBB0_14:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_read_reference_ts_freq         ## TAILCALL
LBB0_12:
	leaq	L_.str(%rip), %rdi
	callq	_MISSING_CASE
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_8:
	movq	_RPM_CONFIG0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	movq	%rbx, %rdi
	movl	%r14d, %esi
	cmpl	$10, %eax
	jg	LBB0_10
## %bb.9:
	callq	_gen10_get_crystal_clock_freq
	jmp	LBB0_11
LBB0_10:
	callq	_gen11_get_crystal_clock_freq
LBB0_11:
	movq	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r14d
	movq	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %r14d
	movb	$3, %cl
	subb	%r14b, %cl
	sarl	%cl, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_CTC_MODE,4,2                   ## @CTC_MODE
	.comm	_CTC_SOURCE_PARAMETER_MASK,4,2  ## @CTC_SOURCE_PARAMETER_MASK
	.comm	_CTC_SOURCE_DIVIDE_LOGIC,4,2    ## @CTC_SOURCE_DIVIDE_LOGIC
	.comm	_CTC_SHIFT_PARAMETER_MASK,4,2   ## @CTC_SHIFT_PARAMETER_MASK
	.comm	_CTC_SHIFT_PARAMETER_SHIFT,4,2  ## @CTC_SHIFT_PARAMETER_SHIFT
	.comm	_RPM_CONFIG0,4,2                ## @RPM_CONFIG0
	.comm	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK,4,2 ## @GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK
	.comm	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT,4,2 ## @GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown gen, unable to read command streamer timestamp frequency\n"

	.no_dead_strip	_read_timestamp_frequency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_timestamp_frequency
_read_timestamp_frequency:              ; @read_timestamp_frequency
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_INTEL_GEN
	cmp	w0, #4
	b.gt	LBB0_2
; %bb.1:
	ldr	w8, [x19]
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #4
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #9
	b.ge	LBB0_5
; %bb.3:
	mov	w0, #12500
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #9
	b.gt	LBB0_8
; %bb.6:
Lloh0:
	adrp	x8, _CTC_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CTC_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_I915_READ
Lloh3:
	adrp	x8, _CTC_SOURCE_PARAMETER_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CTC_SOURCE_PARAMETER_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _CTC_SOURCE_DIVIDE_LOGIC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CTC_SOURCE_DIVIDE_LOGIC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_10
; %bb.7:
	mov	x20, x0
	mov	x0, x19
	bl	_IS_GEN9_LP
	cmp	x0, #0
	mov	w8, #19200
	mov	w9, #24000
	csel	w8, w9, w8, eq
Lloh9:
	adrp	x9, _CTC_SHIFT_PARAMETER_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CTC_SHIFT_PARAMETER_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _CTC_SHIFT_PARAMETER_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CTC_SHIFT_PARAMETER_SHIFT@GOTPAGEOFF]
	and	w9, w9, w20
Lloh14:
	ldr	w10, [x10]
	asr	w9, w9, w10
	mov	w10, #3
	sub	w9, w10, w9
	lsr	w0, w8, w9
	b	LBB0_4
LBB0_8:
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #12
	b.gt	LBB0_11
; %bb.9:
Lloh15:
	adrp	x8, _CTC_MODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CTC_MODE@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_I915_READ
Lloh18:
	adrp	x8, _CTC_SOURCE_PARAMETER_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CTC_SOURCE_PARAMETER_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh21:
	adrp	x9, _CTC_SOURCE_DIVIDE_LOGIC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CTC_SOURCE_DIVIDE_LOGIC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_read_reference_ts_freq
LBB0_11:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	bl	_MISSING_CASE
	mov	w0, #0
	b	LBB0_4
LBB0_12:
Lloh26:
	adrp	x8, _RPM_CONFIG0@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RPM_CONFIG0@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_I915_READ
	mov	x20, x0
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #10
	b.gt	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	x1, x20
	bl	_gen10_get_crystal_clock_freq
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	mov	x1, x20
	bl	_gen11_get_crystal_clock_freq
LBB0_15:
Lloh29:
	adrp	x8, _GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT@GOTPAGEOFF]
	and	w8, w8, w20
Lloh34:
	ldr	w9, [x9]
	asr	w8, w8, w9
	mov	w9, #3
	sub	w8, w9, w8
	asr	w0, w0, w8
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_CTC_MODE,4,2                   ; @CTC_MODE
	.comm	_CTC_SOURCE_PARAMETER_MASK,4,2  ; @CTC_SOURCE_PARAMETER_MASK
	.comm	_CTC_SOURCE_DIVIDE_LOGIC,4,2    ; @CTC_SOURCE_DIVIDE_LOGIC
	.comm	_CTC_SHIFT_PARAMETER_MASK,4,2   ; @CTC_SHIFT_PARAMETER_MASK
	.comm	_CTC_SHIFT_PARAMETER_SHIFT,4,2  ; @CTC_SHIFT_PARAMETER_SHIFT
	.comm	_RPM_CONFIG0,4,2                ; @RPM_CONFIG0
	.comm	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK,4,2 ; @GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK
	.comm	_GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT,4,2 ; @GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown gen, unable to read command streamer timestamp frequency\n"

	.no_dead_strip	_read_timestamp_frequency
.subsections_via_symbols
