	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_v2_qp_flow_control_init
_hns_roce_v2_qp_flow_control_init:      ## @hns_roce_v2_qp_flow_control_init
	.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
	pushq	%rax
	.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, %r14
	callq	_mutex_lock
	movq	_HNS_ROCE_OPC_RESET_SCCC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_hns_roce_cmq_setup_basic_desc
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_hns_roce_cmq_send
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r13d
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movq	_HNS_ROCE_OPC_CLR_SCCC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_hns_roce_cmq_setup_basic_desc
	movq	-48(%rbp), %rbx
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movl	%eax, (%rbx)
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_hns_roce_cmq_send
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_HNS_ROCE_CMQ_SCC_CLR_DONE_CNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_12
## %bb.6:
	movl	$-1, %ebx
	movq	-48(%rbp), %r12
	leaq	-48(%rbp), %r15
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_HNS_ROCE_OPC_QUERY_SCCC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_hns_roce_cmq_setup_basic_desc
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_hns_roce_cmq_send
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpq	$0, (%r12)
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	$20, %edi
	callq	_msleep
	incl	%ebx
	movq	_HNS_ROCE_CMQ_SCC_CLR_DONE_CNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_7
LBB0_12:
	movl	4(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_13
LBB0_8:
	movl	%eax, %r13d
	movl	4(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_10:
	xorl	%r13d, %r13d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_OPC_RESET_SCCC,4,2    ## @HNS_ROCE_OPC_RESET_SCCC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset SCC ctx  failed(%d)\n"

	.comm	_HNS_ROCE_OPC_CLR_SCCC,4,2      ## @HNS_ROCE_OPC_CLR_SCCC
L_.str.1:                               ## @.str.1
	.asciz	"Clear SCC ctx failed(%d)\n"

	.comm	_HNS_ROCE_CMQ_SCC_CLR_DONE_CNT,4,2 ## @HNS_ROCE_CMQ_SCC_CLR_DONE_CNT
	.comm	_HNS_ROCE_OPC_QUERY_SCCC,4,2    ## @HNS_ROCE_OPC_QUERY_SCCC
L_.str.2:                               ## @.str.2
	.asciz	"Query clr cmq failed(%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Query SCC clr done flag overtime.\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_hns_roce_v2_qp_flow_control_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_v2_qp_flow_control_init
_hns_roce_v2_qp_flow_control_init:      ; @hns_roce_v2_qp_flow_control_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _HNS_ROCE_OPC_RESET_SCCC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HNS_ROCE_OPC_RESET_SCCC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_hns_roce_cmq_setup_basic_desc
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_hns_roce_cmq_send
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_2:
Lloh5:
	adrp	x8, _HNS_ROCE_OPC_CLR_SCCC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HNS_ROCE_OPC_CLR_SCCC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_hns_roce_cmq_setup_basic_desc
	ldr	x21, [sp, #8]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	str	w0, [x21]
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_hns_roce_cmq_send
	cbz	w0, LBB0_5
; %bb.3:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	bl	_dev_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_13
LBB0_5:
Lloh10:
	adrp	x20, _HNS_ROCE_CMQ_SCC_CLR_DONE_CNT@GOTPAGE
Lloh11:
	ldr	x20, [x20, _HNS_ROCE_CMQ_SCC_CLR_DONE_CNT@GOTPAGEOFF]
	ldr	w8, [x20]
	tbnz	w8, #31, LBB0_10
; %bb.6:
	mov	w22, #-1
	ldr	x23, [sp, #8]
Lloh12:
	adrp	x24, _HNS_ROCE_OPC_QUERY_SCCC@GOTPAGE
Lloh13:
	ldr	x24, [x24, _HNS_ROCE_OPC_QUERY_SCCC@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	add	x0, sp, #8
	mov	w2, #1
	bl	_hns_roce_cmq_setup_basic_desc
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_hns_roce_cmq_send
	cbnz	w0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x23]
	cbnz	x8, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #20
	bl	_msleep
	ldr	w8, [x20]
	add	w22, w22, #1
	cmp	w22, w8
	b.lt	LBB0_7
LBB0_10:
	ldr	w0, [x19, #4]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_11:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_12:
	mov	w21, #0
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_OPC_RESET_SCCC,4,2    ; @HNS_ROCE_OPC_RESET_SCCC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset SCC ctx  failed(%d)\n"

	.comm	_HNS_ROCE_OPC_CLR_SCCC,4,2      ; @HNS_ROCE_OPC_CLR_SCCC
l_.str.1:                               ; @.str.1
	.asciz	"Clear SCC ctx failed(%d)\n"

	.comm	_HNS_ROCE_CMQ_SCC_CLR_DONE_CNT,4,2 ; @HNS_ROCE_CMQ_SCC_CLR_DONE_CNT
	.comm	_HNS_ROCE_OPC_QUERY_SCCC,4,2    ; @HNS_ROCE_OPC_QUERY_SCCC
l_.str.2:                               ; @.str.2
	.asciz	"Query clr cmq failed(%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Query SCC clr done flag overtime.\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_hns_roce_v2_qp_flow_control_init
.subsections_via_symbols
