	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_function_clear
_hns_roce_function_clear:               ## @hns_roce_function_clear
	.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	%rdi, %rbx
	callq	_hns_roce_func_clr_chk_rst
	xorl	%r15d, %r15d
	movl	$0, %r14d
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	_HNS_ROCE_OPC_FUNC_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r12
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_hns_roce_cmq_setup_basic_desc
	movq	-48(%rbp), %r13
	movl	$1, %r15d
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_hns_roce_cmq_send
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movl	%eax, %r12d
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r12d, %r14d
	jmp	LBB0_3
LBB0_5:
	movq	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_msleep
	movq	_HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_hns_roce_func_clr_chk_rst
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	xorl	%r15d, %r15d
LBB0_3:
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_hns_roce_func_clr_rst_prc
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r15
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	callq	_msleep
	subq	(%r13), %r12
	movq	_HNS_ROCE_OPC_FUNC_CLEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_hns_roce_cmq_setup_basic_desc
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_hns_roce_cmq_send
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_FUNC_CLEAR_RST_FUN_DONE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_roce_get_bit
	testq	%rax, %rax
	jne	LBB0_16
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	testq	%r12, %r12
	je	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rdi
	callq	_hns_roce_func_clr_chk_rst
	testq	%rax, %rax
	je	LBB0_10
	jmp	LBB0_8
LBB0_16:
	movl	$1, (%rbx)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_OPC_FUNC_CLEAR,4,2    ## @HNS_ROCE_OPC_FUNC_CLEAR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Func clear write failed, ret = %d.\n"

	.comm	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL,8,3 ## @HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL
	.comm	_HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS,8,3 ## @HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS
	.comm	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT,8,3 ## @HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT
	.comm	_FUNC_CLEAR_RST_FUN_DONE_S,4,2  ## @FUNC_CLEAR_RST_FUN_DONE_S
L_.str.1:                               ## @.str.1
	.asciz	"Func clear fail.\n"

	.no_dead_strip	_hns_roce_function_clear
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_function_clear
_hns_roce_function_clear:               ; @hns_roce_function_clear
	.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	x19, x0
	bl	_hns_roce_func_clr_chk_rst
	cbz	x0, LBB0_2
LBB0_1:
	mov	w21, #0
	mov	w20, #0
	b	LBB0_4
LBB0_2:
Lloh0:
	adrp	x22, _HNS_ROCE_OPC_FUNC_CLEAR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HNS_ROCE_OPC_FUNC_CLEAR@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x0, sp, #8
	mov	w2, #0
	bl	_hns_roce_cmq_setup_basic_desc
	ldr	x23, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_hns_roce_cmq_send
	cbz	w0, LBB0_6
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #4]
	str	x20, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w21, #1
LBB0_4:
	ldr	w0, [x19, #4]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_hns_roce_func_clr_rst_prc
LBB0_5:
	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_6:
Lloh6:
	adrp	x8, _HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
	bl	_msleep
Lloh9:
	adrp	x8, _HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh11:
	ldr	x24, [x8]
	cbz	x24, LBB0_1
; %bb.7:
	mov	x0, x19
	bl	_hns_roce_func_clr_chk_rst
	cbnz	x0, LBB0_1
; %bb.8:
Lloh12:
	adrp	x25, _HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT@GOTPAGE
Lloh13:
	ldr	x25, [x25, _HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT@GOTPAGEOFF]
Lloh14:
	adrp	x26, _FUNC_CLEAR_RST_FUN_DONE_S@GOTPAGE
Lloh15:
	ldr	x26, [x26, _FUNC_CLEAR_RST_FUN_DONE_S@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	bl	_msleep
	ldr	x21, [x25]
	ldr	w1, [x22]
	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
	mov	x20, x0
	cbnz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x23]
	ldr	w1, [x26]
	bl	_roce_get_bit
	cbnz	x0, LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	sub	x24, x24, x21
	cbz	x24, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	bl	_hns_roce_func_clr_chk_rst
	mov	w21, #0
	cbz	x0, LBB0_9
	b	LBB0_4
LBB0_13:
	mov	w21, #0
	b	LBB0_4
LBB0_14:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_OPC_FUNC_CLEAR,4,2    ; @HNS_ROCE_OPC_FUNC_CLEAR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Func clear write failed, ret = %d.\n"

	.comm	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL,8,3 ; @HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_INTERVAL
	.comm	_HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS,8,3 ; @HNS_ROCE_V2_FUNC_CLEAR_TIMEOUT_MSECS
	.comm	_HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT,8,3 ; @HNS_ROCE_V2_READ_FUNC_CLEAR_FLAG_FAIL_WAIT
	.comm	_FUNC_CLEAR_RST_FUN_DONE_S,4,2  ; @FUNC_CLEAR_RST_FUN_DONE_S
l_.str.1:                               ; @.str.1
	.asciz	"Func clear fail.\n"

	.no_dead_strip	_hns_roce_function_clear
.subsections_via_symbols
