	.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_calc_theta
LCPI0_0:
	.long	0x47000000                      ## float 32768
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_celt_calc_theta:                       ## @celt_calc_theta
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	testl	%edx, %edx
	je	LBB0_4
## %bb.1:
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.2:
	movl	%ecx, %eax
	cmpl	$1, %ecx
	jne	LBB0_8
## %bb.3:
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
                                        ## implicit-def: $xmm4
	testb	$1, %al
	jne	LBB0_11
	jmp	LBB0_18
LBB0_4:
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.5:
	movl	%ecx, %eax
	cmpl	$1, %ecx
	jne	LBB0_13
## %bb.6:
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
                                        ## implicit-def: $xmm4
	testb	$1, %al
	jne	LBB0_16
	jmp	LBB0_18
LBB0_7:
	xorps	%xmm4, %xmm4
	jmp	LBB0_18
LBB0_8:
	movl	%eax, %edx
	andl	$-2, %edx
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rcx,4), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	movss	4(%rdi,%rcx,4), %xmm3           ## xmm3 = mem[0],zero,zero,zero
	movss	(%rsi,%rcx,4), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	movss	4(%rsi,%rcx,4), %xmm5           ## xmm5 = mem[0],zero,zero,zero
	movaps	%xmm2, %xmm1
	addss	%xmm4, %xmm1
	subss	%xmm4, %xmm2
	insertps	$16, %xmm2, %xmm1               ## xmm1 = xmm1[0],xmm2[0],xmm1[2,3]
	mulps	%xmm1, %xmm1
	addps	%xmm0, %xmm1
	movaps	%xmm3, %xmm4
	addss	%xmm5, %xmm4
	subss	%xmm5, %xmm3
	insertps	$16, %xmm3, %xmm4               ## xmm4 = xmm4[0],xmm3[0],xmm4[2,3]
	mulps	%xmm4, %xmm4
	movaps	%xmm4, %xmm0
	addps	%xmm1, %xmm0
	addq	$2, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_9
## %bb.10:
	addps	%xmm1, %xmm4
	testb	$1, %al
	je	LBB0_18
