	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns3_clean_tx_ring             ## -- Begin function hns3_clean_tx_ring
	.p2align	4, 0x90
_hns3_clean_tx_ring:                    ## @hns3_clean_tx_ring
	.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	24(%rdi), %rax
	movq	16(%rax), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_netdev_priv
	movq	%rax, %r14
	movq	24(%rbx), %rax
	movq	_HNS3_RING_TX_RING_HEAD_REG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	8(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_rmb
	movq	%rbx, %rdi
	callq	_is_ring_empty
	testq	%rax, %rax
	jne	LBB0_10
## %bb.1:
	cmpl	(%rbx), %r12d
	jne	LBB0_2
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_is_valid_clean_head
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.11:
	movl	(%rbx), %r8d
	movl	48(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_netdev_err
	leaq	32(%rbx), %r14
	movq	%r14, %rdi
	callq	_u64_stats_update_begin
	incl	16(%rbx)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_u64_stats_update_end           ## TAILCALL
LBB0_3:
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_hns3_nic_reclaim_desc
	movl	-48(%rbp), %eax
	movq	40(%rbx), %rcx
	addl	%eax, (%rcx)
	movl	-44(%rbp), %eax
	addl	%eax, 4(%rcx)
	leaq	32(%rbx), %r12
	movq	%r12, %rdi
	callq	_u64_stats_update_begin
	movl	-48(%rbp), %eax
	addl	%eax, 4(%rbx)
	movl	-44(%rbp), %eax
	addl	%eax, 8(%rbx)
	movq	%r12, %rdi
	callq	_u64_stats_update_end
	movq	24(%rbx), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_netdev_get_tx_queue
	movq	%rax, %r12
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	movq	%rax, %rdi
	callq	_netdev_tx_completed_queue
	xorl	%r13d, %r13d
	cmpl	$0, -44(%rbp)
	je	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	callq	_netif_carrier_ok
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_ring_space
	movq	_HNS3_MAX_BD_PER_PKT@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	cmpq	(%rcx), %rax
	setg	%r13b
LBB0_6:
	movl	%r13d, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	xorl	%eax, %eax
	callq	_smp_mb
	movq	%r12, %rdi
	callq	_netif_tx_queue_stopped
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	_HNS3_NIC_STATE_DOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_netif_tx_wake_queue
	incl	12(%rbx)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS3_RING_TX_RING_HEAD_REG,8,3 ## @HNS3_RING_TX_RING_HEAD_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong head (%d, %d-%d)\n"

	.comm	_HNS3_MAX_BD_PER_PKT,8,3        ## @HNS3_MAX_BD_PER_PKT
	.comm	_HNS3_NIC_STATE_DOWN,4,2        ## @HNS3_NIC_STATE_DOWN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns3_clean_tx_ring             ; -- Begin function hns3_clean_tx_ring
	.p2align	2
_hns3_clean_tx_ring:                    ; @hns3_clean_tx_ring
	.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	x19, x0
	ldr	x8, [x0, #24]
	ldr	x8, [x8, #16]
	ldr	x21, [x8]
	mov	x0, x21
	bl	_netdev_priv
	mov	x20, x0
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
Lloh0:
	adrp	x9, _HNS3_RING_TX_RING_HEAD_REG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HNS3_RING_TX_RING_HEAD_REG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x22, x0
	bl	_rmb
	mov	x0, x19
	bl	_is_ring_empty
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	cmp	w22, w8
	b.ne	LBB0_3
LBB0_2:
	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
LBB0_3:
	mov	x0, x19
	mov	x1, x22
	bl	_is_valid_clean_head
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w3, [x19, #48]
	ldr	w4, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_netdev_err
	add	x20, x19, #32
	mov	x0, x20
	bl	_u64_stats_update_begin
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	mov	x0, x20
	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
	b	_u64_stats_update_end
LBB0_5:
	str	xzr, [sp, #8]
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	_hns3_nic_reclaim_desc
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #40]
	ldp	w10, w11, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	ldr	w8, [sp, #8]
	add	w8, w11, w8
	str	w8, [x9, #4]
	add	x22, x19, #32
	mov	x0, x22
	bl	_u64_stats_update_begin
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x19, #4]
	add	w8, w9, w8
	ldr	w9, [sp, #8]
	add	w9, w10, w9
	stp	w8, w9, [x19, #4]
	mov	x0, x22
	bl	_u64_stats_update_end
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_netdev_get_tx_queue
	mov	x22, x0
	ldp	w1, w2, [sp, #8]
	bl	_netdev_tx_completed_queue
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_8
; %bb.6:
	mov	x0, x21
	bl	_netif_carrier_ok
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_ring_space
Lloh5:
	adrp	x8, _HNS3_MAX_BD_PER_PKT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HNS3_MAX_BD_PER_PKT@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, gt
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.10:
	bl	_smp_mb
	mov	x0, x22
	bl	_netif_tx_queue_stopped
	cbz	x0, LBB0_2
; %bb.11:
Lloh8:
	adrp	x8, _HNS3_NIC_STATE_DOWN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HNS3_NIC_STATE_DOWN@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbnz	w0, LBB0_2
; %bb.12:
	mov	x0, x22
	bl	_netif_tx_wake_queue
	ldr	w8, [x19, #12]
	add	w8, w8, #1
	str	w8, [x19, #12]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS3_RING_TX_RING_HEAD_REG,8,3 ; @HNS3_RING_TX_RING_HEAD_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong head (%d, %d-%d)\n"

	.comm	_HNS3_MAX_BD_PER_PKT,8,3        ; @HNS3_MAX_BD_PER_PKT
	.comm	_HNS3_NIC_STATE_DOWN,4,2        ; @HNS3_NIC_STATE_DOWN
.subsections_via_symbols
