	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function vdbeSorterAddToTree
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_vdbeSorterAddToTree:                   ## @vdbeSorterAddToTree
	.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	%rcx, %rbx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r14
	leaq	-56(%rbp), %rdx
	movq	%r8, %rsi
	callq	_vdbeIncrMergerNew
	movl	%eax, %r10d
	cmpl	$1, %r13d
	jle	LBB0_1
## %bb.3:
	movq	_SORTER_MAX_MERGE_COUNT@GOTPCREL(%rip), %r9
	movl	(%r9), %eax
	leal	-1(%r13), %r8d
	movl	$1, %r12d
	movl	$1, %ecx
	cmpl	$8, %r8d
	jb	LBB0_12
## %bb.4:
	movl	%r8d, %ecx
	andl	$-8, %ecx
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leal	-8(%rcx), %edx
	movl	%edx, %edi
	shrl	$3, %edi
	incl	%edi
	movl	%edi, %esi
	andl	$7, %esi
	cmpl	$56, %edx
	jae	LBB0_6
## %bb.5:
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,1,1,1]
	movdqa	%xmm1, %xmm2
	jmp	LBB0_8
LBB0_1:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r10d
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	je	LBB0_23
	jmp	LBB0_2
LBB0_6:
	andl	$-8, %edi
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,1,1,1]
	movdqa	%xmm1, %xmm2
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	addl	$-8, %edi
	jne	LBB0_7
LBB0_8:
	testl	%esi, %esi
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	pmulld	%xmm0, %xmm1
	pmulld	%xmm0, %xmm2
	decl	%esi
	jne	LBB0_9
LBB0_10:
	pmulld	%xmm2, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	pmulld	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	pmulld	%xmm0, %xmm1
	movd	%xmm1, %r12d
	cmpl	%ecx, %r8d
	je	LBB0_14
## %bb.11:
	orl	$1, %ecx
LBB0_12:
	movl	%r13d, %edx
	subl	%ecx, %edx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	imull	%eax, %r12d
	decl	%edx
	jne	LBB0_13
LBB0_14:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r10d
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	jne	LBB0_2
## %bb.15:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%r8d, %eax
	cltd
	idivl	%r12d
	movl	(%r9), %edi
	cltd
	idivl	%edi
	movq	(%rbx), %rax
	movslq	%edx, %rcx
	leaq	(%rax,%rcx,8), %rbx
	cmpq	$0, (%rax,%rcx,8)
	jne	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r9, %r15
	callq	_vdbeMergeEngineNew
	testq	%rax, %rax
	je	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movq	%rbx, %rdx
	callq	_vdbeIncrMergerNew
	movl	%eax, %r10d
	jmp	LBB0_20
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	_SQLITE_NOMEM_BKPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	%r15, %r9
	movq	_SQLITE_OK@GOTPCREL(%rip), %rsi
LBB0_21:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	(%rsi), %r10d
	jne	LBB0_2
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	(%rbx), %rax
	movq	(%rax), %rbx
	movl	%r12d, %eax
	cltd
	idivl	(%r9)
	incl	%r14d
	movl	%eax, %r12d
	cmpl	%r13d, %r14d
	jl	LBB0_16
LBB0_23:
	movq	-56(%rbp), %rcx
	movq	(%rbx), %rbx
	movq	_SORTER_MAX_MERGE_COUNT@GOTPCREL(%rip), %rdi
	movl	%r8d, %eax
	cltd
	idivl	(%rdi)
	movslq	%edx, %rax
	movq	%rcx, (%rbx,%rax,8)
	jmp	LBB0_24
LBB0_2:
	movq	-56(%rbp), %rdi
	movl	%r10d, %ebx
	callq	_vdbeIncrFree
	movl	%ebx, %r10d
LBB0_24:
	movl	%r10d, %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
	.comm	_SORTER_MAX_MERGE_COUNT,4,2     ## @SORTER_MAX_MERGE_COUNT
	.comm	_SQLITE_NOMEM_BKPT,4,2          ## @SQLITE_NOMEM_BKPT
	.no_dead_strip	_vdbeSorterAddToTree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterAddToTree
