	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function normalize_query_rate_weights
LCPI0_0:
	.quad	0x3e112e0be826d695              ## double 1.0000000000000001E-9
LCPI0_1:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_normalize_query_rate_weights:          ## @normalize_query_rate_weights
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_query_rate_weights@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	$-1, %eax
	testl	%r9d, %r9d
	jle	LBB0_20
## %bb.1:
	movq	_QRW@GOTPCREL(%rip), %r8
	movq	(%r8), %rdi
	leaq	-1(%r9), %rcx
	movl	%r9d, %esi
	andl	$7, %esi
	cmpq	$7, %rcx
	jae	LBB0_3
## %bb.2:
	xorpd	%xmm1, %xmm1
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_3:
	movl	%r9d, %ecx
	andl	$-8, %ecx
	xorpd	%xmm1, %xmm1
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	addsd	(%rdi,%rdx,8), %xmm1
	addsd	8(%rdi,%rdx,8), %xmm1
	addsd	16(%rdi,%rdx,8), %xmm1
	addsd	24(%rdi,%rdx,8), %xmm1
	addsd	32(%rdi,%rdx,8), %xmm1
	addsd	40(%rdi,%rdx,8), %xmm1
	addsd	48(%rdi,%rdx,8), %xmm1
	addsd	56(%rdi,%rdx,8), %xmm1
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_4
LBB0_5:
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.6:
	leaq	(%rdi,%rdx,8), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	addsd	(%rcx,%rdx,8), %xmm1
	incq	%rdx
	cmpq	%rdx, %rsi
	jne	LBB0_7
LBB0_8:
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	ja	LBB0_20
## %bb.9:
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movq	(%r8), %rdx
	cmpl	$4, %r9d
	jae	LBB0_11
## %bb.10:
	xorl	%esi, %esi
	jmp	LBB0_18
LBB0_11:
	movl	%r9d, %esi
	andl	$-4, %esi
	movddup	%xmm0, %xmm1                    ## xmm1 = xmm0[0,0]
	leaq	-4(%rsi), %rax
	movq	%rax, %rdi
	shrq	$2, %rdi
	incq	%rdi
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rdi, %rcx
	andq	$-2, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movupd	(%rdx,%rax,8), %xmm2
	movupd	16(%rdx,%rax,8), %xmm3
	movupd	32(%rdx,%rax,8), %xmm4
	movupd	48(%rdx,%rax,8), %xmm5
	mulpd	%xmm1, %xmm2
	mulpd	%xmm1, %xmm3
	movupd	%xmm2, (%rdx,%rax,8)
	movupd	%xmm3, 16(%rdx,%rax,8)
	mulpd	%xmm1, %xmm4
	mulpd	%xmm1, %xmm5
	movupd	%xmm4, 32(%rdx,%rax,8)
	movupd	%xmm5, 48(%rdx,%rax,8)
	addq	$8, %rax
	addq	$-2, %rcx
	jne	LBB0_14
## %bb.15:
	testb	$1, %dil
	je	LBB0_17
LBB0_16:
	movupd	(%rdx,%rax,8), %xmm2
	movupd	16(%rdx,%rax,8), %xmm3
	mulpd	%xmm1, %xmm2
	mulpd	%xmm1, %xmm3
	movupd	%xmm2, (%rdx,%rax,8)
	movupd	%xmm3, 16(%rdx,%rax,8)
LBB0_17:
	xorl	%eax, %eax
	cmpq	%r9, %rsi
	je	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movsd	(%rdx,%rsi,8), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm0, %xmm1
	movsd	%xmm1, (%rdx,%rsi,8)
	incq	%rsi
	cmpq	%rsi, %r9
	jne	LBB0_18
## %bb.19:
	xorl	%eax, %eax
LBB0_20:
	popq	%rbp
	retq
LBB0_12:
	xorl	%eax, %eax
	testb	$1, %dil
	jne	LBB0_16
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_query_rate_weights,4,2         ## @query_rate_weights
	.comm	_QRW,8,3                        ## @QRW
	.no_dead_strip	_normalize_query_rate_weights
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function normalize_query_rate_weights
_normalize_query_rate_weights:          ; @normalize_query_rate_weights
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _query_rate_weights@GOTPAGE
Lloh1:
	ldr	x8, [x8, _query_rate_weights@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
Lloh3:
	adrp	x9, _QRW@GOTPAGE
Lloh4:
	ldr	x9, [x9, _QRW@GOTPAGEOFF]
	ldr	x10, [x9]
	cmp	w8, #4
	b.hs	LBB0_3
; %bb.2:
	mov	x11, #0
	movi	d0, #0000000000000000
	b	LBB0_6
LBB0_3:
	and	x11, x8, #0xfffffffc
	add	x12, x10, #16
	movi	d0, #0000000000000000
	mov	x13, x11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d1, d2, [x12, #-16]
	ldp	d3, d4, [x12], #32
	fadd	d0, d0, d1
	fadd	d0, d0, d2
	fadd	d0, d0, d3
	fadd	d0, d0, d4
	subs	x13, x13, #4
	b.ne	LBB0_4
; %bb.5:
	cmp	x11, x8
	b.eq	LBB0_8
LBB0_6:
	add	x10, x10, x11, lsl #3
	sub	x11, x8, x11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x10], #8
	fadd	d0, d0, d1
	subs	x11, x11, #1
	b.ne	LBB0_7
LBB0_8:
	mov	x10, #54933
	movk	x10, #59430, lsl #16
	movk	x10, #11787, lsl #32
	movk	x10, #15889, lsl #48
	fmov	d1, x10
	fcmp	d0, d1
	b.pl	LBB0_10
LBB0_9:
	mov	w0, #-1
	ret
LBB0_10:
	fmov	d1, #1.00000000
	ldr	x9, [x9]
	fdiv	d0, d1, d0
	cmp	w8, #8
	b.hs	LBB0_12
; %bb.11:
	mov	x10, #0
	b	LBB0_15
LBB0_12:
	and	x10, x8, #0xfffffff8
	dup.2d	v1, v0[0]
	add	x11, x9, #32
	mov	x12, x10
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldp	q2, q3, [x11, #-32]
	ldp	q4, q5, [x11]
	fmul.2d	v2, v1, v2
	fmul.2d	v3, v1, v3
	fmul.2d	v4, v1, v4
	fmul.2d	v5, v5, v0[0]
	stp	q2, q3, [x11, #-32]
	stp	q4, q5, [x11], #64
	subs	x12, x12, #8
	b.ne	LBB0_13
; %bb.14:
	cmp	x10, x8
	b.eq	LBB0_17
LBB0_15:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x9]
	fmul	d1, d0, d1
	str	d1, [x9], #8
	subs	x8, x8, #1
	b.ne	LBB0_16
LBB0_17:
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_query_rate_weights,4,2         ; @query_rate_weights
	.comm	_QRW,8,3                        ; @QRW
	.no_dead_strip	_normalize_query_rate_weights
.subsections_via_symbols
