	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nth_rtt
_nth_rtt:                               ## @nth_rtt
	.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	$-1, %r13d
	cmpq	%rsi, %rdx
	jae	LBB0_9
## %bb.1:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movl	$4, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	%rax, %r14
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.3:
	movl	$1, %eax
	movq	%r14, %rcx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	cmpl	$-1, %edx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%edx, (%rcx)
	addq	$4, %rcx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r12, %rax
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx), %rbx
	incq	%rax
	testq	%rbx, %rbx
	jne	LBB0_4
LBB0_8:
	movq	_rtt_compare@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_qsort
	xorl	%edi, %edi
	addq	$-1, %r15
	setb	%dil
	callq	_log_assert
	movl	(%r14,%r15,4), %r13d
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_log_err
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"malloc failure: allocating rtt_list"

	.comm	_rtt_compare,4,2                ## @rtt_compare
	.no_dead_strip	_nth_rtt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nth_rtt
_nth_rtt:                               ; @nth_rtt
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cmp	x2, x1
	b.hs	LBB0_10
; %bb.1:
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	mov	x0, x1
	mov	w1, #4
	bl	_calloc
	cbz	x0, LBB0_9
; %bb.2:
	mov	x20, x0
	cbz	x22, LBB0_8
; %bb.3:
	mov	w8, #1
	mov	x9, x20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x22]
	cmn	w10, #1
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w10, [x9], #4
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x8, x21
	b.hs	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x22, [x22, #8]
	add	x8, x8, #1
	cbnz	x22, LBB0_4
LBB0_8:
Lloh0:
	adrp	x8, _rtt_compare@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rtt_compare@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #4
	bl	_qsort
	subs	x19, x19, #1
	cset	w0, hs
	bl	_log_assert
	ldr	w19, [x20, x19, lsl #2]
	mov	x0, x20
	bl	_free
	b	LBB0_11
LBB0_9:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
LBB0_10:
	mov	w19, #-1
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"malloc failure: allocating rtt_list"

	.comm	_rtt_compare,4,2                ; @rtt_compare
	.no_dead_strip	_nth_rtt
.subsections_via_symbols
