	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_nearest
_find_nearest:                          ## @find_nearest
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $edx killed $edx def $rdx
	movslq	(%rsi), %rcx
	xorl	%eax, %eax
	cmpq	%rdi, %rcx
	jg	LBB0_7
## %bb.1:
	movslq	%edx, %rax
	decl	%edx
	movslq	-4(%rsi,%rax,4), %rax
	cmpq	%rdi, %rax
	jge	LBB0_3
## %bb.2:
	movl	%edx, %eax
LBB0_7:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_3:
	xorl	%eax, %eax
	testl	%edx, %edx
	cmovlel	%eax, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, %rdx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	4(%rsi,%rcx,4), %r8
	incq	%rcx
	cmpq	%rdi, %r8
	jl	LBB0_4
## %bb.6:
	subl	%edi, %r8d
	subl	-4(%rsi,%rcx,4), %edi
	leal	-1(%rcx), %eax
	cmpl	%r8d, %edi
	cmovgl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_find_nearest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_nearest
_find_nearest:                          ; @find_nearest
	.cfi_startproc
; %bb.0:
	ldrsw	x8, [x1]
	cmp	x8, x0
	b.le	LBB0_2
LBB0_1:
	mov	w0, #0
	ret
LBB0_2:
	sub	w8, w2, #1
	ldrsw	x9, [x1, w8, sxtw #2]
	cmp	x9, x0
	b.lt	LBB0_7
; %bb.3:
	mov	x10, #0
	cmp	w8, #0
	csel	w9, w8, wzr, gt
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x9, x10
	b.eq	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x10, #1
	add	x10, x1, x10, lsl #2
	ldrsw	x11, [x10, #4]
	mov	x10, x8
	cmp	x11, x0
	b.lt	LBB0_4
; %bb.6:
	add	x9, x1, x8, lsl #2
	ldur	w9, [x9, #-4]
	sub	w9, w0, w9
	sub	w10, w8, #1
	sub	w11, w11, w0
	cmp	w9, w11
	csel	w8, w8, w10, gt
LBB0_7:
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_find_nearest
.subsections_via_symbols
