	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_fantog_update
_nouveau_fantog_update:                 ## @nouveau_fantog_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	%esi, %r12d
	movq	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_nouveau_timer
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_nouveau_gpio
	movq	%rax, %r14
	leaq	8(%r15), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	testl	%r12d, %r12d
	jns	LBB0_2
## %bb.1:
	movl	(%r15), %r12d
LBB0_2:
	movl	%r12d, (%r15)
	movq	_DCB_GPIO_FAN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$255, %ecx
	callq	*8(%r14)
	movl	%eax, %r13d
	movl	(%rbx), %edx
	xorl	%r8d, %r8d
	testl	%eax, %eax
	sete	%r8b
	movl	$100, %ebx
	movl	$0, %eax
	cmovnel	%eax, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$255, %ecx
	callq	*(%r14)
	leaq	12(%r15), %r14
	movq	%r14, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	cmpl	%ebx, %r12d
	je	LBB0_5
## %bb.4:
	movl	4(%r15), %eax
	imull	%eax, %r12d
	movslq	%r12d, %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	subl	%ecx, %eax
	testl	%r13d, %r13d
	cmovel	%ecx, %eax
	imull	$1000, %eax, %esi               ## imm = 0x3E8
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	*(%rdi)
LBB0_5:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DCB_GPIO_FAN,4,2               ## @DCB_GPIO_FAN
	.no_dead_strip	_nouveau_fantog_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_fantog_update
_nouveau_fantog_update:                 ; @nouveau_fantog_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	x21, x1
	mov	x22, x0
	ldr	x20, [x0, #16]
	mov	x0, x20
	bl	_nouveau_timer
	mov	x19, x0
	mov	x0, x20
	bl	_nouveau_gpio
	mov	x24, x0
	add	x20, x22, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	tbz	w21, #31, LBB0_2
; %bb.1:
	ldr	w21, [x22]
LBB0_2:
	mov	x23, x22
	str	w21, [x23], #12
	ldr	x8, [x24, #8]
Lloh0:
	adrp	x26, _DCB_GPIO_FAN@GOTPAGE
Lloh1:
	ldr	x26, [x26, _DCB_GPIO_FAN@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x24
	mov	w1, #0
	mov	w3, #255
	blr	x8
	mov	x25, x0
	cmp	w0, #0
	cset	w4, eq
	ldr	x8, [x24]
	ldr	w2, [x26]
	mov	w9, #100
	csel	w26, w9, wzr, eq
	mov	x0, x24
	mov	w1, #0
	mov	w3, #255
	blr	x8
	mov	x0, x23
	bl	_list_empty
	cbz	x0, LBB0_5
; %bb.3:
	cmp	w21, w26
	b.eq	LBB0_5
; %bb.4:
	ldr	w8, [x22, #4]
	mul	w9, w8, w21
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	sub	w8, w8, w9
	cmp	w25, #0
	csel	w8, w9, w8, eq
	ldr	x9, [x19]
	mov	w10, #1000
	mul	w1, w8, w10
	mov	x0, x19
	mov	x2, x23
	blr	x9
LBB0_5:
	mov	x0, x20
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DCB_GPIO_FAN,4,2               ; @DCB_GPIO_FAN
	.no_dead_strip	_nouveau_fantog_update
.subsections_via_symbols
