	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rds_destroy_mr
_rds_destroy_mr:                        ## @rds_destroy_mr
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	40(%rdi), %r14
	movl	36(%rdi), %r15d
	addq	$32, %rdi
	callq	_atomic_read
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_rdsdebug
	movq	_RDS_MR_DEAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	28(%rbx), %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_1
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	24(%rbx), %r15
	movq	%r15, %rdi
	callq	_RB_EMPTY_NODE
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	4(%r14), %rsi
	movq	%r15, %rdi
	callq	_rb_erase
LBB0_3:
	movq	16(%rbx), %r15
	movq	$0, 16(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	(%rbx), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RDS: destroy mr key is %x refcnt %u\n"

	.comm	_RDS_MR_DEAD,4,2                ## @RDS_MR_DEAD
	.no_dead_strip	_rds_destroy_mr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rds_destroy_mr
_rds_destroy_mr:                        ; @rds_destroy_mr
	.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
	ldr	x20, [x0, #40]
	ldr	w21, [x0, #36]
	add	x0, x0, #32
	bl	_atomic_read
	mov	x2, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_rdsdebug
Lloh2:
	adrp	x8, _RDS_MR_DEAD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RDS_MR_DEAD@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x1, x19, #28
	bl	_test_and_set_bit
	cbz	x0, LBB0_2
LBB0_1:
	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_2:
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x21, x19, #24
	mov	x0, x21
	bl	_RB_EMPTY_NODE
	cbnz	w0, LBB0_4
; %bb.3:
	add	x1, x20, #4
	mov	x0, x21
	bl	_rb_erase
LBB0_4:
	ldr	x21, [x19, #16]
	str	xzr, [x19, #16]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	cbz	x21, LBB0_1
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	x2, [x8]
	ldr	w1, [x19]
	mov	x0, x21
	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
	br	x2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RDS: destroy mr key is %x refcnt %u\n"

	.comm	_RDS_MR_DEAD,4,2                ; @RDS_MR_DEAD
	.no_dead_strip	_rds_destroy_mr
.subsections_via_symbols
