	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_v1_destroy_cq
_hns_roce_v1_destroy_cq:                ## @hns_roce_v1_destroy_cq
	.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
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_to_hr_dev
	movq	%rax, %r14
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_hr_cq
	movq	8(%r14), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	callq	_hns_roce_free_cq
	movq	_ROCEE_SCAEP_WR_CQE_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_roce_read
	movl	%eax, %r13d
	movq	_ROCEE_CAEP_CQE_WCMD_EMPTY@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_roce_read
	movq	_HNS_ROCE_CQE_WCMD_EMPTY_BIT@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_1
LBB0_6:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	addq	$4, %rsi
	movq	%r14, %rdi
	callq	_hns_roce_mtt_cleanup
	movl	8(%rbx), %edi
	callq	_ib_umem_release
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_8
## %bb.7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movslq	%r13d, %r13
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ROCEE_SCAEP_WR_CQE_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_roce_read
	cltq
	subq	%r13, %rax
	movq	_HNS_ROCE_MIN_CQE_CNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	incl	%r12d
	movq	_HNS_ROCE_MAX_FREE_CQ_WAIT_CNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jg	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_roce_read
	testl	%eax, (%r15)
	je	LBB0_3
	jmp	LBB0_6
LBB0_8:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	incq	%rax
	movslq	(%r14), %rsi
	imulq	%rax, %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hns_roce_buf_free              ## TAILCALL
LBB0_5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_warn
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ROCEE_SCAEP_WR_CQE_CNT,4,2     ## @ROCEE_SCAEP_WR_CQE_CNT
	.comm	_ROCEE_CAEP_CQE_WCMD_EMPTY,4,2  ## @ROCEE_CAEP_CQE_WCMD_EMPTY
	.comm	_HNS_ROCE_CQE_WCMD_EMPTY_BIT,4,2 ## @HNS_ROCE_CQE_WCMD_EMPTY_BIT
	.comm	_HNS_ROCE_MIN_CQE_CNT,8,3       ## @HNS_ROCE_MIN_CQE_CNT
	.comm	_HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS,4,2 ## @HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS
	.comm	_HNS_ROCE_MAX_FREE_CQ_WAIT_CNT,4,2 ## @HNS_ROCE_MAX_FREE_CQ_WAIT_CNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Destroy cq 0x%lx timeout!\n"

	.no_dead_strip	_hns_roce_v1_destroy_cq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_v1_destroy_cq
_hns_roce_v1_destroy_cq:                ; @hns_roce_v1_destroy_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x1, [sp, #24]                   ; 8-byte Folded Spill
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_to_hr_dev
	mov	x21, x0
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	mov	x0, x19
	bl	_to_hr_cq
	mov	x22, x0
	ldr	x8, [x21, #8]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x21
	mov	x1, x22
	bl	_hns_roce_free_cq
Lloh0:
	adrp	x25, _ROCEE_SCAEP_WR_CQE_CNT@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ROCEE_SCAEP_WR_CQE_CNT@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x21
	bl	_roce_read
	mov	x24, x0
Lloh2:
	adrp	x26, _ROCEE_CAEP_CQE_WCMD_EMPTY@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ROCEE_CAEP_CQE_WCMD_EMPTY@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x21
	bl	_roce_read
Lloh4:
	adrp	x27, _HNS_ROCE_CQE_WCMD_EMPTY_BIT@GOTPAGE
Lloh5:
	ldr	x27, [x27, _HNS_ROCE_CQE_WCMD_EMPTY_BIT@GOTPAGEOFF]
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_3
LBB0_1:
	add	x1, x22, #4
	mov	x0, x21
	bl	_hns_roce_mtt_cleanup
	ldr	w0, [x22, #8]
	bl	_ib_umem_release
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	cbz	x8, LBB0_7
; %bb.2:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
	sxtw	x24, w24
	mov	w28, #-1
Lloh6:
	adrp	x23, _HNS_ROCE_MIN_CQE_CNT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _HNS_ROCE_MIN_CQE_CNT@GOTPAGEOFF]
Lloh8:
	adrp	x20, _HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS@GOTPAGE
Lloh9:
	ldr	x20, [x20, _HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS@GOTPAGEOFF]
Lloh10:
	adrp	x19, _HNS_ROCE_MAX_FREE_CQ_WAIT_CNT@GOTPAGE
Lloh11:
	ldr	x19, [x19, _HNS_ROCE_MAX_FREE_CQ_WAIT_CNT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x21
	bl	_roce_read
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x9, [x23]
	sub	x8, x8, x24
	cmp	x8, x9
	b.ge	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	bl	_msleep
	ldr	w8, [x19]
	add	w28, w28, #1
	cmp	w28, w8
	b.gt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x26]
	mov	x0, x21
	bl	_roce_read
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_4
	b	LBB0_1
LBB0_7:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldrsw	x8, [x8]
	ldrsw	x9, [x21]
	madd	x1, x9, x8, x9
	mov	x0, x21
	mov	x2, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_hns_roce_buf_free
LBB0_8:
	ldr	w2, [x22, #12]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_dev_warn
	b	LBB0_1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ROCEE_SCAEP_WR_CQE_CNT,4,2     ; @ROCEE_SCAEP_WR_CQE_CNT
	.comm	_ROCEE_CAEP_CQE_WCMD_EMPTY,4,2  ; @ROCEE_CAEP_CQE_WCMD_EMPTY
	.comm	_HNS_ROCE_CQE_WCMD_EMPTY_BIT,4,2 ; @HNS_ROCE_CQE_WCMD_EMPTY_BIT
	.comm	_HNS_ROCE_MIN_CQE_CNT,8,3       ; @HNS_ROCE_MIN_CQE_CNT
	.comm	_HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS,4,2 ; @HNS_ROCE_EACH_FREE_CQ_WAIT_MSECS
	.comm	_HNS_ROCE_MAX_FREE_CQ_WAIT_CNT,4,2 ; @HNS_ROCE_MAX_FREE_CQ_WAIT_CNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Destroy cq 0x%lx timeout!\n"

	.no_dead_strip	_hns_roce_v1_destroy_cq
.subsections_via_symbols
