	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_set_root             ## -- Begin function bch_btree_set_root
	.p2align	4, 0x90
_bch_btree_set_root:                    ## @bch_btree_set_root
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	-40(%rbp), %rdi
	callq	_closure_init_stack
	movq	%r14, %rdi
	callq	_trace_bcache_btree_set_root
	xorl	%edi, %edi
	cmpl	$0, 16(%r14)
	sete	%dil
	callq	_BUG_ON
	leaq	12(%r14), %r15
	movq	%r15, %rdi
	callq	_KEY_PTRS
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_BTREE_PRIO@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_PTR_BUCKET
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	(%r12), %rax
	setne	%dil
	callq	_BUG_ON
	incl	%ebx
	movq	%r15, %rdi
	callq	_KEY_PTRS
	cmpl	%eax, %ebx
	jb	LBB0_2
LBB0_3:
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_lock
	leaq	8(%r14), %rdi
	callq	_list_del_init
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_unlock
	movq	(%r14), %rdi
	movq	%r14, (%rdi)
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_bch_journal_meta
	movq	%rbx, %rdi
	callq	_closure_sync
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTREE_PRIO,8,3                 ## @BTREE_PRIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_set_root             ; -- Begin function bch_btree_set_root
	.p2align	2
_bch_btree_set_root:                    ; @bch_btree_set_root
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	add	x0, sp, #8
	bl	_closure_init_stack
	mov	x0, x19
	bl	_trace_bcache_btree_set_root
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cset	w0, eq
	bl	_BUG_ON
	add	x20, x19, #12
	mov	x0, x20
	bl	_KEY_PTRS
	cbz	w0, LBB0_3
; %bb.1:
	mov	w21, #0
Lloh0:
	adrp	x22, _BTREE_PRIO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BTREE_PRIO@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	mov	x1, x20
	mov	x2, x21
	bl	_PTR_BUCKET
	ldr	x8, [x0]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w0, ne
	bl	_BUG_ON
	add	w21, w21, #1
	mov	x0, x20
	bl	_KEY_PTRS
	cmp	w21, w0
	b.lo	LBB0_2
LBB0_3:
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_mutex_lock
	add	x0, x19, #8
	bl	_list_del_init
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_mutex_unlock
	ldr	x0, [x19]
	str	x19, [x0]
	add	x1, sp, #8
	bl	_bch_journal_meta
	add	x0, sp, #8
	bl	_closure_sync
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BTREE_PRIO,8,3                 ; @BTREE_PRIO
.subsections_via_symbols
