	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltr501_write_thresh
_ltr501_write_thresh:                   ## @ltr501_write_thresh
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movl	%ecx, %r15d
	movq	%rsi, %r12
	movl	%r9d, -36(%rbp)
	callq	_iio_priv
	testl	%ebx, %ebx
	js	LBB0_15
## %bb.1:
	movq	%rax, %r14
	movl	(%r12), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_15
## %bb.3:
	movq	_LTR501_ALS_THRESH_MASK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_15
## %bb.4:
	cmpl	$131, %r15d
	je	LBB0_8
## %bb.5:
	cmpl	$130, %r15d
	jne	LBB0_15
## %bb.6:
	movq	%r14, %r15
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	movq	_LTR501_ALS_THRESH_UP@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	_LTR501_PS_THRESH_MASK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_15
## %bb.10:
	cmpl	$131, %r15d
	je	LBB0_14
## %bb.11:
	cmpl	$130, %r15d
	jne	LBB0_15
## %bb.12:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	movq	_LTR501_PS_THRESH_UP@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %r15
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	movq	_LTR501_ALS_THRESH_LOW@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	$2, %ecx
	callq	_regmap_bulk_write
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_16
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	4(%r14), %edi
	movq	_LTR501_PS_THRESH_LOW@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	$2, %ecx
	callq	_regmap_bulk_write
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LTR501_ALS_THRESH_MASK,4,2     ## @LTR501_ALS_THRESH_MASK
	.comm	_LTR501_ALS_THRESH_UP,4,2       ## @LTR501_ALS_THRESH_UP
	.comm	_LTR501_ALS_THRESH_LOW,4,2      ## @LTR501_ALS_THRESH_LOW
	.comm	_LTR501_PS_THRESH_MASK,4,2      ## @LTR501_PS_THRESH_MASK
	.comm	_LTR501_PS_THRESH_UP,4,2        ## @LTR501_PS_THRESH_UP
	.comm	_LTR501_PS_THRESH_LOW,4,2       ## @LTR501_PS_THRESH_LOW
	.no_dead_strip	_ltr501_write_thresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltr501_write_thresh
_ltr501_write_thresh:                   ; @ltr501_write_thresh
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x5
	mov	x20, x3
	mov	x22, x1
	str	w5, [sp, #12]
	bl	_iio_priv
	tbnz	w21, #31, LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_11
; %bb.3:
Lloh0:
	adrp	x8, _LTR501_ALS_THRESH_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LTR501_ALS_THRESH_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.lt	LBB0_11
; %bb.4:
	cmp	w20, #131
	b.eq	LBB0_13
; %bb.5:
	cmp	w20, #130
	b.ne	LBB0_11
; %bb.6:
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x8, _LTR501_ALS_THRESH_UP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LTR501_ALS_THRESH_UP@GOTPAGEOFF]
	b	LBB0_14
LBB0_7:
Lloh5:
	adrp	x8, _LTR501_PS_THRESH_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LTR501_PS_THRESH_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w21
	b.lt	LBB0_11
; %bb.8:
	cmp	w20, #131
	b.eq	LBB0_15
; %bb.9:
	cmp	w20, #130
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x8, _LTR501_PS_THRESH_UP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LTR501_PS_THRESH_UP@GOTPAGEOFF]
	b	LBB0_16
LBB0_11:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	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
	add	sp, sp, #64
	ret
LBB0_13:
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x8, _LTR501_ALS_THRESH_LOW@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LTR501_ALS_THRESH_LOW@GOTPAGEOFF]
LBB0_14:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	w3, #2
	bl	_regmap_bulk_write
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	b	LBB0_12
LBB0_15:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh15:
	adrp	x8, _LTR501_PS_THRESH_LOW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LTR501_PS_THRESH_LOW@GOTPAGEOFF]
LBB0_16:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	w3, #2
	bl	_regmap_bulk_write
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LTR501_ALS_THRESH_MASK,4,2     ; @LTR501_ALS_THRESH_MASK
	.comm	_LTR501_ALS_THRESH_UP,4,2       ; @LTR501_ALS_THRESH_UP
	.comm	_LTR501_ALS_THRESH_LOW,4,2      ; @LTR501_ALS_THRESH_LOW
	.comm	_LTR501_PS_THRESH_MASK,4,2      ; @LTR501_PS_THRESH_MASK
	.comm	_LTR501_PS_THRESH_UP,4,2        ; @LTR501_PS_THRESH_UP
	.comm	_LTR501_PS_THRESH_LOW,4,2       ; @LTR501_PS_THRESH_LOW
	.no_dead_strip	_ltr501_write_thresh
.subsections_via_symbols