_vdbeSorterAddToTree:                   ; @vdbeSorterAddToTree
	.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	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	add	x2, sp, #8
	mov	x1, x4
	bl	_vdbeIncrMergerNew
	mov	x20, x0
	subs	w9, w21, #1
	b.le	LBB0_3
; %bb.1:
Lloh0:
	adrp	x24, _SORTER_MAX_MERGE_COUNT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SORTER_MAX_MERGE_COUNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w9, #16
	b.hs	LBB0_4
; %bb.2:
	mov	w25, #1
	mov	w10, #1
	b	LBB0_7
LBB0_3:
Lloh2:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_17
	b	LBB0_18
LBB0_4:
	and	w11, w9, #0xfffffff0
	dup.4s	v1, w8
	orr	w10, w11, #0x1
	movi.4s	v0, #1
	mov	x12, x11
	movi.4s	v2, #1
	movi.4s	v3, #1
	movi.4s	v4, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mul.4s	v0, v1, v0
	mul.4s	v2, v1, v2
	mul.4s	v3, v1, v3
	mul.4s	v4, v1, v4
	subs	w12, w12, #16
	b.ne	LBB0_5
; %bb.6:
	mul.4s	v0, v2, v0
	mul.4s	v0, v3, v0
	mul.4s	v0, v4, v0
	ext.16b	v1, v0, v0, #8
	mul.2s	v0, v0, v1
	fmov	w12, s0
	mov.s	w13, v0[1]
	mul	w25, w12, w13
	cmp	w9, w11
	b.eq	LBB0_9
LBB0_7:
	sub	w9, w21, w10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mul	w25, w8, w25
	subs	w9, w9, #1
	b.ne	LBB0_8
LBB0_9:
Lloh5:
	adrp	x26, _SQLITE_OK@GOTPAGE
Lloh6:
	ldr	x26, [x26, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w20, w8
	b.ne	LBB0_18
; %bb.10:
	mov	w27, #1
Lloh7:
	adrp	x28, _SQLITE_NOMEM_BKPT@GOTPAGE
Lloh8:
	ldr	x28, [x28, _SQLITE_NOMEM_BKPT@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sdiv	w8, w19, w25
	ldr	w0, [x24]
	sdiv	w9, w8, w0
	msub	w8, w9, w0, w8
	ldr	x9, [x23]
	add	x23, x9, w8, sxtw #3
	ldr	x8, [x23]
	cbnz	x8, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	bl	_vdbeMergeEngineNew
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x1, x0
	mov	x0, x22
	mov	x2, x23
	bl	_vdbeIncrMergerNew
	mov	x20, x0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w20, [x28]
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x26]
	cmp	w20, w8
	b.ne	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x23]
	ldr	x23, [x8]
	ldr	w8, [x24]
	add	w27, w27, #1
	sdiv	w25, w25, w8
	cmp	w27, w21
	b.lt	LBB0_11
LBB0_17:
	ldr	x8, [sp, #8]
Lloh9:
	adrp	x9, _SORTER_MAX_MERGE_COUNT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SORTER_MAX_MERGE_COUNT@GOTPAGEOFF]
	ldr	x10, [x23]
Lloh11:
	ldr	w9, [x9]
	sdiv	w11, w19, w9
	msub	w9, w11, w9, w19
	str	x8, [x10, w9, sxtw #3]
	b	LBB0_19
LBB0_18:
	ldr	x0, [sp, #8]
	bl	_vdbeIncrFree
LBB0_19:
	mov	x0, x20
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SORTER_MAX_MERGE_COUNT,4,2     ; @SORTER_MAX_MERGE_COUNT
	.comm	_SQLITE_NOMEM_BKPT,4,2          ; @SQLITE_NOMEM_BKPT
	.no_dead_strip	_vdbeSorterAddToTree
.subsections_via_symbols
