	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	(%rdi), %r12
	leal	1274448(,%rbx,4), %esi
	movq	%r12, %rdi
	callq	_nvkm_rd32
	movl	%eax, %r14d
	cmpl	$6, %ebx
	jg	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	movl	$1274112, %esi                  ## imm = 0x137100
	callq	_nvkm_rd32
	btl	%ebx, %eax
	jae	LBB0_3
## %bb.2:
	shll	$5, %ebx
	addl	$1273856, %ebx                  ## imm = 0x137000
	movq	%r15, %rdi
	movl	%ebx, %esi
	jmp	LBB0_7
LBB0_4:
	leal	(,%rbx,4), %esi
	addl	$1274208, %esi                  ## imm = 0x137160
	movq	%r12, %rdi
	callq	_nvkm_rd32
	movl	%eax, %r12d
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1274208, %edx                  ## imm = 0x137160
	movl	$1274320, %ecx                  ## imm = 0x1371D0
	callq	_read_div
	movl	%r12d, %edx
	notl	%edx
	movb	$1, %cl
	testl	$259, %edx                      ## imm = 0x103
	jne	LBB0_9
## %bb.5:
	testl	$1073741824, %r12d              ## imm = 0x40000000
	je	LBB0_8
## %bb.6:
	movq	%r15, %rdi
	movl	$1274080, %esi                  ## imm = 0x1370E0
LBB0_7:
	callq	_read_pll
LBB0_8:
	xorl	%ecx, %ecx
LBB0_9:
	testl	%r14d, %r14d
	jns	LBB0_11
LBB0_10:
	movl	%r14d, %esi
	shrl	$8, %esi
	testb	%cl, %cl
	cmovnel	%r14d, %esi
	andl	$63, %esi
	addl	$2, %esi
	addl	%eax, %eax
	cltd
	idivl	%esi
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1274208, %edx                  ## imm = 0x137160
	movl	$1274320, %ecx                  ## imm = 0x1371D0
	callq	_read_div
	movb	$1, %cl
	testl	%r14d, %r14d
	jns	LBB0_11
	jmp	LBB0_10
	.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	x21, x1
	mov	x20, x0
	mov	w24, #29024
	movk	w24, #19, lsl #16
	ldr	x22, [x0]
	lsl	w8, w1, #2
	add	w23, w8, w24
	add	w1, w23, #240
	mov	x0, x22
	bl	_nvkm_rd32
	mov	x19, x0
	cmp	w21, #6
	b.gt	LBB0_3
; %bb.1:
	sub	w1, w24, #96
	mov	x0, x22
	bl	_nvkm_rd32
	lsr	w8, w0, w21
	tbz	w8, #0, LBB0_11
; %bb.2:
	add	w8, w24, w21, lsl #5
	sub	w1, w8, #352
	b	LBB0_6
LBB0_3:
	mov	x0, x22
	mov	x1, x23
	bl	_nvkm_rd32
	mov	x22, x0
	add	w3, w24, #112
	mov	x0, x20
	mov	x1, x21
	mov	w2, #29024
	movk	w2, #19, lsl #16
	bl	_read_div
	mov	w8, #259
	bics	wzr, w8, w22
	b.ne	LBB0_8
; %bb.4:
	tbz	w22, #30, LBB0_7
; %bb.5:
	sub	w1, w24, #128
LBB0_6:
	mov	x0, x20
	bl	_read_pll
LBB0_7:
	mov	w8, #0
	tbz	w19, #31, LBB0_10
	b	LBB0_9
LBB0_8:
	mov	w8, #1
	tbz	w19, #31, LBB0_10
LBB0_9:
	lsr	w9, w19, #8
	cmp	w8, #0
	csel	w8, w19, w9, ne
	and	w8, w8, #0x3f
	add	w8, w8, #2
	lsl	w9, w0, #1
	sdiv	w0, w9, w8
LBB0_10:
	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_11:
	add	w3, w24, #112
	mov	x0, x20
	mov	x1, x21
	mov	w2, #29024
	movk	w2, #19, lsl #16
	bl	_read_div
	mov	w8, #1
	tbz	w19, #31, LBB0_10
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_read_clk
.subsections_via_symbols
