	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_fan
_set_fan:                               ## @set_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	%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	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_sensor_dev_attr_2
	movslq	(%rax), %rbx
	movl	4(%rax), %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtol
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %r12
	addq	$24, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpl	$128, %r13d
	je	LBB0_5
## %bb.1:
	cmpl	$130, %r13d
	je	LBB0_8
## %bb.2:
	cmpl	$129, %r13d
	jne	LBB0_10
## %bb.3:
	cmpl	$3, %ebx
	jg	LBB0_11
## %bb.4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_FAN_TO_REG
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movq	%rbx, %r14
	jmp	LBB0_12
LBB0_5:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	cmpq	$4, %r13
	ja	LBB0_16
## %bb.6:
	movl	$22, %eax
	btq	%r13, %rax
	jae	LBB0_16
## %bb.7:
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_OPT
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dme1737_read
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_FAN_TYPE_TO_REG
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_OPT
	movq	8(%r15), %rcx
	movl	(%rcx,%rbx,4), %edx
	jmp	LBB0_9
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_FAN_MAX_TO_REG
	movq	16(%r15), %rcx
	movl	%eax, -16(%rcx,%rbx,4)
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_MAX
	movq	16(%r15), %rcx
	movl	-16(%rcx,%rbx,4), %edx
LBB0_9:
	movq	%r15, %rdi
	movl	%eax, %esi
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_dev_dbg
	jmp	LBB0_14
LBB0_11:
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_OPT
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dme1737_read
	movq	8(%r15), %rcx
	movl	%ebx, %r14d
	movl	%eax, (%rcx,%r14,4)
	movl	%eax, %edi
	callq	_FAN_TPC_FROM_REG
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_FAN_TO_REG
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%r14,4)
LBB0_12:
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_MIN
	movq	(%r15), %rcx
	movzbl	(%rcx,%r14,4), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dme1737_write
	movl	%ebx, %edi
	callq	_DME1737_REG_FAN_MIN
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %esi
	movq	(%r15), %rax
	movl	(%rax,%r14,4), %edx
	sarl	$8, %edx
	movq	%r15, %rdi
LBB0_13:
	callq	_dme1737_write
LBB0_14:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_15:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%r13, %rdx
	callq	_dev_warn
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fan type value %ld not supported. Choose one of 1, 2, or 4.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unknown function %d.\n"

	.no_dead_strip	_set_fan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_fan
_set_fan:                               ; @set_fan
	.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	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x24, x0
	bl	_dev_get_drvdata
	mov	x21, x0
	mov	x0, x22
	bl	_to_sensor_dev_attr_2
	ldp	w22, w25, [x0]
                                        ; kill: def $w22 killed $w22 def $x22
	sxtw	x22, w22
	mov	x0, x20
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtol
	mov	x23, x0
	add	x20, x21, #24
	mov	x0, x20
	bl	_mutex_lock
	cmp	w25, #128
	b.eq	LBB0_5
; %bb.1:
	cmp	w25, #130
	b.eq	LBB0_8
; %bb.2:
	cmp	w25, #129
	b.ne	LBB0_10
; %bb.3:
	cmp	w22, #3
	b.gt	LBB0_11
; %bb.4:
	mov	x0, x23
	mov	w1, #0
	bl	_FAN_TO_REG
	ldr	x8, [x21]
	str	w0, [x8, x22, lsl #2]
	mov	x24, x22
	b	LBB0_12
LBB0_5:
	cmp	x23, #4
	b.hi	LBB0_15
; %bb.6:
	mov	w8, #1
	lsl	x8, x8, x23
	mov	w9, #22
	tst	x8, x9
	b.eq	LBB0_15
; %bb.7:
	mov	x0, x22
	bl	_DME1737_REG_FAN_OPT
	mov	x1, x0
	mov	x0, x21
	bl	_dme1737_read
	mov	x1, x0
	mov	x0, x23
	bl	_FAN_TYPE_TO_REG
	ldr	x8, [x21, #8]
	lsl	x23, x22, #2
	str	w0, [x8, x23]
	mov	x0, x22
	bl	_DME1737_REG_FAN_OPT
	mov	x1, x0
	ldr	x8, [x21, #8]
	b	LBB0_9
LBB0_8:
	mov	x0, x23
	bl	_FAN_MAX_TO_REG
	ldr	x8, [x21, #16]
	sub	w9, w22, #4
	sbfiz	x23, x9, #2, #32
	str	w0, [x8, x23]
	mov	x0, x22
	bl	_DME1737_REG_FAN_MAX
	mov	x1, x0
	ldr	x8, [x21, #16]
LBB0_9:
	ldr	w2, [x8, x23]
	b	LBB0_13
LBB0_10:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	mov	x2, x25
	bl	_dev_dbg
	b	LBB0_14
LBB0_11:
	mov	x0, x22
	bl	_DME1737_REG_FAN_OPT
	mov	x1, x0
	mov	x0, x21
	bl	_dme1737_read
	ldr	x8, [x21, #8]
	and	x24, x22, #0xffffffff
	lsl	x25, x24, #2
	str	w0, [x8, x25]
	bl	_FAN_TPC_FROM_REG
	mov	x1, x0
	mov	x0, x23
	bl	_FAN_TO_REG
	ldr	x8, [x21]
	str	w0, [x8, x25]
LBB0_12:
	mov	x0, x22
	bl	_DME1737_REG_FAN_MIN
	mov	x1, x0
	ldr	x8, [x21]
	lsl	x23, x24, #2
	ldrb	w2, [x8, x23]
	mov	x0, x21
	bl	_dme1737_write
	mov	x0, x22
	bl	_DME1737_REG_FAN_MIN
	add	w1, w0, #1
	ldr	x8, [x21]
	ldr	w8, [x8, x23]
	asr	w2, w8, #8
LBB0_13:
	mov	x0, x21
	bl	_dme1737_write
LBB0_14:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	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_15:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	neg	x19, x8
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x23
	bl	_dev_warn
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fan type value %ld not supported. Choose one of 1, 2, or 4.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unknown function %d.\n"

	.no_dead_strip	_set_fan
.subsections_via_symbols
