	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeSorterIterInit
_vdbeSorterIterInit:                    ## @vdbeSorterIterInit
	.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	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r15
	movl	%edx, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %rax
	movl	(%rax), %edi
	callq	_sqlite3BtreeGetPageSize
	movl	%eax, %r14d
	xorl	%edi, %edi
	cmpl	%ebx, (%r13)
	setg	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 24(%r15)
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 16(%r15)
	sete	%dil
	callq	_assert
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %eax
	movq	%rbx, %r13
	movl	%eax, 32(%r15)
	movl	%r13d, (%r15)
	movl	$128, 4(%r15)
	movq	%r12, %rdi
	movl	$128, %esi
	callq	_sqlite3DbMallocRaw
	movq	%rax, 24(%r15)
	movl	%r14d, 8(%r15)
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_sqlite3DbMallocRaw
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rcx
	movl	%r13d, %eax
	cltd
	idivl	%r14d
	testl	%edx, %edx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_4
## %bb.3:
	subl	%edx, %r14d
	leal	(%r14,%r13), %r8d
	movl	(%r12), %esi
	movl	4(%r12), %edi
	movl	%esi, %eax
	subl	%r13d, %eax
	cmpl	%esi, %r8d
	cmovlel	%r14d, %eax
	movslq	%edx, %rdx
	leaq	(%rcx,%rdx,4), %rsi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_sqlite3OsRead
	movl	%eax, %ebx
	movq	_SQLITE_IOERR_SHORT_READ@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %ebx
	setne	%dil
	callq	_assert
LBB0_4:
	movq	_SQLITE_OK@GOTPCREL(%rip), %r14
	cmpl	(%r14), %ebx
	jne	LBB0_6
## %bb.5:
	movl	(%r12), %eax
	movl	%eax, 12(%r15)
	leaq	-48(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_vdbeSorterIterVarint
	movl	%eax, %ebx
	movl	-48(%rbp), %eax
	movl	(%r15), %ecx
	addl	%eax, %ecx
	movl	%ecx, 12(%r15)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, (%rcx)
LBB0_6:
	cmpl	(%r14), %ebx
	jne	LBB0_8
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_vdbeSorterIterNext
	movl	%eax, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_SQLITE_NOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SQLITE_OK@GOTPCREL(%rip), %r14
	cmpl	(%r14), %ebx
	je	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_NOMEM,4,2               ## @SQLITE_NOMEM
	.comm	_SQLITE_IOERR_SHORT_READ,4,2    ## @SQLITE_IOERR_SHORT_READ
	.no_dead_strip	_vdbeSorterIterInit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterIterInit
_vdbeSorterIterInit:                    ; @vdbeSorterIterInit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x4
	mov	x19, x3
	mov	x24, x2
	mov	x23, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x26, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SQLITE_OK@GOTPAGEOFF]
	ldr	w22, [x26]
	ldr	w0, [x8]
	bl	_sqlite3BtreeGetPageSize
	mov	x25, x0
	ldr	w8, [x23]
	cmp	w8, w24
	cset	w0, gt
	bl	_assert
	ldr	x8, [x19, #24]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	w8, [x23, #4]
	str	w8, [x19, #32]
	mov	w8, #128
	stp	w24, w8, [x19]
	mov	x0, x20
	mov	w1, #128
	bl	_sqlite3DbMallocRaw
	str	x0, [x19, #24]
	str	w25, [x19, #8]
	mov	x0, x20
	mov	x1, x25
	bl	_sqlite3DbMallocRaw
	str	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.1:
	sdiv	w8, w24, w25
	msub	w9, w8, w25, w24
	cbz	w9, LBB0_3
; %bb.2:
	sub	w10, w25, w9
	add	w11, w10, w24
	ldp	w12, w8, [x23]
	sub	w13, w12, w24
	cmp	w11, w12
	csel	w2, w13, w10, gt
	add	x1, x0, w9, sxtw #2
	mov	x0, x8
	mov	x3, x24
	bl	_sqlite3OsRead
	mov	x22, x0
Lloh2:
	adrp	x8, _SQLITE_IOERR_SHORT_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SQLITE_IOERR_SHORT_READ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	cset	w0, ne
	bl	_assert
LBB0_3:
	ldr	w8, [x26]
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [x23]
	str	w8, [x19, #12]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x19
	bl	_vdbeSorterIterVarint
	mov	x22, x0
	ldr	w8, [x19]
	ldr	w9, [sp, #12]
	add	w8, w9, w8
	str	w8, [x19, #12]
	ldr	w8, [x21]
	add	w8, w8, w9
	str	w8, [x21]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _SQLITE_NOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_NOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
LBB0_6:
	ldr	w8, [x26]
	cmp	w22, w8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_vdbeSorterIterNext
	mov	x22, x0
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_NOMEM,4,2               ; @SQLITE_NOMEM
	.comm	_SQLITE_IOERR_SHORT_READ,4,2    ; @SQLITE_IOERR_SHORT_READ
	.no_dead_strip	_vdbeSorterIterInit
.subsections_via_symbols
