	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function closest_item
_closest_item:                          ## @closest_item
	.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	%edx, %r8d
	movl	%esi, %r14d
	movl	%esi, %eax
	testl	%esi, %esi
	js	LBB0_5
## %bb.1:
	movq	8(%rdi), %rcx
	movl	%esi, %eax
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %ebx
	xorl	%edx, %edx
	cmpq	$0, (%rcx,%rbx,8)
	setne	%dl
	cmpl	%r8d, %edx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rax), %edx
	testl	%eax, %eax
	movl	%edx, %eax
	jg	LBB0_2
## %bb.4:
	movl	%esi, %eax
LBB0_5:
	movl	(%rdi), %ecx
	cmpl	%esi, %ecx
	jle	LBB0_9
## %bb.6:
	movslq	%esi, %rbx
	shlq	$3, %rbx
	addq	8(%rdi), %rbx
	negl	%ecx
	addq	%r14, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edx, %edx
	cmpq	$0, (%rbx,%rdi,8)
	setne	%dl
	cmpl	%r8d, %edx
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rdi
	movl	%ecx, %edx
	addl	%edi, %edx
	jne	LBB0_7
LBB0_9:
	cmpl	%esi, %eax
	jne	LBB0_10
	jmp	LBB0_13
LBB0_14:
	addl	%esi, %edi
	movl	%edi, %r14d
	cmpl	%esi, %eax
	je	LBB0_13
LBB0_10:
	movl	%r14d, %ecx
	subl	%esi, %ecx
	jne	LBB0_12
## %bb.11:
	movl	%eax, %r14d
	jmp	LBB0_13
LBB0_12:
	subl	%eax, %esi
	cmpl	%ecx, %esi
	cmovlel	%eax, %r14d
LBB0_13:
	movl	%r8d, %edi
	callq	_mySide
	movslq	%r14d, %rbx
	movq	%rbx, %rdi
	callq	_TRACE
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_closest_item
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function closest_item
_closest_item:                          ; @closest_item
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	w8, w1
	mov	x9, x1
	tbnz	w1, #31, LBB0_5
; %bb.1:
	ldr	x10, [x0, #8]
	mov	x9, x1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, w9, uxtw #3]
	cmp	x11, #0
	cset	w11, ne
	cmp	w11, w2
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w11, w9, #1
	cmp	w9, #0
	mov	x9, x11
	b.gt	LBB0_2
; %bb.4:
	mov	x9, x1
LBB0_5:
	ldr	w12, [x0]
	cmp	w12, w1
	b.le	LBB0_10
; %bb.6:
	mov	x10, #0
	ldr	x11, [x0, #8]
	add	x11, x11, w1, sxtw #3
	neg	w12, w12
	add	x12, x12, w1, uxtw
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x11, x10, lsl #3]
	cmp	x13, #0
	cset	w13, ne
	cmp	w13, w2
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x10, x10, #1
	cmn	w12, w10
	b.ne	LBB0_7
	b	LBB0_10
LBB0_9:
	add	w8, w1, w10
LBB0_10:
	sub	w10, w1, w9
	sub	w11, w8, w1
	cmp	w10, w11
	csel	w10, w8, w9, gt
	cmp	w8, w1
	csel	w10, w9, w10, eq
	cmp	w9, w1
	csel	w19, w8, w10, eq
	mov	x0, x2
	bl	_mySide
	sxtw	x0, w19
	bl	_TRACE
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_closest_item
.subsections_via_symbols