LBB0_11:
	movss	(%rdi,%rcx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movss	(%rsi,%rcx,4), %xmm2            ## xmm2 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm4
	addss	%xmm2, %xmm4
	subss	%xmm2, %xmm1
	insertps	$16, %xmm1, %xmm4               ## xmm4 = xmm4[0],xmm1[0],xmm4[2,3]
	jmp	LBB0_17
LBB0_13:
	movl	%eax, %edx
	andl	$-2, %edx
	xorps	%xmm0, %xmm0
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rdi,%rcx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movss	4(%rdi,%rcx,4), %xmm4           ## xmm4 = mem[0],zero,zero,zero
	insertps	$16, (%rsi,%rcx,4), %xmm1       ## xmm1 = xmm1[0],mem[0],xmm1[2,3]
	mulps	%xmm1, %xmm1
	addps	%xmm0, %xmm1
	insertps	$16, 4(%rsi,%rcx,4), %xmm4      ## xmm4 = xmm4[0],mem[0],xmm4[2,3]
	mulps	%xmm4, %xmm4
	movaps	%xmm4, %xmm0
	addps	%xmm1, %xmm0
	addq	$2, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_14
## %bb.15:
	addps	%xmm1, %xmm4
	testb	$1, %al
	je	LBB0_18
LBB0_16:
	movss	(%rdi,%rcx,4), %xmm4            ## xmm4 = mem[0],zero,zero,zero
	insertps	$16, (%rsi,%rcx,4), %xmm4       ## xmm4 = xmm4[0],mem[0],xmm4[2,3]
LBB0_17:
	mulps	%xmm4, %xmm4
	addps	%xmm0, %xmm4
LBB0_18:
	movaps	%xmm4, -32(%rbp)                ## 16-byte Spill
	movshdup	%xmm4, %xmm0                    ## xmm0 = xmm4[1,1,3,3]
	callq	_sqrtf
	movl	%eax, %ebx
	movaps	-32(%rbp), %xmm0                ## 16-byte Reload
	callq	_sqrtf
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_atan2f
	mulss	LCPI0_0(%rip), %xmm0
	movq	_M_PI@GOTPCREL(%rip), %rax
	divss	(%rax), %xmm0
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_lrintf                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_M_PI,4,2                       ## @M_PI
	.no_dead_strip	_celt_calc_theta
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function celt_calc_theta
_celt_calc_theta:                       ; @celt_calc_theta
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cmp	w3, #1
	cbz	w2, LBB0_4
; %bb.1:
	b.lt	LBB0_7
; %bb.2:
	mov	w8, w3
	cmp	w3, #4
	b.hs	LBB0_8
; %bb.3:
	mov	x9, #0
	movi	d17, #0000000000000000
	b	LBB0_11
LBB0_4:
	b.lt	LBB0_7
; %bb.5:
	mov	w8, w3
	cmp	w3, #4
	b.hs	LBB0_13
; %bb.6:
	mov	x9, #0
	movi	d17, #0000000000000000
	b	LBB0_16
LBB0_7:
	movi	d17, #0000000000000000
	b	LBB0_19
LBB0_8:
	and	x9, x8, #0xfffffffc
	add	x10, x1, #8
	add	x11, x0, #8
	movi	d17, #0000000000000000
	mov	x12, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldp	s0, s1, [x11, #-8]
	ldp	s2, s3, [x11], #16
	ldp	s4, s5, [x10, #-8]
	ldp	s6, s7, [x10], #16
	fadd.2s	v16, v0, v4
	fsub.2s	v0, v0, v4
	dup.2s	v0, v0[0]
	mov.s	v0[0], v16[0]
	fadd.2s	v4, v1, v5
	fsub.2s	v1, v1, v5
	dup.2s	v1, v1[0]
	mov.s	v1[0], v4[0]
	fadd.2s	v4, v2, v6
	fsub.2s	v2, v2, v6
	dup.2s	v2, v2[0]
	mov.s	v2[0], v4[0]
	fadd.2s	v4, v3, v7
	fsub.2s	v3, v3, v7
	dup.2s	v3, v3[0]
	mov.s	v3[0], v4[0]
	fmul.2s	v0, v0, v0
	fmul.2s	v1, v1, v1
	fmul.2s	v2, v2, v2
	fmul.2s	v3, v3, v3
	fadd.2s	v0, v17, v0
	fadd.2s	v0, v0, v1
	fadd.2s	v0, v0, v2
	fadd.2s	v17, v0, v3
	subs	x12, x12, #4
	b.ne	LBB0_9
; %bb.10:
	cmp	x9, x8
	b.eq	LBB0_19
LBB0_11:
	lsl	x11, x9, #2
	add	x10, x1, x11
	add	x11, x0, x11
	sub	x8, x8, x9
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	s2, [x11], #4
	fmov	d0, d17
	ldr	s3, [x10], #4
	fsub.2s	v1, v2, v3
	dup.2s	v1, v1[0]
	fadd.2s	v2, v2, v3
	mov.s	v1[0], v2[0]
	fmla.2s	v17, v1, v1
	subs	x8, x8, #1
	b.ne	LBB0_12
	b	LBB0_18
LBB0_13:
	and	x9, x8, #0xfffffffc
	add	x10, x1, #8
	add	x11, x0, #8
	movi	d17, #0000000000000000
	mov	x12, x9
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sub	x13, x10, #8
	sub	x14, x10, #4
	ldp	s0, s1, [x11, #-8]
	ldp	s2, s3, [x11], #16
	ld1.s	{ v0 }[1], [x13]
	fmul.2s	v0, v0, v0
	ld1.s	{ v1 }[1], [x14]
	mov	x13, x10
	ld1.s	{ v2 }[1], [x13], #4
	fmul.2s	v1, v1, v1
	fmul.2s	v2, v2, v2
	ld1.s	{ v3 }[1], [x13]
	fmul.2s	v3, v3, v3
	fadd.2s	v0, v17, v0
	fadd.2s	v0, v0, v1
	fadd.2s	v0, v0, v2
	fadd.2s	v17, v0, v3
	add	x10, x10, #16
	subs	x12, x12, #4
	b.ne	LBB0_14
; %bb.15:
	cmp	x9, x8
	b.eq	LBB0_19
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
	fmov	d0, d17
	ldr	s1, [x11], #4
	ld1.s	{ v1 }[1], [x10], #4
	fmla.2s	v17, v1, v1
	subs	x8, x8, #1
	b.ne	LBB0_17
LBB0_18:
	fmla.2s	v0, v1, v1
	fmov	d17, d0
LBB0_19:
	str	q17, [sp]                       ; 16-byte Folded Spill
	mov	s0, v17[1]
	bl	_sqrtf
	mov	x19, x0
	ldr	q0, [sp]                        ; 16-byte Folded Reload
                                        ; kill: def $s0 killed $s0 killed $q0
	bl	_sqrtf
	mov	x1, x0
	mov	x0, x19
	bl	_atan2f
	movi.2s	v1, #71, lsl #24
	fmul	s0, s0, s1
Lloh0:
	adrp	x8, _M_PI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_PI@GOTPAGEOFF]
Lloh2:
	ldr	s1, [x8]
	fdiv	s0, s0, s1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_lrintf
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_M_PI,4,2                       ; @M_PI
	.no_dead_strip	_celt_calc_theta
.subsections_via_symbols
