	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gp2ap020a00f_write_event_val
_gp2ap020a00f_write_event_val:          ## @gp2ap020a00f_write_event_val
	.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, %r14d
	movl	%ecx, %r13d
	movq	%rsi, %rbx
	callq	_iio_priv
	movq	%rax, %r12
	leaq	8(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_gp2ap020a00f_get_thresh_reg
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_GP2AP020A00F_THRESH_VAL_ID
	movl	%eax, %r13d
	movq	_GP2AP020A00F_THRESH_PH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jle	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	addl	$-128, %ebx
	cmpl	$3, %ebx
	ja	LBB0_3
## %bb.4:
	movq	_GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPCREL(%rip), %rax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rbx,4), %rdx
	addq	%rcx, %rdx
	jmpq	*%rdx
LBB0_9:
	movq	_GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	xorl	%edx, %edx
	jmp	LBB0_11
LBB0_7:
	testl	%r14d, %r14d
	je	LBB0_1
## %bb.8:
	movq	_GP2AP020A00F_FLAG_PROX_FALLING_EV@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	testl	%r14d, %r14d
	je	LBB0_1
## %bb.6:
	movq	_GP2AP020A00F_FLAG_PROX_RISING_EV@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %edi
	leaq	12(%r12), %rsi
	callq	_test_bit
	movl	%eax, %edx
LBB0_11:
	movq	(%r12), %rax
	movslq	%r13d, %rcx
	movl	%r14d, (%rax,%rcx,4)
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_gp2ap020a00f_write_event_threshold
	movl	%eax, %ebx
LBB0_12:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_7
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_GP2AP020A00F_THRESH_PH,4,2     ## @GP2AP020A00F_THRESH_PH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GP2AP020A00F_FLAG_ALS_RISING_EV,4,2 ## @GP2AP020A00F_FLAG_ALS_RISING_EV
	.comm	_GP2AP020A00F_FLAG_ALS_FALLING_EV,4,2 ## @GP2AP020A00F_FLAG_ALS_FALLING_EV
	.comm	_GP2AP020A00F_FLAG_PROX_RISING_EV,4,2 ## @GP2AP020A00F_FLAG_PROX_RISING_EV
	.comm	_GP2AP020A00F_FLAG_PROX_FALLING_EV,4,2 ## @GP2AP020A00F_FLAG_PROX_FALLING_EV
	.no_dead_strip	_gp2ap020a00f_write_event_val
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gp2ap020a00f_write_event_val
_gp2ap020a00f_write_event_val:          ; @gp2ap020a00f_write_event_val
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x5
	mov	x22, x3
	mov	x23, x1
	bl	_iio_priv
	mov	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x23
	mov	x1, x22
	bl	_gp2ap020a00f_get_thresh_reg
	mov	x23, x0
	bl	_GP2AP020A00F_THRESH_VAL_ID
Lloh0:
	adrp	x8, _GP2AP020A00F_THRESH_PH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GP2AP020A00F_THRESH_PH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_2:
	mov	x22, x0
	sub	w9, w23, #128
	cmp	w9, #3
	b.hi	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_ALS_RISING_EV@GOTPAGEOFF]
Lloh8:
	adrp	x10, lJTI0_0@PAGE
Lloh9:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_4
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_4:
Lloh10:
	adrp	x8, _GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_ALS_FALLING_EV@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	mov	w2, #0
	b	LBB0_11
LBB0_6:
	cbz	w20, LBB0_1
; %bb.7:
Lloh12:
	adrp	x8, _GP2AP020A00F_FLAG_PROX_FALLING_EV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_PROX_FALLING_EV@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	cbz	w20, LBB0_1
; %bb.9:
Lloh14:
	adrp	x8, _GP2AP020A00F_FLAG_PROX_RISING_EV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GP2AP020A00F_FLAG_PROX_RISING_EV@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	add	x1, x21, #12
	bl	_test_bit
	mov	x2, x0
LBB0_11:
	ldr	x8, [x21]
	str	w20, [x8, w22, sxtw #2]
	mov	x0, x21
	mov	x1, x22
	bl	_gp2ap020a00f_write_event_threshold
	mov	x20, x0
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_10-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
                                        ; -- End function
	.comm	_GP2AP020A00F_THRESH_PH,4,2     ; @GP2AP020A00F_THRESH_PH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GP2AP020A00F_FLAG_ALS_RISING_EV,4,2 ; @GP2AP020A00F_FLAG_ALS_RISING_EV
	.comm	_GP2AP020A00F_FLAG_ALS_FALLING_EV,4,2 ; @GP2AP020A00F_FLAG_ALS_FALLING_EV
	.comm	_GP2AP020A00F_FLAG_PROX_RISING_EV,4,2 ; @GP2AP020A00F_FLAG_PROX_RISING_EV
	.comm	_GP2AP020A00F_FLAG_PROX_FALLING_EV,4,2 ; @GP2AP020A00F_FLAG_PROX_FALLING_EV
	.no_dead_strip	_gp2ap020a00f_write_event_val
.subsections_via_symbols
