	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnxt_qplib_free_mrw            ## -- Begin function bnxt_qplib_free_mrw
	.p2align	4, 0x90
_bnxt_qplib_free_mrw:                   ## @bnxt_qplib_free_mrw
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	cmpl	$-1, (%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	8(%r14), %r15
	movq	_DEALLOCATE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_RCFW_CMD_PREP
	movq	8(%rbx), %rax
	movq	%rax, -48(%rbp)
	movq	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%dl
	orb	%cl, %dl
	movq	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%al
	orb	%dl, %al
	movzbl	%al, %eax
	shlq	$4, %rax
	movl	(%rbx,%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, -40(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_bnxt_qplib_rcfw_send_message
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	cmpq	$0, 24(%rbx)
	je	LBB0_5
## %bb.4:
	addq	$24, %rbx
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	callq	_bnxt_qplib_free_hwq
	jmp	LBB0_5
LBB0_1:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SP: Free a reserved lkey MRW\n"

	.comm	_DEALLOCATE_KEY,4,2             ## @DEALLOCATE_KEY
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1,8,3 ## @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A,8,3 ## @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B,8,3 ## @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnxt_qplib_free_mrw            ; -- Begin function bnxt_qplib_free_mrw
	.p2align	2
_bnxt_qplib_free_mrw:                   ; @bnxt_qplib_free_mrw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	ldr	w8, [x1]
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x1
	ldr	x21, [x20, #8]
Lloh0:
	adrp	x8, _DEALLOCATE_KEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEALLOCATE_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_RCFW_CMD_PREP
	ldr	x8, [x19, #8]
	str	x8, [sp, #16]
Lloh3:
	adrp	x9, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1@GOTPAGEOFF]
Lloh5:
	adrp	x10, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	cmp	x8, x11
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
	mov	w8, #16
	csel	x8, x8, xzr, eq
	ldr	w0, [x19, x8]
	bl	_cpu_to_le32
	str	x0, [sp, #24]
	add	x1, sp, #16
	add	x2, sp, #8
	mov	x0, x21
	mov	x3, #0
	mov	w4, #0
	bl	_bnxt_qplib_rcfw_send_message
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	x8, [x19, #24]!
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x0, [x20]
	mov	x1, x19
	bl	_bnxt_qplib_free_hwq
	b	LBB0_5
LBB0_4:
	ldr	x0, [x20]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SP: Free a reserved lkey MRW\n"

	.comm	_DEALLOCATE_KEY,4,2             ; @DEALLOCATE_KEY
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1,8,3 ; @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A,8,3 ; @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A
	.comm	_CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B,8,3 ; @CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
.subsections_via_symbols
