	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_rcb_reset_ring_hw          ## -- Begin function hns_rcb_reset_ring_hw
	.p2align	4, 0x90
_hns_rcb_reset_ring_hw:                 ## @hns_rcb_reset_ring_hw
	.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	%rdi, %rbx
	movq	_RCB_RESET_TRY_TIMES@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	testq	%rax, %rax
	jle	LBB0_1
## %bb.2:
	movl	$1, %r15d
	movq	_RCB_RING_TX_RING_FBDNUM_REG@GOTPCREL(%rip), %r12
	movq	_RCB_RING_T0_BE_RST@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_dsaf_write_dev
	testb	%r12b, %r12b
	movq	_RCB_RESET_TRY_TIMES@GOTPCREL(%rip), %r14
	movq	_RCB_RING_TX_RING_FBDNUM_REG@GOTPCREL(%rip), %r12
	je	LBB0_11
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%r15), %rcx
	movq	(%r14), %rax
	cmpq	%rax, %r15
	movq	%rcx, %r15
	jge	LBB0_12
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	$100, %edi
	movl	$200, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_dsaf_read_dev
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_RCB_RING_PREFETCH_EN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_dsaf_write_dev
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_dsaf_write_dev
	movl	$20, %edi
	callq	_msleep
	movq	_RCB_RING_COULD_BE_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dsaf_read_dev
	testq	%rax, %rax
	sete	%r12b
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_RCB_RESET_WAIT_TIMES@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_dsaf_write_dev
	movl	(%r13), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_dsaf_write_dev
	movl	$20, %edi
	callq	_msleep
	movq	_RCB_RING_COULD_BE_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dsaf_read_dev
	testq	%rax, %rax
	sete	%r12b
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	leaq	1(%r14), %rax
	movq	_RCB_RESET_WAIT_TIMES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r14
	movq	%rax, %r14
	jl	LBB0_8
	jmp	LBB0_10
LBB0_1:
	movl	$1, %ecx
LBB0_12:
	cmpq	%rax, %rcx
	jge	LBB0_14
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	(%r14), %rax
	movq	%r15, %rcx
	cmpq	%rax, %rcx
	jl	LBB0_13
LBB0_14:
	movq	8(%rbx), %rax
	movl	(%rax), %r14d
	movl	(%rbx), %edi
	callq	_hns_ae_get_vf_cb
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RCB_RESET_TRY_TIMES,8,3        ## @RCB_RESET_TRY_TIMES
	.comm	_RCB_RING_TX_RING_FBDNUM_REG,4,2 ## @RCB_RING_TX_RING_FBDNUM_REG
	.comm	_RCB_RING_PREFETCH_EN_REG,4,2   ## @RCB_RING_PREFETCH_EN_REG
	.comm	_RCB_RING_T0_BE_RST,4,2         ## @RCB_RING_T0_BE_RST
	.comm	_RCB_RING_COULD_BE_RST,4,2      ## @RCB_RING_COULD_BE_RST
	.comm	_RCB_RESET_WAIT_TIMES,8,3       ## @RCB_RESET_WAIT_TIMES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port%d reset ring fail\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_rcb_reset_ring_hw          ; -- Begin function hns_rcb_reset_ring_hw
	.p2align	2
_hns_rcb_reset_ring_hw:                 ; @hns_rcb_reset_ring_hw
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x20, _RCB_RESET_TRY_TIMES@GOTPAGE
Lloh1:
	ldr	x20, [x20, _RCB_RESET_TRY_TIMES@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w21, #1
Lloh2:
	adrp	x22, _RCB_RING_TX_RING_FBDNUM_REG@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RCB_RING_TX_RING_FBDNUM_REG@GOTPAGEOFF]
Lloh4:
	adrp	x23, _RCB_RING_PREFETCH_EN_REG@GOTPAGE
Lloh5:
	ldr	x23, [x23, _RCB_RING_PREFETCH_EN_REG@GOTPAGEOFF]
Lloh6:
	adrp	x24, _RCB_RING_T0_BE_RST@GOTPAGE
Lloh7:
	ldr	x24, [x24, _RCB_RING_T0_BE_RST@GOTPAGEOFF]
Lloh8:
	adrp	x25, _RCB_RING_COULD_BE_RST@GOTPAGE
Lloh9:
	ldr	x25, [x25, _RCB_RING_COULD_BE_RST@GOTPAGEOFF]
Lloh10:
	adrp	x26, _RCB_RESET_WAIT_TIMES@GOTPAGE
Lloh11:
	ldr	x26, [x26, _RCB_RESET_WAIT_TIMES@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #0
	bl	_dsaf_write_dev
	tbz	w28, #0, LBB0_11
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x21, #1
	ldr	x8, [x20]
	cmp	x21, x8
	mov	x21, x9
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	w0, #100
	mov	w1, #200
	bl	_usleep_range
	ldr	w1, [x22]
	mov	x0, x19
	bl	_dsaf_read_dev
	cbnz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_dsaf_write_dev
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #1
	bl	_dsaf_write_dev
	mov	w0, #20
	bl	_msleep
	ldr	w1, [x25]
	mov	x0, x19
	bl	_dsaf_read_dev
	cmp	x0, #0
	cset	w28, eq
	ldr	x8, [x26]
	ccmp	x8, #1, #8, eq
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #1
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #0
	bl	_dsaf_write_dev
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #1
	bl	_dsaf_write_dev
	mov	w0, #20
	bl	_msleep
	ldr	w1, [x25]
	mov	x0, x19
	bl	_dsaf_read_dev
	cmp	x0, #0
	cset	w28, eq
	ldr	x8, [x26]
	cmp	x0, #0
	ccmp	x27, x8, #0, eq
	add	x27, x27, #1
	b.lt	LBB0_7
	b	LBB0_2
LBB0_8:
	mov	w9, #1
LBB0_9:
	cmp	x9, x8
	b.ge	LBB0_12
LBB0_10:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x8, [x20]
	mov	x9, x21
	cmp	x9, x8
	b.lt	LBB0_10
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	w20, [x8]
	ldr	w0, [x19]
	bl	_hns_ae_get_vf_cb
	ldr	w2, [x0]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dev_err
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RCB_RESET_TRY_TIMES,8,3        ; @RCB_RESET_TRY_TIMES
	.comm	_RCB_RING_TX_RING_FBDNUM_REG,4,2 ; @RCB_RING_TX_RING_FBDNUM_REG
	.comm	_RCB_RING_PREFETCH_EN_REG,4,2   ; @RCB_RING_PREFETCH_EN_REG
	.comm	_RCB_RING_T0_BE_RST,4,2         ; @RCB_RING_T0_BE_RST
	.comm	_RCB_RING_COULD_BE_RST,4,2      ; @RCB_RING_COULD_BE_RST
	.comm	_RCB_RESET_WAIT_TIMES,8,3       ; @RCB_RESET_WAIT_TIMES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port%d reset ring fail\n"

.subsections_via_symbols
