	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_cstate_prog
_nvkm_cstate_prog:                      ## @nvkm_cstate_prog
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movq	(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rbx
	leaq	8(%rsi), %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	4(%r13), %r14
	jmp	LBB0_3
LBB0_1:
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_nvkm_cstate_get
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rax, %rdx
	callq	_nvkm_cstate_find_best
	movq	%rax, %r14
LBB0_3:
	leaq	16(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.4:
	movl	(%r13), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %edx
	callq	_nvkm_therm_cstate
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r15d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_6
LBB0_7:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.8:
	movl	(%r14), %esi
	movl	4(%r13), %edx
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	$1, %r8d
	callq	_nvkm_volt_set_id
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %r15d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_10
LBB0_11:
	movq	8(%r12), %rax
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	*(%rax)
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movq	8(%r12), %rax
	movq	%r12, %rdi
	callq	*8(%rax)
	movl	%eax, %r15d
	movq	8(%r12), %rax
	movq	%r12, %rdi
	callq	*16(%rax)
LBB0_13:
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.14:
	movl	(%r14), %esi
	movl	4(%r13), %edx
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	callq	_nvkm_volt_set_id
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	movl	%eax, %r15d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_nvkm_error
	jmp	LBB0_18
LBB0_6:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_23
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_23
LBB0_15:
	xorl	%r15d, %r15d
LBB0_18:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.19:
	movl	(%r13), %esi
	movl	$-1, %edx
	callq	_nvkm_therm_cstate
	testl	%eax, %eax
	je	LBB0_20
## %bb.21:
	movl	%eax, %r15d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_24
## %bb.22:
	leaq	L_.str.3(%rip), %rsi
LBB0_23:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_nvkm_error
	jmp	LBB0_24
LBB0_20:
	xorl	%r15d, %r15d
LBB0_24:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to raise fan speed: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to raise voltage: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to lower voltage: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to lower fan speed: %d\n"

	.no_dead_strip	_nvkm_cstate_prog
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_cstate_prog
_nvkm_cstate_prog:                      ; @nvkm_cstate_prog
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x2
	mov	x20, x1
	mov	x22, x0
	mov	x19, x0
	ldr	x8, [x19, #16]!
	ldp	x23, x21, [x8]
	add	x0, x1, #8
	bl	_list_empty
	cbz	w0, LBB0_2
; %bb.1:
	add	x25, x20, #4
	cbnz	x21, LBB0_3
	b	LBB0_5
LBB0_2:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x24
	bl	_nvkm_cstate_get
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_nvkm_cstate_find_best
	mov	x25, x0
	cbz	x21, LBB0_5
LBB0_3:
	ldr	w1, [x20]
	mov	x0, x21
	mov	w2, #1
	bl	_nvkm_therm_cstate
	cbz	w0, LBB0_5
; %bb.4:
	mov	x24, x0
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_18
LBB0_5:
	cbz	x23, LBB0_8
; %bb.6:
	ldr	w1, [x25]
	ldr	w2, [x20, #4]
	ldr	w3, [x22]
	mov	x0, x23
	mov	w4, #1
	bl	_nvkm_volt_set_id
	cbz	w0, LBB0_8
; %bb.7:
	mov	x24, x0
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_19
LBB0_8:
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	mov	x1, x25
	blr	x8
	mov	x24, x0
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
	mov	x0, x22
	blr	x8
	mov	x24, x0
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #16]
	mov	x0, x22
	blr	x8
LBB0_10:
	cbz	x23, LBB0_14
; %bb.11:
	ldr	w1, [x25]
	ldr	w2, [x20, #4]
	ldr	w3, [x22]
	mov	x0, x23
	mov	w4, #-1
	bl	_nvkm_volt_set_id
	mov	x24, x0
	cbz	w0, LBB0_14
; %bb.12:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmn	w24, w8
	b.eq	LBB0_14
; %bb.13:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x24
	bl	_nvkm_error
LBB0_14:
	cbz	x21, LBB0_21
; %bb.15:
	ldr	w1, [x20]
	mov	x0, x21
	mov	w2, #-1
	bl	_nvkm_therm_cstate
	mov	x24, x0
	cbz	w0, LBB0_21
; %bb.16:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmn	w24, w8
	b.eq	LBB0_21
; %bb.17:
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_18:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_20:
	mov	x0, x19
	mov	x2, x24
	bl	_nvkm_error
LBB0_21:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to raise fan speed: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to raise voltage: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to lower voltage: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to lower fan speed: %d\n"

	.no_dead_strip	_nvkm_cstate_prog
.subsections_via_symbols
