	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_mclk
_calc_mclk:                             ## @calc_mclk
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_nouveau_dev
	movq	%r12, -120(%rbp)
	movq	_mclk_timing_set@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -112(%rbp)
	movq	_mclk_clock_set@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -108(%rbp)
	movq	_mclk_mrs@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -104(%rbp)
	movq	_mclk_mrg@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -100(%rbp)
	movq	_mclk_wait@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -96(%rbp)
	movq	_mclk_refresh_self@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -92(%rbp)
	movq	_mclk_refresh_auto@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -88(%rbp)
	movq	_mclk_refresh@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -84(%rbp)
	movq	_mclk_precharge@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -80(%rbp)
	movq	%r13, -72(%rbp)
	movq	%rax, %rdi
	movl	$16392, %esi                    ## imm = 0x4008
	callq	_nv_rd32
	andl	$2113994239, %eax               ## imm = 0x7E00FDFF
	movl	%eax, (%r12)
	movl	(%r15), %ebx
	movq	_clk_src_href@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_read_clk
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_clk_same
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	orb	$2, 1(%r12)
	jmp	LBB0_5
LBB0_2:
	movl	(%r15), %ecx
	leaq	-52(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-48(%rbp), %rdx
	leaq	-60(%rbp), %r8
	leaq	-56(%rbp), %r9
	movq	%r13, %rdi
	movl	$16392, %esi                    ## imm = 0x4008
	callq	_calc_pll
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	-52(%rbp), %eax
	movl	%eax, %ecx
	shll	$22, %ecx
	shll	$16, %eax
	orl	%ecx, %eax
	orl	(%r12), %eax
	movl	-48(%rbp), %ecx
	shll	$19, %ecx
	orl	%eax, %ecx
	orl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	%ecx, (%r12)
	movl	-60(%rbp), %eax
	shll	$8, %eax
	orl	-56(%rbp), %eax
	movl	%eax, 4(%r12)
LBB0_5:
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_hwsq_init
	movl	(%r14), %edi
	callq	_nv_device
	cmpl	$146, (%rax)
	jl	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	movl	$6361600, %esi                  ## imm = 0x611200
	movl	$13056, %edx                    ## imm = 0x3300
	callq	_hwsq_wr32
LBB0_7:
	movq	%r12, %rdi
	movl	$16, %esi
	xorl	%edx, %edx
	callq	_hwsq_setf
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_hwsq_op5f
	leaq	-120(%rbp), %rdi
	movq	%r15, %rsi
	callq	_nouveau_mem_exec
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	%r12, %rdi
	movl	$16, %esi
	movl	$1, %edx
	callq	_hwsq_setf
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_hwsq_op5f
	movl	(%r14), %edi
	callq	_nv_device
	cmpl	$146, (%rax)
	jl	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	movl	$6361600, %esi                  ## imm = 0x611200
	movl	$13104, %edx                    ## imm = 0x3330
	callq	_hwsq_wr32
LBB0_10:
	movq	%r12, %rdi
	callq	_hwsq_fini
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mclk_timing_set,4,2            ## @mclk_timing_set
	.comm	_mclk_clock_set,4,2             ## @mclk_clock_set
	.comm	_mclk_mrs,4,2                   ## @mclk_mrs
	.comm	_mclk_mrg,4,2                   ## @mclk_mrg
	.comm	_mclk_wait,4,2                  ## @mclk_wait
	.comm	_mclk_refresh_self,4,2          ## @mclk_refresh_self
	.comm	_mclk_refresh_auto,4,2          ## @mclk_refresh_auto
	.comm	_mclk_refresh,4,2               ## @mclk_refresh
	.comm	_mclk_precharge,4,2             ## @mclk_precharge
	.comm	_clk_src_href,4,2               ## @clk_src_href
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_calc_mclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_mclk
_calc_mclk:                             ; @calc_mclk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x23, x0
	bl	_nouveau_drm
	mov	x19, x0
	mov	x0, x23
	bl	_nouveau_dev
Lloh0:
	adrp	x8, _mclk_timing_set@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mclk_timing_set@GOTPAGEOFF]
	str	x22, [sp, #24]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _mclk_clock_set@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mclk_clock_set@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #32]
Lloh6:
	adrp	x8, _mclk_mrs@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mclk_mrs@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _mclk_mrg@GOTPAGE
Lloh10:
	ldr	x9, [x9, _mclk_mrg@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #40]
Lloh12:
	adrp	x8, _mclk_wait@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mclk_wait@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _mclk_refresh_self@GOTPAGE
Lloh16:
	ldr	x9, [x9, _mclk_refresh_self@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _mclk_refresh_auto@GOTPAGE
Lloh19:
	ldr	x10, [x10, _mclk_refresh_auto@GOTPAGEOFF]
	stp	w8, w9, [sp, #48]
Lloh20:
	ldr	w8, [x10]
Lloh21:
	adrp	x9, _mclk_refresh@GOTPAGE
Lloh22:
	ldr	x9, [x9, _mclk_refresh@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #56]
Lloh24:
	adrp	x8, _mclk_precharge@GOTPAGE
Lloh25:
	ldr	x8, [x8, _mclk_precharge@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [sp, #64]
	str	x23, [sp, #72]
	mov	w1, #16392
	bl	_nv_rd32
	mov	w8, #65023
	movk	w8, #32256, lsl #16
	and	w8, w0, w8
	mov	x21, x22
	str	w8, [x21], #8
	ldr	w24, [x20]
Lloh27:
	adrp	x8, _clk_src_href@GOTPAGE
Lloh28:
	ldr	x8, [x8, _clk_src_href@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_read_clk
	mov	x1, x0
	mov	x0, x24
	bl	_clk_same
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x22]
	orr	w8, w8, #0x200
	str	w8, [x22]
	b	LBB0_4
LBB0_2:
	ldr	w3, [x20]
	add	x2, sp, #16
	add	x4, sp, #12
	add	x5, sp, #8
	add	x6, sp, #4
	mov	x0, x23
	mov	w1, #16392
	bl	_calc_pll
	cbz	w0, LBB0_10
; %bb.3:
	ldr	w8, [sp, #4]
	lsl	w9, w8, #16
	ldr	w10, [x22]
	orr	w8, w9, w8, lsl #22
	orr	w8, w8, w10
	ldr	w9, [sp, #16]
	orr	w8, w8, w9, lsl #19
	orr	w8, w8, #0x80000000
	ldp	w10, w9, [sp, #8]
	orr	w9, w10, w9, lsl #8
	stp	w8, w9, [x22]
LBB0_4:
	mov	x0, x21
	bl	_hwsq_init
	ldr	w0, [x19]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #146
	b.lt	LBB0_6
; %bb.5:
	mov	x0, x21
	mov	w1, #4608
	movk	w1, #97, lsl #16
	mov	w2, #13056
	bl	_hwsq_wr32
LBB0_6:
	mov	x0, x21
	mov	w1, #16
	mov	w2, #0
	bl	_hwsq_setf
	mov	x0, x21
	mov	w1, #0
	mov	w2, #1
	bl	_hwsq_op5f
	add	x0, sp, #24
	mov	x1, x20
	bl	_nouveau_mem_exec
	cbnz	w0, LBB0_11
; %bb.7:
	mov	x0, x21
	mov	w1, #16
	mov	w2, #1
	bl	_hwsq_setf
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_hwsq_op5f
	ldr	w0, [x19]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #146
	b.lt	LBB0_9
; %bb.8:
	mov	x0, x21
	mov	w1, #4608
	movk	w1, #97, lsl #16
	mov	w2, #13104
	bl	_hwsq_wr32
LBB0_9:
	mov	x0, x21
	bl	_hwsq_fini
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh30:
	adrp	x8, _EINVAL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_mclk_timing_set,4,2            ; @mclk_timing_set
	.comm	_mclk_clock_set,4,2             ; @mclk_clock_set
	.comm	_mclk_mrs,4,2                   ; @mclk_mrs
	.comm	_mclk_mrg,4,2                   ; @mclk_mrg
	.comm	_mclk_wait,4,2                  ; @mclk_wait
	.comm	_mclk_refresh_self,4,2          ; @mclk_refresh_self
	.comm	_mclk_refresh_auto,4,2          ; @mclk_refresh_auto
	.comm	_mclk_refresh,4,2               ; @mclk_refresh
	.comm	_mclk_precharge,4,2             ; @mclk_precharge
	.comm	_clk_src_href,4,2               ; @clk_src_href
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_calc_mclk
.subsections_via_symbols
