	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btreeEndTransaction
_btreeEndTransaction:                   ## @btreeEndTransaction
	.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
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movq	16(%rdi), %r14
	callq	_sqlite3BtreeHoldsMutex
	movl	%eax, %edi
	callq	_assert
	movq	$0, 16(%r14)
	movq	(%rbx), %rax
	movq	_TRANS_NONE@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	cmpq	%rcx, %rax
	jle	LBB0_3
## %bb.1:
	cmpl	$2, (%r12)
	jl	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_downgradeAllSharedCacheTableLocks
	movq	_TRANS_READ@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_7
LBB0_3:
	cmpq	%rcx, %rax
	je	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	_clearAllSharedCacheTableLocks
	decq	(%r14)
	movq	(%r15), %rax
	jne	LBB0_6
## %bb.5:
	movq	%rax, 8(%r14)
LBB0_6:
	movq	%rax, (%rbx)
	movq	%r14, %rdi
	callq	_unlockBtreeIfUnused
LBB0_7:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_btreeIntegrity                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TRANS_NONE,8,3                 ## @TRANS_NONE
	.comm	_TRANS_READ,8,3                 ## @TRANS_READ
	.no_dead_strip	_btreeEndTransaction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btreeEndTransaction
_btreeEndTransaction:                   ; @btreeEndTransaction
	.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, x0
	ldp	x22, x20, [x0, #8]
	bl	_sqlite3BtreeHoldsMutex
	bl	_assert
	str	xzr, [x20, #16]
	ldr	x8, [x19]
Lloh0:
	adrp	x21, _TRANS_NONE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _TRANS_NONE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.le	LBB0_3
; %bb.1:
	ldr	w10, [x22]
	cmp	w10, #2
	b.lt	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_downgradeAllSharedCacheTableLocks
Lloh2:
	adrp	x8, _TRANS_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TRANS_READ@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_7
LBB0_3:
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_clearAllSharedCacheTableLocks
	ldr	x8, [x20]
	subs	x8, x8, #1
	str	x8, [x20]
	ldr	x8, [x21]
	b.ne	LBB0_6
; %bb.5:
	str	x8, [x20, #8]
LBB0_6:
	str	x8, [x19]
	mov	x0, x20
	bl	_unlockBtreeIfUnused
LBB0_7:
	mov	x0, x19
	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
	b	_btreeIntegrity
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_TRANS_NONE,8,3                 ; @TRANS_NONE
	.comm	_TRANS_READ,8,3                 ; @TRANS_READ
	.no_dead_strip	_btreeEndTransaction
.subsections_via_symbols
