	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pager_end_transaction
_pager_end_transaction:                 ## @pager_end_transaction
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	_SQLITE_OK@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	callq	_assert_pager_state
	movl	%eax, %edi
	callq	_assert
	movq	(%rbx), %rax
	movq	_PAGER_ERROR@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_assert
	movq	(%rbx), %rax
	movq	_PAGER_WRITER_LOCKED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
## %bb.1:
	movq	8(%rbx), %rax
	movq	_RESERVED_LOCK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
## %bb.2:
	movl	(%r15), %r14d
	jmp	LBB0_33
LBB0_3:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_releaseAllSavepoints
	movl	112(%rbx), %edi
	callq	_isOpen
	movl	$1, %edi
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	cmpq	$0, 16(%rbx)
	sete	%dil
LBB0_5:
	callq	_assert
	movl	112(%rbx), %edi
	callq	_isOpen
	movl	%r14d, %r12d
	testq	%rax, %rax
	je	LBB0_22
## %bb.6:
	movq	%rbx, %rdi
	callq	_pagerUseWal
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movl	112(%rbx), %edi
	callq	_sqlite3IsMemJournal
	movq	24(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_PAGER_JOURNALMODE_MEMORY@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %rcx
	sete	%dil
	callq	_assert
	movl	112(%rbx), %edi
	callq	_sqlite3OsClose
	movl	%r14d, %r12d
	jmp	LBB0_22
LBB0_8:
	movq	_PAGER_JOURNALMODE_TRUNCATE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_12
## %bb.9:
	cmpq	$0, 32(%rbx)
	je	LBB0_10
## %bb.11:
	movl	112(%rbx), %edi
	xorl	%esi, %esi
	callq	_sqlite3OsTruncate
	jmp	LBB0_16
LBB0_12:
	movq	_PAGER_JOURNALMODE_PERSIST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	je	LBB0_15
## %bb.13:
	cmpq	$0, 80(%rbx)
	movq	_PAGER_JOURNALMODE_WAL@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	je	LBB0_17
## %bb.14:
	cmpq	%rax, %rcx
	je	LBB0_17
LBB0_15:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_zeroJournalHdr
LBB0_16:
	movl	%eax, %r12d
	movq	$0, 32(%rbx)
	jmp	LBB0_22
LBB0_10:
	movl	(%r15), %r12d
	movq	$0, 32(%rbx)
	jmp	LBB0_22
LBB0_17:
	cmpl	$0, 116(%rbx)
	je	LBB0_19
## %bb.18:
	xorl	%r13d, %r13d
	jmp	LBB0_20
LBB0_19:
	movl	112(%rbx), %edi
	callq	_sqlite3JournalExists
	testq	%rax, %rax
	setne	%r13b
	movq	24(%rbx), %rcx
	movq	(%r12), %rax
LBB0_20:
	movq	_PAGER_JOURNALMODE_DELETE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	sete	%dil
	movq	_PAGER_JOURNALMODE_MEMORY@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	sete	%dl
	orb	%dil, %dl
	cmpq	%rax, %rcx
	sete	%al
	orb	%dl, %al
	movzbl	%al, %edi
	callq	_assert
	movl	112(%rbx), %edi
	callq	_sqlite3OsClose
	movl	%r14d, %r12d
	testb	%r13b, %r13b
	je	LBB0_22
## %bb.21:
	movl	104(%rbx), %esi
	movl	108(%rbx), %edi
	xorl	%edx, %edx
	callq	_sqlite3OsDelete
	movl	%eax, %r12d
LBB0_22:
	movq	16(%rbx), %rdi
	callq	_sqlite3BitvecDestroy
	movq	$0, 16(%rbx)
	movq	$0, 96(%rbx)
	movl	88(%rbx), %edi
	callq	_sqlite3PcacheCleanAll
	movl	88(%rbx), %edi
	movq	40(%rbx), %rsi
	callq	_sqlite3PcacheTruncate
	movq	%rbx, %rdi
	callq	_pagerUseWal
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movl	72(%rbx), %edi
	callq	_sqlite3WalEndWriteTransaction
	movl	%eax, %r14d
	xorl	%edi, %edi
	cmpl	(%r15), %eax
	sete	%dil
	callq	_assert
LBB0_28:
	cmpq	$0, 80(%rbx)
	jne	LBB0_32
## %bb.29:
	movq	%rbx, %rdi
	callq	_pagerUseWal
	testq	%rax, %rax
	je	LBB0_31
## %bb.30:
	movl	72(%rbx), %edi
	xorl	%esi, %esi
	callq	_sqlite3WalExclusiveMode
	testq	%rax, %rax
	je	LBB0_32
LBB0_31:
	movq	_SHARED_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pagerUnlockDb
	movl	%eax, %r14d
	movq	$0, 64(%rbx)
LBB0_32:
	movq	_PAGER_READER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	$0, 56(%rbx)
	cmpl	(%r15), %r12d
	cmovnel	%r12d, %r14d
LBB0_33:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_28
## %bb.25:
	cmpl	(%r15), %r12d
	jne	LBB0_28
## %bb.26:
	movq	48(%rbx), %rax
	cmpq	40(%rbx), %rax
	jle	LBB0_28
## %bb.27:
	movq	8(%rbx), %rax
	movq	_EXCLUSIVE_LOCK@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	movq	40(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_pager_truncate
	movl	%eax, %r12d
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_PAGER_ERROR,8,3                ## @PAGER_ERROR
	.comm	_PAGER_WRITER_LOCKED,8,3        ## @PAGER_WRITER_LOCKED
	.comm	_RESERVED_LOCK,8,3              ## @RESERVED_LOCK
	.comm	_PAGER_JOURNALMODE_MEMORY,8,3   ## @PAGER_JOURNALMODE_MEMORY
	.comm	_PAGER_JOURNALMODE_TRUNCATE,8,3 ## @PAGER_JOURNALMODE_TRUNCATE
	.comm	_PAGER_JOURNALMODE_PERSIST,8,3  ## @PAGER_JOURNALMODE_PERSIST
	.comm	_PAGER_JOURNALMODE_WAL,8,3      ## @PAGER_JOURNALMODE_WAL
	.comm	_PAGER_JOURNALMODE_DELETE,8,3   ## @PAGER_JOURNALMODE_DELETE
	.comm	_EXCLUSIVE_LOCK,8,3             ## @EXCLUSIVE_LOCK
	.comm	_SHARED_LOCK,4,2                ## @SHARED_LOCK
	.comm	_PAGER_READER,8,3               ## @PAGER_READER
	.comm	_pager_set_pagehash,4,2         ## @pager_set_pagehash
	.no_dead_strip	_pager_end_transaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pager_end_transaction
_pager_end_transaction:                 ; @pager_end_transaction
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SQLITE_OK@GOTPAGEOFF]
	ldr	w20, [x24]
	bl	_assert_pager_state
	bl	_assert
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _PAGER_ERROR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PAGER_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _PAGER_WRITER_LOCKED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PAGER_WRITER_LOCKED@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _RESERVED_LOCK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RESERVED_LOCK@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.2:
	ldr	w0, [x24]
	b	LBB0_30
LBB0_3:
	mov	x0, x19
	bl	_releaseAllSavepoints
	ldr	w0, [x19, #112]
	bl	_isOpen
	cbz	x0, LBB0_5
; %bb.4:
	mov	w0, #1
	b	LBB0_6
LBB0_5:
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w0, eq
LBB0_6:
	bl	_assert
	ldr	w0, [x19, #112]
	bl	_isOpen
	mov	x22, x20
	cbz	x0, LBB0_23
; %bb.7:
	mov	x0, x19
	bl	_pagerUseWal
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
	ldr	w0, [x19, #112]
	bl	_sqlite3IsMemJournal
	ldr	x8, [x19, #24]
	cbz	x0, LBB0_9
; %bb.8:
Lloh11:
	adrp	x9, _PAGER_JOURNALMODE_MEMORY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PAGER_JOURNALMODE_MEMORY@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	w0, [x19, #112]
	bl	_sqlite3OsClose
	mov	x22, x20
	b	LBB0_23
LBB0_9:
Lloh14:
	adrp	x9, _PAGER_JOURNALMODE_TRUNCATE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PAGER_JOURNALMODE_TRUNCATE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_17
; %bb.11:
	ldr	w0, [x19, #112]
	mov	w1, #0
	bl	_sqlite3OsTruncate
	b	LBB0_16
LBB0_12:
Lloh17:
	adrp	x9, _PAGER_JOURNALMODE_PERSIST@GOTPAGE
Lloh18:
	ldr	x9, [x9, _PAGER_JOURNALMODE_PERSIST@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_15
; %bb.13:
	ldr	x10, [x19, #80]
Lloh20:
	adrp	x22, _PAGER_JOURNALMODE_WAL@GOTPAGE
Lloh21:
	ldr	x22, [x22, _PAGER_JOURNALMODE_WAL@GOTPAGEOFF]
	ldr	x9, [x22]
	cbz	x10, LBB0_18
; %bb.14:
	cmp	x8, x9
	b.eq	LBB0_18
LBB0_15:
	mov	x0, x19
	mov	x1, x23
	bl	_zeroJournalHdr
LBB0_16:
	mov	x22, x0
	str	xzr, [x19, #32]
	b	LBB0_23
LBB0_17:
	ldr	w22, [x24]
	str	xzr, [x19, #32]
	b	LBB0_23
LBB0_18:
	ldr	w10, [x19, #116]
	cbz	w10, LBB0_20
; %bb.19:
	mov	w23, #0
	b	LBB0_21
LBB0_20:
	ldr	w0, [x19, #112]
	bl	_sqlite3JournalExists
	cmp	x0, #0
	cset	w23, ne
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
LBB0_21:
Lloh22:
	adrp	x10, _PAGER_JOURNALMODE_DELETE@GOTPAGE
Lloh23:
	ldr	x10, [x10, _PAGER_JOURNALMODE_DELETE@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	cmp	x8, x10
Lloh25:
	adrp	x10, _PAGER_JOURNALMODE_MEMORY@GOTPAGE
Lloh26:
	ldr	x10, [x10, _PAGER_JOURNALMODE_MEMORY@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x10]
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
	cset	w0, eq
	bl	_assert
	ldr	w0, [x19, #112]
	bl	_sqlite3OsClose
	mov	x22, x20
	cbz	w23, LBB0_23
; %bb.22:
	ldp	w1, w0, [x19, #104]
	mov	w2, #0
	bl	_sqlite3OsDelete
	mov	x22, x0
LBB0_23:
	ldr	x0, [x19, #16]
	bl	_sqlite3BitvecDestroy
	str	xzr, [x19, #16]
	str	xzr, [x19, #96]
	ldr	w0, [x19, #88]
	bl	_sqlite3PcacheCleanAll
	ldr	w0, [x19, #88]
	ldr	x1, [x19, #40]
	bl	_sqlite3PcacheTruncate
	mov	x0, x19
	bl	_pagerUseWal
	cbz	x0, LBB0_31
; %bb.24:
	ldr	w0, [x19, #72]
	bl	_sqlite3WalEndWriteTransaction
	mov	x20, x0
	ldr	w8, [x24]
	cmp	w0, w8
	cset	w0, eq
	bl	_assert
LBB0_25:
	ldr	x8, [x19, #80]
	cbnz	x8, LBB0_29
; %bb.26:
	mov	x0, x19
	bl	_pagerUseWal
	cbz	x0, LBB0_28
; %bb.27:
	ldr	w0, [x19, #72]
	mov	w1, #0
	bl	_sqlite3WalExclusiveMode
	cbz	x0, LBB0_29
LBB0_28:
Lloh28:
	adrp	x8, _SHARED_LOCK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SHARED_LOCK@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pagerUnlockDb
	mov	x20, x0
	str	xzr, [x19, #64]
LBB0_29:
Lloh31:
	adrp	x8, _PAGER_READER@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PAGER_READER@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	str	x8, [x19]
	str	xzr, [x19, #56]
	ldr	w8, [x24]
	cmp	w22, w8
	csel	w0, w20, w22, eq
LBB0_30:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_31:
	cbz	w21, LBB0_25
; %bb.32:
	ldr	w8, [x24]
	cmp	w22, w8
	b.ne	LBB0_25
; %bb.33:
	ldp	x9, x8, [x19, #40]
	cmp	x8, x9
	b.le	LBB0_25
; %bb.34:
	ldr	x8, [x19, #8]
Lloh34:
	adrp	x9, _EXCLUSIVE_LOCK@GOTPAGE
Lloh35:
	ldr	x9, [x9, _EXCLUSIVE_LOCK@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	x1, [x19, #40]
	mov	x0, x19
	bl	_pager_truncate
	mov	x22, x0
	b	LBB0_25
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_PAGER_ERROR,8,3                ; @PAGER_ERROR
	.comm	_PAGER_WRITER_LOCKED,8,3        ; @PAGER_WRITER_LOCKED
	.comm	_RESERVED_LOCK,8,3              ; @RESERVED_LOCK
	.comm	_PAGER_JOURNALMODE_MEMORY,8,3   ; @PAGER_JOURNALMODE_MEMORY
	.comm	_PAGER_JOURNALMODE_TRUNCATE,8,3 ; @PAGER_JOURNALMODE_TRUNCATE
	.comm	_PAGER_JOURNALMODE_PERSIST,8,3  ; @PAGER_JOURNALMODE_PERSIST
	.comm	_PAGER_JOURNALMODE_WAL,8,3      ; @PAGER_JOURNALMODE_WAL
	.comm	_PAGER_JOURNALMODE_DELETE,8,3   ; @PAGER_JOURNALMODE_DELETE
	.comm	_EXCLUSIVE_LOCK,8,3             ; @EXCLUSIVE_LOCK
	.comm	_SHARED_LOCK,4,2                ; @SHARED_LOCK
	.comm	_PAGER_READER,8,3               ; @PAGER_READER
	.comm	_pager_set_pagehash,4,2         ; @pager_set_pagehash
	.no_dead_strip	_pager_end_transaction
.subsections_via_symbols
