	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mg_sort                        ## -- Begin function mg_sort
	.p2align	4, 0x90
_mg_sort:                               ## @mg_sort
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	jle	LBB0_11
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_mg_sort
	movslq	%r12d, %rax
	leaq	(%r15,%rax,8), %r15
	subl	%r12d, %r14d
	jle	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##       Child Loop BB0_4 Depth 3
                                        ##       Child Loop BB0_6 Depth 3
	movl	%r14d, %eax
	shrl	%eax
	movq	(%r15,%rax,8), %r9
	leaq	8(%r15), %r8
	xorl	%r12d, %r12d
	movl	%r14d, %esi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=2
	cmpl	%esi, %r12d
	jg	LBB0_10
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_4 Depth 3
                                        ##       Child Loop BB0_6 Depth 3
	movslq	%r12d, %rax
	leaq	(%r15,%rax,8), %rdi
	movl	%r12d, %edx
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_3 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%rdi), %r10
	incl	%edx
	addq	$8, %rdi
	cmpq	%r9, %r10
	jl	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	leal	-1(%rdx), %r12d
	movslq	%esi, %rax
	leaq	(%r8,%rax,8), %rbx
	movl	%esi, %eax
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_3 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	-8(%rbx), %rcx
	addq	$-8, %rbx
	decl	%eax
	cmpq	%r9, %rcx
	jg	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=2
	leal	1(%rax), %esi
	cmpl	%esi, %r12d
	jg	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	%rcx, -8(%rdi)
	movq	%r10, (%rbx)
	movl	%eax, %esi
	movl	%edx, %r12d
	jmp	LBB0_9
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mg_sort                        ; -- Begin function mg_sort
	.p2align	2
_mg_sort:                               ; @mg_sort
	.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	w1, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	_mg_sort
	add	x20, x20, w21, sxtw #3
	sub	w19, w19, w21
	cmp	w19, #0
	b.le	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;       Child Loop BB0_8 Depth 3
	mov	w21, #0
	lsr	w8, w19, #1
	ldr	x8, [x20, w8, uxtw #3]
	add	x9, x20, #8
	mov	x1, x19
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	cmp	w21, w1
	b.gt	LBB0_2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
                                        ;       Child Loop BB0_8 Depth 3
	add	x10, x20, w21, sxtw #3
	mov	x11, x21
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x12, [x10], #8
	add	w11, w11, #1
	cmp	x12, x8
	b.lt	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	sub	w21, w11, #1
	add	x13, x9, w1, sxtw #3
	mov	x14, x1
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x15, [x13, #-8]!
	sub	w14, w14, #1
	cmp	x15, x8
	b.gt	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	add	w1, w14, #1
	cmp	w21, w1
	b.gt	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	stur	x15, [x10, #-8]
	str	x12, [x13]
	mov	x1, x14
	mov	x21, x11
	b	LBB0_4
LBB0_11:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
