	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_mr_free
_hns_roce_mr_free:                      ## @hns_roce_mr_free
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movq	16(%rdi), %r15
	cmpq	$0, 24(%rsi)
	je	LBB0_3
## %bb.1:
	movl	16(%rbx), %edi
	callq	_key_to_hw_index
	movl	8(%r14), %edx
	decl	%edx
	andl	%eax, %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_hns_roce_hw2sw_mpt
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_3:
	cmpq	$-1, (%rbx)
	je	LBB0_9
## %bb.4:
	movq	8(%rbx), %rcx
	movq	_MR_TYPE_MR@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.5:
	movl	40(%rbx), %edi
	callq	_ib_umem_page_count
LBB0_6:
	cmpl	$0, 12(%r14)
	je	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_hns_roce_mhop_free
LBB0_9:
	cmpq	$0, 24(%rbx)
	je	LBB0_11
LBB0_10:
	leaq	4(%r14), %r15
	movl	16(%rbx), %edi
	callq	_key_to_hw_index
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_hns_roce_table_put
LBB0_11:
	movl	16(%rbx), %edi
	callq	_key_to_hw_index
	movq	_BITMAP_NO_RR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hns_roce_bitmap_free           ## TAILCALL
LBB0_7:
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movl	32(%rbx), %ecx
	movl	36(%rbx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_free_coherent
	cmpq	$0, 24(%rbx)
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HW2SW_MPT failed (%d)\n"

	.comm	_MR_TYPE_MR,8,3                 ## @MR_TYPE_MR
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
	.comm	_BITMAP_NO_RR,4,2               ## @BITMAP_NO_RR
	.no_dead_strip	_hns_roce_mr_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_mr_free
_hns_roce_mr_free:                      ; @hns_roce_mr_free
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #16]
	ldr	x8, [x1, #24]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w0, [x20, #16]
	bl	_key_to_hw_index
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	and	w2, w8, w0
	mov	x0, x19
	mov	x1, #0
	bl	_hns_roce_hw2sw_mpt
	cbz	w0, LBB0_3
; %bb.2:
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_warn
LBB0_3:
	ldr	x8, [x20]
	cmn	x8, #1
	b.eq	LBB0_7
; %bb.4:
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _MR_TYPE_MR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MR_TYPE_MR@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.5:
	ldr	w0, [x20, #40]
	bl	_ib_umem_page_count
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_11
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_hns_roce_mhop_free
LBB0_7:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_9
LBB0_8:
	add	x21, x19, #4
	ldr	w0, [x20, #16]
	bl	_key_to_hw_index
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_hns_roce_table_put
LBB0_9:
	ldr	w0, [x20, #16]
	bl	_key_to_hw_index
	mov	x1, x0
Lloh5:
	adrp	x8, _BITMAP_NO_RR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BITMAP_NO_RR@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	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	_hns_roce_bitmap_free
LBB0_10:
	mov	w0, #0
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_6
LBB0_11:
Lloh8:
	adrp	x8, _BA_BYTE_LEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mul	w1, w8, w0
	ldp	w3, w2, [x20, #32]
	mov	x0, x21
	bl	_dma_free_coherent
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_8
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HW2SW_MPT failed (%d)\n"

	.comm	_MR_TYPE_MR,8,3                 ; @MR_TYPE_MR
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
	.comm	_BITMAP_NO_RR,4,2               ; @BITMAP_NO_RR
	.no_dead_strip	_hns_roce_mr_free
.subsections_via_symbols
