	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeSorterInitMerge
_vdbeSorterInitMerge:                   ## @vdbeSorterInitMerge
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r12
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$0, -44(%rbp)
	movq	_SORTER_MAX_MERGE_COUNT@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	movl	%eax, %r14d
	jle	LBB0_7
## %bb.1:
	movl	8(%r12), %edx
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %r15
	leaq	(%r15,%rbx), %rcx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	leaq	-44(%rbp), %r8
	callq	_vdbeSorterIterInit
	movl	%eax, %r14d
	movl	(%r15,%rbx), %ecx
	movl	%ecx, 8(%r12)
	movb	$1, %al
	movq	_SQLITE_OK@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r14d
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	4(%r12), %ecx
	setle	%al
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movzbl	%al, %edi
	callq	_assert
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r14d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r12), %edx
	cmpl	4(%r12), %edx
	jge	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movq	_SORTER_MAX_MERGE_COUNT@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	addq	$4, %rbx
	cmpq	%rcx, %r13
	jl	LBB0_3
LBB0_7:
	cmpl	%eax, %r14d
	jne	LBB0_8
## %bb.9:
	movl	(%r12), %r12d
	cmpl	$2, %r12d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jl	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	-1(%r12), %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_vdbeSorterDoCompare
	movl	%eax, %r14d
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$2, %r12d
	movl	%ebx, %r12d
	ja	LBB0_10
	jmp	LBB0_12
LBB0_8:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_12:
	movl	-44(%rbp), %eax
	movl	%eax, (%r15)
	movl	%r14d, %eax
	addq	$40, %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	_SORTER_MAX_MERGE_COUNT,4,2     ## @SORTER_MAX_MERGE_COUNT
	.no_dead_strip	_vdbeSorterInitMerge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterInitMerge
_vdbeSorterInitMerge:                   ; @vdbeSorterInitMerge
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x2
	mov	x20, x1
	ldr	x21, [x1]
Lloh0:
	adrp	x25, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x25]
	str	wzr, [sp, #12]
Lloh2:
	adrp	x26, _SORTER_MAX_MERGE_COUNT@GOTPAGE
Lloh3:
	ldr	x26, [x26, _SORTER_MAX_MERGE_COUNT@GOTPAGEOFF]
	ldr	w9, [x26]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x22, x0
	mov	x27, #0
	mov	x28, #0
	ldr	w2, [x21, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	add	x24, x8, x27
	add	x4, sp, #12
	mov	x0, x22
	mov	x1, x21
	mov	x3, x24
	bl	_vdbeSorterIterInit
	mov	x23, x0
	ldr	w8, [x24]
	str	w8, [x21, #8]
	ldr	w9, [x25]
	cmp	w0, w9
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x21, #4]
	cmp	w8, w9
	cset	w0, le
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_assert
	ldr	w8, [x25]
	cmp	w23, w8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	w9, w2, [x21, #4]
	cmp	w2, w9
	b.ge	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x28, x28, #1
	ldrsw	x9, [x26]
	add	x27, x27, #4
	cmp	x28, x9
	b.lt	LBB0_2
	b	LBB0_9
LBB0_8:
	mov	x23, x8
LBB0_9:
	ldr	w22, [x21]
	cmp	w23, w8
	ccmp	w22, #2, #8, eq
	b.lt	LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	w21, w22, #1
	mov	x0, x20
	mov	x1, x21
	bl	_vdbeSorterDoCompare
	ldr	w8, [x25]
	cmp	w0, w8
	ccmp	w22, #2, #0, eq
	mov	x22, x21
	b.hi	LBB0_10
; %bb.11:
	mov	x23, x0
LBB0_12:
	ldr	w8, [sp, #12]
	str	w8, [x19]
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SORTER_MAX_MERGE_COUNT,4,2     ; @SORTER_MAX_MERGE_COUNT
	.no_dead_strip	_vdbeSorterInitMerge
.subsections_via_symbols
