	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_fan_update
_nouveau_fan_update:                    ## @nouveau_fan_update
	.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, %ebx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movq	48(%rdi), %r12
	movq	%r12, %rdi
	callq	_nouveau_timer
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	24(%r14), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	testl	%ebx, %ebx
	jns	LBB0_2
## %bb.1:
	movl	(%r14), %ebx
LBB0_2:
	movq	_u8@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	44(%r14), %edx
	movl	%ebx, %esi
	callq	_max_t
	movl	(%r15), %edi
	movl	40(%r14), %edx
	movl	%eax, %esi
	callq	_min_t
	movl	%eax, %r15d
	cmpl	%eax, (%r14)
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_nv_debug
	movl	%r15d, (%r14)
LBB0_4:
	movq	%r12, %rdi
	callq	*8(%r14)
	cmpl	%r15d, %eax
	jne	LBB0_6
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_6:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_11
## %bb.7:
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	cmpl	%r15d, %r13d
	jge	LBB0_12
## %bb.9:
	addl	$3, %r13d
	movl	%r13d, %edi
	movl	%r15d, %esi
	callq	_min
	jmp	LBB0_14
LBB0_11:
	movl	%r15d, %r13d
	jmp	LBB0_15
LBB0_12:
	jle	LBB0_15
## %bb.13:
	addl	$-3, %r13d
	movl	%r13d, %edi
	movl	%r15d, %esi
	callq	_max
LBB0_14:
	movl	%eax, %r13d
LBB0_15:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_nv_debug
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	*16(%r14)
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_17
LBB0_16:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	leaq	28(%r14), %rbx
	movq	%rbx, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_5
## %bb.18:
	cmpl	%r13d, %r15d
	je	LBB0_5
## %bb.19:
	setl	%al
	movzbl	%al, %eax
	imull	$1000000, 32(%r14,%rax,4), %esi ## imm = 0xF4240
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	*(%rdi)
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_u8,4,2                         ## @u8
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FAN target: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"FAN update: %d\n"

	.no_dead_strip	_nouveau_fan_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_fan_update
_nouveau_fan_update:                    ; @nouveau_fan_update
	.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	x23, x2
	mov	x25, x1
	mov	x21, x0
	ldr	x22, [x0, #48]
	mov	x0, x22
	bl	_nouveau_timer
	mov	x20, x0
	add	x19, x21, #24
	mov	x0, x19
	bl	_spin_lock_irqsave
	tbz	w23, #31, LBB0_2
; %bb.1:
	ldr	w23, [x21]
LBB0_2:
Lloh0:
	adrp	x24, _u8@GOTPAGE
Lloh1:
	ldr	x24, [x24, _u8@GOTPAGEOFF]
	ldr	w0, [x24]
	ldr	w2, [x21, #44]
	mov	x1, x23
	bl	_max_t
	mov	x1, x0
	ldr	w0, [x24]
	ldr	w2, [x21, #40]
	bl	_min_t
	mov	x23, x0
	ldr	w8, [x21]
	cmp	w8, w0
	b.eq	LBB0_4
; %bb.3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_nv_debug
	str	w23, [x21]
LBB0_4:
	ldr	x8, [x21, #8]
	mov	x0, x22
	blr	x8
	cmp	w0, w23
	b.ne	LBB0_6
LBB0_5:
	mov	w25, #0
	b	LBB0_15
LBB0_6:
	cbnz	w25, LBB0_10
; %bb.7:
	mov	x24, x0
	tbnz	w0, #31, LBB0_10
; %bb.8:
	cmp	w24, w23
	b.ge	LBB0_11
; %bb.9:
	add	w0, w24, #3
	mov	x1, x23
	bl	_min
	b	LBB0_13
LBB0_10:
	mov	x24, x23
	b	LBB0_14
LBB0_11:
	b.le	LBB0_14
; %bb.12:
	sub	w0, w24, #3
	mov	x1, x23
	bl	_max
LBB0_13:
	mov	x24, x0
LBB0_14:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x24
	bl	_nv_debug
	ldr	x8, [x21, #16]
	mov	x0, x22
	mov	x1, x24
	blr	x8
	mov	x25, x0
	cbz	w0, LBB0_16
LBB0_15:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x25
	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
LBB0_16:
	add	x22, x21, #28
	mov	x0, x22
	bl	_list_empty
	cbz	x0, LBB0_15
; %bb.17:
	cmp	w23, w24
	b.eq	LBB0_15
; %bb.18:
	add	x8, x21, #32
	add	x9, x21, #36
	cmp	w24, w23
	csel	x8, x9, x8, gt
	ldr	w8, [x8]
	ldr	x9, [x20]
	mov	w10, #16960
	movk	w10, #15, lsl #16
	mul	w1, w8, w10
	mov	x0, x20
	mov	x2, x22
	blr	x9
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_u8,4,2                         ; @u8
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FAN target: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"FAN update: %d\n"

	.no_dead_strip	_nouveau_fan_update
.subsections_via_symbols
