	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function whereLoopOutputAdjust
_whereLoopOutputAdjust:                 ## @whereLoopOutputAdjust
	.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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	4(%rsi), %eax
	orl	(%rsi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_WHERE_AUTO_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	8(%rsi), %eax
	sete	%dil
	callq	_assert
	movl	(%rbx), %r14d
	testl	%r14d, %r14d
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	jle	LBB0_1
## %bb.2:
	notl	-44(%rbp)                       ## 4-byte Folded Spill
	movq	8(%rbx), %r12
	xorl	%r10d, %r10d
	movq	_TERM_VIRTUAL@GOTPCREL(%rip), %rdi
	movq	_WO_EQ@GOTPCREL(%rip), %r8
	movq	_WO_IS@GOTPCREL(%rip), %r13
	jmp	LBB0_3
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	addq	%rcx, %rax
	movq	%rax, 16(%r15)
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	leal	-1(%r14), %eax
	addq	$40, %r12
	cmpl	$1, %r14d
	movl	%eax, %r14d
	jle	LBB0_17
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	(%rdi), %eax
	testl	%eax, (%r12)
	jne	LBB0_17
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r12), %eax
	testl	%eax, 4(%r15)
	je	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	andl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r15), %rcx
	incq	%rax
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=2
	decq	%rax
	cmpq	$1, %rax
	jbe	LBB0_12
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-2(%rax), %edx
	movq	(%rcx,%rdx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	cmpq	%r12, %rdx
	je	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=2
	movq	8(%rdx), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	shlq	$3, %rdx
	addq	8(%rbx), %rdx
	cmpq	%r12, %rdx
	jne	LBB0_11
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r12), %rcx
	movq	16(%r15), %rax
	testq	%rcx, %rcx
	jle	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	decq	%rax
	movq	%rax, 16(%r15)
	movl	(%r13), %eax
	orl	(%r8), %eax
	testl	%eax, 24(%r12)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	32(%r12), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	movq	_TK_IS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	sete	%dil
	movl	%r10d, -56(%rbp)                ## 4-byte Spill
	callq	_testcase
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-48(%rbp), %rsi
	callq	_sqlite3ExprIsInteger
	movq	_WO_EQ@GOTPCREL(%rip), %r8
	movq	_TERM_VIRTUAL@GOTPCREL(%rip), %rdi
	movl	-56(%rbp), %r10d                ## 4-byte Reload
	movl	-48(%rbp), %ecx
	cmpl	$2, %ecx
	movl	$20, %edx
	movl	$10, %esi
	cmovll	%esi, %edx
	cmpl	$-1, %ecx
	movl	$20, %ecx
	cmovll	%ecx, %edx
	testq	%rax, %rax
	cmovel	%ecx, %edx
	movl	%edx, -48(%rbp)
	cmpl	%edx, %r10d
	cmovlel	%edx, %r10d
	jmp	LBB0_16
LBB0_1:
	xorl	%r10d, %r10d
LBB0_17:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	subl	%r10d, %eax
	cltq
	cmpq	%rax, 16(%r15)
	jle	LBB0_19
## %bb.18:
	movq	%rax, 16(%r15)
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WHERE_AUTO_INDEX,4,2           ## @WHERE_AUTO_INDEX
	.comm	_TERM_VIRTUAL,4,2               ## @TERM_VIRTUAL
	.comm	_WO_EQ,4,2                      ## @WO_EQ
	.comm	_WO_IS,4,2                      ## @WO_IS
	.comm	_TK_IS,8,3                      ## @TK_IS
	.no_dead_strip	_whereLoopOutputAdjust
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function whereLoopOutputAdjust
_whereLoopOutputAdjust:                 ; @whereLoopOutputAdjust
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldp	w22, w25, [x1]
	ldr	w8, [x1, #8]
Lloh0:
	adrp	x9, _WHERE_AUTO_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WHERE_AUTO_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	ldr	w24, [x21]
	cmp	w24, #1
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	mov	w27, #0
	b.lt	LBB0_15
; %bb.1:
	orr	w8, w25, w22
	mvn	w22, w8
	ldr	x26, [x21, #8]
Lloh3:
	adrp	x25, _TERM_VIRTUAL@GOTPAGE
Lloh4:
	ldr	x25, [x25, _TERM_VIRTUAL@GOTPAGEOFF]
Lloh5:
	adrp	x20, _WO_EQ@GOTPAGE
Lloh6:
	ldr	x20, [x20, _WO_EQ@GOTPAGEOFF]
Lloh7:
	adrp	x23, _WO_IS@GOTPAGE
Lloh8:
	ldr	x23, [x23, _WO_IS@GOTPAGEOFF]
	mov	w28, #40
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, x9
	str	x8, [x19, #16]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #40
	subs	w24, w24, #1
	b.le	LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w8, [x26]
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_15
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26, #4]
	ldr	w9, [x19, #4]
	and	w9, w9, w8
	and	w8, w8, w22
	cmp	w9, #0
	ccmp	w8, #0, #0, ne
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x19, #12]
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	add	x9, x9, #1
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	sub	x9, x9, #1
	cmp	x9, #1
	b.ls	LBB0_12
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w10, w9, #2
	ldr	x10, [x8, w10, uxtw #3]
	cbz	x10, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	cmp	x10, x26
	b.eq	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x10, [x10, #8]
	ldr	x11, [x21, #8]
	madd	x10, x10, x28, x11
	cmp	x10, x26
	b.ne	LBB0_8
	b	LBB0_3
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x26, #16]
	ldr	x8, [x19, #16]
	cmp	x9, #0
	b.le	LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	sub	x8, x8, #1
	str	x8, [x19, #16]
	ldr	w8, [x26, #24]
	ldr	w9, [x20]
	ldr	w10, [x23]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x26, #32]
	ldp	x8, x9, [x8]
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
Lloh9:
	adrp	x9, _TK_IS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TK_IS@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_testcase
	add	x1, sp, #28
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_sqlite3ExprIsInteger
	ldr	w8, [sp, #28]
	cmp	w8, #2
	mov	w9, #-2
	ccmp	w8, w9, #4, lt
	ccmp	x0, #0, #4, gt
	mov	w8, #20
	mov	w9, #10
	csel	w8, w9, w8, ne
	str	w8, [sp, #28]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	b	LBB0_3
LBB0_15:
	ldr	x9, [x19, #16]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	sub	w8, w8, w27
	sxtw	x8, w8
	cmp	x9, x8
	b.le	LBB0_17
; %bb.16:
	str	x8, [x19, #16]
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WHERE_AUTO_INDEX,4,2           ; @WHERE_AUTO_INDEX
	.comm	_TERM_VIRTUAL,4,2               ; @TERM_VIRTUAL
	.comm	_WO_EQ,4,2                      ; @WO_EQ
	.comm	_WO_IS,4,2                      ; @WO_IS
	.comm	_TK_IS,8,3                      ; @TK_IS
	.no_dead_strip	_whereLoopOutputAdjust
.subsections_via_symbols
