	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3533_als_set_resistor
_lm3533_als_set_resistor:               ## @lm3533_als_set_resistor
	.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
	movq	_LM3533_ALS_RESISTOR_MIN@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	%rsi, %rdx
	movq	_LM3533_ALS_RESISTOR_MAX@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jl	LBB0_2
## %bb.3:
	movl	8(%r14), %edi
	movq	_LM3533_REG_ALS_RESISTOR_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_lm3533_write
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	xorl	%ebx, %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3533_ALS_RESISTOR_MIN,8,3    ## @LM3533_ALS_RESISTOR_MIN
	.comm	_LM3533_ALS_RESISTOR_MAX,8,3    ## @LM3533_ALS_RESISTOR_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid resistor value\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LM3533_REG_ALS_RESISTOR_SELECT,4,2 ## @LM3533_REG_ALS_RESISTOR_SELECT
L_.str.1:                               ## @.str.1
	.asciz	"failed to set resistor\n"

	.no_dead_strip	_lm3533_als_set_resistor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm3533_als_set_resistor
_lm3533_als_set_resistor:               ; @lm3533_als_set_resistor
	.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
Lloh0:
	adrp	x8, _LM3533_ALS_RESISTOR_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LM3533_ALS_RESISTOR_MIN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _LM3533_ALS_RESISTOR_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LM3533_ALS_RESISTOR_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x1
	ccmp	x9, x1, #8, le
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_2:
	mov	x2, x1
	ldr	w0, [x19, #8]
Lloh11:
	adrp	x8, _LM3533_REG_ALS_RESISTOR_SELECT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LM3533_REG_ALS_RESISTOR_SELECT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_lm3533_write
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	x0, [x19]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3533_ALS_RESISTOR_MIN,8,3    ; @LM3533_ALS_RESISTOR_MIN
	.comm	_LM3533_ALS_RESISTOR_MAX,8,3    ; @LM3533_ALS_RESISTOR_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid resistor value\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LM3533_REG_ALS_RESISTOR_SELECT,4,2 ; @LM3533_REG_ALS_RESISTOR_SELECT
l_.str.1:                               ; @.str.1
	.asciz	"failed to set resistor\n"

	.no_dead_strip	_lm3533_als_set_resistor
.subsections_via_symbols
