	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_destroy_qp              ## -- Begin function ocrdma_destroy_qp
	.p2align	4, 0x90
_ocrdma_destroy_qp:                     ## @ocrdma_destroy_qp
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_get_ocrdma_qp
	movq	%rax, %rbx
	movl	(%r15), %edi
	callq	_get_ocrdma_dev
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	80(%rbx), %r12
	movq	_OCRDMA_QPS_RST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_IB_QPS_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_IB_QP_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rsi
	movq	%r15, %rdi
	callq	__ocrdma_modify_qp
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_mbx_destroy_qp
	movq	72(%rbx), %rdi
	callq	_spin_lock_irqsave
	movq	64(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:
	cmpq	72(%rbx), %rdi
	je	LBB0_5
## %bb.4:
	callq	_spin_lock
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_del_qpn_map
	movq	64(%rbx), %rdi
	callq	_spin_unlock
	jmp	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_del_qpn_map
LBB0_6:
	movq	72(%rbx), %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, (%r12)
	jne	LBB0_8
## %bb.7:
	movq	72(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_ocrdma_discard_cqes
	movq	64(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_ocrdma_discard_cqes
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	(%r12), %r14
	testq	%r14, %r14
	je	LBB0_11
## %bb.9:
	movl	48(%rbx), %edi
	movl	56(%rbx), %r15d
	callq	_PAGE_ALIGN
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_ocrdma_del_mmap
	cmpl	$0, 40(%rbx)
	jne	LBB0_11
## %bb.10:
	movq	(%r12), %r14
	movl	24(%rbx), %edi
	movl	32(%rbx), %r15d
	callq	_PAGE_ALIGN
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_ocrdma_del_mmap
LBB0_11:
	movq	%rbx, %rdi
	callq	_ocrdma_del_flush_qp
	movq	16(%rbx), %rdi
	callq	_kfree
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OCRDMA_QPS_RST,8,3             ## @OCRDMA_QPS_RST
	.comm	_IB_QPS_ERR,4,2                 ## @IB_QPS_ERR
	.comm	_IB_QP_STATE,4,2                ## @IB_QP_STATE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_destroy_qp              ; -- Begin function ocrdma_destroy_qp
	.p2align	2
_ocrdma_destroy_qp:                     ; @ocrdma_destroy_qp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x0
	bl	_get_ocrdma_qp
	mov	x19, x0
	ldr	w0, [x21]
	bl	_get_ocrdma_dev
	mov	x20, x0
	ldr	x22, [x19, #80]
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _OCRDMA_QPS_RST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OCRDMA_QPS_RST@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _IB_QPS_ERR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_QPS_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh6:
	adrp	x8, _IB_QP_STATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_QP_STATE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x21
	bl	__ocrdma_modify_qp
LBB0_2:
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	bl	_ocrdma_mbx_destroy_qp
	ldr	x0, [x19, #72]
	bl	_spin_lock_irqsave
	ldr	x0, [x19, #64]
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #72]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.4:
	bl	_spin_lock
	mov	x0, x20
	mov	x1, x19
	bl	_ocrdma_del_qpn_map
	ldr	x0, [x19, #64]
	bl	_spin_unlock
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	mov	x1, x19
	bl	_ocrdma_del_qpn_map
LBB0_6:
	ldr	x0, [x19, #72]
	bl	_spin_unlock_irqrestore
	ldr	x8, [x22]
	cbnz	x8, LBB0_8
; %bb.7:
	ldr	x1, [x19, #72]
	mov	x0, x19
	bl	_ocrdma_discard_cqes
	ldr	x1, [x19, #64]
	mov	x0, x19
	bl	_ocrdma_discard_cqes
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	x20, [x22]
	cbz	x20, LBB0_11
; %bb.9:
	ldr	w21, [x19, #56]
	ldr	w0, [x19, #48]
	bl	_PAGE_ALIGN
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_ocrdma_del_mmap
	ldr	w8, [x19, #40]
	cbnz	w8, LBB0_11
; %bb.10:
	ldr	x20, [x22]
	ldr	w21, [x19, #32]
	ldr	w0, [x19, #24]
	bl	_PAGE_ALIGN
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_ocrdma_del_mmap
LBB0_11:
	mov	x0, x19
	bl	_ocrdma_del_flush_qp
	ldr	x0, [x19, #16]
	bl	_kfree
	ldr	x0, [x19, #8]
	bl	_kfree
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_OCRDMA_QPS_RST,8,3             ; @OCRDMA_QPS_RST
	.comm	_IB_QPS_ERR,4,2                 ; @IB_QPS_ERR
	.comm	_IB_QP_STATE,4,2                ; @IB_QP_STATE
.subsections_via_symbols
