	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sqlite3_aggregate_context      ## -- Begin function sqlite3_aggregate_context
	.p2align	4, 0x90
_sqlite3_aggregate_context:             ## @sqlite3_aggregate_context
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	setne	%dil
LBB0_3:
	callq	_assert
	movq	16(%r15), %rax
	movl	(%rax), %edi
	callq	_sqlite3_mutex_held
	movl	%eax, %edi
	callq	_assert
	movq	8(%r15), %rbx
	movl	%r14d, %edi
	shrl	$31, %edi
	callq	_testcase
	movq	_MEM_Agg@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
LBB0_8:
	movq	8(%rbx), %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	testl	%r14d, %r14d
	jle	LBB0_5
## %bb.6:
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_sqlite3VdbeMemGrow
	movl	(%r12), %eax
	movl	%eax, (%rbx)
	movq	(%r15), %rax
	movq	%rax, 16(%rbx)
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
	jmp	LBB0_8
LBB0_5:
	callq	_sqlite3VdbeMemReleaseExternal
	movq	_MEM_Null@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	$0, 8(%rbx)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MEM_Agg,4,2                    ## @MEM_Agg
	.comm	_MEM_Null,4,2                   ## @MEM_Null
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sqlite3_aggregate_context      ; -- Begin function sqlite3_aggregate_context
	.p2align	2
_sqlite3_aggregate_context:             ; @sqlite3_aggregate_context
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, ne
	b	LBB0_4
LBB0_3:
	mov	w0, #0
LBB0_4:
	bl	_assert
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	bl	_sqlite3_mutex_held
	bl	_assert
	ldr	x21, [x20, #8]
	lsr	w0, w19, #31
	bl	_testcase
	ldr	w8, [x21]
Lloh0:
	adrp	x22, _MEM_Agg@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MEM_Agg@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_6
LBB0_5:
	ldr	x0, [x21, #8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x21
	cmp	w19, #0
	b.le	LBB0_9
; %bb.7:
	mov	x1, x19
	mov	w2, #0
	bl	_sqlite3VdbeMemGrow
	ldr	w8, [x22]
	str	w8, [x21]
	ldr	x8, [x20]
	str	x8, [x21, #16]
	ldr	x0, [x21, #8]
	cbz	x0, LBB0_5
; %bb.8:
	mov	w1, #0
	mov	x2, x19
	bl	_memset
	b	LBB0_5
LBB0_9:
	bl	_sqlite3VdbeMemReleaseExternal
Lloh2:
	adrp	x8, _MEM_Null@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MEM_Null@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x21]
	str	xzr, [x21, #8]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MEM_Agg,4,2                    ; @MEM_Agg
	.comm	_MEM_Null,4,2                   ; @MEM_Null
.subsections_via_symbols
