	.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
	.globl	_normalize_query_rate_weights
	.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
	pushq	%rbx
	.cfi_offset %rbx, -24
	movq	_QRP@GOTPCREL(%rip), %r9
	movl	8(%r9), %r10d
	testl	%r10d, %r10d
	je	LBB0_1
## %bb.2:
	movq	_query_rate_weights@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	LBB0_4
	jmp	LBB0_26
LBB0_1:
	movsd	(%r9), %xmm0                    ## xmm0 = mem[0],zero
	movq	_QRW@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_query_rate_weights@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	leal	1(%rsi), %edx
	movl	%edx, (%rcx)
	movsd	%xmm0, (%rax,%rsi,8)
	testl	%edx, %edx
	je	LBB0_26
LBB0_4:
	jle	LBB0_13
## %bb.5:
	movq	_QRW@GOTPCREL(%rip), %r8
	movq	(%r8), %rdi
	movl	%edx, %ebx
	leaq	-1(%rbx), %rax
	movl	%ebx, %esi
	andl	$7, %esi
	cmpq	$7, %rax
	jae	LBB0_7
## %bb.6:
	xorpd	%xmm1, %xmm1
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_7:
	movl	%ebx, %eax
	andl	$-8, %eax
	xorpd	%xmm1, %xmm1
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	addsd	(%rdi,%rcx,8), %xmm1
	addsd	8(%rdi,%rcx,8), %xmm1
	addsd	16(%rdi,%rcx,8), %xmm1
	addsd	24(%rdi,%rcx,8), %xmm1
	addsd	32(%rdi,%rcx,8), %xmm1
	addsd	40(%rdi,%rcx,8), %xmm1
	addsd	48(%rdi,%rcx,8), %xmm1
	addsd	56(%rdi,%rcx,8), %xmm1
	addq	$8, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_8
LBB0_9:
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.10:
	leaq	(%rdi,%rcx,8), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	addsd	(%rax,%rcx,8), %xmm1
	incq	%rcx
	cmpq	%rcx, %rsi
	jne	LBB0_11
LBB0_12:
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	jbe	LBB0_14
LBB0_13:
	movq	_query_rate_weights@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_26
LBB0_14:
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movq	(%r8), %rsi
	cmpl	$4, %edx
	jae	LBB0_16
## %bb.15:
	xorl	%edi, %edi
	jmp	LBB0_23
LBB0_16:
	movl	%ebx, %edi
	andl	$-4, %edi
	movddup	%xmm0, %xmm1                    ## xmm1 = xmm0[0,0]
	leaq	-4(%rdi), %rax
	movq	%rax, %r11
	shrq	$2, %r11
	incq	%r11
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	%r11, %rax
	andq	$-2, %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movupd	(%rsi,%rcx,8), %xmm2
	movupd	16(%rsi,%rcx,8), %xmm3
	movupd	32(%rsi,%rcx,8), %xmm4
	movupd	48(%rsi,%rcx,8), %xmm5
	mulpd	%xmm1, %xmm2
	mulpd	%xmm1, %xmm3
	movupd	%xmm2, (%rsi,%rcx,8)
	movupd	%xmm3, 16(%rsi,%rcx,8)
	mulpd	%xmm1, %xmm4
	mulpd	%xmm1, %xmm5
	movupd	%xmm4, 32(%rsi,%rcx,8)
	movupd	%xmm5, 48(%rsi,%rcx,8)
	addq	$8, %rcx
	addq	$-2, %rax
	jne	LBB0_19
## %bb.20:
	testb	$1, %r11b
	je	LBB0_22
LBB0_21:
	movupd	(%rsi,%rcx,8), %xmm2
	movupd	16(%rsi,%rcx,8), %xmm3
	mulpd	%xmm1, %xmm2
	mulpd	%xmm1, %xmm3
	movupd	%xmm2, (%rsi,%rcx,8)
	movupd	%xmm3, 16(%rsi,%rcx,8)
LBB0_22:
	cmpq	%rbx, %rdi
	je	LBB0_24
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movsd	(%rsi,%rdi,8), %xmm1            ## xmm1 = mem[0],zero
	mulsd	%xmm0, %xmm1
	movsd	%xmm1, (%rsi,%rdi,8)
	incq	%rdi
	cmpq	%rdi, %rbx
	jne	LBB0_23
LBB0_24:
	testl	%r10d, %r10d
	jne	LBB0_26
## %bb.25:
	leal	-1(%rdx), %eax
	movq	_query_rate_weights@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	(%r8), %rax
	movslq	%edx, %rcx
	movsd	-8(%rax,%rcx,8), %xmm0          ## xmm0 = mem[0],zero
	movsd	%xmm0, (%r9)
