	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mac_drv_clear_txd
_mac_drv_clear_txd:                     ## @mac_drv_clear_txd
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_NDD_TRACE
	movq	_QUEUE_S@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	_QUEUE_A0@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jle	LBB0_1
LBB0_6:
	leaq	L_.str.5(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NDD_TRACE                      ## TAILCALL
LBB0_1:
	movq	_BMU_SMT_TX@GOTPCREL(%rip), %r14
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$4, %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rbx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_DB_TX
	leaq	1(%r14), %rax
	movq	_QUEUE_A0@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %r14
	movq	%rbx, %r14
	movq	%rax, %rcx
	jge	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	movq	(%r12), %rax
	movq	(%rax,%rcx,8), %rbx
	movq	16(%rbx), %r13
	movl	$5, %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdx
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_DB_TX
	xorl	%r15d, %r15d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=2
	movl	$4, %edi
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_DB_TX
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_mac_drv_tx_complete
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=2
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%r13, 16(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, (%rbx)
	movl	%eax, %eax
	subq	%rax, 8(%rbx)
	xorl	%r15d, %r15d
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
	movq	_DDI_DMA_SYNC_FORCPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_DRV_BUF_FLUSH
	movl	$5, %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_DB_TX
	movl	8(%r13), %edi
	callq	_CR_READ
	movl	%eax, %edi
	callq	_le32_to_cpu
	movq	_BMU_OWN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	cmpq	$0, 8(%rbx)
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	(%r13), %r13
	incl	%r15d
	movq	_BMU_EOF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	16(%rbx), %r13
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, %r12d
	movq	_DMA_RD@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_3 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r13, %r15
	movl	8(%r13), %edi
	callq	_le32_to_cpu
	movl	%eax, %r14d
	movq	_BMU_SMT_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r14d, %edx
	sarl	$18, %edx
	orl	(%rbx), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_dma_complete
	movq	(%r13), %r13
	decl	%r12d
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=2
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	_BMU_SMT_TX@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	movq	%rax, %r14
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=2
	movq	%r12, %rdi
	callq	_get_txd_mb
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_smt_free_mbuf
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"THcB"

	.comm	_QUEUE_S,4,2                    ## @QUEUE_S
	.comm	_QUEUE_A0,4,2                   ## @QUEUE_A0
L_.str.1:                               ## @.str.1
	.asciz	"clear_txd: QUEUE = %d (0=sync/1=async)"

	.comm	_DDI_DMA_SYNC_FORCPU,4,2        ## @DDI_DMA_SYNC_FORCPU
L_.str.2:                               ## @.str.2
	.asciz	"check OWN/EOF bit of TxD 0x%p"

	.comm	_BMU_OWN,4,2                    ## @BMU_OWN
L_.str.3:                               ## @.str.3
	.asciz	"End of TxDs queue %d"

	.comm	_BMU_EOF,4,2                    ## @BMU_EOF
	.comm	_DMA_RD,4,2                     ## @DMA_RD
	.comm	_BMU_SMT_TX,4,2                 ## @BMU_SMT_TX
L_.str.4:                               ## @.str.4
	.asciz	"mac_drv_tx_comp for TxD 0x%p"

L_.str.5:                               ## @.str.5
	.asciz	"THcE"

	.no_dead_strip	_mac_drv_clear_txd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mac_drv_clear_txd
_mac_drv_clear_txd:                     ; @mac_drv_clear_txd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_NDD_TRACE
Lloh2:
	adrp	x8, _QUEUE_S@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QUEUE_S@GOTPAGEOFF]
Lloh4:
	ldrsw	x9, [x8]
Lloh5:
	adrp	x8, _QUEUE_A0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _QUEUE_A0@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w9, w8
	b.le	LBB0_2
LBB0_1:
Lloh8:
	adrp	x0, l_.str.5@PAGE
Lloh9:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_NDD_TRACE
LBB0_2:
Lloh10:
	adrp	x21, l_.str.2@PAGE
Lloh11:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh12:
	adrp	x22, _DMA_RD@GOTPAGE
Lloh13:
	ldr	x22, [x22, _DMA_RD@GOTPAGEOFF]
Lloh14:
	adrp	x23, _BMU_SMT_TX@GOTPAGE
Lloh15:
	ldr	x23, [x23, _BMU_SMT_TX@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	mov	x8, x20
	str	x8, [sp]
	mov	w0, #4
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_DB_TX
	add	x8, x20, #1
Lloh18:
	adrp	x9, _QUEUE_A0@GOTPAGE
Lloh19:
	ldr	x9, [x9, _QUEUE_A0@GOTPAGEOFF]
Lloh20:
	ldrsw	x9, [x9]
	cmp	x20, x9
	mov	x9, x8
	b.ge	LBB0_1
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
                                        ;       Child Loop BB0_12 Depth 3
	ldr	x8, [x19]
	ldr	x27, [x8, x9, lsl #3]
	ldr	x24, [x27, #16]
	stp	x9, x9, [sp]                    ; 8-byte Folded Spill
	mov	w0, #5
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DB_TX
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	str	x25, [sp]
	mov	w0, #4
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_DB_TX
	mov	x0, x19
	mov	x1, x25
	bl	_mac_drv_tx_complete
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x27]
	add	w8, w8, w28
	str	w8, [x27]
	ldr	x8, [x27, #8]
	sub	x8, x8, w28, uxtw
	stp	x8, x24, [x27, #8]
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
                                        ;       Child Loop BB0_12 Depth 3
	mov	w28, #0
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
Lloh25:
	adrp	x8, _DDI_DMA_SYNC_FORCPU@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DDI_DMA_SYNC_FORCPU@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_DRV_BUF_FLUSH
	str	x24, [sp]
	mov	w0, #5
	mov	x1, x21
	bl	_DB_TX
	ldr	w0, [x24, #8]
	bl	_CR_READ
	bl	_le32_to_cpu
Lloh28:
	adrp	x8, _BMU_OWN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BMU_OWN@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	x8, [x27, #8]
	cbz	x8, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=3
	ldr	x24, [x24]
	add	w28, w28, #1
Lloh31:
	adrp	x8, _BMU_EOF@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BMU_EOF@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	x24, [x27, #16]
	mov	x20, x28
LBB0_12:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x25, x24
	ldr	w0, [x24, #8]
	bl	_le32_to_cpu
	mov	x26, x0
	ldr	w8, [x22]
	ldr	w9, [x23]
	and	w9, w9, w0
	orr	w2, w8, w9, asr #18
	mov	x0, x19
	mov	x1, x24
	bl	_dma_complete
	ldr	x24, [x24]
	subs	w20, w20, #1
	b.ne	LBB0_12
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x23]
	tst	w8, w26
	b.eq	LBB0_5
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x19
	bl	_get_txd_mb
	mov	x1, x0
	mov	x0, x19
	bl	_smt_free_mbuf
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"THcB"

	.comm	_QUEUE_S,4,2                    ; @QUEUE_S
	.comm	_QUEUE_A0,4,2                   ; @QUEUE_A0
l_.str.1:                               ; @.str.1
	.asciz	"clear_txd: QUEUE = %d (0=sync/1=async)"

	.comm	_DDI_DMA_SYNC_FORCPU,4,2        ; @DDI_DMA_SYNC_FORCPU
l_.str.2:                               ; @.str.2
	.asciz	"check OWN/EOF bit of TxD 0x%p"

	.comm	_BMU_OWN,4,2                    ; @BMU_OWN
l_.str.3:                               ; @.str.3
	.asciz	"End of TxDs queue %d"

	.comm	_BMU_EOF,4,2                    ; @BMU_EOF
	.comm	_DMA_RD,4,2                     ; @DMA_RD
	.comm	_BMU_SMT_TX,4,2                 ; @BMU_SMT_TX
l_.str.4:                               ; @.str.4
	.asciz	"mac_drv_tx_comp for TxD 0x%p"

l_.str.5:                               ; @.str.5
	.asciz	"THcE"

	.no_dead_strip	_mac_drv_clear_txd
.subsections_via_symbols
