	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	_vdbeSortAllocUnpacked
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_22
## %bb.1:
	movq	(%r15), %rbx
	movl	8(%r12), %edi
	callq	_vdbeSorterGetCompare
	movl	%eax, 12(%r12)
	movl	$512, %edi                      ## imm = 0x200
	callq	_sqlite3MallocZero
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.4:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, (%r15)
	movq	%r13, %rbx
	testq	%r13, %r13
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_14
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%rbx, %rdi
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %r15
	callq	_sqlite3MallocSize
	xorl	%edi, %edi
	cmpq	%rax, %r15
	setb	%dil
	callq	_assert
	movq	(%rbx), %r13
	shlq	$2, %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %r13
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %r13
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	$0, 8(%rbx)
	movq	(%r14), %rdx
	movq	%r14, %r15
	testq	%rdx, %rdx
	je	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_vdbeSorterMerge
	movq	%rax, %rbx
	movq	$0, (%r15)
	movq	8(%r15), %rdx
	addq	$8, %r15
	testq	%rdx, %rdx
	jne	LBB0_11
	jmp	LBB0_13
LBB0_14:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_vdbeSorterMerge
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=1
	incq	%rbx
	cmpq	$64, %rbx
	je	LBB0_20
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	%rdx, %rax
	jmp	LBB0_19
LBB0_20:
	movq	%rax, (%r15)
	movq	%r14, %rdi
	callq	_sqlite3_free
	movq	(%r12), %rax
	movl	(%rax), %eax
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	sete	%cl
	movq	_SQLITE_NOMEM@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	(%r12), %rax
	jmp	LBB0_21
LBB0_2:
	movq	_SQLITE_NOMEM_BKPT@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_NOMEM_BKPT,4,2          ## @SQLITE_NOMEM_BKPT
	.comm	_SQLITE_NOMEM,4,2               ## @SQLITE_NOMEM
	.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:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	bl	_vdbeSortAllocUnpacked
Lloh0:
	adrp	x23, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.1:
	ldr	x22, [x20]
	ldr	w0, [x19, #8]
	bl	_vdbeSorterGetCompare
	str	w0, [x19, #12]
	mov	w0, #512
	bl	_sqlite3MallocZero
	cbz	x0, LBB0_20
; %bb.2:
	mov	x21, x0
	cbnz	x22, LBB0_11
LBB0_3:
	mov	x22, #0
	mov	x1, #0
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_vdbeSorterMerge
	mov	x1, x0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, #8
	cmp	x22, #512
	b.eq	LBB0_19
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x21, x22]
	cbz	x2, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cbnz	x1, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x2
	b	LBB0_5
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x25, x21
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	str	x22, [x25]
	mov	x22, x24
	cbz	x24, LBB0_3
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	x0, x22
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x24, [x22]
	bl	_sqlite3MallocSize
	cmp	x24, x0
	cset	w0, lo
	bl	_assert
	ldr	x8, [x20, #8]
	ldr	x9, [x22]
	add	x24, x8, x9, lsl #2
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x24, [x22, #8]
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x24, #0
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=1
	str	xzr, [x22, #8]
	ldr	x2, [x21]
	cbz	x2, LBB0_9
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x25, x21
LBB0_18:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x22
	bl	_vdbeSorterMerge
	mov	x22, x0
	str	xzr, [x25]
	ldr	x2, [x25, #8]!
	cbnz	x2, LBB0_18
	b	LBB0_10
LBB0_19:
	str	x1, [x20]
	mov	x0, x21
	bl	_sqlite3_free
	ldr	x8, [x19]
	ldr	w8, [x8]
	ldr	w9, [x23]
	cmp	w8, w9
Lloh2:
	adrp	x9, _SQLITE_NOMEM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SQLITE_NOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	ccmp	w8, w9, #4, ne
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19]
	b	LBB0_21
LBB0_20:
Lloh5:
	adrp	x8, _SQLITE_NOMEM_BKPT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_NOMEM_BKPT@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
LBB0_22:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_NOMEM_BKPT,4,2          ; @SQLITE_NOMEM_BKPT
	.comm	_SQLITE_NOMEM,4,2               ; @SQLITE_NOMEM
	.no_dead_strip	_vdbeSorterSort
.subsections_via_symbols
