	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function completionBestIndex
LCPI0_0:
	.quad	0x40b3880000000000              ## double 5000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_completionBestIndex:                   ## @completionBestIndex
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	(%rsi), %r10d
	testl	%r10d, %r10d
	jle	LBB0_1
## %bb.2:
	movq	32(%rsi), %rdi
	movq	_SQLITE_INDEX_CONSTRAINT_EQ@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	cmpl	$1, %r10d
	jne	LBB0_4
## %bb.3:
	xorl	%r11d, %r11d
	movl	$-1, %r8d
	movl	$-1, %r9d
	xorl	%edx, %edx
LBB0_18:
	testb	$1, %r10b
	je	LBB0_25
## %bb.19:
	cmpq	$0, (%rdi)
	je	LBB0_25
## %bb.20:
	cmpq	%r14, 8(%rdi)
	jne	LBB0_25
## %bb.21:
	movl	16(%rdi), %eax
	cmpl	$129, %eax
	je	LBB0_24
## %bb.22:
	cmpl	$128, %eax
	jne	LBB0_25
## %bb.23:
	orl	$2, %r11d
	movl	%edx, %r8d
LBB0_25:
	testl	%r9d, %r9d
	js	LBB0_26
LBB0_27:
	movq	24(%rsi), %rax
	movl	%r9d, %ecx
	movabsq	$4294967297, %rdx               ## imm = 0x100000001
	movq	%rdx, (%rax,%rcx,8)
	movl	$1, %eax
	testl	%r8d, %r8d
	jns	LBB0_29
	jmp	LBB0_30
LBB0_1:
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	jmp	LBB0_30
LBB0_4:
	movl	%r10d, %eax
	andl	$-2, %eax
	xorl	%r11d, %r11d
	movl	$-1, %r8d
	movl	$-1, %r9d
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	$1, %r11d
	movl	%ebx, %r9d
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	addl	$2, %edx
	addq	$48, %rdi
	cmpl	%edx, %eax
	je	LBB0_18
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rdi)
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r14, 8(%rdi)
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	16(%rdi), %ebx
	cmpl	$128, %ebx
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$129, %ebx
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	orl	$1, %r11d
	movl	%edx, %r9d
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, 24(%rdi)
	je	LBB0_17
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r14, 32(%rdi)
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%rdx), %ebx
	movl	40(%rdi), %ecx
	cmpl	$129, %ecx
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$128, %ecx
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	orl	$2, %r11d
	movl	%ebx, %r8d
	jmp	LBB0_17
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	$2, %r11d
	movl	%edx, %r8d
	cmpq	$0, 24(%rdi)
	jne	LBB0_12
	jmp	LBB0_17
LBB0_24:
	orl	$1, %r11d
	movl	%edx, %r9d
	testl	%r9d, %r9d
	jns	LBB0_27
LBB0_26:
	xorl	%eax, %eax
	testl	%r8d, %r8d
	js	LBB0_30
LBB0_29:
	incl	%eax
	movq	24(%rsi), %rcx
	movl	%r8d, %edx
	movl	%eax, (%rcx,%rdx,8)
	movl	$1, 4(%rcx,%rdx,8)
LBB0_30:
	movl	%r11d, 4(%rsi)
	imull	$1000, %eax, %ecx               ## imm = 0x3E8
	cvtsi2sd	%ecx, %xmm0
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsi)
	imull	$-100, %eax, %eax
	addl	$500, %eax                      ## imm = 0x1F4
	movl	%eax, 16(%rsi)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_INDEX_CONSTRAINT_EQ,8,3 ## @SQLITE_INDEX_CONSTRAINT_EQ
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.no_dead_strip	_completionBestIndex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function completionBestIndex
_completionBestIndex:                   ; @completionBestIndex
	.cfi_startproc
; %bb.0:
	ldr	w10, [x1]
	cmp	w10, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w8, #0
	mov	w11, #0
	ldr	x9, [x1, #32]
Lloh0:
	adrp	x12, _SQLITE_INDEX_CONSTRAINT_EQ@GOTPAGE
Lloh1:
	ldr	x12, [x12, _SQLITE_INDEX_CONSTRAINT_EQ@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x12]
	add	x13, x9, #16
	mov	w9, #-1
	mov	w14, #-1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w11, w11, #1
	add	x13, x13, #24
	cmp	w10, w11
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x15, [x13, #-16]
	cbz	x15, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	x15, [x13, #-8]
	cmp	x15, x12
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w15, [x13]
	orr	w16, w8, #0x2
	orr	w17, w8, #0x1
	cmp	w15, #129
	csel	w8, w8, w17, ne
	csel	w17, w14, w11, ne
	cmp	w15, #128
	csel	w8, w16, w8, eq
	csel	w14, w14, w17, eq
	csel	w9, w11, w9, eq
	b	LBB0_2
LBB0_6:
	tbnz	w14, #31, LBB0_9
; %bb.7:
	ldr	x10, [x1, #24]
	movi.2s	v0, #1
	str	d0, [x10, w14, uxtw #3]
	mov	w10, #1
	tbz	w9, #31, LBB0_10
	b	LBB0_11
LBB0_8:
	mov	w8, #0
	mov	w10, #0
	b	LBB0_11
LBB0_9:
	mov	w10, #0
	tbnz	w9, #31, LBB0_11
LBB0_10:
	add	w10, w10, #1
	ldr	x11, [x1, #24]
	add	x9, x11, w9, uxtw #3
	mov	w11, #1
	stp	w10, w11, [x9]
LBB0_11:
	str	w8, [x1, #4]
	mov	w8, #1000
	mul	w8, w10, w8
	scvtf	d0, w8
	mov	x8, #149533581377536
	movk	x8, #16563, lsl #48
	fmov	d1, x8
	fsub	d0, d1, d0
	str	d0, [x1, #8]
	mov	w8, #-100
	mul	w8, w10, w8
	add	w8, w8, #500
	str	w8, [x1, #16]
Lloh3:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_INDEX_CONSTRAINT_EQ,8,3 ; @SQLITE_INDEX_CONSTRAINT_EQ
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_completionBestIndex
.subsections_via_symbols
