	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_dma_rx_reset
_bgmac_dma_rx_reset:                    ## @bgmac_dma_rx_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r14
	movq	_BGMAC_DMA_RX_CTL@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	xorl	%edx, %edx
	callq	_bgmac_write
	movq	_BGMAC_DMA_RX_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	movq	_BGMAC_DMA_RX_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BGMAC_DMA_RX_STAT_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_bgmac_wait_value
	testl	%eax, %eax
	je	LBB0_3
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movl	(%r14), %edi
	movq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_DMA_RX_CTL,8,3           ## @BGMAC_DMA_RX_CTL
	.comm	_BGMAC_DMA_RX_STATUS,8,3        ## @BGMAC_DMA_RX_STATUS
	.comm	_BGMAC_DMA_RX_STAT,4,2          ## @BGMAC_DMA_RX_STAT
	.comm	_BGMAC_DMA_RX_STAT_DISABLED,4,2 ## @BGMAC_DMA_RX_STAT_DISABLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset of ring 0x%X RX failed\n"

	.no_dead_strip	_bgmac_dma_rx_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_rx_reset
_bgmac_dma_rx_reset:                    ; @bgmac_dma_rx_reset
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x9, _BGMAC_DMA_RX_CTL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BGMAC_DMA_RX_CTL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w2, #0
	bl	_bgmac_write
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _BGMAC_DMA_RX_STATUS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BGMAC_DMA_RX_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
Lloh6:
	adrp	x8, _BGMAC_DMA_RX_STAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BGMAC_DMA_RX_STAT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _BGMAC_DMA_RX_STAT_DISABLED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BGMAC_DMA_RX_STAT_DISABLED@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w4, #10000
	bl	_bgmac_wait_value
	cbz	w0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	w0, [x20]
	ldr	x2, [x19]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_err
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_DMA_RX_CTL,8,3           ; @BGMAC_DMA_RX_CTL
	.comm	_BGMAC_DMA_RX_STATUS,8,3        ; @BGMAC_DMA_RX_STATUS
	.comm	_BGMAC_DMA_RX_STAT,4,2          ; @BGMAC_DMA_RX_STAT
	.comm	_BGMAC_DMA_RX_STAT_DISABLED,4,2 ; @BGMAC_DMA_RX_STAT_DISABLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset of ring 0x%X RX failed\n"

	.no_dead_strip	_bgmac_dma_rx_reset
.subsections_via_symbols
