	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeSorterListToPMA
_vdbeSorterListToPMA:                   ## @vdbeSorterListToPMA
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movq	_SQLITE_OK@GOTPCREL(%rip), %r12
	movl	(%r12), %r14d
	movq	(%rsi), %r13
	leaq	-44(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpq	$0, (%r13)
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_vdbeSorterSort
	movl	%eax, %r14d
	movl	(%r12), %eax
	cmpl	%eax, %r14d
	jne	LBB0_7
## %bb.3:
	cmpq	$0, 16(%r13)
	jne	LBB0_8
## %bb.4:
	leaq	16(%r13), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_vdbeSorterOpenTempFile
	movl	%eax, %r14d
	movl	$1, %edi
	cmpl	(%r12), %eax
	jne	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	setne	%dil
LBB0_6:
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 24(%r13)
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 32(%r13)
	sete	%dil
	callq	_assert
	movl	(%r12), %eax
LBB0_7:
	cmpl	%eax, %r14d
	jne	LBB0_12
LBB0_8:
	leaq	24(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rsi
	movq	24(%r13), %rcx
	leaq	-44(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_fileWriterInit
	incq	32(%r13)
	movq	(%r13), %rsi
	movq	%rbx, %rdi
	callq	_fileWriterWriteVarint
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.9:
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	movq	16(%rbx), %r14
	movq	%r12, %rdi
	callq	_fileWriterWriteVarint
	movl	8(%rbx), %esi
	movq	(%rbx), %rdx
	movq	%r12, %rdi
	callq	_fileWriterWrite
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_sqlite3DbFree
	movq	%r14, %rbx
	testq	%r14, %r14
	jne	LBB0_10
LBB0_11:
	movq	$0, 8(%r13)
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_fileWriterFinish
	movl	%eax, %r14d
	jmp	LBB0_12
LBB0_1:
	xorl	%edi, %edi
	cmpq	$0, 8(%r13)
	sete	%dil
	callq	_assert
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %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
	.no_dead_strip	_vdbeSorterListToPMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterListToPMA
_vdbeSorterListToPMA:                   ; @vdbeSorterListToPMA
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SQLITE_OK@GOTPAGEOFF]
	ldr	w20, [x23]
	ldr	x22, [x1]
	add	x0, sp, #12
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x22]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x0, x21
	bl	_vdbeSorterSort
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x21, x22
	ldr	x8, [x21, #16]!
	cbnz	x8, LBB0_9
; %bb.3:
	mov	x0, x19
	mov	x1, x21
	bl	_vdbeSorterOpenTempFile
	mov	x20, x0
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x21]
	cmp	x8, #0
	cset	w0, ne
	b	LBB0_8
LBB0_5:
	ldr	x8, [x22, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	b	LBB0_12
LBB0_6:
	mov	x20, x0
	cmp	w20, w8
	b.eq	LBB0_9
	b	LBB0_12
LBB0_7:
	mov	w0, #1
LBB0_8:
	bl	_assert
	ldr	x8, [x22, #24]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x22, #32]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	w8, [x23]
	cmp	w20, w8
	b.ne	LBB0_12
LBB0_9:
	ldr	x1, [x22, #16]
	mov	x20, x22
	ldr	x3, [x20, #24]!
	add	x2, sp, #12
	mov	x0, x19
	bl	_fileWriterInit
	ldr	x8, [x22, #32]
	add	x8, x8, #1
	str	x8, [x22, #32]
	ldr	x1, [x22]
	add	x0, sp, #12
	bl	_fileWriterWriteVarint
	ldr	x21, [x22, #8]
	cbz	x21, LBB0_11
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x21, #16]
	ldr	x1, [x21]
	add	x0, sp, #12
	bl	_fileWriterWriteVarint
	ldr	w1, [x21, #8]
	ldr	x2, [x21]
	add	x0, sp, #12
	bl	_fileWriterWrite
	mov	x0, x19
	mov	x1, x21
	bl	_sqlite3DbFree
	mov	x21, x23
	cbnz	x23, LBB0_10
LBB0_11:
	str	xzr, [x22, #8]
	add	x1, sp, #12
	mov	x0, x19
	mov	x2, x20
	bl	_fileWriterFinish
	mov	x20, x0
LBB0_12:
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_vdbeSorterListToPMA
.subsections_via_symbols
