	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function celt_stereo_merge
LCPI0_0:
	.long	0x3a1d4952                      ## float 6.00000028E-4
LCPI0_1:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_celt_stereo_merge:                     ## @celt_stereo_merge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edx, %edx
	jle	LBB0_3
## %bb.1:
	movl	%edx, %r8d
	cmpl	$1, %edx
	jne	LBB0_4
## %bb.2:
	xorps	%xmm2, %xmm2
	xorl	%ecx, %ecx
                                        ## implicit-def: $xmm1
	testb	$1, %r8b
	jne	LBB0_7
	jmp	LBB0_8
LBB0_3:
	xorps	%xmm1, %xmm1
	jmp	LBB0_8
LBB0_4:
	movl	%r8d, %eax
	andl	$-2, %eax
	xorps	%xmm2, %xmm2
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movss	(%rsi,%rcx,4), %xmm3            ## xmm3 = mem[0],zero,zero,zero
	movss	4(%rsi,%rcx,4), %xmm1           ## xmm1 = mem[0],zero,zero,zero
	movsldup	%xmm3, %xmm4                    ## xmm4 = xmm3[0,0,2,2]
	insertps	$16, (%rdi,%rcx,4), %xmm3       ## xmm3 = xmm3[0],mem[0],xmm3[2,3]
	mulps	%xmm4, %xmm3
	addps	%xmm2, %xmm3
	movsldup	%xmm1, %xmm2                    ## xmm2 = xmm1[0,0,2,2]
	insertps	$16, 4(%rdi,%rcx,4), %xmm1      ## xmm1 = xmm1[0],mem[0],xmm1[2,3]
	mulps	%xmm2, %xmm1
	movaps	%xmm1, %xmm2
	addps	%xmm3, %xmm2
	addq	$2, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.6:
	addps	%xmm3, %xmm1
	testb	$1, %r8b
	je	LBB0_8
LBB0_7:
	movss	(%rsi,%rcx,4), %xmm3            ## xmm3 = mem[0],zero,zero,zero
	movsldup	%xmm3, %xmm1                    ## xmm1 = xmm3[0,0,2,2]
	insertps	$16, (%rdi,%rcx,4), %xmm3       ## xmm3 = xmm3[0],mem[0],xmm3[2,3]
	mulps	%xmm3, %xmm1
	addps	%xmm2, %xmm1
LBB0_8:
	movshdup	%xmm1, %xmm3                    ## xmm3 = xmm1[1,1,3,3]
	mulss	%xmm0, %xmm3
	movaps	%xmm0, %xmm2
	mulss	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	addss	%xmm3, %xmm3
	movaps	%xmm2, %xmm1
	subss	%xmm3, %xmm1
	movss	LCPI0_0(%rip), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm4
	ja	LBB0_13
## %bb.9:
	addss	%xmm2, %xmm3
	ucomiss	%xmm3, %xmm4
	ja	LBB0_13
## %bb.10:
	testl	%edx, %edx
	jle	LBB0_41
## %bb.11:
	xorps	%xmm4, %xmm4
	sqrtss	%xmm1, %xmm4
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	divss	%xmm4, %xmm2
	sqrtss	%xmm3, %xmm3
	divss	%xmm3, %xmm1
	movl	%edx, %r9d
	cmpl	$4, %edx
	jb	LBB0_12
## %bb.18:
	leaq	(%rsi,%r9,4), %rax
	cmpq	%rdi, %rax
	jbe	LBB0_31
## %bb.19:
	leaq	(%rdi,%r9,4), %rax
	cmpq	%rsi, %rax
	jbe	LBB0_31
LBB0_12:
	xorl	%ecx, %ecx
LBB0_37:
	movq	%rcx, %rax
	notq	%rax
	testb	$1, %r9b
	je	LBB0_39
## %bb.38:
	movss	(%rdi,%rcx,4), %xmm3            ## xmm3 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	movss	(%rsi,%rcx,4), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm5
	subss	%xmm4, %xmm5
	mulss	%xmm2, %xmm5
	movss	%xmm5, (%rdi,%rcx,4)
	addss	%xmm4, %xmm3
	mulss	%xmm1, %xmm3
	movss	%xmm3, (%rsi,%rcx,4)
	orq	$1, %rcx
