	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sort_ref_dir
_sort_ref_dir:                          ## @sort_ref_dir
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	4(%rdi), %esi
	cmpl	%esi, (%rdi)
	je	LBB0_10
## %bb.1:
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	movq	_ref_entry_cmp@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_QSORT
	cmpl	$0, 4(%r14)
	jle	LBB0_2
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r14), %rax
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movslq	%r12d, %rcx
	incl	%r12d
	movq	%r13, (%rax,%rcx,8)
	movq	%r13, %r15
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	4(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movq	(%rax,%rbx,8), %r13
	testq	%r15, %r15
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_is_dup_ref
	testq	%rax, %rax
	je	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_free_ref_entry
	jmp	LBB0_8
LBB0_2:
	xorl	%r12d, %r12d
LBB0_9:
	movl	%r12d, 4(%r14)
	movl	%r12d, (%r14)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ref_entry_cmp,4,2              ## @ref_entry_cmp
	.no_dead_strip	_sort_ref_dir
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sort_ref_dir
_sort_ref_dir:                          ; @sort_ref_dir
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldp	w8, w1, [x0]
	cmp	w8, w1
	b.eq	LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x8, _ref_entry_cmp@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ref_entry_cmp@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_QSORT
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x23, #0
	mov	w22, #0
	mov	x20, #0
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	x21, [x8, w22, sxtw #3]
	add	w22, w22, #1
	mov	x20, x21
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19, #4]
	cmp	x23, x8
	b.ge	LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x21, [x8, x23, lsl #3]
	cbz	x20, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_is_dup_ref
	cbz	x0, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_free_ref_entry
	b	LBB0_5
LBB0_9:
	mov	w22, #0
LBB0_10:
	stp	w22, w22, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ref_entry_cmp,4,2              ; @ref_entry_cmp
	.no_dead_strip	_sort_ref_dir
.subsections_via_symbols
