	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ads1015_write_event
_ads1015_write_event:                   ## @ads1015_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %r14d
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	callq	_iio_priv
	movq	%rax, %rbx
	movl	8(%r15), %r13d
	movq	%rax, %rdi
	addq	$8, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	cmpl	$129, %r14d
	je	LBB0_7
## %bb.1:
	cmpl	$128, %r14d
	jne	LBB0_12
## %bb.2:
	decb	%r13b
	movl	$1, %edx
	movl	%r13d, %ecx
	shll	%cl, %edx
	movl	$-1, %eax
	shll	%cl, %eax
	cmpl	%r12d, %edx
	jle	LBB0_12
## %bb.3:
	cmpl	%r12d, %eax
	jg	LBB0_12
## %bb.4:
	movq	_IIO_EV_DIR_RISING@GOTPCREL(%rip), %rdx
	movq	16(%rbx), %rax
	movq	(%r15), %rcx
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	cmpl	%esi, (%rdx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	(%rcx,%rcx,2), %rcx
	jne	LBB0_6
## %bb.5:
	movl	%r12d, (%rax,%rcx,4)
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_7:
	movq	24(%rbx), %rax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rcx
	movslq	(%rax,%rcx,4), %r14
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %rax
	imull	(%rax), %r12d
	movq	_ads1015_comp_queue@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	xorl	%r15d, %r15d
	movl	$0, %r13d
	cmpl	$2, %eax
	jl	LBB0_11
## %bb.8:
	addl	16(%rbp), %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ads1015_comp_queue@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%rdi,%r13,4), %eax
	movq	(%rbx), %rcx
	cltd
	idivl	(%rcx,%r14,4)
	cmpl	%eax, %r12d
	jle	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%r13
	callq	_ARRAY_SIZE
	decl	%eax
	cltq
	cmpq	%rax, %r13
	jl	LBB0_9
LBB0_11:
	movq	16(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	%r13d, 8(%rax,%rcx,4)
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_14:
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%r12d, 4(%rax,%rcx,4)
	xorl	%r15d, %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ## @IIO_EV_DIR_RISING
	.comm	_USEC_PER_SEC,4,2               ## @USEC_PER_SEC
	.comm	_ads1015_comp_queue,8,3         ## @ads1015_comp_queue
	.no_dead_strip	_ads1015_write_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ads1015_write_event
_ads1015_write_event:                   ; @ads1015_write_event
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x6
	mov	x22, x5
	mov	x25, x4
	mov	x23, x3
	mov	x20, x1
	bl	_iio_priv
	mov	x21, x0
	ldr	w26, [x20, #8]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	cmp	w25, #129
	b.eq	LBB0_4
; %bb.1:
	cmp	w25, #128
	b.ne	LBB0_3
; %bb.2:
	sub	w8, w26, #1
	mov	w9, #1
	lsl	w9, w9, w8
	mov	w10, #-1
	lsl	w8, w10, w8
	cmp	w9, w22
	ccmp	w8, w22, #0, gt
	b.le	LBB0_8
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
LBB0_4:
	ldr	x8, [x21, #24]
	ldr	x9, [x20]
	ldrsw	x23, [x8, x9, lsl #2]
Lloh3:
	adrp	x26, _USEC_PER_SEC@GOTPAGE
Lloh4:
	ldr	x26, [x26, _USEC_PER_SEC@GOTPAGEOFF]
	ldr	w28, [x26]
Lloh5:
	adrp	x27, _ads1015_comp_queue@GOTPAGE
Lloh6:
	ldr	x27, [x27, _ads1015_comp_queue@GOTPAGEOFF]
	ldr	x0, [x27]
	bl	_ARRAY_SIZE
	cmp	w0, #2
	b.lt	LBB0_10
; %bb.5:
	mov	x25, #0
	madd	w22, w28, w22, w24
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x27]
	ldr	w8, [x0, x25, lsl #2]
	ldr	w9, [x26]
	mul	w8, w9, w8
	ldr	x9, [x21]
	ldr	w9, [x9, x23, lsl #2]
	sdiv	w8, w8, w9
	cmp	w22, w8
	b.le	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, #1
	bl	_ARRAY_SIZE
	sub	w8, w0, #1
	cmp	x25, w8, sxtw
	b.lt	LBB0_6
	b	LBB0_11
LBB0_8:
Lloh7:
	adrp	x8, _IIO_EV_DIR_RISING@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IIO_EV_DIR_RISING@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x8]
	ldr	x8, [x21, #16]
	ldr	x9, [x20]
	cmp	w10, w23
	b.ne	LBB0_12
; %bb.9:
	mov	w23, #0
	mov	w10, #12
	mul	x9, x9, x10
	str	w22, [x8, x9]
	b	LBB0_13
LBB0_10:
	mov	w25, #0
LBB0_11:
	mov	w23, #0
	ldr	x8, [x21, #16]
	ldr	x9, [x20]
	mov	w10, #12
	madd	x8, x9, x10, x8
	str	w25, [x8, #8]
	b	LBB0_13
LBB0_12:
	mov	w23, #0
	mov	w10, #12
	madd	x8, x9, x10, x8
	str	w22, [x8, #4]
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_EV_DIR_RISING,4,2          ; @IIO_EV_DIR_RISING
	.comm	_USEC_PER_SEC,4,2               ; @USEC_PER_SEC
	.comm	_ads1015_comp_queue,8,3         ; @ads1015_comp_queue
	.no_dead_strip	_ads1015_write_event
.subsections_via_symbols
