	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_mw_enable
_hns_roce_mw_enable:                    ## @hns_roce_mw_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, %r15
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rsi), %edi
	callq	_key_to_hw_index
	movq	%rax, %r12
	leaq	24(%rbx), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_hns_roce_table_get
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_hns_roce_alloc_cmd_mailbox
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	movq	%r14, %rsi
	movq	%r12, %r15
	jmp	LBB0_8
LBB0_3:
	movq	8(%rbx), %rax
	movl	(%r13), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	*(%rax)
	movq	%r13, %rcx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r12, %r15
	jmp	LBB0_7
LBB0_5:
	movslq	(%rbx), %rdx
	decq	%rdx
	movq	%r12, %r15
	andq	%r12, %rdx
	movq	%rbx, %rdi
	movq	%rcx, %r12
	movq	%rcx, %rsi
	callq	_hns_roce_sw2hw_mpt
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movl	%eax, %r13d
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_free_cmd_mailbox
	movq	%r14, %rsi
LBB0_8:
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_hns_roce_table_put
LBB0_9:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_hns_roce_free_cmd_mailbox
	xorl	%r13d, %r13d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MW write mtpt fail!\n"

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

	.no_dead_strip	_hns_roce_mw_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_mw_enable
_hns_roce_mw_enable:                    ; @hns_roce_mw_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	x22, [x0, #16]
	ldr	w0, [x1, #4]
	bl	_key_to_hw_index
	mov	x20, x0
	add	x21, x19, #24
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_hns_roce_table_get
	mov	x25, x0
	cbnz	w0, LBB0_9
; %bb.1:
	mov	x0, x19
	bl	_hns_roce_alloc_cmd_mailbox
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x25, x0
	b	LBB0_8
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x23]
	mov	x1, x24
	blr	x8
	cbz	w0, LBB0_5
; %bb.4:
	mov	x25, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldrsw	x8, [x19]
	sub	x8, x8, #1
	and	x2, x20, x8
	mov	x0, x19
	mov	x1, x23
	bl	_hns_roce_sw2hw_mpt
	mov	x25, x0
	cbz	w0, LBB0_10
; %bb.6:
	str	x25, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x22
	bl	_dev_err
	mov	x0, x19
	mov	x1, x23
	bl	_hns_roce_free_cmd_mailbox
LBB0_8:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_hns_roce_table_put
LBB0_9:
	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_10:
	mov	w8, #1
	str	w8, [x24]
	mov	x0, x19
	mov	x1, x23
	bl	_hns_roce_free_cmd_mailbox
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MW write mtpt fail!\n"

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

	.no_dead_strip	_hns_roce_mw_enable
.subsections_via_symbols