LBB0_39:
	addq	%r9, %rax
	je	LBB0_41
	.p2align	4, 0x90
LBB0_40:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rcx,4), %xmm3            ## xmm3 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	movss	(%rsi,%rcx,4), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm5
	subss	%xmm4, %xmm5
	mulss	%xmm2, %xmm5
	movss	%xmm5, (%rdi,%rcx,4)
	addss	%xmm4, %xmm3
	mulss	%xmm1, %xmm3
	movss	%xmm3, (%rsi,%rcx,4)
	movss	4(%rdi,%rcx,4), %xmm3           ## xmm3 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	movss	4(%rsi,%rcx,4), %xmm4           ## xmm4 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm5
	subss	%xmm4, %xmm5
	mulss	%xmm2, %xmm5
	movss	%xmm5, 4(%rdi,%rcx,4)
	addss	%xmm4, %xmm3
	mulss	%xmm1, %xmm3
	movss	%xmm3, 4(%rsi,%rcx,4)
	addq	$2, %rcx
	cmpq	%rcx, %r9
	jne	LBB0_40
	jmp	LBB0_41
LBB0_13:
	testl	%edx, %edx
	jle	LBB0_41
## %bb.14:
	movl	%edx, %r8d
	xorl	%ecx, %ecx
	cmpl	$8, %edx
	jb	LBB0_27
## %bb.15:
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$32, %rax
	jb	LBB0_27
## %bb.16:
	movl	%r8d, %ecx
	andl	$-8, %ecx
	leaq	-8(%rcx), %rax
	movq	%rax, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %r9d
	andl	$3, %r9d
	cmpq	$24, %rax
	jae	LBB0_21
## %bb.17:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_31:
	movl	%r9d, %ecx
	andl	$-4, %ecx
	movaps	%xmm0, %xmm5
	shufps	$0, %xmm0, %xmm5                ## xmm5 = xmm5[0,0],xmm0[0,0]
	movaps	%xmm2, %xmm4
	shufps	$0, %xmm2, %xmm4                ## xmm4 = xmm4[0,0],xmm2[0,0]
	movaps	%xmm1, %xmm8
	shufps	$0, %xmm1, %xmm8                ## xmm8 = xmm8[0,0],xmm1[0,0]
	leaq	-4(%rcx), %rax
	movq	%rax, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rax, %rax
	je	LBB0_42
## %bb.32:
	movq	%r8, %rax
	andq	$-2, %rax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rdi,%rdx,4), %xmm3
	mulps	%xmm5, %xmm3
	movups	(%rsi,%rdx,4), %xmm7
	movaps	%xmm3, %xmm6
	subps	%xmm7, %xmm6
	mulps	%xmm4, %xmm6
	movups	%xmm6, (%rdi,%rdx,4)
	addps	%xmm7, %xmm3
	mulps	%xmm8, %xmm3
	movups	%xmm3, (%rsi,%rdx,4)
	movups	16(%rdi,%rdx,4), %xmm3
	mulps	%xmm5, %xmm3
	movups	16(%rsi,%rdx,4), %xmm6
	movaps	%xmm3, %xmm7
	subps	%xmm6, %xmm7
	mulps	%xmm4, %xmm7
	movups	%xmm7, 16(%rdi,%rdx,4)
	addps	%xmm6, %xmm3
	mulps	%xmm8, %xmm3
	movups	%xmm3, 16(%rsi,%rdx,4)
	addq	$8, %rdx
	addq	$-2, %rax
	jne	LBB0_33
## %bb.34:
	testb	$1, %r8b
	je	LBB0_36
LBB0_35:
	movups	(%rdi,%rdx,4), %xmm3
	mulps	%xmm5, %xmm3
	movups	(%rsi,%rdx,4), %xmm5
	movaps	%xmm3, %xmm6
	subps	%xmm5, %xmm6
	mulps	%xmm6, %xmm4
	movups	%xmm4, (%rdi,%rdx,4)
	addps	%xmm5, %xmm3
	mulps	%xmm3, %xmm8
	movups	%xmm8, (%rsi,%rdx,4)
