	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_v1_dereg_mr
_hns_roce_v1_dereg_mr:                  ## @hns_roce_v1_dereg_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	24(%rdi), %rbx
	movq	_HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmpq	$0, 24(%rsi)
	je	LBB0_3
## %bb.1:
	movl	12(%r12), %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
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	%rax, %rbx
	addq	$4, %rbx
	movq	_hns_roce_v1_mr_free_work_fn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_INIT_WORK
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	4(%r14), %rax
	movq	%rax, 24(%r13)
	leaq	-56(%rbp), %rdi
	movq	%rdi, 8(%r13)
	movl	$1, (%r13)
	movq	%r12, 16(%r13)
	callq	_init_completion
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_queue_work
	testq	%r15, %r15
	jle	LBB0_11
## %bb.6:
	leaq	-56(%rbp), %rbx
	movq	_HNS_ROCE_V1_FREE_MR_WAIT_VALUE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_try_wait_for_completion
	testq	%rax, %rax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r14), %rdi
	callq	_msleep
	subq	(%r14), %r15
	jg	LBB0_7
LBB0_11:
	movl	$0, (%r13)
	leaq	-56(%rbp), %rdi
	callq	_try_wait_for_completion
	xorl	%ebx, %ebx
	testq	%rax, %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	_jiffies@GOTPCREL(%rip), %r15
	jne	LBB0_13
## %bb.12:
	movl	12(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_8:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_9:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	_jiffies@GOTPCREL(%rip), %r15
LBB0_13:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	12(%r12), %ebx
	movq	(%r15), %rdi
	callq	_jiffies_to_usecs
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_jiffies_to_usecs
	subq	%rax, %r15
	leaq	L_.str.2(%rip), %rsi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%ebx, %edx
	movq	%r15, %rcx
	callq	_dev_dbg
	cmpq	$-1, (%r12)
	je	LBB0_15
## %bb.14:
	movl	8(%r12), %edi
	callq	_ib_umem_page_count
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %esi
	movl	16(%r12), %ecx
	movl	20(%r12), %edx
	movq	%r13, %rdi
	callq	_dma_free_coherent
LBB0_15:
	movl	12(%r12), %edi
	callq	_key_to_hw_index
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_hns_roce_bitmap_free
	movl	8(%r12), %edi
	callq	_ib_umem_release
	movq	%r12, %rdi
	callq	_kfree
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS,8,3 ## @HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS
	.comm	_jiffies,8,3                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HW2SW_MPT failed!\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_hns_roce_v1_mr_free_work_fn,4,2 ## @hns_roce_v1_mr_free_work_fn
	.comm	_HNS_ROCE_V1_FREE_MR_WAIT_VALUE,8,3 ## @HNS_ROCE_V1_FREE_MR_WAIT_VALUE
L_.str.1:                               ## @.str.1
	.asciz	"Free mr work 0x%x over 50s and failed!\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.2:                               ## @.str.2
	.asciz	"Free mr 0x%x use 0x%x us.\n"

	.no_dead_strip	_hns_roce_v1_dereg_mr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_v1_dereg_mr
_hns_roce_v1_dereg_mr:                  ; @hns_roce_v1_dereg_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh2:
	ldr	x26, [x8]
Lloh3:
	adrp	x25, _jiffies@GOTPAGE
Lloh4:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldr	x22, [x25]
	ldp	x27, x21, [x0, #16]
	ldr	x8, [x1, #24]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w0, [x19, #12]
	bl	_key_to_hw_index
	ldr	w8, [x20, #8]
	sub	w8, w8, #1
	and	w2, w8, w0
	mov	x0, x20
	mov	x1, #0
	bl	_hns_roce_hw2sw_mpt
	cbz	x0, LBB0_3
; %bb.2:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_warn
LBB0_3:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.4:
	mov	x23, x0
	add	x24, x0, #4
Lloh10:
	adrp	x8, _hns_roce_v1_mr_free_work_fn@GOTPAGE
Lloh11:
	ldr	x8, [x8, _hns_roce_v1_mr_free_work_fn@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_INIT_WORK
	add	x8, x20, #4
	stp	x19, x8, [x23, #16]
	add	x8, sp, #8
	mov	w9, #1
	str	w9, [x23]
	str	x8, [x23, #8]
	add	x0, sp, #8
	bl	_init_completion
	ldr	w0, [x27]
	mov	x1, x24
	bl	_queue_work
	cmp	x26, #1
	b.lt	LBB0_8
; %bb.5:
Lloh13:
	adrp	x24, _HNS_ROCE_V1_FREE_MR_WAIT_VALUE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _HNS_ROCE_V1_FREE_MR_WAIT_VALUE@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	bl	_try_wait_for_completion
	cbnz	x0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x24]
	bl	_msleep
	ldr	x8, [x24]
	sub	x26, x26, x8
	cmp	x26, #0
	b.gt	LBB0_6
LBB0_8:
	str	wzr, [x23]
	add	x0, sp, #8
	bl	_try_wait_for_completion
	mov	w23, #0
	cbnz	x0, LBB0_13
; %bb.9:
	ldr	w8, [x19, #12]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_warn
Lloh17:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_13
LBB0_12:
	mov	w23, #0
LBB0_13:
	ldr	w24, [x19, #12]
	ldr	x0, [x25]
	bl	_jiffies_to_usecs
	mov	x25, x0
	mov	x0, x22
	bl	_jiffies_to_usecs
	sub	x3, x25, x0
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x24
	bl	_dev_dbg
	ldr	x8, [x19]
	cmn	x8, #1
	b.eq	LBB0_15
; %bb.14:
	ldr	w0, [x19, #8]
	bl	_ib_umem_page_count
	lsl	w1, w0, #3
	ldp	w3, w2, [x19, #16]
	mov	x0, x21
	bl	_dma_free_coherent
LBB0_15:
	ldr	w0, [x19, #12]
	bl	_key_to_hw_index
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_hns_roce_bitmap_free
	ldr	w0, [x19, #8]
	bl	_ib_umem_release
	mov	x0, x19
	bl	_kfree
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS,8,3 ; @HNS_ROCE_V1_FREE_MR_TIMEOUT_MSECS
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HW2SW_MPT failed!\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_hns_roce_v1_mr_free_work_fn,4,2 ; @hns_roce_v1_mr_free_work_fn
	.comm	_HNS_ROCE_V1_FREE_MR_WAIT_VALUE,8,3 ; @HNS_ROCE_V1_FREE_MR_WAIT_VALUE
l_.str.1:                               ; @.str.1
	.asciz	"Free mr work 0x%x over 50s and failed!\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.2:                               ; @.str.2
	.asciz	"Free mr 0x%x use 0x%x us.\n"

	.no_dead_strip	_hns_roce_v1_dereg_mr
.subsections_via_symbols
