	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm3533_als_set_threshold
_lm3533_als_set_threshold:              ## @lm3533_als_set_threshold
	.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, %r13
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_iio_priv
	movq	%rax, %r14
	movq	_LM3533_ALS_THRESH_MAX@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jae	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_11
LBB0_2:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_lm3533_als_get_threshold_reg
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	testl	%r15d, %r15d
	sete	%sil
	movl	%ebx, %edi
	callq	_lm3533_als_get_threshold_reg
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_lm3533_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
LBB0_9:
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_10
LBB0_4:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, -64(%rbp)
	setg	%al
	setl	%cl
	testl	%r15d, %r15d
	cmovel	%ecx, %eax
	cmpb	$1, %al
	jne	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_10
LBB0_6:
	movl	4(%r14), %edi
	callq	_lm3533_write
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_7:
	xorl	%r13d, %r13d
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3533_ALS_THRESH_MAX,4,2      ## @LM3533_ALS_THRESH_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get threshold\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to set threshold\n"

	.no_dead_strip	_lm3533_als_set_threshold
.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_threshold
_lm3533_als_set_threshold:              ; @lm3533_als_set_threshold
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	bl	_iio_priv
Lloh0:
	adrp	x8, _LM3533_ALS_THRESH_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LM3533_ALS_THRESH_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_6
LBB0_2:
	mov	x19, x0
	mov	x0, x23
	mov	x1, x22
	bl	_lm3533_als_get_threshold_reg
	mov	x24, x0
	cmp	w22, #0
	cset	w1, eq
	mov	x0, x23
	bl	_lm3533_als_get_threshold_reg
	mov	x23, x0
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x19, #4]
	add	x2, sp, #8
	mov	x1, x23
	bl	_lm3533_read
	cbz	w0, LBB0_7
; %bb.3:
	mov	x23, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x23
	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
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	x8, [sp, #8]
	cmp	x8, x21
	cset	w8, gt
	cset	w9, lt
	cmp	w22, #0
	csel	w8, w9, w8, eq
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.8:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_5
LBB0_9:
	ldr	w0, [x19, #4]
	mov	x1, x24
	mov	x2, x21
	bl	_lm3533_write
	mov	x23, x0
	cbz	w0, LBB0_5
; %bb.10:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3533_ALS_THRESH_MAX,4,2      ; @LM3533_ALS_THRESH_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get threshold\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to set threshold\n"

	.no_dead_strip	_lm3533_als_set_threshold
.subsections_via_symbols
