	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rereg_mr_trans
_rereg_mr_trans:                        ## @rereg_mr_trans
	.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
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r13d
	movl	%edx, %r12d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_hr_dev
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_to_hr_mr
	movq	%rax, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rbx), %r15
	cmpq	$-1, (%rax)
	je	LBB0_4
## %bb.1:
	movq	8(%r14), %rdi
	callq	_ib_umem_page_count
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	cmpq	$0, (%rdi)
	je	LBB0_3
## %bb.2:
	movq	%r14, %rsi
	callq	_hns_roce_mhop_free
	jmp	LBB0_4
LBB0_3:
	shll	$3, %eax
	movl	16(%r14), %ecx
	movl	20(%r14), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dma_free_coherent
LBB0_4:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rdi
	callq	_ib_umem_release
	xorl	%r15d, %r15d
	movq	32(%rbp), %rdi
	movl	%r12d, %esi
	movq	%r13, %r12
	movl	%r12d, %edx
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_ib_umem_get
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	8(%r14), %rdi
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	callq	_PTR_ERR
	movq	$0, 8(%r14)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_6:
	callq	_ib_umem_page_count
	movl	%eax, %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, (%rbx)
	je	LBB0_11
## %bb.7:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_hns_roce_mhop_alloc
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_17
	jmp	LBB0_8
LBB0_11:
	shll	$3, %esi
	movq	%r14, %rdx
	addq	$16, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_alloc_coherent
	movl	%eax, 20(%r14)
	testl	%eax, %eax
	je	LBB0_12
LBB0_8:
	movl	24(%rbp), %ecx
	movq	16(%rbp), %rdx
	movq	8(%rbx), %r10
	movl	(%rdx), %eax
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %r8d
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rax
	pushq	%r12
	callq	*(%r10)
	addq	$16, %rsp
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.9:
	movq	8(%r14), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_ib_umem_write_mr
	testl	%eax, %eax
	je	LBB0_10
## %bb.13:
	movl	%eax, %r15d
	cmpq	$-1, (%r14)
	je	LBB0_17
## %bb.14:
	movq	8(%r14), %rdi
	callq	_ib_umem_page_count
	cmpq	$0, (%rbx)
	je	LBB0_16
## %bb.15:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_mhop_free
	jmp	LBB0_17
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_17:
	movq	8(%r14), %rdi
	callq	_ib_umem_release
LBB0_18:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_16:
	shll	$3, %eax
	movl	16(%r14), %ecx
	movl	20(%r14), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_dma_free_coherent
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_rereg_mr_trans
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rereg_mr_trans
_rereg_mr_trans:                        ; @rereg_mr_trans
	.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
	str	w7, [sp, #12]                   ; 4-byte Folded Spill
	mov	x26, x6
	mov	x25, x5
	mov	x24, x4
	mov	x23, x3
	mov	x28, x2
	mov	x27, x1
	mov	x19, x0
	ldr	x22, [x29, #16]
	ldr	w0, [x0]
	bl	_to_hr_dev
	mov	x20, x0
	mov	x0, x19
	bl	_to_hr_mr
	mov	x19, x0
	ldr	x21, [x20, #16]
	ldr	x8, [x0]
	cmn	x8, #1
	b.eq	LBB0_4
; %bb.1:
	ldr	x0, [x19, #8]
	bl	_ib_umem_page_count
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_mhop_free
	b	LBB0_4
LBB0_3:
	lsl	w1, w0, #3
	ldp	w3, w2, [x19, #16]
	mov	x0, x21
	bl	_dma_free_coherent
LBB0_4:
	ldr	x0, [x19, #8]
	bl	_ib_umem_release
	mov	x0, x22
	mov	x1, x28
	mov	x2, x23
	mov	x3, x25
	mov	w4, #0
	bl	_ib_umem_get
	str	x0, [x19, #8]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	x8, LBB0_6
; %bb.5:
	bl	_PTR_ERR
	str	xzr, [x19, #8]
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w28, w8
	b	LBB0_16
LBB0_6:
	bl	_ib_umem_page_count
	mov	x1, x0
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x20
	mov	x2, x19
	bl	_hns_roce_mhop_alloc
	mov	x28, x0
	cbnz	w0, LBB0_15
	b	LBB0_9
LBB0_8:
	lsl	w1, w1, #3
	add	x2, x19, #16
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_dma_alloc_coherent
	str	w0, [x19, #20]
	cbz	w0, LBB0_14
LBB0_9:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w7, [x26]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x27
	ldr	w3, [sp, #12]                   ; 4-byte Folded Reload
	mov	x4, x25
	mov	x5, x24
	mov	x6, x23
	blr	x8
	mov	x28, x0
	cbnz	w0, LBB0_15
; %bb.10:
	ldr	x2, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_ib_umem_write_mr
	mov	x28, x0
	cbz	w0, LBB0_16
; %bb.11:
	ldr	x8, [x19]
	cmn	x8, #1
	b.eq	LBB0_15
; %bb.12:
	ldr	x0, [x19, #8]
	bl	_ib_umem_page_count
	ldr	x8, [x20]
	cbz	x8, LBB0_17
; %bb.13:
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_mhop_free
	b	LBB0_15
LBB0_14:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w28, w8
LBB0_15:
	ldr	x0, [x19, #8]
	bl	_ib_umem_release
LBB0_16:
	mov	x0, x28
	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
LBB0_17:
	lsl	w1, w0, #3
	ldp	w3, w2, [x19, #16]
	mov	x0, x21
	bl	_dma_free_coherent
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_rereg_mr_trans
.subsections_via_symbols
