	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds9960_write_event
_apds9960_write_event:                  ## @apds9960_write_event
	.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	%r9d, %r15d
	movl	%r8d, %ebx
	movl	%ecx, %r12d
	movq	%rsi, %r13
	callq	_iio_priv
	movq	%rax, %r14
	movq	_IIO_EV_INFO_VALUE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_1
## %bb.2:
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_apds9960_get_thres_reg
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movq	(%r13), %rax
	movq	_IIO_PROXIMITY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.4:
	testl	%r15d, %r15d
	js	LBB0_1
## %bb.5:
	movq	_APDS9960_MAX_PXS_THRES_VAL@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jl	LBB0_1
## %bb.6:
	movl	(%r14), %edi
	movl	-44(%rbp), %esi
	movl	%r15d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	jns	LBB0_12
	jmp	LBB0_13
LBB0_7:
	movq	_IIO_INTENSITY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.8:
	testl	%r15d, %r15d
	js	LBB0_1
## %bb.9:
	movq	_APDS9960_MAX_ALS_THRES_VAL@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jl	LBB0_1
## %bb.10:
	movl	%r15d, %edi
	callq	_cpu_to_le16
	movl	%eax, -48(%rbp)
	movl	(%r14), %edi
	movl	-44(%rbp), %esi
	leaq	-48(%rbp), %rdx
	movl	$2, %ecx
	callq	_regmap_bulk_write
	testl	%eax, %eax
	js	LBB0_13
LBB0_12:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_EV_INFO_VALUE,4,2          ## @IIO_EV_INFO_VALUE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_PROXIMITY,8,3              ## @IIO_PROXIMITY
	.comm	_APDS9960_MAX_PXS_THRES_VAL,4,2 ## @APDS9960_MAX_PXS_THRES_VAL
	.comm	_IIO_INTENSITY,8,3              ## @IIO_INTENSITY
	.comm	_APDS9960_MAX_ALS_THRES_VAL,4,2 ## @APDS9960_MAX_ALS_THRES_VAL
	.no_dead_strip	_apds9960_write_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds9960_write_event
_apds9960_write_event:                  ; @apds9960_write_event
	.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	x19, x5
	mov	x23, x4
	mov	x22, x3
	mov	x21, x1
	bl	_iio_priv
Lloh0:
	adrp	x8, _IIO_EV_INFO_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_EV_INFO_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_11
; %bb.1:
	mov	x20, x0
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_apds9960_get_thres_reg
	tbnz	w0, #31, LBB0_12
; %bb.2:
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _IIO_PROXIMITY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IIO_PROXIMITY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	tbnz	w19, #31, LBB0_11
; %bb.4:
Lloh6:
	adrp	x8, _APDS9960_MAX_PXS_THRES_VAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _APDS9960_MAX_PXS_THRES_VAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	b.lt	LBB0_11
; %bb.5:
	ldr	w0, [x20]
	ldr	w1, [sp, #12]
	mov	x2, x19
	bl	_regmap_write
	tbz	w0, #31, LBB0_10
	b	LBB0_12
LBB0_6:
Lloh9:
	adrp	x9, _IIO_INTENSITY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IIO_INTENSITY@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.7:
	tbnz	w19, #31, LBB0_11
; %bb.8:
Lloh12:
	adrp	x8, _APDS9960_MAX_ALS_THRES_VAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _APDS9960_MAX_ALS_THRES_VAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w19
	b.lt	LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_cpu_to_le16
	str	w0, [sp, #8]
	ldr	w0, [x20]
	ldr	w1, [sp, #12]
	add	x2, sp, #8
	mov	w3, #2
	bl	_regmap_bulk_write
	tbnz	w0, #31, LBB0_12
LBB0_10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_EV_INFO_VALUE,4,2          ; @IIO_EV_INFO_VALUE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_PROXIMITY,8,3              ; @IIO_PROXIMITY
	.comm	_APDS9960_MAX_PXS_THRES_VAL,4,2 ; @APDS9960_MAX_PXS_THRES_VAL
	.comm	_IIO_INTENSITY,8,3              ; @IIO_INTENSITY
	.comm	_APDS9960_MAX_ALS_THRES_VAL,4,2 ; @APDS9960_MAX_ALS_THRES_VAL
	.no_dead_strip	_apds9960_write_event
.subsections_via_symbols
