	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nct7904_write_fan
_nct7904_write_fan:                     ## @nct7904_write_fan
	.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
	movq	%rcx, %r15
	movl	%edx, %r12d
	movl	%esi, %ebx
	callq	_dev_get_drvdata
	cmpl	$128, %ebx
	jne	LBB0_5
## %bb.1:
	testq	%r15, %r15
	jle	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movl	$1350000, %edi                  ## imm = 0x149970
	movq	%r15, %rsi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %edi
	movl	$1, %esi
	movl	$8191, %edx                     ## imm = 0x1FFF
	callq	_clamp_val
	movq	%rax, %r15
	shrl	$5, %eax
	movzbl	%al, %ecx
	movq	_BANK_1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_FANIN1_HV_HL_REG@GOTPCREL(%rip), %rax
	addl	%r12d, %r12d
	movl	(%rax), %edx
	addl	%r12d, %edx
	movq	%r14, %rdi
	callq	_nct7904_write_reg
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	andl	$31, %r15d
	movl	(%rbx), %esi
	movq	_FANIN1_LV_HL_REG@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	movq	%r14, %rdi
	movl	%r12d, %edx
	movq	%r15, %rcx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nct7904_write_reg              ## TAILCALL
LBB0_5:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BANK_1,4,2                     ## @BANK_1
	.comm	_FANIN1_HV_HL_REG,4,2           ## @FANIN1_HV_HL_REG
	.comm	_FANIN1_LV_HL_REG,4,2           ## @FANIN1_LV_HL_REG
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_nct7904_write_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nct7904_write_fan
_nct7904_write_fan:                     ; @nct7904_write_fan
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	bl	_dev_get_drvdata
	cmp	w22, #128
	b.ne	LBB0_4
; %bb.1:
	cmp	x21, #0
	b.le	LBB0_5
; %bb.2:
	mov	x19, x0
	mov	w0, #39280
	movk	w0, #20, lsl #16
	mov	x1, x21
	bl	_DIV_ROUND_CLOSEST
	mov	w1, #1
	mov	w2, #8191
	bl	_clamp_val
	mov	x21, x0
	ubfx	x3, x0, #5, #8
Lloh0:
	adrp	x22, _BANK_1@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BANK_1@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _FANIN1_HV_HL_REG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FANIN1_HV_HL_REG@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	lsl	w20, w20, #1
	add	w2, w8, w20
	mov	x0, x19
	bl	_nct7904_write_reg
	tbnz	w0, #31, LBB0_7
; %bb.3:
	and	x3, x21, #0x1f
	ldr	w1, [x22]
Lloh5:
	adrp	x8, _FANIN1_LV_HL_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FANIN1_LV_HL_REG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w2, w8, w20
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_nct7904_write_reg
LBB0_4:
Lloh8:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BANK_1,4,2                     ; @BANK_1
	.comm	_FANIN1_HV_HL_REG,4,2           ; @FANIN1_HV_HL_REG
	.comm	_FANIN1_LV_HL_REG,4,2           ; @FANIN1_LV_HL_REG
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_nct7904_write_fan
.subsections_via_symbols
