	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeMergeEngineStep
_vdbeMergeEngineStep:                   ## @vdbeMergeEngineStep
	.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	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	24(%rdi), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movslq	4(%rax), %r14
	movq	%r14, %r13
	shlq	$4, %r13
	movq	16(%rdi), %rdi
	addq	%r13, %rdi
	callq	_vdbePmaReaderNext
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_15
## %bb.1:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)
	movl	8(%rbx), %r12d
	addl	%r14d, %r12d
	movq	16(%rbx), %rax
	cmpl	$1, %r12d
	movq	%rbx, %rsi
	jle	LBB0_2
## %bb.3:
	orq	$16, %r13
	addq	%rax, %r13
	andl	$65534, %r14d                   ## imm = 0xFFFE
	shlq	$4, %r14
	addq	%rax, %r14
	movl	%r12d, %r15d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%rsi), %rcx
	movq	16(%rsi), %rax
	movq	%r14, %rdx
	subq	%rax, %rdx
	shrq	$4, %rdx
	movl	%edx, (%rcx,%rbx,4)
	xorl	$1, %ebx
	movslq	%ebx, %rdx
	movslq	(%rcx,%rdx,4), %r13
	shlq	$4, %r13
	addq	%rax, %r13
	movl	$0, -44(%rbp)
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$3, %r12d
	movl	%r15d, %r12d
	jle	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	shrl	$31, %r15d
	addl	%r12d, %r15d
	sarl	%r15d
	cmpq	$0, (%r14)
	movslq	%r15d, %rbx
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, (%r13)
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r14), %ecx
	movl	12(%r14), %edx
	movl	8(%r13), %r9d
	movl	12(%r13), %r8d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	callq	*(%rdi)
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r13, %r14
	jb	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, (%r14)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$0, -44(%rbp)
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%rsi), %rcx
	movq	16(%rsi), %rax
	movq	%r13, %rdx
	subq	%rax, %rdx
	shrq	$4, %rdx
	movl	%edx, (%rcx,%rbx,4)
	xorl	$1, %ebx
	movslq	%ebx, %rdx
	movslq	(%rcx,%rdx,4), %r14
	shlq	$4, %r14
	addq	%rax, %r14
	jmp	LBB0_13
LBB0_2:
	movq	(%rsi), %rcx
LBB0_14:
	movslq	4(%rcx), %rcx
	shlq	$4, %rcx
	xorl	%edx, %edx
	cmpq	$0, (%rax,%rcx)
	sete	%dl
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %eax                 ## 4-byte Reload
LBB0_15:
	cmpl	%ecx, %eax
	jne	LBB0_17
## %bb.16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %eax
LBB0_17:
	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
	.no_dead_strip	_vdbeMergeEngineStep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeMergeEngineStep
_vdbeMergeEngineStep:                   ; @vdbeMergeEngineStep
	.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	x21, x1
	mov	x22, x0
	ldr	x8, [x0]
	ldrsw	x24, [x8, #4]
	ldp	x8, x19, [x0, #16]
	add	x0, x8, x24, lsl #4
	bl	_vdbePmaReaderNext
	mov	x20, x0
Lloh0:
	adrp	x23, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SQLITE_OK@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_15
; %bb.1:
	and	x9, x24, #0xffffffff
	str	wzr, [sp, #12]
	ldr	w8, [x22, #8]
	add	w24, w8, w9
	ldr	x8, [x22, #16]
	cmp	w24, #1
	b.le	LBB0_13
; %bb.2:
	orr	w10, w9, #0x1
	add	x25, x8, w10, sxtw #4
	and	x9, x9, #0xfffe
	add	x27, x8, x9, lsl #4
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22, #16]
	sub	x9, x27, x8
	lsr	x10, x9, #4
	ldr	x9, [x22]
	str	w10, [x9, w26, sxtw #2]
	sxtw	x10, w26
	eor	x10, x10, #0x1
	ldrsw	x10, [x9, x10, lsl #2]
	add	x25, x8, x10, lsl #4
	str	wzr, [sp, #12]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w24, #3
	mov	x24, x26
	b.le	LBB0_14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w24, #0
	cinc	w8, w24, lt
	asr	w26, w8, #1
	ldr	x8, [x27]
	cbz	x8, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x25]
	cbz	x8, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	ldp	w3, w2, [x27, #8]
	ldp	w5, w4, [x25, #8]
	add	x1, sp, #12
	mov	x0, x19
	blr	x8
	tbnz	w0, #31, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cbnz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x27, x25
	b.lo	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x27]
	cbz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [sp, #12]
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22, #16]
	sub	x9, x25, x8
	lsr	x10, x9, #4
	ldr	x9, [x22]
	mov	x11, x26
	sxtw	x11, w11
	str	w10, [x9, w26, sxtw #2]
	eor	x10, x11, #0x1
	ldrsw	x10, [x9, x10, lsl #2]
	add	x27, x8, x10, lsl #4
	b	LBB0_4
LBB0_13:
	ldr	x9, [x22]
LBB0_14:
	ldrsw	x9, [x9, #4]
	lsl	x9, x9, #4
	ldr	x8, [x8, x9]
	cmp	x8, #0
	cset	w8, eq
	str	w8, [x21]
	ldr	w8, [x23]
LBB0_15:
	cmp	w20, w8
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x19, #8]
	ldr	w20, [x8]
LBB0_17:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.no_dead_strip	_vdbeMergeEngineStep
.subsections_via_symbols
