	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_scale_vector_to_given_sum_of_squares ## -- Begin function ff_scale_vector_to_given_sum_of_squares
	.p2align	4, 0x90
_ff_scale_vector_to_given_sum_of_squares: ## @ff_scale_vector_to_given_sum_of_squares
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movss	%xmm0, -28(%rbp)                ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_avpriv_scalarproduct_float_c
	xorps	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm0
	jne	LBB0_1
	jnp	LBB0_4
LBB0_1:
	movss	-28(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm2
	movaps	%xmm2, %xmm0
	ucomiss	%xmm1, %xmm2
	jb	LBB0_3
## %bb.2:
	sqrtss	%xmm0, %xmm0
LBB0_4:
	testl	%r15d, %r15d
	jg	LBB0_5
	jmp	LBB0_18
LBB0_3:
	callq	_sqrt
	testl	%r15d, %r15d
	jle	LBB0_18
LBB0_5:
	movl	%r15d, %eax
	xorl	%ecx, %ecx
	cmpl	$8, %r15d
	jb	LBB0_14
## %bb.6:
	movq	%r14, %rdx
	subq	%rbx, %rdx
	cmpq	$32, %rdx
	jb	LBB0_14
## %bb.7:
	movl	%eax, %ecx
	andl	$-8, %ecx
	movaps	%xmm0, %xmm1
	shufps	$0, %xmm0, %xmm1                ## xmm1 = xmm1[0,0],xmm0[0,0]
	leaq	-8(%rcx), %rdx
	movq	%rdx, %rsi
	shrq	$3, %rsi
	incq	%rsi
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.9:
	movq	%rsi, %rdi
	andq	$-2, %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rbx,%rdx,4), %xmm2
	movups	16(%rbx,%rdx,4), %xmm3
	mulps	%xmm1, %xmm2
	mulps	%xmm1, %xmm3
	movups	%xmm2, (%r14,%rdx,4)
	movups	%xmm3, 16(%r14,%rdx,4)
	movups	32(%rbx,%rdx,4), %xmm2
	movups	48(%rbx,%rdx,4), %xmm3
	mulps	%xmm1, %xmm2
	mulps	%xmm1, %xmm3
	movups	%xmm2, 32(%r14,%rdx,4)
	movups	%xmm3, 48(%r14,%rdx,4)
	addq	$16, %rdx
	addq	$-2, %rdi
	jne	LBB0_10
## %bb.11:
	testb	$1, %sil
	je	LBB0_13
LBB0_12:
	movups	(%rbx,%rdx,4), %xmm2
	movups	16(%rbx,%rdx,4), %xmm3
	mulps	%xmm1, %xmm2
	mulps	%xmm1, %xmm3
	movups	%xmm2, (%r14,%rdx,4)
	movups	%xmm3, 16(%r14,%rdx,4)
LBB0_13:
	cmpq	%rax, %rcx
	je	LBB0_18
LBB0_14:
	movq	%rcx, %rdx
	notq	%rdx
	addq	%rax, %rdx
	movq	%rax, %rsi
	andq	$3, %rsi
	je	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rbx,%rcx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rcx,4)
	incq	%rcx
	decq	%rsi
	jne	LBB0_15
LBB0_16:
	cmpq	$3, %rdx
	jb	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movss	(%rbx,%rcx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rcx,4)
	movss	4(%rbx,%rcx,4), %xmm1           ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, 4(%r14,%rcx,4)
	movss	8(%rbx,%rcx,4), %xmm1           ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, 8(%r14,%rcx,4)
	movss	12(%rbx,%rcx,4), %xmm1          ## xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	movss	%xmm1, 12(%r14,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_17
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%edx, %edx
	testb	$1, %sil
	jne	LBB0_12
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_scale_vector_to_given_sum_of_squares ; -- Begin function ff_scale_vector_to_given_sum_of_squares
	.p2align	2
_ff_scale_vector_to_given_sum_of_squares: ; @ff_scale_vector_to_given_sum_of_squares
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-64]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset b8, -56
	.cfi_offset b9, -64
	mov	x21, x2
	fmov	s8, s0
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_avpriv_scalarproduct_float_c
                                        ; kill: def $s0 killed $s0 def $q0
	fcmp	s0, #0.0
	b.eq	LBB0_2
; %bb.1:
	fdiv	s1, s8, s0
	fsqrt	s0, s1
	fcmp	s0, s0
	b.vs	LBB0_11
LBB0_2:
	cmp	w21, #1
	b.lt	LBB0_10
LBB0_3:
	mov	x9, #0
	mov	w8, w21
	cmp	w21, #16
	b.lo	LBB0_8
; %bb.4:
	sub	x10, x20, x19
	cmp	x10, #64
	b.lo	LBB0_8
; %bb.5:
	and	x9, x8, #0xfffffff0
	dup.4s	v1, v0[0]
	add	x10, x20, #32
	add	x11, x19, #32
	mov	x12, x9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q2, q3, [x11, #-32]
	ldp	q4, q5, [x11], #64
	fmul.4s	v2, v1, v2
	fmul.4s	v3, v1, v3
	fmul.4s	v4, v1, v4
	fmul.4s	v5, v5, v0[0]
	stp	q2, q3, [x10, #-32]
	stp	q4, q5, [x10], #64
	subs	x12, x12, #16
	b.ne	LBB0_6
; %bb.7:
	cmp	x9, x8
	b.eq	LBB0_10
LBB0_8:
	lsl	x11, x9, #2
	add	x10, x20, x11
	add	x11, x19, x11
	sub	x8, x8, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	s1, [x11], #4
	fmul	s1, s0, s1
	str	s1, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_9
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #64               ; 16-byte Folded Reload
	ret
LBB0_11:
	fmov	s0, s1
	bl	_sqrt
                                        ; kill: def $s0 killed $s0 def $q0
	cmp	w21, #1
	b.ge	LBB0_3
	b	LBB0_10
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
