	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8xxxu_flush_fifo            ## -- Begin function rtl8xxxu_flush_fifo
	.p2align	4, 0x90
_rtl8xxxu_flush_fifo:                   ## @rtl8xxxu_flush_fifo
	.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, %r12
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_REG_TXPAUSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$255, %edx
	callq	_rtl8xxxu_write8
	movq	_REG_RXPKT_NUM@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_read32
	movq	_RXPKT_NUM_RW_RELEASE_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_rtl8xxxu_write32
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movl	$100, %ebx
	movq	_RXPKT_NUM_RXDMA_IDLE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_read32
	testl	%eax, (%r14)
	jne	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	addl	$-1, %ebx
	jb	LBB0_1
## %bb.4:
	movl	$-1, %ebx
	jmp	LBB0_5
LBB0_2:
	xorl	%r15d, %r15d
LBB0_5:
	movq	_REG_RQPN_NPQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rtl8xxxu_write16
	movq	_REG_RQPN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-2147483648, %edx              ## imm = 0x80000000
	callq	_rtl8xxxu_write32
	movl	$2, %edi
	callq	_mdelay
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_warn
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_TXPAUSE,4,2                ## @REG_TXPAUSE
	.comm	_REG_RXPKT_NUM,4,2              ## @REG_RXPKT_NUM
	.comm	_RXPKT_NUM_RW_RELEASE_EN,4,2    ## @RXPKT_NUM_RW_RELEASE_EN
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RXPKT_NUM_RXDMA_IDLE,4,2       ## @RXPKT_NUM_RXDMA_IDLE
	.comm	_REG_RQPN_NPQ,4,2               ## @REG_RQPN_NPQ
	.comm	_REG_RQPN,4,2                   ## @REG_RQPN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to flush FIFO\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8xxxu_flush_fifo            ; -- Begin function rtl8xxxu_flush_fifo
	.p2align	2
_rtl8xxxu_flush_fifo:                   ; @rtl8xxxu_flush_fifo
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _REG_TXPAUSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_TXPAUSE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #255
	bl	_rtl8xxxu_write8
Lloh3:
	adrp	x23, _REG_RXPKT_NUM@GOTPAGE
Lloh4:
	ldr	x23, [x23, _REG_RXPKT_NUM@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_rtl8xxxu_read32
Lloh5:
	adrp	x8, _RXPKT_NUM_RW_RELEASE_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RXPKT_NUM_RW_RELEASE_EN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x23]
	mov	x0, x20
	bl	_rtl8xxxu_write32
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	mov	w22, #100
Lloh11:
	adrp	x24, _RXPKT_NUM_RXDMA_IDLE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _RXPKT_NUM_RXDMA_IDLE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_rtl8xxxu_read32
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w22, w22, #1
	cmn	w22, #1
	b.ne	LBB0_1
	b	LBB0_4
LBB0_3:
	mov	w21, #0
LBB0_4:
Lloh13:
	adrp	x8, _REG_RQPN_NPQ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REG_RQPN_NPQ@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_rtl8xxxu_write16
Lloh16:
	adrp	x8, _REG_RQPN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REG_RQPN@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-2147483648
	bl	_rtl8xxxu_write32
	mov	w0, #2
	bl	_mdelay
	cbnz	w22, LBB0_6
; %bb.5:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_6:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_TXPAUSE,4,2                ; @REG_TXPAUSE
	.comm	_REG_RXPKT_NUM,4,2              ; @REG_RXPKT_NUM
	.comm	_RXPKT_NUM_RW_RELEASE_EN,4,2    ; @RXPKT_NUM_RW_RELEASE_EN
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RXPKT_NUM_RXDMA_IDLE,4,2       ; @RXPKT_NUM_RXDMA_IDLE
	.comm	_REG_RQPN_NPQ,4,2               ; @REG_RQPN_NPQ
	.comm	_REG_RQPN,4,2                   ; @REG_RQPN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to flush FIFO\n"

.subsections_via_symbols