LBB0_36:
	cmpq	%r9, %rcx
	je	LBB0_41
	jmp	LBB0_37
LBB0_21:
	andq	$-4, %rdx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rdi,%rax,4), %xmm0
	movups	16(%rdi,%rax,4), %xmm1
	movups	%xmm0, (%rsi,%rax,4)
	movups	%xmm1, 16(%rsi,%rax,4)
	movups	32(%rdi,%rax,4), %xmm0
	movups	48(%rdi,%rax,4), %xmm1
	movups	%xmm0, 32(%rsi,%rax,4)
	movups	%xmm1, 48(%rsi,%rax,4)
	movups	64(%rdi,%rax,4), %xmm0
	movups	80(%rdi,%rax,4), %xmm1
	movups	%xmm0, 64(%rsi,%rax,4)
	movups	%xmm1, 80(%rsi,%rax,4)
	movups	96(%rdi,%rax,4), %xmm0
	movups	112(%rdi,%rax,4), %xmm1
	movups	%xmm0, 96(%rsi,%rax,4)
	movups	%xmm1, 112(%rsi,%rax,4)
	addq	$32, %rax
	addq	$-4, %rdx
	jne	LBB0_22
LBB0_23:
	testq	%r9, %r9
	je	LBB0_26
## %bb.24:
	leaq	(%rsi,%rax,4), %r10
	addq	$16, %r10
	leaq	(%rdi,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rax,%rdx), %xmm0
	movups	(%rax,%rdx), %xmm1
	movups	%xmm0, -16(%r10,%rdx)
	movups	%xmm1, (%r10,%rdx)
	addq	$32, %rdx
	cmpq	%rdx, %r9
	jne	LBB0_25
LBB0_26:
	cmpq	%r8, %rcx
	je	LBB0_41
LBB0_27:
	movq	%rcx, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdx
	andq	$3, %rdx
	je	LBB0_29
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi,%rcx,4)
	incq	%rcx
	decq	%rdx
	jne	LBB0_28
