	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getNextNearest
_getNextNearest:                        ## @getNextNearest
	.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
	movq	%rdi, %r15
	movslq	24(%rdi), %r14
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_pfree
	movq	$0, (%r15)
LBB0_2:
	movq	%r14, %rdi
	callq	_getNextGISTSearchItem
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rbx), %xmm0
	movups	16(%rbx), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_GISTSearchItemIsHeap
	testq	%rax, %rax
	jne	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_CHECK_FOR_INTERRUPTS
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_gistScanPage
	movq	%rbx, %rdi
	callq	_pfree
	movq	%r14, %rdi
	callq	_getNextGISTSearchItem
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_10
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_10
LBB0_6:
	movl	24(%rbx), %eax
	movl	%eax, 20(%r15)
	movl	20(%rbx), %eax
	movl	%eax, 16(%r15)
	movl	(%r14), %esi
	movl	(%rbx), %edx
	movl	16(%rbx), %ecx
	movq	%r15, %rdi
	callq	_index_store_float8_orderby_distances
	cmpq	$0, 8(%r15)
	je	LBB0_8
## %bb.7:
	movq	8(%rbx), %rax
	movq	%rax, (%r15)
LBB0_8:
	movq	%rbx, %rdi
	callq	_pfree
	movl	$1, %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_getNextNearest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getNextNearest
_getNextNearest:                        ; @getNextNearest
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldrsw	x20, [x0, #24]
	ldr	x0, [x0]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_pfree
	str	xzr, [x19]
LBB0_2:
	mov	x0, x20
	bl	_getNextGISTSearchItem
	cbz	x0, LBB0_9
; %bb.3:
	mov	x21, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x21]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_GISTSearchItemIsHeap
	cbnz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_CHECK_FOR_INTERRUPTS
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x21
	mov	x3, #0
	mov	x4, #0
	bl	_gistScanPage
	mov	x0, x21
	bl	_pfree
	mov	x0, x20
	bl	_getNextGISTSearchItem
	mov	x21, x0
	cbnz	x0, LBB0_4
	b	LBB0_9
LBB0_6:
	ldur	d0, [x21, #20]
	str	d0, [x19, #16]
	ldr	w1, [x20]
	ldr	w2, [x21]
	ldr	w3, [x21, #16]
	mov	x0, x19
	bl	_index_store_float8_orderby_distances
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	x8, [x21, #8]
	str	x8, [x19]
LBB0_8:
	mov	x0, x21
	bl	_pfree
	mov	w0, #1
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_getNextNearest
.subsections_via_symbols
