	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_mr_enable
_hns_roce_mr_enable:                    ## @hns_roce_mr_enable
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	12(%rsi), %edi
	callq	_key_to_hw_index
	movq	%rax, %r15
	movq	24(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%r13), %r14
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_hns_roce_table_get
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movq	%r13, %rdi
	callq	_hns_roce_alloc_cmd_mailbox
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_11
LBB0_3:
	movq	%rbx, %rsi
	movq	(%rbx), %rcx
	movq	_MR_TYPE_FRMR@GOTPCREL(%rip), %rdx
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	cmpq	(%rdx), %rcx
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_4
## %bb.5:
	movl	(%r12), %edi
	callq	*8(%rax)
	jmp	LBB0_6
LBB0_4:
	movl	(%r12), %edi
	movq	%r15, %rdx
	callq	*(%rax)
LBB0_6:
	movl	%eax, %r12d
	testl	%eax, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_8:
	movslq	(%r13), %rax
	decq	%rax
	movq	%r15, %rdx
	andq	%rax, %rdx
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_sw2hw_mpt
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_10:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_free_cmd_mailbox
LBB0_11:
	movq	%r14, %rsi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_hns_roce_table_put
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	$1, 8(%rbx)
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_free_cmd_mailbox
	xorl	%r12d, %r12d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_MR_TYPE_FRMR,8,3               ## @MR_TYPE_FRMR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Write mtpt fail!\n"

L_.str.1:                               ## @.str.1
	.asciz	"SW2HW_MPT failed (%d)\n"

	.no_dead_strip	_hns_roce_mr_enable
.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_enable
_hns_roce_mr_enable:                    ; @hns_roce_mr_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x24, x1
	mov	x19, x0
	ldr	w0, [x1, #12]
	bl	_key_to_hw_index
	mov	x20, x0
	ldr	x23, [x19, #24]
	add	x21, x19, #16
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_hns_roce_table_get
	mov	x25, x0
	cbnz	w0, LBB0_11
; %bb.1:
	mov	x0, x19
	bl	_hns_roce_alloc_cmd_mailbox
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x25, x0
	b	LBB0_10
LBB0_3:
	ldr	x9, [x24]
Lloh0:
	adrp	x8, _MR_TYPE_FRMR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MR_TYPE_FRMR@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
	ldr	x8, [x19, #8]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x8, #8]
	ldr	w0, [x22]
	mov	x1, x24
	blr	x8
	mov	x25, x0
	cbz	w0, LBB0_7
LBB0_5:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_6:
	ldr	x8, [x8]
	ldr	w0, [x22]
	mov	x1, x24
	mov	x2, x20
	blr	x8
	mov	x25, x0
	cbnz	w0, LBB0_5
LBB0_7:
	ldrsw	x8, [x19]
	sub	x8, x8, #1
	and	x2, x20, x8
	mov	x0, x19
	mov	x1, x22
	bl	_hns_roce_sw2hw_mpt
	mov	x25, x0
	cbz	w0, LBB0_12
; %bb.8:
	str	x25, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	mov	x0, x23
	bl	_dev_err
	mov	x0, x19
	mov	x1, x22
	bl	_hns_roce_free_cmd_mailbox
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_hns_roce_table_put
LBB0_11:
	mov	x0, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
	mov	w8, #1
	str	w8, [x24, #8]
	mov	x0, x19
	mov	x1, x22
	bl	_hns_roce_free_cmd_mailbox
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_MR_TYPE_FRMR,8,3               ; @MR_TYPE_FRMR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Write mtpt fail!\n"

l_.str.1:                               ; @.str.1
	.asciz	"SW2HW_MPT failed (%d)\n"

	.no_dead_strip	_hns_roce_mr_enable
.subsections_via_symbols
