	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max31790_write_pwm
_max31790_write_pwm:                    ## @max31790_write_pwm
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movl	%edx, %r15d
	movl	%esi, %r14d
	callq	_dev_get_drvdata
	movq	%rax, %rbx
	movq	24(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r12
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpl	$129, %r14d
	je	LBB0_4
## %bb.1:
	cmpl	$128, %r14d
	jne	LBB0_8
## %bb.2:
	cmpq	$256, %r13                      ## imm = 0x100
	jae	LBB0_9
## %bb.3:
	shlq	$8, %r13
	movq	(%rbx), %rax
	movslq	%r15d, %r14
	movq	%r13, (%rax,%r14,8)
	movl	%r15d, %edi
	callq	_MAX31790_REG_PWMOUT
	movq	(%rbx), %rcx
	movq	(%rcx,%r14,8), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_i2c_smbus_write_word_swapped
	jmp	LBB0_14
LBB0_4:
	movq	8(%rbx), %rax
	movslq	%r15d, %rdi
	movl	(%rax,%rdi,4), %r15d
	cmpq	$2, %r13
	je	LBB0_11
## %bb.5:
	cmpq	$1, %r13
	je	LBB0_12
## %bb.6:
	testq	%r13, %r13
	jne	LBB0_9
## %bb.7:
	movq	_MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPCREL(%rip), %rcx
	movq	_MAX31790_FAN_CFG_RPM_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%edx, %r15d
	jmp	LBB0_13
LBB0_8:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	movq	_MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPCREL(%rip), %rcx
	movq	_MAX31790_FAN_CFG_RPM_MODE@GOTPCREL(%rip), %rdx
	orl	(%rcx), %r15d
	orl	(%rdx), %r15d
	jmp	LBB0_13
LBB0_12:
	movq	_MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
	movq	_MAX31790_FAN_CFG_RPM_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %r15d
LBB0_13:
	movl	%r15d, (%rax,%rdi,4)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MAX31790_REG_FAN_CONFIG
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_i2c_smbus_write_byte_data
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX31790_FAN_CFG_TACH_INPUT_EN,4,2 ## @MAX31790_FAN_CFG_TACH_INPUT_EN
	.comm	_MAX31790_FAN_CFG_RPM_MODE,4,2  ## @MAX31790_FAN_CFG_RPM_MODE
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_max31790_write_pwm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max31790_write_pwm
_max31790_write_pwm:                    ; @max31790_write_pwm
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x3
	mov	x21, x2
	mov	x24, x1
	bl	_dev_get_drvdata
	mov	x23, x0
	ldr	x20, [x0, #24]
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	cmp	w24, #129
	b.eq	LBB0_4
; %bb.1:
	cmp	w24, #128
	b.ne	LBB0_8
; %bb.2:
	cmp	x22, #256
	b.hs	LBB0_9
; %bb.3:
	lsl	x8, x22, #8
	ldr	x9, [x23]
	mov	x10, x21
	sbfiz	x22, x10, #3, #32
	str	x8, [x9, x22]
	mov	x0, x21
	bl	_MAX31790_REG_PWMOUT
	mov	x1, x0
	ldr	x8, [x23]
	ldr	x2, [x8, x22]
	mov	x0, x20
	bl	_i2c_smbus_write_word_swapped
	b	LBB0_15
LBB0_4:
	ldr	x8, [x23, #8]
	ldr	w9, [x8, w21, sxtw #2]
	cmp	x22, #2
	b.eq	LBB0_11
; %bb.5:
	cmp	x22, #1
	b.eq	LBB0_12
; %bb.6:
	cbnz	x22, LBB0_9
; %bb.7:
Lloh0:
	adrp	x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
Lloh3:
	adrp	x11, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGE
Lloh4:
	ldr	x11, [x11, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	orr	w10, w11, w10
	b	LBB0_13
LBB0_8:
Lloh6:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_16
LBB0_11:
Lloh10:
	adrp	x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
Lloh13:
	adrp	x11, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGE
Lloh14:
	ldr	x11, [x11, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	orr	w9, w10, w9
	orr	w22, w9, w11
	b	LBB0_14
LBB0_12:
Lloh16:
	adrp	x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGE
Lloh17:
	ldr	x10, [x10, _MAX31790_FAN_CFG_TACH_INPUT_EN@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh19:
	adrp	x10, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGE
Lloh20:
	ldr	x10, [x10, _MAX31790_FAN_CFG_RPM_MODE@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
LBB0_13:
	bic	w22, w9, w10
LBB0_14:
	sxtw	x9, w21
	str	w22, [x8, x9, lsl #2]
	mov	x0, x21
	bl	_MAX31790_REG_FAN_CONFIG
	mov	x1, x0
	mov	x0, x20
	mov	x2, x22
	bl	_i2c_smbus_write_byte_data
LBB0_15:
	mov	x20, x0
LBB0_16:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX31790_FAN_CFG_TACH_INPUT_EN,4,2 ; @MAX31790_FAN_CFG_TACH_INPUT_EN
	.comm	_MAX31790_FAN_CFG_RPM_MODE,4,2  ; @MAX31790_FAN_CFG_RPM_MODE
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_max31790_write_pwm
.subsections_via_symbols
