	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_dma_tx_reset
_bgmac_dma_tx_reset:                    ## @bgmac_dma_tx_reset
	.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	%rsi, %r15
	movq	(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movq	_BGMAC_DMA_TX_CTL@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	_BGMAC_DMA_TX_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bgmac_write
	movl	$1000, %r13d                    ## imm = 0x3E8
	movq	_BGMAC_DMA_TX_STAT_STOPPED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BGMAC_DMA_TX_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_bgmac_read
	movl	%eax, %ebx
	movq	_BGMAC_DMA_TX_STAT@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_BGMAC_DMA_TX_STAT_DISABLED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_BGMAC_DMA_TX_STAT_IDLEWAIT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	(%r12), %ebx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	_udelay
	decl	%r13d
	jne	LBB0_2
## %bb.6:
	movl	(%r14), %edi
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movq	_BGMAC_DMA_TX_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_bgmac_write
	movq	_BGMAC_DMA_TX_STATUS@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	(%r15), %rsi
	movq	_BGMAC_DMA_TX_STAT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	_BGMAC_DMA_TX_STAT_DISABLED@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_bgmac_wait_value
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	(%r14), %edi
	movq	(%r15), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movl	$300, %edi                      ## imm = 0x12C
	callq	_udelay
	movq	(%r13), %rsi
	addq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_bgmac_read
	andl	(%rbx), %eax
	cmpl	(%r12), %eax
	jne	LBB0_10
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r14), %edi
	movq	(%r15), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_DMA_TX_CTL,8,3           ## @BGMAC_DMA_TX_CTL
	.comm	_BGMAC_DMA_TX_SUSPEND,4,2       ## @BGMAC_DMA_TX_SUSPEND
	.comm	_BGMAC_DMA_TX_STATUS,8,3        ## @BGMAC_DMA_TX_STATUS
	.comm	_BGMAC_DMA_TX_STAT,4,2          ## @BGMAC_DMA_TX_STAT
	.comm	_BGMAC_DMA_TX_STAT_DISABLED,4,2 ## @BGMAC_DMA_TX_STAT_DISABLED
	.comm	_BGMAC_DMA_TX_STAT_IDLEWAIT,4,2 ## @BGMAC_DMA_TX_STAT_IDLEWAIT
	.comm	_BGMAC_DMA_TX_STAT_STOPPED,4,2  ## @BGMAC_DMA_TX_STAT_STOPPED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout suspending DMA TX ring 0x%X (BGMAC_DMA_TX_STAT: 0x%08X)\n"

L_.str.1:                               ## @.str.1
	.asciz	"DMA TX ring 0x%X wasn't disabled on time, waiting additional 300us\n"

L_.str.2:                               ## @.str.2
	.asciz	"Reset of DMA TX ring 0x%X failed\n"

	.no_dead_strip	_bgmac_dma_tx_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgmac_dma_tx_reset
_bgmac_dma_tx_reset:                    ; @bgmac_dma_tx_reset
	.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
	ldr	x8, [x1]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _BGMAC_DMA_TX_CTL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BGMAC_DMA_TX_CTL@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x1, x9, x8
Lloh2:
	adrp	x8, _BGMAC_DMA_TX_SUSPEND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BGMAC_DMA_TX_SUSPEND@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_bgmac_write
	mov	w25, #1000
Lloh5:
	adrp	x23, _BGMAC_DMA_TX_STATUS@GOTPAGE
Lloh6:
	ldr	x23, [x23, _BGMAC_DMA_TX_STATUS@GOTPAGEOFF]
Lloh7:
	adrp	x22, _BGMAC_DMA_TX_STAT@GOTPAGE
Lloh8:
	ldr	x22, [x22, _BGMAC_DMA_TX_STAT@GOTPAGEOFF]
Lloh9:
	adrp	x21, _BGMAC_DMA_TX_STAT_DISABLED@GOTPAGE
Lloh10:
	ldr	x21, [x21, _BGMAC_DMA_TX_STAT_DISABLED@GOTPAGEOFF]
Lloh11:
	adrp	x26, _BGMAC_DMA_TX_STAT_IDLEWAIT@GOTPAGE
Lloh12:
	ldr	x26, [x26, _BGMAC_DMA_TX_STAT_IDLEWAIT@GOTPAGEOFF]
Lloh13:
	adrp	x27, _BGMAC_DMA_TX_STAT_STOPPED@GOTPAGE
Lloh14:
	ldr	x27, [x27, _BGMAC_DMA_TX_STAT_STOPPED@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	x0, x20
	bl	_bgmac_read
	ldr	w8, [x22]
	and	w28, w8, w0
	ldr	w8, [x21]
	ldr	w9, [x26]
	ldr	w10, [x27]
	cmp	w28, w8
	ccmp	w28, w9, #4, ne
	ccmp	w28, w10, #4, ne
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_udelay
	subs	w25, w25, #1
	b.ne	LBB0_2
; %bb.4:
	ldr	w0, [x20]
	ldr	x2, [x19]
	str	x28, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
	ldr	x8, [x19]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	x0, x20
	mov	w2, #0
	bl	_bgmac_write
	ldr	x8, [x19]
	ldr	x9, [x23]
	add	x1, x9, x8
	ldr	w2, [x22]
	ldr	w3, [x21]
	mov	x0, x20
	mov	w4, #10000
	bl	_bgmac_wait_value
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	w0, [x20]
	ldr	x2, [x19]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	mov	w0, #300
	bl	_udelay
	ldr	x8, [x19]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	x0, x20
	bl	_bgmac_read
	ldr	w8, [x22]
	and	w8, w8, w0
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_8
LBB0_7:
	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
	ret
LBB0_8:
	ldr	w0, [x20]
	ldr	x2, [x19]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	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	_dev_err
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_DMA_TX_CTL,8,3           ; @BGMAC_DMA_TX_CTL
	.comm	_BGMAC_DMA_TX_SUSPEND,4,2       ; @BGMAC_DMA_TX_SUSPEND
	.comm	_BGMAC_DMA_TX_STATUS,8,3        ; @BGMAC_DMA_TX_STATUS
	.comm	_BGMAC_DMA_TX_STAT,4,2          ; @BGMAC_DMA_TX_STAT
	.comm	_BGMAC_DMA_TX_STAT_DISABLED,4,2 ; @BGMAC_DMA_TX_STAT_DISABLED
	.comm	_BGMAC_DMA_TX_STAT_IDLEWAIT,4,2 ; @BGMAC_DMA_TX_STAT_IDLEWAIT
	.comm	_BGMAC_DMA_TX_STAT_STOPPED,4,2  ; @BGMAC_DMA_TX_STAT_STOPPED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout suspending DMA TX ring 0x%X (BGMAC_DMA_TX_STAT: 0x%08X)\n"

l_.str.1:                               ; @.str.1
	.asciz	"DMA TX ring 0x%X wasn't disabled on time, waiting additional 300us\n"

l_.str.2:                               ; @.str.2
	.asciz	"Reset of DMA TX ring 0x%X failed\n"

	.no_dead_strip	_bgmac_dma_tx_reset
.subsections_via_symbols
