	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_25
## %bb.1:
	movl	(%rsi), %r9d
	testl	%r9d, %r9d
	js	LBB0_25
## %bb.2:
	xorl	%eax, %eax
	movl	$0, %r10d
	testl	%r9d, %r9d
	je	LBB0_12
## %bb.3:
	leal	-1(%r9), %r11d
	movq	%r11, %r8
	negq	%r8
	xorl	%r10d, %r10d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%r9), %ecx
	decq	%r11
	incq	%r10
	cmpl	$1, %r9d
	movl	%ecx, %r9d
	jbe	LBB0_7
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	cmpl	$2, %r9d
	jb	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r10, %rcx
	notq	%rcx
	cmpq	%r8, %rcx
	jne	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %r14d
	xorl	%ecx, %ecx
	testb	$1, %r11b
	je	LBB0_24
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r11, %r14
	andq	$-2, %r14
	xorl	%ecx, %ecx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=2
	addq	$2, %rcx
	cmpq	%rcx, %r14
	je	LBB0_20
LBB0_15:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%rcx,4), %ebx
	movl	4(%rdi,%rcx,4), %edx
	cmpl	%edx, %ebx
	jle	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	%edx, (%rdi,%rcx,4)
	movl	%ebx, 4(%rdi,%rcx,4)
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=2
	movl	4(%rdi,%rcx,4), %ebx
	movl	8(%rdi,%rcx,4), %edx
	cmpl	%edx, %ebx
	jle	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	%edx, 4(%rdi,%rcx,4)
	movl	%ebx, 8(%rdi,%rcx,4)
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	1(%rcx), %r14
	testb	$1, %r11b
	je	LBB0_24
LBB0_22:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rdi,%rcx,4), %ebx
	movl	(%rdi,%r14,4), %edx
	cmpl	%edx, %ebx
	jle	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%edx, (%rdi,%rcx,4)
	movl	%ebx, (%rdi,%r14,4)
	jmp	LBB0_24
LBB0_25:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_7:
	movl	(%rsi), %r8d
	xorl	%r10d, %r10d
	cmpl	$2, %r8d
	jl	LBB0_12
## %bb.8:
	xorl	%r10d, %r10d
	movl	$1, %edx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rdx
	movslq	%r8d, %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r10d, %rcx
	movl	(%rdi,%rdx,4), %r9d
	cmpl	%r9d, (%rdi,%rcx,4)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leal	1(%rcx), %r10d
	movl	%r9d, 4(%rdi,%rcx,4)
	movl	(%rsi), %r8d
	jmp	LBB0_11
LBB0_12:
	incl	%r10d
	movl	%r10d, (%rsi)
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.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:
	cbz	x0, LBB0_10
; %bb.1:
	ldr	w8, [x1]
	tbnz	w8, #31, LBB0_10
; %bb.2:
	cbz	w8, LBB0_17
; %bb.3:
	sub	w9, w8, #1
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	x9, x9, #1
	subs	w8, w8, #1
	b.ls	LBB0_11
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	cmp	w8, #2
	b.lo	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x10, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x10, x10, #1
	cmp	x9, x10
	b.eq	LBB0_4
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x11, x0, x10, lsl #2
	ldp	w12, w13, [x11]
	cmp	w12, w13
	b.le	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	str	w13, [x0, x10, lsl #2]
	str	w12, [x11, #4]
	b	LBB0_7
LBB0_10:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_11:
	ldr	w10, [x1]
	cmp	w10, #2
	b.lt	LBB0_16
; %bb.12:
	mov	w8, #0
	mov	w9, #1
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x9, x9, #1
	cmp	x9, w10, sxtw
	b.ge	LBB0_17
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x0, w8, sxtw #2]
	ldr	w11, [x0, x9, lsl #2]
	cmp	w12, w11
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	sxtw	x8, w8
	add	x8, x8, #1
	str	w11, [x0, x8, lsl #2]
	ldr	w10, [x1]
                                        ; 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, [x1]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sort_and_eliminate
.subsections_via_symbols