LBB0_26:
	xorl	%eax, %eax
	popq	%rbx
	popq	%rbp
	retq
LBB0_17:
	xorl	%ecx, %ecx
	testb	$1, %r11b
	jne	LBB0_21
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_QRP,16,3                       ## @QRP
	.comm	_QRW,8,3                        ## @QRW
	.comm	_query_rate_weights,4,2         ## @query_rate_weights
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_normalize_query_rate_weights   ; -- Begin function normalize_query_rate_weights
	.p2align	2
_normalize_query_rate_weights:          ; @normalize_query_rate_weights
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _QRP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QRP@GOTPAGEOFF]
	ldr	w10, [x8, #8]
Lloh2:
	adrp	x9, _query_rate_weights@GOTPAGE
Lloh3:
	ldr	x9, [x9, _query_rate_weights@GOTPAGEOFF]
	cbz	w10, LBB0_3
; %bb.1:
	ldr	w11, [x9]
	cbnz	w11, LBB0_4
LBB0_2:
	mov	w0, #0
	ret
LBB0_3:
	ldr	d0, [x8]
Lloh4:
	adrp	x11, _QRW@GOTPAGE
Lloh5:
	ldr	x11, [x11, _QRW@GOTPAGEOFF]
Lloh6:
	ldr	x12, [x11]
	ldrsw	x13, [x9]
	add	w11, w13, #1
	str	w11, [x9]
	str	d0, [x12, x13, lsl #3]
	cbz	w11, LBB0_2
LBB0_4:
	cmp	w11, #1
	b.lt	LBB0_13
; %bb.5:
Lloh7:
	adrp	x12, _QRW@GOTPAGE
Lloh8:
	ldr	x12, [x12, _QRW@GOTPAGEOFF]
	ldr	x14, [x12]
	mov	w13, w11
	cmp	w11, #4
	b.hs	LBB0_7
; %bb.6:
	mov	x15, #0
	movi	d0, #0000000000000000
	b	LBB0_10
LBB0_7:
	and	x15, x13, #0xfffffffc
	add	x16, x14, #16
	movi	d0, #0000000000000000
	mov	x17, x15
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d1, d2, [x16, #-16]
	ldp	d3, d4, [x16], #32
	fadd	d0, d0, d1
	fadd	d0, d0, d2
	fadd	d0, d0, d3
	fadd	d0, d0, d4
	subs	x17, x17, #4
	b.ne	LBB0_8
; %bb.9:
	cmp	x15, x13
	b.eq	LBB0_12
LBB0_10:
	add	x14, x14, x15, lsl #3
	sub	x15, x13, x15
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x14], #8
	fadd	d0, d0, d1
	subs	x15, x15, #1
	b.ne	LBB0_11
LBB0_12:
	mov	x14, #54933
	movk	x14, #59430, lsl #16
	movk	x14, #11787, lsl #32
	movk	x14, #15889, lsl #48
	fmov	d1, x14
	fcmp	d0, d1
	b.pl	LBB0_14
LBB0_13:
	str	wzr, [x9]
	mov	w0, #0
	ret
LBB0_14:
	fmov	d1, #1.00000000
	ldr	x14, [x12]
	fdiv	d0, d1, d0
	cmp	w11, #8
	b.hs	LBB0_16
; %bb.15:
	mov	x15, #0
	b	LBB0_19
LBB0_16:
	and	x15, x13, #0xfffffff8
	dup.2d	v1, v0[0]
	add	x16, x14, #32
	mov	x17, x15
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldp	q2, q3, [x16, #-32]
	ldp	q4, q5, [x16]
	fmul.2d	v2, v1, v2
	fmul.2d	v3, v1, v3
	fmul.2d	v4, v1, v4
	fmul.2d	v5, v5, v0[0]
	stp	q2, q3, [x16, #-32]
	stp	q4, q5, [x16], #64
	subs	x17, x17, #8
	b.ne	LBB0_17
; %bb.18:
	cmp	x15, x13
	b.eq	LBB0_21
LBB0_19:
	add	x14, x14, x15, lsl #3
	sub	x13, x13, x15
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x14]
	fmul	d1, d0, d1
	str	d1, [x14], #8
	subs	x13, x13, #1
	b.ne	LBB0_20
LBB0_21:
	cbnz	w10, LBB0_2
; %bb.22:
	sxtw	x10, w11
	sub	x10, x10, #1
	str	w10, [x9]
	ldr	x9, [x12]
	ldr	d0, [x9, x10, lsl #3]
	str	d0, [x8]
	mov	w0, #0
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_QRP,16,3                       ; @QRP
	.comm	_QRW,8,3                        ; @QRW
	.comm	_query_rate_weights,4,2         ; @query_rate_weights
.subsections_via_symbols
