	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk8312_set_range
_stk8312_set_range:                     ## @stk8312_set_range
	.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
	movl	%esi, %r12d
	leal	-3(%r12), %eax
	cmpl	$-3, %eax
	ja	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_2:
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	cmpl	%r12d, (%rdi)
	je	LBB0_9
## %bb.3:
	movq	8(%r15), %r13
	movl	4(%r15), %r14d
	movq	_STK8312_MODE_STANDBY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_stk8312_set_mode
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_STK8312_REG_STH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:
	movq	_STK8312_RNG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_STK8312_RNG_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r12d, %edx
	shll	%cl, %edx
	notl	%eax
	andl	%eax, %ebx
	orl	%ebx, %edx
	movq	_STK8312_REG_STH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_7
## %bb.10:
	movl	%r12d, (%r15)
	movq	%r15, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_stk8312_set_mode               ## TAILCALL
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_7:
	movl	%eax, %ebx
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_stk8312_set_mode
LBB0_9:
	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	_STK8312_MODE_STANDBY,4,2       ## @STK8312_MODE_STANDBY
	.comm	_STK8312_REG_STH,4,2            ## @STK8312_REG_STH
	.comm	_STK8312_RNG_MASK,4,2           ## @STK8312_RNG_MASK
	.comm	_STK8312_RNG_SHIFT,4,2          ## @STK8312_RNG_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to change sensor range\n"

	.no_dead_strip	_stk8312_set_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk8312_set_range
_stk8312_set_range:                     ; @stk8312_set_range
	.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
	sub	w8, w1, #3
	cmn	w8, #3
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_11
LBB0_2:
	mov	x22, x1
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, w1
	b.ne	LBB0_4
; %bb.3:
	mov	w23, #0
	b	LBB0_11
LBB0_4:
	ldr	x21, [x19, #8]
	ldr	w20, [x19, #4]
Lloh3:
	adrp	x8, _STK8312_MODE_STANDBY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STK8312_MODE_STANDBY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stk8312_set_mode
	tbnz	w0, #31, LBB0_8
; %bb.5:
Lloh6:
	adrp	x24, _STK8312_REG_STH@GOTPAGE
Lloh7:
	ldr	x24, [x24, _STK8312_REG_STH@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
	tbnz	w0, #31, LBB0_10
; %bb.6:
Lloh8:
	adrp	x8, _STK8312_RNG_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STK8312_RNG_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	bic	w8, w23, w8
Lloh11:
	adrp	x9, _STK8312_RNG_SHIFT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _STK8312_RNG_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w2, w9, w8
	ldr	w1, [x24]
	mov	x0, x21
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_9
; %bb.7:
	str	w22, [x19]
	mov	x0, x19
	mov	x1, 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
	b	_stk8312_set_mode
LBB0_8:
	mov	x23, x0
	b	LBB0_11
LBB0_9:
	mov	x23, x0
LBB0_10:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	x0, x19
	mov	x1, x20
	bl	_stk8312_set_mode
LBB0_11:
	mov	x0, x23
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_STK8312_MODE_STANDBY,4,2       ; @STK8312_MODE_STANDBY
	.comm	_STK8312_REG_STH,4,2            ; @STK8312_REG_STH
	.comm	_STK8312_RNG_MASK,4,2           ; @STK8312_RNG_MASK
	.comm	_STK8312_RNG_SHIFT,4,2          ; @STK8312_RNG_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to change sensor range\n"

	.no_dead_strip	_stk8312_set_range
.subsections_via_symbols
