	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sort_and_eliminate
_sort_and_eliminate:                    ## @sort_and_eliminate
	.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
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.1:
	movl	(%rsi), %r12d
	testl	%r12d, %r12d
	js	LBB0_24
## %bb.2:
	xorl	%r15d, %r15d
	movl	$0, %ecx
	testl	%r12d, %r12d
	je	LBB0_22
## %bb.3:
	movq	%rdi, %r13
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leal	-1(%r12), %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%r12), %eax
	decq	%rbx
	cmpl	$1, %r12d
	movl	%eax, %r12d
	jbe	LBB0_10
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	cmpl	$2, %r12d
	jb	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	incq	%r14
	cmpq	%r14, %rbx
	je	LBB0_9
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13,%r14,8), %rdi
	movq	8(%r13,%r14,8), %rsi
	cmpq	%rsi, %rdi
	jle	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	callq	_swap
	jmp	LBB0_8
LBB0_24:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_23
LBB0_10:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi), %r8d
	xorl	%ecx, %ecx
	cmpl	$2, %r8d
	jl	LBB0_22
## %bb.11:
	movl	%r8d, %ecx
	decq	%r8
	cmpl	$2, %ecx
	jne	LBB0_13
## %bb.12:
	xorl	%ecx, %ecx
	movl	$1, %edx
LBB0_19:
	testb	$1, %r8b
	je	LBB0_22
## %bb.20:
	movslq	%ecx, %rax
	movq	(%r13,%rdx,8), %rdx
	cmpq	%rdx, (%r13,%rax,8)
	je	LBB0_22
## %bb.21:
	leal	1(%rax), %ecx
	movq	%rdx, 8(%r13,%rax,8)
LBB0_22:
	incl	%ecx
	movl	%ecx, (%rsi)
LBB0_23:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	%r8, %rax
	andq	$-2, %rax
	negq	%rax
	xorl	%ecx, %ecx
	movl	$1, %edx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	(%rax,%rdx), %rdi
	addq	$2, %rdi
	addq	$2, %rdx
	cmpq	$1, %rdi
	je	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movslq	%ecx, %rdi
	movq	(%r13,%rdx,8), %rbx
	cmpq	%rbx, (%r13,%rdi,8)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	leal	1(%rdi), %ecx
	movq	%rbx, 8(%r13,%rdi,8)
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movslq	%ecx, %rdi
	movq	8(%r13,%rdx,8), %rbx
	cmpq	%rbx, (%r13,%rdi,8)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	leal	1(%rdi), %ecx
	movq	%rbx, 8(%r13,%rdi,8)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sort_and_eliminate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sort_and_eliminate
_sort_and_eliminate:                    ; @sort_and_eliminate
	.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
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x1
	ldr	w21, [x1]
	tbnz	w21, #31, LBB0_10
; %bb.2:
	cbz	w21, LBB0_16
; %bb.3:
	mov	x20, x0
	sub	w22, w21, #1
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	x22, x22, #1
	subs	w21, w21, #1
	b.ls	LBB0_11
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	cmp	w21, #2
	b.lo	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x23, x23, #1
	cmp	x22, x23
	b.eq	LBB0_4
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x8, x20, x23, lsl #3
	ldp	x0, x1, [x8]
	cmp	x0, x1
	b.le	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	bl	_swap
	b	LBB0_7
LBB0_10:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_11:
	ldr	w10, [x19]
	cmp	w10, #2
	b.lt	LBB0_16
; %bb.12:
	mov	w8, #0
	add	x9, x20, #8
	sub	x10, x10, #1
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x9, x9, #8
	subs	x10, x10, #1
	b.eq	LBB0_17
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x20, w8, sxtw #3]
	ldr	x11, [x9]
	cmp	x12, x11
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	sxtw	x8, w8
	add	x8, x8, #1
	str	x11, [x20, x8, lsl #3]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	b	LBB0_13
LBB0_16:
	mov	w8, #0
LBB0_17:
	mov	w0, #0
	add	w8, w8, #1
	str	w8, [x19]
LBB0_18:
	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	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sort_and_eliminate
.subsections_via_symbols
