	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max6650_set_target
_max6650_set_target:                    ## @max6650_set_target
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.1:
	movq	_FAN_RPM_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_FAN_RPM_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rsi, %rdi
	movl	%eax, %esi
	callq	_clamp_val
	movq	%rax, %rbx
	movl	8(%r14), %edi
	callq	_DIV_FROM_REG
	movl	%eax, %esi
	shlq	$8, %rbx
	movabsq	$-8608480567731124087, %rcx     ## imm = 0x8888888888888889
	movq	%rbx, %rax
	mulq	%rcx
	movq	%rdx, %rcx
	movq	_clock@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	shrq	$5, %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_2
## %bb.3:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_4
LBB0_5:
	movq	_MAX6650_CFG_MODE_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_max6650_set_operating_mode     ## TAILCALL
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_4:
	decl	%eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	cmpl	$255, %ecx
	movl	$255, %edx
	cmovbl	%ecx, %edx
	movl	%edx, (%r14)
	movl	4(%r14), %edi
	movq	_MAX6650_REG_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_i2c_smbus_write_byte_data      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX6650_CFG_MODE_OFF,4,2       ## @MAX6650_CFG_MODE_OFF
	.comm	_FAN_RPM_MIN,4,2                ## @FAN_RPM_MIN
	.comm	_FAN_RPM_MAX,4,2                ## @FAN_RPM_MAX
	.comm	_clock,4,2                      ## @clock
	.comm	_MAX6650_REG_SPEED,4,2          ## @MAX6650_REG_SPEED
	.no_dead_strip	_max6650_set_target
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max6650_set_target
_max6650_set_target:                    ; @max6650_set_target
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cbz	x1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _FAN_RPM_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FAN_RPM_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _FAN_RPM_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FAN_RPM_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x9]
	mov	x0, x1
	mov	x1, x8
	bl	_clamp_val
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_DIV_FROM_REG
                                        ; kill: def $w0 killed $w0 def $x0
Lloh6:
	adrp	x8, _clock@GOTPAGE
Lloh7:
	ldr	x8, [x8, _clock@GOTPAGEOFF]
Lloh8:
	ldrsw	x8, [x8]
	sxtw	x9, w0
	mul	x8, x8, x9
	lsl	x9, x20, #8
	mov	x10, #-8608480567731124088
	movk	x10, #34953
	umulh	x9, x9, x10
	lsr	x9, x9, #5
	udiv	x8, x8, x9
	sub	w8, w8, #1
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	mov	w9, #255
	cmp	w8, #255
	csel	w2, w8, w9, lo
	str	w2, [x19]
	ldr	w0, [x19, #4]
Lloh9:
	adrp	x8, _MAX6650_REG_SPEED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX6650_REG_SPEED@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_i2c_smbus_write_byte_data
LBB0_2:
Lloh12:
	adrp	x8, _MAX6650_CFG_MODE_OFF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX6650_CFG_MODE_OFF@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_max6650_set_operating_mode
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX6650_CFG_MODE_OFF,4,2       ; @MAX6650_CFG_MODE_OFF
	.comm	_FAN_RPM_MIN,4,2                ; @FAN_RPM_MIN
	.comm	_FAN_RPM_MAX,4,2                ; @FAN_RPM_MAX
	.comm	_clock,4,2                      ; @clock
	.comm	_MAX6650_REG_SPEED,4,2          ; @MAX6650_REG_SPEED
	.no_dead_strip	_max6650_set_target
.subsections_via_symbols
