	.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_and
LCPI0_0:
	.long	0xbf800000                      ## float -1
LCPI0_2:
	.long	0x00000000                      ## float 0
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_calc_rank_and:                         ## @calc_rank_and
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	(%rdx), %eax
	movl	%eax, -52(%rbp)
	leaq	-52(%rbp), %rsi
	movq	%rdx, %rdi
	callq	_SortAndUniqItems
	cmpl	$1, -52(%rbp)
	jg	LBB0_2
## %bb.1:
	movq	%rax, %rdi
	callq	_pfree
	movq	%r14, %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	callq	_calc_rank_or
	jmp	LBB0_36
LBB0_2:
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	shll	$3, %edi
	callq	_palloc0
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$1, -152(%rbp)
	movq	-144(%rbp), %rax
	movq	$0, (%rax)
	movq	_MAXENTRYPOS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decl	%esi
	xorl	%edi, %edi
	callq	_WEP_SETPOS
	cmpl	$0, -52(%rbp)
	jle	LBB0_3
## %bb.4:
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_34:                                ##   in Loop: Header=BB0_5 Depth=1
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	incq	%r14
	movslq	-52(%rbp), %rax
	cmpq	%rax, %r14
	jge	LBB0_35
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##       Child Loop BB0_15 Depth 3
                                        ##         Child Loop BB0_18 Depth 4
                                        ##           Child Loop BB0_20 Depth 5
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r14,8), %rdx
	leaq	-68(%rbp), %rcx
	callq	_find_wordentry
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -68(%rbp)
	jle	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movq	%r14, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=2
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_33:                                ##   in Loop: Header=BB0_9 Depth=2
	addq	$8, %rbx
	movq	%rbx, %rax
	subq	-96(%rbp), %rax                 ## 8-byte Folded Reload
	sarq	$3, %rax
	movslq	-68(%rbp), %rcx
	cmpq	%rcx, %rax
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	jge	LBB0_34
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_15 Depth 3
                                        ##         Child Loop BB0_18 Depth 4
                                        ##           Child Loop BB0_20 Depth 5
	cmpq	$0, (%rbx)
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	%rbx, %rsi
	callq	__POSVECPTR
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx,%r14,8)
	testq	%r14, %r14
	jne	LBB0_14
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	-152(%rbp), %rcx
	movq	%rcx, (%rax,%r14,8)
	movq	%rcx, %rax
	testq	%r14, %r14
	je	LBB0_13
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=2
	movq	8(%rax), %rcx
	movq	%rcx, -136(%rbp)                ## 8-byte Spill
	movl	(%rax), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%ecx, %ecx
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movq	%rbx, -160(%rbp)                ## 8-byte Spill
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_15 Depth=3
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	incq	%rcx
	movq	-120(%rbp), %r14                ## 8-byte Reload
	cmpq	%r14, %rcx
	movq	-160(%rbp), %rbx                ## 8-byte Reload
	je	LBB0_33
LBB0_15:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_9 Depth=2
                                        ## =>    This Loop Header: Depth=3
                                        ##         Child Loop BB0_18 Depth 4
                                        ##           Child Loop BB0_20 Depth 5
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	je	LBB0_32
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=3
	cmpl	$0, -104(%rbp)                  ## 4-byte Folded Reload
	jle	LBB0_32
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=3
	movq	8(%rax), %r13
	movl	(%rax), %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_18 Depth=4
	incq	%r12
	cmpq	-104(%rbp), %r12                ## 8-byte Folded Reload
	je	LBB0_32
LBB0_18:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_9 Depth=2
                                        ##       Parent Loop BB0_15 Depth=3
                                        ## =>      This Loop Header: Depth=4
                                        ##           Child Loop BB0_20 Depth 5
	cmpl	$0, -128(%rbp)                  ## 4-byte Folded Reload
	jle	LBB0_31
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=4
	xorl	%r15d, %r15d
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_20 Depth=5
	cvtss2sd	%xmm1, %xmm1
	movsd	LCPI0_1(%rip), %xmm3            ## xmm3 = mem[0],zero
	movapd	%xmm3, %xmm2
	subsd	%xmm1, %xmm2
	cvtss2sd	%xmm0, %xmm0
	movapd	%xmm3, %xmm1
	subsd	%xmm0, %xmm1
	mulsd	%xmm2, %xmm1
	movapd	%xmm3, %xmm0
	subsd	%xmm1, %xmm0
