	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_dsaf_wait_pkt_clean        ## -- Begin function hns_dsaf_wait_pkt_clean
	.p2align	4, 0x90
_hns_dsaf_wait_pkt_clean:               ## @hns_dsaf_wait_pkt_clean
	.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	_DSAF_SERVICE_NW_NUM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	%esi, (%rcx)
	jle	LBB0_11
## %bb.1:
	movq	%rdi, %r15
	movq	_HNS_MAX_WAIT_CNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	$1, %r13d
	testl	%edx, %edx
	jle	LBB0_2
## %bb.3:
	movslq	%esi, %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_DSAF_XGE_NUM@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rsi
	addq	%r14, %rsi
	shlq	$6, %rsi
	movq	_DSAF_VOQ_IN_PKT_NUM_0_REG@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_dsaf_read_dev
	movq	%rax, %r12
	movslq	(%rbx), %rsi
	addq	%r14, %rsi
	shlq	$6, %rsi
	movq	_DSAF_VOQ_OUT_PKT_NUM_0_REG@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_dsaf_read_dev
	cmpq	%rax, %r12
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movl	$100, %edi
	movl	$200, %esi
	callq	_usleep_range
	leal	1(%r13), %ecx
	movq	_HNS_MAX_WAIT_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, %r13d
	movl	%ecx, %r13d
	jl	LBB0_4
## %bb.7:
	movl	%ecx, %r13d
	jmp	LBB0_8
LBB0_2:
                                        ## implicit-def: $r12
                                        ## implicit-def: $rbx
	cmpl	%edx, %r13d
	jge	LBB0_10
	jmp	LBB0_11
LBB0_5:
	movq	_HNS_MAX_WAIT_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rbx
LBB0_8:
	xorl	%eax, %eax
	cmpl	%edx, %r13d
	jl	LBB0_11
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSAF_SERVICE_NW_NUM,4,2        ## @DSAF_SERVICE_NW_NUM
	.comm	_HNS_MAX_WAIT_CNT,4,2           ## @HNS_MAX_WAIT_CNT
	.comm	_DSAF_VOQ_IN_PKT_NUM_0_REG,8,3  ## @DSAF_VOQ_IN_PKT_NUM_0_REG
	.comm	_DSAF_XGE_NUM,4,2               ## @DSAF_XGE_NUM
	.comm	_DSAF_VOQ_OUT_PKT_NUM_0_REG,8,3 ## @DSAF_VOQ_OUT_PKT_NUM_0_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hns dsaf clean wait timeout(%u - %u).\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_dsaf_wait_pkt_clean        ; -- Begin function hns_dsaf_wait_pkt_clean
	.p2align	2
_hns_dsaf_wait_pkt_clean:               ; @hns_dsaf_wait_pkt_clean
	.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
Lloh0:
	adrp	x8, _DSAF_SERVICE_NW_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DSAF_SERVICE_NW_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_9
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x24, _HNS_MAX_WAIT_CNT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _HNS_MAX_WAIT_CNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x20, x1
	mov	w23, #1
Lloh5:
	adrp	x25, _DSAF_VOQ_IN_PKT_NUM_0_REG@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DSAF_VOQ_IN_PKT_NUM_0_REG@GOTPAGEOFF]
Lloh7:
	adrp	x26, _DSAF_XGE_NUM@GOTPAGE
Lloh8:
	ldr	x26, [x26, _DSAF_XGE_NUM@GOTPAGEOFF]
Lloh9:
	adrp	x27, _DSAF_VOQ_OUT_PKT_NUM_0_REG@GOTPAGE
Lloh10:
	ldr	x27, [x27, _DSAF_VOQ_OUT_PKT_NUM_0_REG@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	w9, [x26]
	add	w9, w9, w20
	lsl	w9, w9, #6
	add	x1, x8, w9, sxtw
	mov	x0, x19
	bl	_dsaf_read_dev
	mov	x21, x0
	ldr	x8, [x27]
	ldr	w9, [x26]
	add	w9, w9, w20
	lsl	w9, w9, #6
	add	x1, x8, w9, sxtw
	mov	x0, x19
	bl	_dsaf_read_dev
	cmp	x21, x0
	b.eq	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x0
	mov	w0, #100
	mov	w1, #200
	bl	_usleep_range
	add	w9, w23, #1
	ldr	w8, [x24]
	cmp	w23, w8
	mov	x23, x9
	b.lt	LBB0_3
; %bb.5:
	mov	x23, x9
	cmp	w23, w8
	b.lt	LBB0_9
LBB0_6:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x22
	bl	_dev_err
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_7:
	mov	w23, #1
                                        ; implicit-def: $x21
                                        ; implicit-def: $x22
	cmp	w23, w8
	b.lt	LBB0_9
	b	LBB0_6
LBB0_8:
	ldr	w8, [x24]
	mov	x22, x21
	cmp	w23, w8
	b.ge	LBB0_6
LBB0_9:
	mov	w0, #0
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DSAF_SERVICE_NW_NUM,4,2        ; @DSAF_SERVICE_NW_NUM
	.comm	_HNS_MAX_WAIT_CNT,4,2           ; @HNS_MAX_WAIT_CNT
	.comm	_DSAF_VOQ_IN_PKT_NUM_0_REG,8,3  ; @DSAF_VOQ_IN_PKT_NUM_0_REG
	.comm	_DSAF_XGE_NUM,4,2               ; @DSAF_XGE_NUM
	.comm	_DSAF_VOQ_OUT_PKT_NUM_0_REG,8,3 ; @DSAF_VOQ_OUT_PKT_NUM_0_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hns dsaf clean wait timeout(%u - %u).\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
