	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_llist_mergesort                ## -- Begin function llist_mergesort
	.p2align	4, 0x90
_llist_mergesort:                       ## @llist_mergesort
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	%rdi, -56(%rbp)
	movl	$1, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$1, %esi
	movq	%r14, %rdx
	callq	_get_nth_next
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	leaq	-80(%rbp), %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, -72(%rbp)
	movq	%rcx, -48(%rbp)
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	*-96(%rbp)                      ## 8-byte Folded Reload
	testl	%eax, %eax
	leaq	-56(%rbp), %rdi
	cmovgq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_pop_item
	movq	%rax, %r12
	cmpq	$0, -56(%rbp)
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_17
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %rax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	-80(%rbp), %rdi
	movq	%rdi, -56(%rbp)
	movq	%rbx, %r13
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, -48(%rbp)
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_get_nth_next
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	cmovneq	%rbx, %rax
	movq	%r13, %rbx
	movq	%rax, -72(%rbp)
	cmpq	$0, -56(%rbp)
	movq	%r12, %r13
	je	LBB0_17
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
	movq	-48(%rbp), %rsi
	testq	%rsi, %rsi
	setne	%dl
	testq	%rax, %rax
	setne	%cl
	orq	%rax, %rsi
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	%r13, %r12
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=3
	movq	%r14, %rsi
	callq	_pop_item
	movq	%rax, %r12
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	*%r15
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	setne	%dl
	movq	-72(%rbp), %rsi
	testq	%rsi, %rsi
	setne	%cl
	orq	%rsi, %rax
	movq	%r12, %r13
	je	LBB0_16
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	leaq	-56(%rbp), %rdi
	testb	$1, %dl
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=3
	movq	%rbx, %rdi
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=3
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=3
	testb	$1, %cl
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=3
	movq	-56(%rbp), %rdi
	movq	-80(%rbp), %rsi
	callq	*-96(%rbp)                      ## 8-byte Folded Reload
	movq	%rbx, %rdi
	testl	%eax, %eax
	jg	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=3
	leaq	-56(%rbp), %rdi
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	*%r15
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addq	%rsi, %rsi
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, -56(%rbp)
	movq	%r12, %rdi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdx
	callq	_get_nth_next
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %r12
	jmp	LBB0_5
LBB0_1:
	xorl	%r12d, %r12d
LBB0_2:
	movq	%r12, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	_llist_mergesort                ; -- Begin function llist_mergesort
	.p2align	2
_llist_mergesort:                       ; @llist_mergesort
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x0
	cbz	x0, LBB0_14
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	str	x22, [sp, #16]
	mov	x0, x22
	mov	w1, #1
	mov	x2, x21
	bl	_get_nth_next
	str	x0, [sp]
	cbz	x0, LBB0_14
; %bb.2:
	mov	x1, x0
	mov	w23, #1
	add	x26, sp, #16
	mov	x27, sp
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
	str	x23, [sp, #8]
	str	x23, [sp, #24]
	mov	x0, x22
	blr	x19
	cmp	w0, #0
	csel	x0, x27, x26, gt
	mov	x1, x21
	bl	_pop_item
	mov	x22, x0
	ldr	x8, [sp, #16]
	mov	x25, x0
	cbz	x8, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [sp, #8]
	mov	x24, x22
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	x0, [sp]
	stp	x0, x23, [sp, #16]
	mov	x1, x23
	mov	x2, x21
	bl	_get_nth_next
	cmp	x0, #0
	csel	x10, xzr, x23, eq
	stp	x0, x10, [sp]
	ldr	x8, [sp, #16]
	mov	x24, x25
	cbz	x8, LBB0_12
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
	ldr	x11, [sp, #24]
	cmp	x11, #0
	cset	w8, ne
	cmp	x10, #0
	cset	w9, ne
	orr	x10, x11, x10
	cbnz	x10, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x25, x24
	b	LBB0_5
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=3
	mov	x1, x21
	bl	_pop_item
	mov	x25, x0
	mov	x0, x24
	mov	x1, x25
	blr	x20
	ldr	x10, [sp, #24]
	ldr	x11, [sp, #8]
	cmp	x10, #0
	cset	w8, ne
	cmp	x11, #0
	cset	w9, ne
	mov	x24, x25
	orr	x10, x10, x11
	cbz	x10, LBB0_5
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	tst	w8, #0x1
	csel	x0, x26, x27, ne
	tbz	w8, #0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=3
	tbz	w9, #0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=3
	ldr	x0, [sp, #16]
	ldr	x1, [sp]
	blr	x19
	cmp	w0, #0
	csel	x0, x27, x26, gt
	b	LBB0_8
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x25
	mov	x1, #0
	blr	x20
	lsl	x23, x23, #1
	str	x22, [sp, #16]
	mov	x0, x22
	mov	x1, x23
	mov	x2, x21
	bl	_get_nth_next
	str	x0, [sp]
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x0
	ldr	x22, [sp, #16]
	b	LBB0_3
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
