	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function resolveSelectStep
_resolveSelectStep:                     ## @resolveSelectStep
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%edi, %edi
	testq	%rsi, %rsi
	setne	%dil
	callq	_assert
	movl	(%r14), %eax
	movq	_SF_Resolved@GOTPCREL(%rip), %r12
	movq	_WRC_Prune@GOTPCREL(%rip), %r15
	testl	%eax, (%r12)
	jne	LBB0_1
## %bb.2:
	movq	(%rbx), %r15
	movq	8(%rbx), %rdx
	movq	16(%r15), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_SF_Expanded@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_46
## %bb.3:
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	leaq	-128(%rbp), %r13
	movq	_WRC_Abort@GOTPCREL(%rip), %r15
	movq	%r14, %rbx
	movq	%r14, -136(%rbp)                ## 8-byte Spill
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##       Child Loop BB0_13 Depth 3
                                        ##       Child Loop BB0_20 Depth 3
                                        ##     Child Loop BB0_24 Depth 2
                                        ##     Child Loop BB0_41 Depth 2
	xorl	%edi, %edi
	testl	%eax, %ecx
	setne	%dil
	callq	_assert
	movl	(%r12), %eax
	xorl	%edi, %edi
	andl	(%rbx), %eax
	sete	%dil
	callq	_assert
	movl	(%r12), %eax
	orl	%eax, (%rbx)
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -88(%rbp)
	movq	72(%rbx), %rsi
	movq	%r13, %rdi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_1
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	64(%rbx), %rsi
	movq	%r13, %rdi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_1
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	56(%rbx), %rax
	cmpl	$0, (%rax)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_21
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r13d, %r13d
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_10 Depth=2
	cmpl	$0, 8(%r12,%r14,8)
	sete	%al
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	setle	%cl
	setne	%bl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movl	%ebx, 8(%r12,%r14,8)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	56(%rbx), %rax
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=2
	incq	%r13
	movslq	(%rax), %rcx
	cmpq	%rcx, %r13
	jge	LBB0_22
LBB0_10:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_13 Depth 3
                                        ##       Child Loop BB0_20 Depth 3
	movq	8(%rax), %r12
	leaq	(,%r13,2), %r14
	addq	%r13, %r14
	movq	16(%r12,%r14,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	xorl	%r15d, %r15d
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%rdx, %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	addl	32(%rax), %r15d
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_13
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	(%rdi), %rbx
	movq	(%r12,%r14,8), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%rax, (%rdi)
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=2
	callq	_sqlite3ResolveSelectNames
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	cmpq	$0, 8(%rax)
	jne	LBB0_47
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_47
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_8
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_10 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	subl	32(%rax), %r15d
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_20
	jmp	LBB0_8
LBB0_21:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
LBB0_22:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_NC_AllowAgg@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -128(%rbp)
	movq	%rax, -104(%rbp)
	movq	%rdx, -120(%rbp)
	movq	40(%rbx), %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	cmpl	$0, (%r14)
	movq	_WRC_Abort@GOTPCREL(%rip), %r15
	leaq	-128(%rbp), %r13
	jle	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r14), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r13, %rdi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_1
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_24
LBB0_26:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_SF_Aggregate@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	xorl	%edi, %edi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	andl	(%r14), %eax
	sete	%dil
	callq	_assert
	movq	48(%r14), %r12
	testq	%r12, %r12
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	-128(%rbp), %eax
	movq	_NC_HasAgg@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_45
LBB0_28:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %eax
	orl	%eax, (%r14)
