	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function envelope_detector_read_raw
_envelope_detector_read_raw:            ## @envelope_detector_read_raw
	.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
	movq	%r8, %rbx
	movq	%rcx, %r14
	movq	%rdx, %r15
	callq	_iio_priv
	movq	%rax, %r13
	cmpq	$128, %rbx
	je	LBB0_7
## %bb.1:
	cmpq	$129, %rbx
	jne	LBB0_8
## %bb.2:
	leaq	16(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	8(%r13), %eax
	movl	4(%r13), %ecx
	addl	%eax, %ecx
	movl	%ecx, (%r13)
	decl	%eax
	movl	%eax, 28(%r13)
	movq	%r13, %rdi
	callq	_envelope_detector_setup_compare
	movq	%r13, %rdi
	addq	$24, %rdi
	callq	_wait_for_completion
	movl	12(%r13), %r12d
	testl	%r12d, %r12d
	js	LBB0_3
## %bb.4:
	cmpl	$0, 8(%r13)
	je	LBB0_6
## %bb.5:
	movl	4(%r13), %eax
	subl	%r12d, %eax
	movl	%eax, %r12d
LBB0_6:
	movl	%r12d, (%r15)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_9
LBB0_7:
	movl	20(%r13), %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_iio_read_channel_scale         ## TAILCALL
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_9
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_envelope_detector_read_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function envelope_detector_read_raw
_envelope_detector_read_raw:            ; @envelope_detector_read_raw
	.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	x22, x4
	mov	x21, x3
	mov	x19, x2
	bl	_iio_priv
	mov	x20, x0
	cmp	x22, #128
	b.eq	LBB0_6
; %bb.1:
	cmp	x22, #129
	b.ne	LBB0_7
; %bb.2:
	add	x21, x20, #16
	mov	x0, x21
	bl	_mutex_lock
	ldp	w8, w9, [x20, #4]
	add	w8, w9, w8
	str	w8, [x20]
	sub	w8, w9, #1
	str	w8, [x20, #28]
	mov	x0, x20
	bl	_envelope_detector_setup_compare
	add	x0, x20, #24
	bl	_wait_for_completion
	ldr	w22, [x20, #12]
	tbnz	w22, #31, LBB0_8
; %bb.3:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_5
; %bb.4:
	ldr	w8, [x20, #4]
	sub	w22, w8, w22
LBB0_5:
	str	w22, [x19]
	mov	x0, x21
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	b	LBB0_9
LBB0_6:
	ldr	w0, [x20, #20]
	mov	x1, x19
	mov	x2, x21
	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
	b	_iio_read_channel_scale
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_8:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_envelope_detector_read_raw
.subsections_via_symbols
