	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vcnl4035_write_thresh
_vcnl4035_write_thresh:                 ## @vcnl4035_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movl	%r8d, %ebx
	movl	%ecx, %r12d
	callq	_iio_priv
	movq	%rax, %r14
	cmpl	$129, %ebx
	je	LBB0_10
## %bb.1:
	cmpl	$128, %ebx
	jne	LBB0_14
## %bb.2:
	cmpl	$65536, %r15d                   ## imm = 0x10000
	jae	LBB0_14
## %bb.3:
	movq	_IIO_EV_DIR_RISING@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_7
## %bb.4:
	cmpl	%r15d, (%r14)
	jg	LBB0_14
## %bb.5:
	movl	12(%r14), %edi
	movq	_VCNL4035_ALS_THDH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	movl	%r15d, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_10:
	cmpl	$8, %r15d
	ja	LBB0_14
## %bb.11:
	movl	%r15d, %edi
	callq	_hweight8
	cmpl	$1, %eax
	jne	LBB0_14
## %bb.12:
	movl	12(%r14), %edi
	movq	_VCNL4035_ALS_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VCNL4035_ALS_PERS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	movl	%r15d, 8(%r14)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_7:
	cmpl	%r15d, 4(%r14)
	jge	LBB0_8
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	12(%r14), %edi
	movq	_VCNL4035_ALS_THDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movl	%r15d, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ## @IIO_EV_DIR_RISING
	.comm	_VCNL4035_ALS_THDH,4,2          ## @VCNL4035_ALS_THDH
	.comm	_VCNL4035_ALS_THDL,4,2          ## @VCNL4035_ALS_THDL
	.comm	_VCNL4035_ALS_CONF,4,2          ## @VCNL4035_ALS_CONF
	.comm	_VCNL4035_ALS_PERS_MASK,4,2     ## @VCNL4035_ALS_PERS_MASK
	.no_dead_strip	_vcnl4035_write_thresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vcnl4035_write_thresh
_vcnl4035_write_thresh:                 ; @vcnl4035_write_thresh
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x5
	mov	x22, x4
	mov	x21, x3
	bl	_iio_priv
	mov	x20, x0
	cmp	w22, #129
	b.eq	LBB0_7
; %bb.1:
	cmp	w22, #128
	b.ne	LBB0_12
; %bb.2:
	cmp	w19, #16, lsl #12               ; =65536
	b.hs	LBB0_12
; %bb.3:
Lloh0:
	adrp	x8, _IIO_EV_DIR_RISING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_EV_DIR_RISING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_11
; %bb.4:
	ldr	w8, [x20]
	cmp	w8, w19
	b.gt	LBB0_12
; %bb.5:
	ldr	w0, [x20, #12]
Lloh3:
	adrp	x8, _VCNL4035_ALS_THDH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VCNL4035_ALS_THDH@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_regmap_write
	cbnz	w0, LBB0_13
; %bb.6:
	str	w19, [x20, #4]
	b	LBB0_13
LBB0_7:
	cmp	w19, #8
	b.hi	LBB0_12
; %bb.8:
	mov	x0, x19
	bl	_hweight8
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.9:
	ldr	w0, [x20, #12]
Lloh6:
	adrp	x8, _VCNL4035_ALS_CONF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VCNL4035_ALS_CONF@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _VCNL4035_ALS_PERS_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VCNL4035_ALS_PERS_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x3, x19
	bl	_regmap_update_bits
	cbnz	w0, LBB0_13
; %bb.10:
	str	w19, [x20, #8]
	b	LBB0_13
LBB0_11:
	ldr	w8, [x20, #4]
	cmp	w8, w19
	b.ge	LBB0_14
LBB0_12:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	w0, [x20, #12]
Lloh15:
	adrp	x8, _VCNL4035_ALS_THDL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VCNL4035_ALS_THDL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_regmap_write
	cbnz	w0, LBB0_13
; %bb.15:
	str	w19, [x20]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ; @IIO_EV_DIR_RISING
	.comm	_VCNL4035_ALS_THDH,4,2          ; @VCNL4035_ALS_THDH
	.comm	_VCNL4035_ALS_THDL,4,2          ; @VCNL4035_ALS_THDL
	.comm	_VCNL4035_ALS_CONF,4,2          ; @VCNL4035_ALS_CONF
	.comm	_VCNL4035_ALS_PERS_MASK,4,2     ; @VCNL4035_ALS_PERS_MASK
	.no_dead_strip	_vcnl4035_write_thresh
.subsections_via_symbols
