	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_clk
_read_clk:                              ## @read_clk
	.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
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_nouveau_dev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nouveau_drm
	cmpl	$64, %r15d
	jl	LBB0_3
## %bb.1:
	movl	(%rax), %edi
	callq	_nv_device
	cmpl	$175, (%rax)
	jne	LBB0_8
## %bb.2:
	movq	%r14, %rdi
	movl	$18204, %esi                    ## imm = 0x471C
	callq	_nv_rd32
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	jmp	LBB0_11
LBB0_3:
	leal	16672(,%r15,4), %esi
	movq	%r14, %rdi
	callq	_nv_rd32
	movl	%eax, %r12d
	movl	%eax, %ecx
	andl	$256, %ecx                      ## imm = 0x100
	xorl	%eax, %eax
	orl	%ecx, %r13d
	je	LBB0_11
## %bb.4:
	movl	%r12d, %ecx
	andl	$12288, %ecx                    ## imm = 0x3000
	cmpl	$12288, %ecx                    ## imm = 0x3000
	je	LBB0_9
## %bb.5:
	cmpl	$8192, %ecx                     ## imm = 0x2000
	je	LBB0_10
## %bb.6:
	testl	%ecx, %ecx
	jne	LBB0_11
LBB0_8:
	movl	(%r14), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_read_vco
	shrl	$16, %r12d
	andl	$63, %r12d
	addl	$2, %r12d
	addl	%eax, %eax
	cltd
	idivl	%r12d
	jmp	LBB0_11
LBB0_10:
	testb	$64, %r12b
	movl	$100000, %ecx                   ## imm = 0x186A0
	movl	$108000, %eax                   ## imm = 0x1A5E0
	cmovel	%ecx, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_read_clk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_clk
_read_clk:                              ; @read_clk
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	bl	_nouveau_dev
	mov	x19, x0
	mov	x0, x21
	bl	_nouveau_drm
	cmp	w20, #64
	b.lt	LBB0_3
; %bb.1:
	ldr	w0, [x0]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #175
	b.ne	LBB0_7
; %bb.2:
	mov	x0, x19
	mov	w1, #18204
	bl	_nv_rd32
	mov	w8, #1000
	mul	w0, w0, w8
	b	LBB0_9
LBB0_3:
	mov	w8, #16672
	add	w1, w8, w20, lsl #2
	mov	x0, x19
	bl	_nv_rd32
	and	w8, w0, #0x100
	orr	w8, w22, w8
	cbz	w8, LBB0_8
; %bb.4:
	mov	x23, x0
	and	w8, w0, #0x3000
	cmp	w8, #3, lsl #12                 ; =12288
	b.eq	LBB0_10
; %bb.5:
	cmp	w8, #2, lsl #12                 ; =8192
	b.eq	LBB0_11
; %bb.6:
	cbnz	w8, LBB0_8
LBB0_7:
	ldr	w0, [x19]
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x21
	mov	x1, x20
	bl	_read_vco
	ubfx	w8, w23, #16, #6
	add	w8, w8, #2
	lsl	w9, w0, #1
	sdiv	w0, w9, w8
	b	LBB0_9
LBB0_11:
	tst	w23, #0x40
	mov	w8, #42464
	movk	w8, #1, lsl #16
	mov	w9, #34464
	movk	w9, #1, lsl #16
	csel	w0, w9, w8, eq
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_read_clk
.subsections_via_symbols
