	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function envelope_detector_setup_compare
_envelope_detector_setup_compare:       ## @envelope_detector_setup_compare
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	4(%rdi), %ecx
	movl	8(%rdi), %edx
	movq	32(%rdi), %rax
	cmpq	$1, %rax
	movl	%edx, %esi
	adcl	%ecx, %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	movl	%edi, (%rbx)
	incl	%edx
	cmpl	%edx, %ecx
	je	LBB0_6
## %bb.1:
	xorl	%esi, %esi
	movl	28(%rbx), %edi
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	12(%rbx), %esi
LBB0_3:
	callq	_iio_write_channel_raw
	testl	%eax, %eax
	js	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_envelope_detector_comp_latch
	movl	(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_iio_write_channel_raw
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	movl	20(%rbx), %edi
	addq	$24, %rbx
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_schedule_delayed_work          ## TAILCALL
LBB0_5:
	movl	%eax, (%rbx)
LBB0_6:
	addq	$16, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_complete                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_envelope_detector_setup_compare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function envelope_detector_setup_compare
_envelope_detector_setup_compare:       ; @envelope_detector_setup_compare
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldp	w9, w10, [x0, #4]
	add	w11, w10, w9
	ldr	x8, [x0, #32]
	cmp	x8, #0
	cinc	w11, w11, eq
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	str	w11, [x0]
	add	w10, w10, #1
	cmp	w9, w10
	b.ne	LBB0_2
; %bb.1:
	add	x0, x19, #16
	b	LBB0_8
LBB0_2:
	ldr	w0, [x19, #28]
	cbz	x8, LBB0_4
; %bb.3:
	mov	w1, #0
	bl	_iio_write_channel_raw
	tbz	w0, #31, LBB0_5
	b	LBB0_7
LBB0_4:
	ldr	w1, [x19, #12]
	bl	_iio_write_channel_raw
	tbnz	w0, #31, LBB0_7
LBB0_5:
	mov	x0, x19
	bl	_envelope_detector_comp_latch
	ldr	w0, [x19, #28]
	ldr	w1, [x19]
	bl	_iio_write_channel_raw
	tbnz	w0, #31, LBB0_7
; %bb.6:
	add	x20, x19, #24
	ldr	w0, [x19, #20]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_schedule_delayed_work
LBB0_7:
	str	w0, [x19], #16
	mov	x0, x19
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_complete
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_envelope_detector_setup_compare
.subsections_via_symbols
