	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function resolveOrderGroupBy
_resolveOrderGroupBy:                   ## @resolveOrderGroupBy
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.1:
	movq	%rsi, %r13
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdx)
	jle	LBB0_16
## %bb.2:
	movq	(%r13), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	8(%rdx), %r15
	xorl	%ebx, %ebx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	callq	_sqlite3ExprIsInteger
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %eax
	leal	-65536(%rax), %ecx
	cmpl	$-65536, %ecx                   ## imm = 0xFFFF0000
	jbe	LBB0_18
LBB0_5:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %r14
	movl	%eax, (%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rbx
	incl	%ebx
	addq	$16, %r15
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	cmpl	(%rdx), %ebx
	jge	LBB0_16
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_sqlite3ExprSkipCollate
	movq	%rax, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpb	$71, (%rax)
	je	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r13), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_resolveAsName
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	jg	LBB0_5
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	$0, (%r15)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_sqlite3ResolveExprNames
	testq	%rax, %rax
	jne	LBB0_19
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %r14
	movq	(%r13), %rax
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_resolveRemoveWindows
	incq	%rbx
	movl	%ebx, (%r15)
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	(%r13), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_6
LBB0_14:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	xorl	%edi, %edi
	movq	%r12, %rsi
	movl	$-1, %ecx
	callq	_sqlite3ExprCompare
	testq	%rax, %rax
	je	LBB0_12
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	incq	%rbx
	jmp	LBB0_13
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_sqlite3ResolveOrderGroupBy
	jmp	LBB0_20
LBB0_17:
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_18:
	incl	%ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	callq	_resolveOutOfRangeError
LBB0_19:
	movl	$1, %eax
LBB0_20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_resolveOrderGroupBy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function resolveOrderGroupBy
_resolveOrderGroupBy:                   ; @resolveOrderGroupBy
	.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
	cbz	x2, LBB0_17
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x23, x0
	ldr	x22, [x0]
	ldr	w8, [x2]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.2:
	mov	w27, #0
	ldr	x8, [x21]
	ldr	w24, [x8]
	ldr	x28, [x20, #8]
	b	LBB0_7
LBB0_3:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x1, sp, #12
	mov	x0, x26
	bl	_sqlite3ExprIsInteger
	cbz	x0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [sp, #12]
	sub	w8, w0, #16, lsl #12            ; =65536
	cmn	w8, #16, lsl #12                ; =65536
	b.ls	LBB0_18
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	str	w0, [x28]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w27, w27, #1
	add	x28, x28, #16
	ldr	w8, [x20]
	cmp	w27, w8
	b.ge	LBB0_16
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x25, [x28, #8]
	mov	x0, x25
	bl	_sqlite3ExprSkipCollate
	mov	x26, x0
	ldrb	w8, [x19]
	cmp	w8, #71
	b.eq	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x21]
	mov	x0, x22
	mov	x2, x26
	bl	_resolveAsName
	str	w0, [sp, #12]
	cmp	w0, #0
	b.gt	LBB0_5
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	str	wzr, [x28]
	mov	x0, x23
	mov	x1, x25
	bl	_sqlite3ResolveExprNames
	cbnz	x0, LBB0_19
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x21]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x26, #0
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=2
	mov	x0, x21
	mov	x1, x25
	bl	_resolveRemoveWindows
	add	x26, x26, #1
	str	w26, [x28]
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=2
	ldr	x8, [x21]
	ldrsw	x9, [x8]
	cmp	x26, x9
	b.ge	LBB0_6
LBB0_14:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x8, #8]
	ldr	w2, [x8, x26, lsl #2]
	mov	w0, #0
	mov	x1, x25
	mov	w3, #-1
	bl	_sqlite3ExprCompare
	cbz	x0, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x26, x26, #1
	b	LBB0_13
LBB0_16:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_sqlite3ResolveOrderGroupBy
	b	LBB0_20
LBB0_17:
	mov	w0, #0
	b	LBB0_20
LBB0_18:
	add	w2, w27, #1
	mov	x0, x22
	mov	x1, x19
	mov	x3, x24
	bl	_resolveOutOfRangeError
LBB0_19:
	mov	w0, #1
LBB0_20:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_resolveOrderGroupBy
.subsections_via_symbols
