	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeSorterSort
_vdbeSorterSort:                        ## @vdbeSorterSort
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rbx
	movl	$512, %edi                      ## imm = 0x200
	callq	_sqlite3MallocZero
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %r13
	movq	%r13, -48(%rbp)
	testq	%r13, %r13
	je	LBB0_8
## %bb.3:
	leaq	-48(%rbp), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax
	movq	%rax, (%r14)
	movq	%r13, -48(%rbp)
	testq	%r13, %r13
	je	LBB0_8
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	%r13, %rax
	movq	(%r13), %r13
	movq	$0, (%rax)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r15, %rcx
	callq	_vdbeSorterMerge
	movq	$0, (%r14)
	movq	8(%r14), %rdx
	addq	$8, %r14
	testq	%rdx, %rdx
	jne	LBB0_5
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, %r14
	movq	$0, -48(%rbp)
	xorl	%esi, %esi
	leaq	-48(%rbp), %r15
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx,8), %rdx
	movq	%r12, %rdi
	movq	%r15, %rcx
	callq	_vdbeSorterMerge
	incq	%rbx
	movq	-48(%rbp), %rsi
	cmpq	$64, %rbx
	jne	LBB0_9
## %bb.10:
	movq	%rsi, (%r14)
	movq	%r13, %rdi
	callq	_sqlite3_free
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	movq	_SQLITE_NOMEM@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_NOMEM,4,2               ## @SQLITE_NOMEM
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.no_dead_strip	_vdbeSorterSort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterSort
_vdbeSorterSort:                        ; @vdbeSorterSort
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x21, [x0]
	mov	w0, #512
	bl	_sqlite3MallocZero
	cbz	x0, LBB0_11
; %bb.1:
	mov	x20, x0
	ldr	x22, [x21]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x20
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	str	x8, [x23]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	str	x22, [sp, #8]
	cbz	x22, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x8, x22
	ldr	x22, [x22]
	str	xzr, [x8]
	ldr	x2, [x20]
	cbz	x2, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x20
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x1, [sp, #8]
	add	x3, sp, #8
	mov	x0, x19
	bl	_vdbeSorterMerge
	str	xzr, [x23]
	ldr	x2, [x23, #8]!
	cbnz	x2, LBB0_7
	b	LBB0_3
LBB0_8:
	mov	x22, #0
	mov	x1, #0
	str	xzr, [sp, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x20, x22]
	add	x3, sp, #8
	mov	x0, x19
	bl	_vdbeSorterMerge
	ldr	x1, [sp, #8]
	add	x22, x22, #8
	cmp	x22, #512
	b.ne	LBB0_9
; %bb.10:
	str	x1, [x21]
	mov	x0, x20
	bl	_sqlite3_free
Lloh0:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh2:
	adrp	x8, _SQLITE_NOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SQLITE_NOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_NOMEM,4,2               ; @SQLITE_NOMEM
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_vdbeSorterSort
.subsections_via_symbols