LBB0_29:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_NC_AsMaybe@GOTPCREL(%rip), %rcx
	movq	32(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_4 Depth=1
	testq	%r12, %r12
	je	LBB0_55
LBB0_31:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	40(%rbx), %rax
	movq	%rax, -112(%rbp)
	movq	%rcx, %r14
	movl	(%rcx), %eax
	orl	%eax, -128(%rbp)
	movq	%r13, %rdi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_1
## %bb.32:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	24(%rbx), %rsi
	movq	%r13, %rdi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_1
## %bb.33:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %eax
	notl	%eax
	andl	-128(%rbp), %eax
	movq	_NC_AllowAgg@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	$0, -120(%rbp)
	movl	%eax, -128(%rbp)
	cmpq	$0, -80(%rbp)                   ## 8-byte Folded Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_35
## %bb.34:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%rsi), %rdx
	movq	%r13, %rdi
	leaq	L_.str.1(%rip), %rcx
	callq	_resolveOrderGroupBy
	testq	%rax, %rax
	jne	LBB0_1
LBB0_35:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_1
## %bb.36:                              ##   in Loop: Header=BB0_4 Depth=1
	testq	%r12, %r12
	je	LBB0_43
## %bb.37:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	leaq	L_.str.2(%rip), %rcx
	callq	_resolveOrderGroupBy
	testq	%rax, %rax
	jne	LBB0_1
## %bb.38:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_1
## %bb.39:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, (%r12)
	jle	LBB0_43
## %bb.40:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r12), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_41:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14,%rbx,8), %rdi
	movq	_EP_Agg@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ExprHasProperty
	testq	%rax, %rax
	jne	LBB0_53
## %bb.42:                              ##   in Loop: Header=BB0_41 Depth=2
	incq	%rbx
	cmpl	(%r12), %ebx
	jl	LBB0_41
LBB0_43:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_56
## %bb.44:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %eax
	movq	_SF_Expanded@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_SF_Resolved@GOTPCREL(%rip), %r12
	jmp	LBB0_4
LBB0_45:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_NC_AllowAgg@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, -128(%rbp)
	jmp	LBB0_29
LBB0_46:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_sqlite3SelectPrep
	cmpq	$0, 8(%r15)
	jne	LBB0_47
## %bb.49:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_47
LBB0_50:
	movq	_WRC_Prune@GOTPCREL(%rip), %r15
	jmp	LBB0_1
LBB0_47:
	movq	_WRC_Abort@GOTPCREL(%rip), %r15
LBB0_1:
	movl	(%r15), %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_53:
	leaq	L_.str.3(%rip), %rsi
LBB0_54:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sqlite3ErrorMsg
	jmp	LBB0_1
LBB0_55:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_54
LBB0_56:
	cmpq	$0, -80(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_50
## %bb.57:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-136(%rbp), %rsi                ## 8-byte Reload
	callq	_resolveCompoundOrderBy
	testq	%rax, %rax
	jne	LBB0_1
	jmp	LBB0_50
	.cfi_endproc
                                        ## -- End function
	.comm	_SF_Resolved,4,2                ## @SF_Resolved
	.comm	_WRC_Prune,4,2                  ## @WRC_Prune
	.comm	_SF_Expanded,4,2                ## @SF_Expanded
	.comm	_WRC_Abort,4,2                  ## @WRC_Abort
	.comm	_NC_AllowAgg,4,2                ## @NC_AllowAgg
	.comm	_SF_Aggregate,4,2               ## @SF_Aggregate
	.comm	_NC_HasAgg,4,2                  ## @NC_HasAgg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"a GROUP BY clause is required before HAVING"

	.comm	_NC_AsMaybe,4,2                 ## @NC_AsMaybe
L_.str.1:                               ## @.str.1
	.asciz	"ORDER"

L_.str.2:                               ## @.str.2
	.asciz	"GROUP"

	.comm	_EP_Agg,4,2                     ## @EP_Agg
L_.str.3:                               ## @.str.3
	.asciz	"aggregate functions are not allowed in the GROUP BY clause"

	.no_dead_strip	_resolveSelectStep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function resolveSelectStep
_resolveSelectStep:                     ; @resolveSelectStep
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, x1
	mov	x20, x0
	cmp	x1, #0
	cset	w0, ne
	bl	_assert
Lloh0:
	adrp	x25, _SF_Resolved@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SF_Resolved@GOTPAGEOFF]
	ldr	w8, [x19]
	ldr	w9, [x25]
Lloh2:
	adrp	x22, _WRC_Prune@GOTPAGE
Lloh3:
	ldr	x22, [x22, _WRC_Prune@GOTPAGEOFF]
	mov	x10, x22
	tst	w9, w8
	b.ne	LBB0_48
; %bb.1:
	ldp	x20, x21, [x20]
	ldr	x27, [x20, #16]
Lloh4:
	adrp	x9, _SF_Expanded@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SF_Expanded@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_43
; %bb.2:
	ldr	x10, [x19, #8]
	str	x10, [sp, #8]                   ; 8-byte Folded Spill
	mov	w23, #24
	mov	x24, x19
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_19 Depth 3
                                        ;     Child Loop BB0_22 Depth 2
                                        ;     Child Loop BB0_38 Depth 2
	tst	w9, w8
	cset	w0, ne
	bl	_assert
	ldr	w8, [x24]
	ldr	w9, [x25]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	ldr	w8, [x25]
	ldr	w9, [x24]
	orr	w8, w9, w8
	str	w8, [x24]
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	str	x20, [sp, #56]
	ldr	x1, [x24, #72]
	add	x0, sp, #16
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_47
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [x24, #64]
	add	x0, sp, #16
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_47
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #56]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_20
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, #0
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	madd	x22, x25, x23, x22
	ldr	w8, [x22, #8]
	cmp	w8, #0
	ccmp	w28, #1, #0, eq
	cset	w0, lt
	bl	_assert
	cmp	w28, #0
	cset	w8, ne
	str	w8, [x22, #8]
	ldr	x8, [x24, #56]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x25, x25, #1
	ldrsw	x9, [x8]
	cmp	x25, x9
	b.ge	LBB0_20
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
                                        ;       Child Loop BB0_19 Depth 3
	ldr	x22, [x8, #8]
	madd	x9, x25, x23, x22
	ldr	x1, [x9, #16]
	cbz	x1, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	w28, #0
	cbz	x21, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x8, x21
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w9, [x8, #32]
	add	w28, w28, w9
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_12
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=2
	ldr	x26, [x20]
	mul	x8, x25, x23
	ldr	x8, [x22, x8]
	cbz	x8, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=2
	str	x8, [x20]
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=2
	mov	x0, x20
	mov	x2, x21
	bl	_sqlite3ResolveSelectNames
	str	x26, [x20]
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_47
; %bb.16:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [x27]
	cbnz	x8, LBB0_47
; %bb.17:                               ;   in Loop: Header=BB0_9 Depth=2
	cbz	x21, LBB0_7
; %bb.18:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x8, x21
LBB0_19:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w9, [x8, #32]
	sub	w28, w28, w9
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_19
	b	LBB0_7
LBB0_20:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh7:
	adrp	x9, _NC_AllowAgg@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NC_AllowAgg@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	str	w9, [sp, #16]
	str	x8, [sp, #40]
	str	x21, [sp, #24]
	ldr	x22, [x24, #40]
	cmp	x22, #0
	cset	w0, ne
	bl	_assert
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.21:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, #0
LBB0_22:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #8]
	ldr	x1, [x8, x25, lsl #3]
	add	x0, sp, #16
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_47
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=2
	add	x25, x25, #1
	ldrsw	x8, [x22]
	cmp	x25, x8
	b.lt	LBB0_22
LBB0_24:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
Lloh10:
	adrp	x22, _SF_Aggregate@GOTPAGE
Lloh11:
	ldr	x22, [x22, _SF_Aggregate@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	ldr	x25, [x24, #48]
	cbnz	x25, LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #16]
Lloh12:
	adrp	x9, _NC_HasAgg@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NC_HasAgg@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_42
LBB0_26:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x24]
	orr	w8, w9, w8
	str	w8, [x24]
	ldr	x1, [x24, #32]
	cbz	x1, LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x25, LBB0_49
LBB0_28:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24, #40]
	str	x8, [sp, #32]
Lloh15:
	adrp	x8, _NC_AsMaybe@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NC_AsMaybe@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [sp, #16]
	orr	w8, w9, w8
	str	w8, [sp, #16]
	add	x0, sp, #16
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_47
; %bb.29:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [x24, #24]
	add	x0, sp, #16
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_47
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh18:
	adrp	x8, _NC_AsMaybe@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NC_AsMaybe@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [sp, #16]
	bic	w8, w9, w8
	str	xzr, [sp, #24]
Lloh21:
	adrp	x9, _NC_AllowAgg@GOTPAGE
Lloh22:
	ldr	x9, [x9, _NC_AllowAgg@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #16]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cbnz	x8, LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x2, [x24, #16]
	add	x0, sp, #16
	mov	x1, x24
Lloh24:
	adrp	x3, l_.str.1@PAGE
Lloh25:
	add	x3, x3, l_.str.1@PAGEOFF
	bl	_resolveOrderGroupBy
	cbnz	x0, LBB0_47
LBB0_32:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27]
	cbnz	x8, LBB0_47
; %bb.33:                               ;   in Loop: Header=BB0_3 Depth=1
	cbz	x25, LBB0_40
; %bb.34:                               ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #16
	mov	x1, x24
	mov	x2, x25
Lloh26:
	adrp	x3, l_.str.2@PAGE
Lloh27:
	add	x3, x3, l_.str.2@PAGEOFF
	bl	_resolveOrderGroupBy
	cbnz	x0, LBB0_47
; %bb.35:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27]
	cbnz	x8, LBB0_47
; %bb.36:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_40
; %bb.37:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, #0
	ldr	x28, [x25, #8]
LBB0_38:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x28, x22, lsl #3]
Lloh28:
	adrp	x8, _EP_Agg@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EP_Agg@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_ExprHasProperty
	cbnz	x0, LBB0_45
; %bb.39:                               ;   in Loop: Header=BB0_38 Depth=2
	ldr	w8, [x25]
	add	x22, x22, #1
	cmp	w22, w8
	b.lt	LBB0_38
LBB0_40:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x24, [x24, #8]
	cbz	x24, LBB0_50
; %bb.41:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
Lloh31:
	adrp	x9, _SF_Expanded@GOTPAGE
Lloh32:
	ldr	x9, [x9, _SF_Expanded@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
Lloh34:
	adrp	x25, _SF_Resolved@GOTPAGE
Lloh35:
	ldr	x25, [x25, _SF_Resolved@GOTPAGEOFF]
	b	LBB0_3
LBB0_42:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh36:
	adrp	x9, _NC_AllowAgg@GOTPAGE
Lloh37:
	ldr	x9, [x9, _NC_AllowAgg@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [sp, #16]
	ldr	x1, [x24, #32]
	cbnz	x1, LBB0_27
	b	LBB0_28
LBB0_43:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_sqlite3SelectPrep
	ldr	x8, [x20, #8]
Lloh39:
	adrp	x10, _WRC_Abort@GOTPAGE
Lloh40:
	ldr	x10, [x10, _WRC_Abort@GOTPAGEOFF]
	cbnz	x8, LBB0_48
; %bb.44:
	ldr	x8, [x27]
	cmp	x8, #0
	csel	x10, x22, x10, eq
	b	LBB0_48
LBB0_45:
Lloh41:
	adrp	x1, l_.str.3@PAGE
Lloh42:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_46:
	mov	x0, x20
	bl	_sqlite3ErrorMsg
LBB0_47:
Lloh43:
	adrp	x10, _WRC_Abort@GOTPAGE
Lloh44:
	ldr	x10, [x10, _WRC_Abort@GOTPAGEOFF]
LBB0_48:
	ldr	w0, [x10]
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_49:
Lloh45:
	adrp	x1, l_.str@PAGE
Lloh46:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_46
LBB0_50:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x8, LBB0_52
; %bb.51:
	mov	x0, x20
	mov	x1, x19
	bl	_resolveCompoundOrderBy
	cbnz	x0, LBB0_47
LBB0_52:
Lloh47:
	adrp	x10, _WRC_Prune@GOTPAGE
Lloh48:
	ldr	x10, [x10, _WRC_Prune@GOTPAGEOFF]
	b	LBB0_48
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_SF_Resolved,4,2                ; @SF_Resolved
	.comm	_WRC_Prune,4,2                  ; @WRC_Prune
	.comm	_SF_Expanded,4,2                ; @SF_Expanded
	.comm	_WRC_Abort,4,2                  ; @WRC_Abort
	.comm	_NC_AllowAgg,4,2                ; @NC_AllowAgg
	.comm	_SF_Aggregate,4,2               ; @SF_Aggregate
	.comm	_NC_HasAgg,4,2                  ; @NC_HasAgg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"a GROUP BY clause is required before HAVING"

	.comm	_NC_AsMaybe,4,2                 ; @NC_AsMaybe
l_.str.1:                               ; @.str.1
	.asciz	"ORDER"

l_.str.2:                               ; @.str.2
	.asciz	"GROUP"

	.comm	_EP_Agg,4,2                     ; @EP_Agg
l_.str.3:                               ; @.str.3
	.asciz	"aggregate functions are not allowed in the GROUP BY clause"

	.no_dead_strip	_resolveSelectStep
.subsections_via_symbols
