	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function envelope_calculate_ampl
_envelope_calculate_ampl:               ## @envelope_calculate_ampl
	.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
	.cfi_offset %rbx, -24
	movq	(%rdi), %r8
	movq	16(%rdi), %r11
	movslq	8(%rdi), %rax
	cmpl	%esi, -4(%r11,%rax,4)
	jle	LBB0_1
## %bb.2:
	movl	%esi, %r10d
	movl	%eax, %eax
	xorl	%edi, %edi
	cmpl	$2, %eax
	jl	LBB0_9
## %bb.3:
	leaq	-1(%rax), %r9
	addq	$-2, %rax
	movl	%r9d, %edx
	andl	$3, %edx
	cmpq	$3, %rax
	jae	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	movl	$1, %eax
	jmp	LBB0_7
LBB0_1:
	movl	-4(%r8,%rax,4), %r10d
	jmp	LBB0_10
LBB0_5:
	andq	$-4, %r9
	xorl	%edi, %edi
	movl	$1, %eax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r10d, (%r11,%rax,4)
	cmovlel	%eax, %edi
	leal	1(%rax), %ecx
	cmpl	%r10d, 4(%r11,%rax,4)
	cmovgl	%edi, %ecx
	cmpl	%r10d, 8(%r11,%rax,4)
	leal	2(%rax), %ebx
	cmovgl	%ecx, %ebx
	leal	3(%rax), %edi
	cmpl	%r10d, 12(%r11,%rax,4)
	cmovgl	%ebx, %edi
	addq	$4, %rax
	addq	$4, %rsi
	cmpq	%r9, %rsi
	jne	LBB0_6
LBB0_7:
	testq	%rdx, %rdx
	je	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r10d, (%r11,%rax,4)
	cmovlel	%eax, %edi
	incq	%rax
	decq	%rdx
	jne	LBB0_8
LBB0_9:
	movslq	%edi, %rax
	movl	(%r11,%rax,4), %ecx
	movl	4(%r11,%rax,4), %esi
	subl	%ecx, %esi
	movl	(%r8,%rax,4), %edi
	movl	4(%r8,%rax,4), %eax
	subl	%edi, %eax
	shll	$24, %eax
	cltd
	idivl	%esi
	subl	%ecx, %r10d
	imull	%eax, %r10d
	sarl	$24, %r10d
	addl	%edi, %r10d
LBB0_10:
	movl	%r10d, %eax
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_envelope_calculate_ampl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function envelope_calculate_ampl
_envelope_calculate_ampl:               ; @envelope_calculate_ampl
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0]
	ldr	w10, [x0, #8]
	sub	w9, w10, #1
	sbfiz	x11, x9, #2, #32
	ldr	x9, [x0, #16]
	ldr	w12, [x9, x11]
	cmp	w12, w1
	b.le	LBB0_4
; %bb.1:
	cmp	w10, #2
	b.lt	LBB0_5
; %bb.2:
	mov	w11, #0
	mov	w12, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x9, x12, lsl #2]
	cmp	w13, w1
	csel	w11, w11, w12, gt
	add	x12, x12, #1
	cmp	x10, x12
	b.ne	LBB0_3
	b	LBB0_6
LBB0_4:
	ldr	w0, [x8, x11]
	ret
LBB0_5:
	mov	w11, #0
LBB0_6:
	sbfiz	x10, x11, #2, #32
	add	x11, x10, #4
	ldr	w12, [x9, x11]
	ldr	w9, [x9, x10]
	sub	w12, w12, w9
	ldr	w11, [x8, x11]
	ldr	w8, [x8, x10]
	sub	w10, w11, w8
	lsl	w10, w10, #24
	sdiv	w10, w10, w12
	sub	w9, w1, w9
	mul	w9, w10, w9
	add	w0, w8, w9, asr #24
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_envelope_calculate_ampl
.subsections_via_symbols
