	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function channel_calculate_ampl
_channel_calculate_ampl:                ## @channel_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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	cmpq	$0, 56(%rdi)
	setne	%cl
	movq	32(%rdi), %rdi
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	addq	$8, %rdi
	movl	48(%rbx), %esi
	callq	_envelope_calculate_ampl
	movq	32(%rbx), %rdi
	jmp	LBB0_3
LBB0_1:
	movb	%cl, %al
	shll	$6, %eax
LBB0_3:
	movl	4(%rbx), %ecx
	addl	(%rbx), %ecx
	cmpl	$64, %ecx
	movl	$64, %edx
	cmovll	%ecx, %edx
	xorl	%r8d, %r8d
	testl	%edx, %edx
	cmovlel	%r8d, %edx
	movq	40(%rbx), %rsi
	movq	8(%rsi), %rcx
	imull	(%rcx), %edx
	movq	_FP_ONE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %edx
	sarl	$13, %edx
	imull	8(%rbx), %edx
	sarl	$15, %edx
	imull	(%rsi), %eax
	imull	%edx, %eax
	sarl	$12, %eax
	movl	%eax, 12(%rbx)
	cmpq	$0, (%rdi)
	je	LBB0_5
## %bb.4:
	movl	24(%rbx), %esi
	callq	_envelope_calculate_ampl
	movl	%eax, %r8d
	addl	$-32, %r8d
LBB0_5:
	movl	16(%rbx), %eax
	movl	$255, %ecx
	subl	%eax, %ecx
	cmpl	$128, %eax
	cmovll	%eax, %ecx
	imull	%r8d, %ecx
	sarl	$5, %ecx
	addl	%eax, %ecx
	movl	%ecx, 20(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FP_ONE,4,2                     ## @FP_ONE
	.no_dead_strip	_channel_calculate_ampl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function channel_calculate_ampl
_channel_calculate_ampl:                ; @channel_calculate_ampl
	.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
	ldr	x8, [x0, #56]
	cmp	x8, #0
	cset	w9, ne
	ldr	x0, [x0, #32]
	mov	x8, x0
	ldr	x10, [x8, #8]!
	cbz	x10, LBB0_2
; %bb.1:
	ldr	w1, [x19, #48]
	mov	x0, x8
	bl	_envelope_calculate_ampl
	mov	x8, x0
	ldr	x0, [x19, #32]
	b	LBB0_3
LBB0_2:
	lsl	w8, w9, #6
LBB0_3:
	ldp	w9, w10, [x19]
	add	w9, w10, w9
	mov	w10, #64
	cmp	w9, #64
	csel	w9, w9, w10, lt
	cmp	w9, #0
	csel	w9, w9, wzr, gt
	ldr	x10, [x19, #40]
	ldr	x11, [x10, #8]
	ldr	w11, [x11]
	mul	w9, w9, w11
Lloh0:
	adrp	x11, _FP_ONE@GOTPAGE
Lloh1:
	ldr	x11, [x11, _FP_ONE@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	mul	w9, w9, w11
	asr	w9, w9, #13
	ldr	w11, [x19, #8]
	mul	w9, w9, w11
	asr	w9, w9, #15
	ldr	w10, [x10]
	mul	w8, w10, w8
	mul	w8, w8, w9
	asr	w8, w8, #12
	str	w8, [x19, #12]
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w1, [x19, #24]
	bl	_envelope_calculate_ampl
	sub	w8, w0, #32
LBB0_5:
	ldr	w9, [x19, #16]
	mov	w10, #255
	sub	w10, w10, w9
	cmp	w9, #128
	csel	w10, w9, w10, lt
	mul	w8, w10, w8
	add	w8, w9, w8, asr #5
	str	w8, [x19, #20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_FP_ONE,4,2                     ; @FP_ONE
	.no_dead_strip	_channel_calculate_ampl
.subsections_via_symbols