LBB0_29:                                ##   in Loop: Header=BB0_20 Depth=5
	cvtsd2ss	%xmm0, %xmm0
LBB0_30:                                ##   in Loop: Header=BB0_20 Depth=5
	incq	%r15
	cmpq	%r15, -128(%rbp)                ## 8-byte Folded Reload
	je	LBB0_31
LBB0_20:                                ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_9 Depth=2
                                        ##       Parent Loop BB0_15 Depth=3
                                        ##         Parent Loop BB0_18 Depth=4
                                        ## =>        This Inner Loop Header: Depth=5
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	movq	-136(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%r12,4), %edi
	callq	_WEP_GETPOS
	movq	%rax, %rbx
	movl	(%r13,%r15,4), %edi
	callq	_WEP_GETPOS
	subl	%eax, %ebx
	movl	%ebx, %edi
	callq	_Abs
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_21
LBB0_24:                                ##   in Loop: Header=BB0_20 Depth=5
	testl	%r14d, %r14d
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_20 Depth=5
	movq	_MAXENTRYPOS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_26:                                ##   in Loop: Header=BB0_20 Depth=5
	movq	-136(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%r12,4), %edi
	callq	_wpos
	movl	%eax, %ebx
	movl	(%r13,%r15,4), %edi
	callq	_wpos
	imull	%eax, %ebx
	movl	%r14d, %edi
	callq	_word_distance
	imull	%eax, %ebx
	movl	%ebx, %edi
	callq	_sqrt
	movss	-44(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	xorps	%xmm2, %xmm2
	ucomiss	%xmm1, %xmm2
	jbe	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_20 Depth=5
	cvtss2sd	%xmm0, %xmm0
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_20 Depth=5
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-120(%rbp), %rcx                ## 8-byte Reload
	leaq	-152(%rbp), %rdx
	cmpq	%rdx, (%rax,%rcx,8)
	je	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=5
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	-152(%rbp), %rcx
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	cmpq	%rcx, (%rax,%rdx,8)
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_20 Depth=5
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_30
LBB0_3:
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
LBB0_35:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pfree
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_pfree
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_36:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXENTRYPOS,4,2                ## @MAXENTRYPOS
	.no_dead_strip	_calc_rank_and
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_rank_and
_calc_rank_and:                         ; @calc_rank_and
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	d9, d8, [sp, #96]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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 w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	ldr	w8, [x2]
	str	w8, [sp, #72]
	add	x1, sp, #72
	mov	x0, x2
	bl	_SortAndUniqItems
	ldr	w8, [sp, #72]
	cmp	w8, #1
	b.gt	LBB0_2
; %bb.1:
	bl	_pfree
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_calc_rank_or
	fmov	s8, s0
	b	LBB0_28
LBB0_2:
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	ldr	w8, [x19]
	lsl	w0, w8, #3
	bl	_palloc0
	mov	x22, x0
	mov	w8, #1
	str	w8, [sp, #80]
	ldr	x8, [sp, #88]
	str	xzr, [x8]
Lloh0:
	adrp	x27, _MAXENTRYPOS@GOTPAGE
Lloh1:
	ldr	x27, [x27, _MAXENTRYPOS@GOTPAGEOFF]
	ldr	w8, [x27]
	sub	w1, w8, #1
	mov	x0, #0
	bl	_WEP_SETPOS
	ldr	w8, [sp, #72]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.3:
	str	w20, [sp, #28]                  ; 4-byte Folded Spill
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x28, #0
	fmov	s8, #-1.00000000
	fmov	d9, #1.00000000
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [sp, #72]
	cmp	x28, x8
	b.ge	LBB0_27
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;         Child Loop BB0_19 Depth 4
                                        ;           Child Loop BB0_23 Depth 5
	ldp	x1, x8, [sp, #8]                ; 16-byte Folded Reload
	ldr	x2, [x8, x28, lsl #3]
	add	x3, sp, #76
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	bl	_find_wordentry
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #76]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x19, [sp, #32]                  ; 8-byte Folded Reload
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldp	x8, x19, [sp, #32]              ; 16-byte Folded Reload
	add	x19, x19, #8
	sub	x8, x19, x8
	ldrsw	x9, [sp, #76]
	cmp	x9, x8, asr #3
	b.le	LBB0_4
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;         Child Loop BB0_19 Depth 4
                                        ;           Child Loop BB0_23 Depth 5
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	mov	x1, x19
	bl	__POSVECPTR
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=2
	add	x0, sp, #80
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=2
	str	x0, [x22, x28, lsl #3]
	str	x19, [sp, #40]                  ; 8-byte Folded Spill
	cbz	x28, LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x19, #0
	ldr	x20, [x0, #8]
	ldr	w8, [x0]
	str	x8, [sp, #64]                   ; 8-byte Folded Spill
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=3
	add	x19, x19, #1
	cmp	x19, x28
	b.eq	LBB0_8
LBB0_15:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_19 Depth 4
                                        ;           Child Loop BB0_23 Depth 5
	ldr	x8, [x22, x19, lsl #3]
	cbz	x8, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=3
	ldr	x9, [sp, #64]                   ; 8-byte Folded Reload
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=3
	mov	x24, #0
	ldr	x9, [x8, #8]
	ldr	w23, [x8]
	stp	x9, x23, [sp, #48]              ; 16-byte Folded Spill
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=4
	add	x24, x24, #1
	ldp	x23, x8, [sp, #56]              ; 16-byte Folded Reload
	cmp	x24, x8
	b.eq	LBB0_14
LBB0_19:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ;       Parent Loop BB0_15 Depth=3
                                        ; =>      This Loop Header: Depth=4
                                        ;           Child Loop BB0_23 Depth 5
	cmp	w23, #1
	b.lt	LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=4
	ldr	x21, [sp, #48]                  ; 8-byte Folded Reload
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_23 Depth=5
	ldr	w8, [x27]
	cmp	w0, #0
	csel	w25, w8, w0, eq
	ldr	w0, [x20, x24, lsl #2]
	bl	_wpos
	mov	x26, x0
	ldr	w0, [x21]
	bl	_wpos
	mul	w26, w0, w26
	mov	x0, x25
	bl	_word_distance
	mul	w0, w26, w0
	bl	_sqrt
	fcmp	s8, #0.0
	fcvt	d1, s8
	fsub	d1, d9, d1
	fcvt	d0, s0
	fsub	d2, d9, d0
	fmsub	d1, d1, d2, d9
	fcsel	d0, d1, d0, pl
	fcvt	s8, d0
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=5
	add	x21, x21, #4
	subs	x23, x23, #1
	b.eq	LBB0_18
LBB0_23:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ;       Parent Loop BB0_15 Depth=3
                                        ;         Parent Loop BB0_19 Depth=4
                                        ; =>        This Inner Loop Header: Depth=5
	ldr	w0, [x20, x24, lsl #2]
	bl	_WEP_GETPOS
	mov	x25, x0
	ldr	w0, [x21]
	bl	_WEP_GETPOS
	sub	w0, w25, w0
	bl	_Abs
	cbnz	w0, LBB0_21
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=5
	ldr	x8, [x22, x28, lsl #3]
	add	x9, sp, #80
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=5
	ldr	x8, [x22, x19, lsl #3]
	add	x9, sp, #80
	cmp	x8, x9
	b.ne	LBB0_22
	b	LBB0_21
LBB0_26:
	fmov	s8, #-1.00000000
LBB0_27:
	mov	x0, x22
	bl	_pfree
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_pfree
LBB0_28:
	fmov	s0, s8
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #96]               ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXENTRYPOS,4,2                ; @MAXENTRYPOS
	.no_dead_strip	_calc_rank_and
.subsections_via_symbols
