	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function npcm7xx_fan_compute
_npcm7xx_fan_compute:                   ## @npcm7xx_fan_compute
	.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
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	16(%rbp), %r12
	movq	_NPCM7XX_FAN_CMPA@GOTPCREL(%rip), %rax
	movl	(%rdi), %edi
	cmpq	%rdx, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TCRA
	jmp	LBB0_3
LBB0_2:
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TCRB
LBB0_3:
	movl	%eax, %edi
	callq	_ioread16
	movq	%rax, %r14
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TICLR
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_iowrite8
	movq	8(%r13), %rcx
	shlq	$4, %rbx
	leaq	(%rcx,%rbx), %rsi
	movq	(%rcx,%rbx), %rax
	movq	_FAN_INIT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	cmpq	%rdi, %rax
	jne	LBB0_5
## %bb.4:
	movq	_FAN_PREPARE_TO_GET_FIRST_CAPTURE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rsi)
	movl	$0, 8(%rcx,%rbx)
	jmp	LBB0_7
LBB0_5:
	movq	_FAN_ENOUGH_SAMPLE@GOTPCREL(%rip), %r8
	movslq	(%r8), %rdx
	cmpq	%rdx, %rax
	jge	LBB0_8
## %bb.6:
	movq	_NPCM7XX_FAN_TCNT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	subl	%r14d, %edx
	addl	%edx, 8(%rcx,%rbx)
	incq	%rax
	movq	%rax, (%rsi)
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	jne	LBB0_10
## %bb.9:
	movq	_NPCM7XX_FAN_TCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r14d, %eax
	addl	8(%rcx,%rbx), %eax
	movl	%eax, 8(%rcx,%rbx)
	cltd
	idivl	(%r8)
	movl	%eax, 12(%rcx,%rbx)
	movq	%rdi, (%rsi)
LBB0_10:
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TIEN
	movl	%eax, %edi
	callq	_ioread8
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	notq	%rbx
	andq	%rax, %rbx
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TIEN
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_iowrite8
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TCKC
	movl	%eax, %edi
	callq	_ioread8
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	notq	%rbx
	andq	%rax, %rbx
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	_NPCM7XX_FAN_REG_TCKC
	movq	%rbx, %rdi
	movl	%eax, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iowrite8                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NPCM7XX_FAN_CMPA,8,3           ## @NPCM7XX_FAN_CMPA
	.comm	_FAN_INIT,8,3                   ## @FAN_INIT
	.comm	_FAN_PREPARE_TO_GET_FIRST_CAPTURE,8,3 ## @FAN_PREPARE_TO_GET_FIRST_CAPTURE
	.comm	_FAN_ENOUGH_SAMPLE,4,2          ## @FAN_ENOUGH_SAMPLE
	.comm	_NPCM7XX_FAN_TCNT,8,3           ## @NPCM7XX_FAN_TCNT
	.no_dead_strip	_npcm7xx_fan_compute
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function npcm7xx_fan_compute
_npcm7xx_fan_compute:                   ; @npcm7xx_fan_compute
	.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, x6
	mov	x20, x5
	mov	x22, x4
	mov	x23, x3
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _NPCM7XX_FAN_CMPA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NPCM7XX_FAN_CMPA@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w0, [x0]
	cmp	x8, x2
	b.ne	LBB0_2
; %bb.1:
	bl	_NPCM7XX_FAN_REG_TCRA
	b	LBB0_3
LBB0_2:
	bl	_NPCM7XX_FAN_REG_TCRB
LBB0_3:
	bl	_ioread16
	mov	x25, x0
	ldr	w0, [x21]
	mov	x1, x19
	bl	_NPCM7XX_FAN_REG_TICLR
	mov	x1, x0
	mov	x0, x24
	bl	_iowrite8
	ldr	x9, [x21, #8]
	add	x8, x9, x23, lsl #4
	ldr	x11, [x8]
Lloh3:
	adrp	x10, _FAN_INIT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _FAN_INIT@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x11, x10
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x9, _FAN_PREPARE_TO_GET_FIRST_CAPTURE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FAN_PREPARE_TO_GET_FIRST_CAPTURE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	x9, [x8]
	str	wzr, [x8, #8]
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x12, _FAN_ENOUGH_SAMPLE@GOTPAGE
Lloh10:
	ldr	x12, [x12, _FAN_ENOUGH_SAMPLE@GOTPAGEOFF]
	ldrsw	x13, [x12]
	cmp	x11, x13
	b.ge	LBB0_8
; %bb.6:
Lloh11:
	adrp	x10, _NPCM7XX_FAN_TCNT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _NPCM7XX_FAN_TCNT@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	add	x9, x9, x23, lsl #4
	ldr	w12, [x9, #8]
	sub	w10, w10, w25
	add	w10, w12, w10
	str	w10, [x9, #8]
	add	x9, x11, #1
	str	x9, [x8]
LBB0_7:
	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_8:
	b.ne	LBB0_10
; %bb.9:
Lloh14:
	adrp	x11, _NPCM7XX_FAN_TCNT@GOTPAGE
Lloh15:
	ldr	x11, [x11, _NPCM7XX_FAN_TCNT@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	add	x9, x9, x23, lsl #4
	ldr	w13, [x9, #8]
	sub	w11, w11, w25
	add	w11, w13, w11
	str	w11, [x9, #8]
	ldr	w12, [x12]
	sdiv	w11, w11, w12
	str	w11, [x9, #12]
	str	x10, [x8]
LBB0_10:
	ldr	w0, [x21]
	mov	x1, x19
	bl	_NPCM7XX_FAN_REG_TIEN
	bl	_ioread8
	bic	x22, x0, x22
	ldr	w0, [x21]
	mov	x1, x19
	bl	_NPCM7XX_FAN_REG_TIEN
	mov	x1, x0
	mov	x0, x22
	bl	_iowrite8
	ldr	w0, [x21]
	mov	x1, x19
	bl	_NPCM7XX_FAN_REG_TCKC
	bl	_ioread8
	bic	x20, x0, x20
	ldr	w0, [x21]
	mov	x1, x19
	bl	_NPCM7XX_FAN_REG_TCKC
	mov	x1, x0
	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	_iowrite8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NPCM7XX_FAN_CMPA,8,3           ; @NPCM7XX_FAN_CMPA
	.comm	_FAN_INIT,8,3                   ; @FAN_INIT
	.comm	_FAN_PREPARE_TO_GET_FIRST_CAPTURE,8,3 ; @FAN_PREPARE_TO_GET_FIRST_CAPTURE
	.comm	_FAN_ENOUGH_SAMPLE,4,2          ; @FAN_ENOUGH_SAMPLE
	.comm	_NPCM7XX_FAN_TCNT,8,3           ; @NPCM7XX_FAN_TCNT
	.no_dead_strip	_npcm7xx_fan_compute
.subsections_via_symbols
