	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function calc_rank
LCPI0_0:
	.long	0x1e3ce508                      ## float 9.99999968E-21
LCPI0_2:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x4000000000000000              ## double 2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_calc_rank:                             ## @calc_rank
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	%rdx, %rdi
	callq	_GETQUERY
	xorps	%xmm2, %xmm2
	cmpq	$0, (%r15)
	je	LBB0_22
## %bb.1:
	cmpl	$0, (%rbx)
	je	LBB0_22
## %bb.2:
	movq	(%rax), %rcx
	movq	_QI_OPR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.3:
	movq	8(%rax), %rax
	movq	_OP_AND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movq	_OP_PHRASE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
LBB0_6:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_calc_rank_or
	jmp	LBB0_7
LBB0_5:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_calc_rank_and
LBB0_7:
	xorps	%xmm1, %xmm1
	movaps	%xmm0, %xmm2
	cmpltss	%xmm1, %xmm2
	movss	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	andps	%xmm2, %xmm1
	andnps	%xmm0, %xmm2
	orps	%xmm1, %xmm2
	movq	_RANK_NORM_LOGLENGTH@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_10
## %bb.8:
	cmpq	$0, (%r15)
	jle	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movaps	%xmm2, -64(%rbp)                ## 16-byte Spill
	callq	_cnt_length
	incl	%eax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	callq	_log
	movss	%xmm0, -36(%rbp)                ## 4-byte Spill
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	callq	_log
	movaps	-64(%rbp), %xmm2                ## 16-byte Reload
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	divss	%xmm1, %xmm2
LBB0_10:
	movq	_RANK_NORM_LENGTH@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_14
## %bb.11:
	movaps	%xmm2, -64(%rbp)                ## 16-byte Spill
	movq	%r15, %rdi
	callq	_cnt_length
	testl	%eax, %eax
	jle	LBB0_12
## %bb.13:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movaps	-64(%rbp), %xmm2                ## 16-byte Reload
	divss	%xmm0, %xmm2
	jmp	LBB0_14
LBB0_12:
	movaps	-64(%rbp), %xmm2                ## 16-byte Reload
LBB0_14:
	movq	_RANK_NORM_UNIQ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_17
## %bb.15:
	movq	(%r15), %rax
	testq	%rax, %rax
	jle	LBB0_17
## %bb.16:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	divss	%xmm0, %xmm2
LBB0_17:
	movq	_RANK_NORM_LOGUNIQ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_20
## %bb.18:
	movq	(%r15), %rax
	testq	%rax, %rax
	jle	LBB0_20
## %bb.19:
	incq	%rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	movaps	%xmm2, -64(%rbp)                ## 16-byte Spill
	callq	_log
	movss	%xmm0, -36(%rbp)                ## 4-byte Spill
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	callq	_log
	movaps	-64(%rbp), %xmm2                ## 16-byte Reload
	movss	-36(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	divss	%xmm1, %xmm2
LBB0_20:
	movq	_RANK_NORM_RDIVRPLUS1@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_22
## %bb.21:
	movss	LCPI0_2(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm0
	divss	%xmm0, %xmm2
LBB0_22:
	movaps	%xmm2, %xmm0
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QI_OPR,8,3                     ## @QI_OPR
	.comm	_OP_AND,8,3                     ## @OP_AND
	.comm	_OP_PHRASE,8,3                  ## @OP_PHRASE
	.comm	_RANK_NORM_LOGLENGTH,4,2        ## @RANK_NORM_LOGLENGTH
	.comm	_RANK_NORM_LENGTH,4,2           ## @RANK_NORM_LENGTH
	.comm	_RANK_NORM_UNIQ,4,2             ## @RANK_NORM_UNIQ
	.comm	_RANK_NORM_LOGUNIQ,4,2          ## @RANK_NORM_LOGUNIQ
	.comm	_RANK_NORM_RDIVRPLUS1,4,2       ## @RANK_NORM_RDIVRPLUS1
	.no_dead_strip	_calc_rank
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_rank
_calc_rank:                             ; @calc_rank
	.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	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	mov	x0, x2
	bl	_GETQUERY
	ldr	x8, [x20]
	movi	d8, #0000000000000000
	cbz	x8, LBB0_20
; %bb.1:
	ldr	w8, [x21]
	cbz	w8, LBB0_20
; %bb.2:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _QI_OPR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QI_OPR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x0, #8]
Lloh3:
	adrp	x9, _OP_AND@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OP_AND@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _OP_PHRASE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _OP_PHRASE@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_calc_rank_and
	b	LBB0_6
LBB0_5:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_calc_rank_or
LBB0_6:
	fcmp	s0, #0.0
	mov	w8, #58632
	movk	w8, #7740, lsl #16
	fmov	s1, w8
	fcsel	s8, s1, s0, mi
Lloh9:
	adrp	x8, _RANK_NORM_LOGLENGTH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RANK_NORM_LOGLENGTH@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_9
; %bb.7:
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_cnt_length
	add	w8, w0, #1
	scvtf	d0, w8
	bl	_log
	fmov	s9, s0
	fmov	d0, #2.00000000
	bl	_log
	fdiv	s0, s9, s0
	fdiv	s8, s8, s0
LBB0_9:
Lloh12:
	adrp	x8, _RANK_NORM_LENGTH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RANK_NORM_LENGTH@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_cnt_length
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.11:
	scvtf	s0, w0
	fdiv	s8, s8, s0
LBB0_12:
Lloh15:
	adrp	x8, _RANK_NORM_UNIQ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RANK_NORM_UNIQ@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_15
; %bb.13:
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.14:
	scvtf	s0, x8
	fdiv	s8, s8, s0
LBB0_15:
Lloh18:
	adrp	x8, _RANK_NORM_LOGUNIQ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RANK_NORM_LOGUNIQ@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_18
; %bb.16:
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_18
; %bb.17:
	add	x8, x8, #1
	scvtf	d0, x8
	bl	_log
	fmov	s9, s0
	fmov	d0, #2.00000000
	bl	_log
	fdiv	s0, s9, s0
	fdiv	s8, s8, s0
LBB0_18:
Lloh21:
	adrp	x8, _RANK_NORM_RDIVRPLUS1@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RANK_NORM_RDIVRPLUS1@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_20
; %bb.19:
	fmov	s0, #1.00000000
	fadd	s0, s8, s0
	fdiv	s8, s8, s0
LBB0_20:
	fmov	s0, s8
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_QI_OPR,8,3                     ; @QI_OPR
	.comm	_OP_AND,8,3                     ; @OP_AND
	.comm	_OP_PHRASE,8,3                  ; @OP_PHRASE
	.comm	_RANK_NORM_LOGLENGTH,4,2        ; @RANK_NORM_LOGLENGTH
	.comm	_RANK_NORM_LENGTH,4,2           ; @RANK_NORM_LENGTH
	.comm	_RANK_NORM_UNIQ,4,2             ; @RANK_NORM_UNIQ
	.comm	_RANK_NORM_LOGUNIQ,4,2          ; @RANK_NORM_LOGUNIQ
	.comm	_RANK_NORM_RDIVRPLUS1,4,2       ; @RANK_NORM_RDIVRPLUS1
	.no_dead_strip	_calc_rank
.subsections_via_symbols
