	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad7291_write_event_value
_ad7291_write_event_value:              ## @ad7291_write_event_value
	.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, %ebx
	movl	%r8d, %r14d
	movl	%ecx, %r15d
	movq	%rsi, %r12
	callq	_iio_priv
	movq	%rax, %r13
	movq	_IIO_EV_INFO_HYSTERESIS@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rax
	movq	_IIO_VOLTAGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_2:
	testl	%ebx, %ebx
	js	LBB0_4
## %bb.3:
	movq	_AD7291_VALUE_MASK@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_4
LBB0_6:
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_ad7291_threshold_reg
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ad7291_i2c_write               ## TAILCALL
LBB0_5:
	leal	-2048(%rbx), %eax
	cmpl	$-4097, %eax                    ## imm = 0xEFFF
	ja	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_EV_INFO_HYSTERESIS,4,2     ## @IIO_EV_INFO_HYSTERESIS
	.comm	_IIO_VOLTAGE,8,3                ## @IIO_VOLTAGE
	.comm	_AD7291_VALUE_MASK,4,2          ## @AD7291_VALUE_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ad7291_write_event_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad7291_write_event_value
_ad7291_write_event_value:              ; @ad7291_write_event_value
	.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	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x1
	bl	_iio_priv
	mov	x23, x0
Lloh0:
	adrp	x8, _IIO_EV_INFO_HYSTERESIS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_EV_INFO_HYSTERESIS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x22]
Lloh3:
	adrp	x9, _IIO_VOLTAGE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IIO_VOLTAGE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_2:
	tbnz	w19, #31, LBB0_6
; %bb.3:
Lloh6:
	adrp	x8, _AD7291_VALUE_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AD7291_VALUE_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	b.lt	LBB0_6
LBB0_4:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_ad7291_threshold_reg
	mov	x1, x0
	mov	x0, x23
	mov	x2, x19
	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
	b	_ad7291_i2c_write
LBB0_5:
	sub	w8, w19, #2048
	mov	w9, #-4097
	cmp	w8, w9
	b.hi	LBB0_4
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_EV_INFO_HYSTERESIS,4,2     ; @IIO_EV_INFO_HYSTERESIS
	.comm	_IIO_VOLTAGE,8,3                ; @IIO_VOLTAGE
	.comm	_AD7291_VALUE_MASK,4,2          ; @AD7291_VALUE_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ad7291_write_event_value
.subsections_via_symbols
