	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_therm_fan_mode            ## -- Begin function nvkm_therm_fan_mode
	.p2align	4, 0x90
_nvkm_therm_fan_mode:                   ## @nvkm_therm_fan_mode
	.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, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	leaq	_nvkm_therm_fan_mode.name(%rip), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	cmpl	%r12d, %eax
	jle	LBB0_3
## %bb.1:
	movq	_NVKM_THERM_CTRL_NONE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_nvkm_pmu_fan_controlled
	testq	%rax, %rax
	jne	LBB0_3
LBB0_4:
	movq	_NVKM_THERM_CTRL_AUTO@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	8(%r14), %rax
	movq	%r14, %rdi
	callq	*(%rax)
	testq	%rax, %rax
	js	LBB0_3
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	%r12d, (%r14)
	je	LBB0_8
## %bb.7:
	leaq	16(%r14), %rdi
	movslq	%r12d, %rax
	movq	(%r15,%rax,8), %rdx
	leaq	L_.str.3(%rip), %rsi
	callq	_nvkm_debug
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_nvkm_therm_update
	jmp	LBB0_8
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	4                               ## @nvkm_therm_fan_mode.name
_nvkm_therm_fan_mode.name:
	.quad	L_.str
	.quad	L_.str.1
	.quad	L_.str.2

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"disabled"

L_.str.1:                               ## @.str.1
	.asciz	"manual"

L_.str.2:                               ## @.str.2
	.asciz	"automatic"

	.comm	_NVKM_THERM_CTRL_NONE,4,2       ## @NVKM_THERM_CTRL_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NVKM_THERM_CTRL_AUTO,4,2       ## @NVKM_THERM_CTRL_AUTO
L_.str.3:                               ## @.str.3
	.asciz	"fan management: %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_therm_fan_mode            ; -- Begin function nvkm_therm_fan_mode
	.p2align	2
_nvkm_therm_fan_mode:                   ; @nvkm_therm_fan_mode
	.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	x19, x1
	mov	x20, x0
	mov	x21, x0
	ldr	x23, [x21, #16]!
Lloh0:
	adrp	x22, _nvkm_therm_fan_mode.name@PAGE
Lloh1:
	add	x22, x22, _nvkm_therm_fan_mode.name@PAGEOFF
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	w0, w19
	b.le	LBB0_8
; %bb.1:
Lloh2:
	adrp	x8, _NVKM_THERM_CTRL_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NVKM_THERM_CTRL_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x23
	bl	_nvkm_pmu_fan_controlled
	cbnz	x0, LBB0_8
LBB0_3:
Lloh5:
	adrp	x8, _NVKM_THERM_CTRL_AUTO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NVKM_THERM_CTRL_AUTO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	tbnz	x0, #63, LBB0_8
LBB0_5:
	ldr	w8, [x20]
	cmp	w8, w19
	b.eq	LBB0_7
; %bb.6:
	ldr	x2, [x22, w19, sxtw #3]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_nvkm_debug
	mov	x0, x20
	mov	x1, x19
	bl	_nvkm_therm_update
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	3                               ; @nvkm_therm_fan_mode.name
_nvkm_therm_fan_mode.name:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"disabled"

l_.str.1:                               ; @.str.1
	.asciz	"manual"

l_.str.2:                               ; @.str.2
	.asciz	"automatic"

	.comm	_NVKM_THERM_CTRL_NONE,4,2       ; @NVKM_THERM_CTRL_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NVKM_THERM_CTRL_AUTO,4,2       ; @NVKM_THERM_CTRL_AUTO
l_.str.3:                               ; @.str.3
	.asciz	"fan management: %s\n"

.subsections_via_symbols