LBB0_29:
	cmpq	$3, %rax
	jb	LBB0_41
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rcx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi,%rcx,4)
	movss	4(%rdi,%rcx,4), %xmm0           ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rsi,%rcx,4)
	movss	8(%rdi,%rcx,4), %xmm0           ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%rsi,%rcx,4)
	movss	12(%rdi,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 12(%rsi,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_30
LBB0_41:
	popq	%rbp
	retq
LBB0_42:
	xorl	%edx, %edx
	testb	$1, %r8b
	jne	LBB0_35
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_celt_stereo_merge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function celt_stereo_merge
_celt_stereo_merge:                     ; @celt_stereo_merge
	.cfi_startproc
; %bb.0:
                                        ; kill: def $s0 killed $s0 def $q0
	cmp	w2, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w8, w2
	cmp	w2, #4
	b.hs	LBB0_4
; %bb.2:
	mov	x9, #0
	movi	d1, #0000000000000000
	movi	d2, #0000000000000000
	b	LBB0_7
LBB0_3:
	movi	d2, #0000000000000000
	movi	d1, #0000000000000000
	b	LBB0_9
LBB0_4:
	and	x9, x8, #0xfffffffc
	add	x10, x1, #8
	add	x11, x0, #8
	movi	d1, #0000000000000000
	mov	x12, x9
	movi	d2, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	s3, s4, [x11, #-8]
	ldp	s5, s6, [x11], #16
	ldp	s7, s16, [x10, #-8]
	ldp	s17, s18, [x10], #16
	fmul	s3, s3, s7
	fmul	s4, s4, s16
	fmul	s5, s5, s17
	fmul	s6, s6, s18
	fadd	s1, s1, s3
	fadd	s1, s1, s4
	fadd	s1, s1, s5
	fadd	s1, s1, s6
	fmul	s3, s7, s7
	fmul	s4, s16, s16
	fmul	s5, s17, s17
	fmul	s6, s18, s18
	fadd	s2, s2, s3
	fadd	s2, s2, s4
	fadd	s2, s2, s5
	fadd	s2, s2, s6
	subs	x12, x12, #4
	b.ne	LBB0_5
; %bb.6:
	cmp	x9, x8
	b.eq	LBB0_9
LBB0_7:
	lsl	x11, x9, #2
	add	x10, x1, x11
	add	x11, x0, x11
	sub	x8, x8, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	s3, [x11], #4
	ldr	s4, [x10], #4
	fmadd	s1, s3, s4, s1
	fmadd	s2, s4, s4, s2
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
	fmul	s3, s1, s0
	fmadd	s2, s0, s0, s2
	fmov	s1, #-2.00000000
	fmadd	s1, s3, s1, s2
	fmov	s4, #2.00000000
	fmadd	s2, s3, s4, s2
	mov	w8, #18770
	movk	w8, #14877, lsl #16
	fmov	s3, w8
	fcmp	s1, s3
	mov	w8, #18770
	movk	w8, #14877, lsl #16
	fmov	s3, w8
	fccmp	s2, s3, #8, pl
	b.pl	LBB0_18
; %bb.10:
	cmp	w2, #1
	b.lt	LBB0_25
; %bb.11:
	mov	x9, #0
	mov	w8, w2
	cmp	w2, #16
	b.lo	LBB0_16
; %bb.12:
	sub	x10, x1, x0
	cmp	x10, #64
	b.lo	LBB0_16
; %bb.13:
	and	x9, x8, #0xfffffff0
	add	x10, x1, #32
	add	x11, x0, #32
	mov	x12, x9
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x11, #-32]
	ldp	q2, q3, [x11], #64
	stp	q0, q1, [x10, #-32]
	stp	q2, q3, [x10], #64
	subs	x12, x12, #16
	b.ne	LBB0_14
; %bb.15:
	cmp	x9, x8
	b.eq	LBB0_25
LBB0_16:
	lsl	x11, x9, #2
	add	x10, x1, x11
	add	x11, x0, x11
	sub	x8, x8, x9
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	s0, [x11], #4
	str	s0, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_17
	b	LBB0_25
LBB0_18:
	cmp	w2, #1
	b.lt	LBB0_25
; %bb.19:
	fsqrt	s1, s1
	fmov	s3, #1.00000000
	fdiv	s1, s3, s1
	fsqrt	s2, s2
	mov	w8, w2
	fdiv	s2, s3, s2
	cmp	w2, #8
	b.lo	LBB0_22
; %bb.20:
	lsl	x9, x8, #2
	add	x10, x1, x9
	cmp	x10, x0
	b.ls	LBB0_26
; %bb.21:
	add	x9, x0, x9
	cmp	x9, x1
	b.ls	LBB0_26
LBB0_22:
	mov	x9, #0
LBB0_23:
	lsl	x11, x9, #2
	add	x10, x1, x11
	add	x11, x0, x11
	sub	x8, x8, x9
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	s3, [x11]
	fmul	s3, s3, s0
	ldr	s4, [x10]
	fsub	s5, s3, s4
	fmul	s5, s1, s5
	str	s5, [x11], #4
	fadd	s3, s3, s4
	fmul	s3, s2, s3
	str	s3, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_24
LBB0_25:
	ret
LBB0_26:
	dup.4s	v3, v0[0]
	dup.4s	v4, v1[0]
	and	x9, x8, #0xfffffff8
	dup.4s	v5, v2[0]
	add	x10, x0, #16
	add	x11, x1, #16
	mov	x12, x9
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldp	q6, q7, [x10, #-16]
	fmul.4s	v6, v6, v3
	fmul.4s	v7, v7, v0[0]
	ldp	q16, q17, [x11, #-16]
	fsub.4s	v18, v6, v16
	fsub.4s	v19, v7, v17
	fmul.4s	v18, v4, v18
	fmul.4s	v19, v19, v1[0]
	stp	q18, q19, [x10, #-16]
	fadd.4s	v6, v6, v16
	fadd.4s	v7, v7, v17
	fmul.4s	v6, v5, v6
	fmul.4s	v7, v7, v2[0]
	stp	q6, q7, [x11, #-16]
	add	x10, x10, #32
	add	x11, x11, #32
	subs	x12, x12, #8
	b.ne	LBB0_27
; %bb.28:
	cmp	x9, x8
	b.eq	LBB0_25
	b	LBB0_23
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_celt_stereo_merge
.subsections_via_symbols
