	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_wave
_add_wave:                              ## @add_wave
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movl	%ecx, %r10d
                                        ## kill: def $edx killed $edx def $rdx
	movb	$5, %cl
	subb	%r10b, %cl
	movl	$-1, %r11d
	shll	%cl, %r11d
	cmpl	$-2, %r11d
	jg	LBB0_3
## %bb.1:
	movl	16(%rbp), %r14d
	movq	_amplitude_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andl	$63, %r9d
	movss	(%rax,%r9,4), %xmm0             ## xmm0 = mem[0],zero,zero,zero
	notl	%r11d
	movb	$4, %cl
	subb	%r10b, %cl
	movl	%edx, %r12d
	sarl	%cl, %r12d
	shll	$6, %r14d
	xorl	%eax, %eax
	cmpl	$1, (%rdi)
	movq	8(%rdi), %rcx
	cmovel	%eax, %r8d
	movslq	%r8d, %rbx
	movq	(%rcx,%rbx,8), %r13
	movq	16(%rcx,%rbx,8), %rbx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %ecx
	addl	%r12d, %ecx
	movslq	20(%rdi), %r8
	imull	%r8d, %esi
	addl	%ecx, %esi
	movslq	%esi, %rcx
	leaq	(%rbx,%rcx,4), %rsi
	leaq	(,%rcx,4), %rbx
	addq	%r13, %rbx
	leal	(%rdx,%rdx), %r9d
	incl	%r9d
	leal	3(%r10), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r9d
	movq	24(%rdi), %rcx
	movslq	%r10d, %rdx
	movq	(%rcx,%rdx,8), %r10
	movq	_sin_table@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movslq	32(%rdi), %rcx
	leaq	(%r13,%rcx,8), %r15
	movslq	%r12d, %r12
	leaq	(%r13,%r12,4), %r13
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r12,4), %rdi
	addl	%r9d, %r14d
	shll	$8, %r12d
	subl	%r12d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	-128(%r14), %ecx
	movss	(%r10,%rax,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	andl	$511, %ecx                      ## imm = 0x1FF
	movss	(%rdx,%rcx,4), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm2
	movl	%r14d, %ecx
	andl	$511, %ecx                      ## imm = 0x1FF
	mulss	(%rdx,%rcx,4), %xmm1
	movss	(%rbx), %xmm3                   ## xmm3 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm3
	movss	%xmm3, (%rbx)
	movss	4(%rbx), %xmm3                  ## xmm3 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm3
	movss	%xmm3, 4(%rbx)
	movss	(%rsi), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm2
	movss	%xmm2, (%rsi)
	movss	4(%rsi), %xmm2                  ## xmm2 = mem[0],zero,zero,zero
	subss	%xmm1, %xmm2
	movss	%xmm2, 4(%rsi)
	leaq	(%rbx,%r8,4), %rbx
	leaq	(%rsi,%r8,4), %rsi
	cmpq	%r15, %rbx
	cmovaeq	%r13, %rbx
	cmovaeq	%rdi, %rsi
	incq	%rax
	addl	%r9d, %r14d
	cmpq	%rax, %r11
	jne	LBB0_2
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amplitude_tab,8,3              ## @amplitude_tab
	.comm	_sin_table,8,3                  ## @sin_table
	.no_dead_strip	_add_wave
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_wave
_add_wave:                              ; @add_wave
	.cfi_startproc
; %bb.0:
	mov	w8, #5
	sub	w8, w8, w3
	mov	w9, #-1
	lsl	w8, w9, w8
	cmn	w8, #2
	b.gt	LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, _amplitude_tab@GOTPAGE
Lloh1:
	ldr	x9, [x9, _amplitude_tab@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	and	w10, w5, #0x3f
	ldr	s0, [x9, w10, uxtw #2]
	mvn	w8, w8
	mov	w9, #4
	sub	w9, w9, w3
	asr	w17, w2, w9
	ldr	x9, [x0, #8]
	ldr	w10, [x0]
	cmp	w10, #1
	csel	w10, wzr, w4, eq
	add	x10, x9, w10, sxtw #3
	ldr	x16, [x10, #16]
	ldp	w9, w4, [x0, #16]
                                        ; kill: def $w4 killed $w4 def $x4
	sxtw	x4, w4
	add	w9, w9, w17
	madd	w9, w4, w1, w9
	sbfiz	x11, x9, #2, #32
	add	x9, x16, x11
	ldr	x15, [x10]
	add	x10, x15, x11
	mov	w12, #1
	bfi	w12, w2, #1, #31
	add	w13, w3, #3
	ldr	x11, [x0, #24]
	ldr	x11, [x11, w3, sxtw #3]
	lsl	w12, w12, w13
Lloh3:
	adrp	x13, _sin_table@GOTPAGE
Lloh4:
	ldr	x13, [x13, _sin_table@GOTPAGEOFF]
Lloh5:
	ldr	x13, [x13]
	ldrsw	x14, [x0, #32]
	add	x14, x15, x14, lsl #3
	sbfiz	x0, x17, #2, #32
	add	x15, x15, x0
	add	x16, x16, x0
	add	w0, w12, w6, lsl #6
	sub	w17, w0, w17, lsl #8
	lsl	x0, x4, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	w1, w17, #128
	ldr	s1, [x11], #4
	fmul	s1, s0, s1
	and	w1, w1, #0x1ff
	ldr	s2, [x13, w1, uxtw #2]
	fmul	s2, s1, s2
	and	w1, w17, #0x1ff
	ldr	s3, [x13, w1, uxtw #2]
	fmul	s1, s1, s3
	ldp	s3, s4, [x10]
	fadd	s3, s2, s3
	fsub	s2, s4, s2
	stp	s3, s2, [x10]
	ldp	s2, s3, [x9]
	fadd	s2, s1, s2
	fsub	s1, s3, s1
	add	x1, x9, x0
	add	x10, x10, x0
	cmp	x10, x14
	stp	s2, s1, [x9]
	csel	x10, x10, x15, lo
	csel	x9, x1, x16, lo
	add	w17, w17, w12
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_3:
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_amplitude_tab,8,3              ; @amplitude_tab
	.comm	_sin_table,8,3                  ; @sin_table
	.no_dead_strip	_add_wave
.subsections_via_symbols
