	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function bgmac_dma_init
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_bgmac_dma_init:                        ## @bgmac_dma_init
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_BGMAC_MAX_TX_RINGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15,%rbx)
	movq	_BGMAC_MAX_TX_RINGS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$48, %rbx
	cmpq	%rax, %r12
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r15
	leaq	(%r15,%rbx), %r14
	cmpq	$0, 24(%r15,%rbx)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_bgmac_dma_tx_enable
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %r14
	movq	_BGMAC_DMA_TX_RINGLO@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	addq	40(%r15,%rbx), %r13
	movl	32(%r15,%rbx), %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_bgmac_write
	movq	_BGMAC_DMA_TX_RINGHI@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	addq	40(%r15,%rbx), %r13
	movl	32(%r15,%rbx), %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r14, %r13
	movl	%eax, %edx
	callq	_bgmac_write
	cmpq	$0, 24(%r15,%rbx)
	je	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_bgmac_dma_tx_enable
	jmp	LBB0_2
LBB0_7:
	movq	_BGMAC_MAX_RX_RINGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_19
## %bb.8:
	xorl	%ecx, %ecx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_bgmac_dma_rx_update_index
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movq	_BGMAC_MAX_RX_RINGS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rcx
	jge	LBB0_19
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	(%r13), %r12
	movq	%r13, %r15
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rcx,2), %r13
	shlq	$4, %r13
	leaq	(%r12,%r13), %r14
	cmpq	$0, 24(%r12,%r13)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_bgmac_dma_rx_enable
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	leaq	(%r12,%r13), %rax
	addq	$24, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_BGMAC_DMA_RX_RINGLO@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	40(%r12,%r13), %rbx
	movl	32(%r12,%r13), %edi
	callq	_lower_32_bits
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_bgmac_write
	movq	_BGMAC_DMA_RX_RINGHI@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	40(%r12,%r13), %rbx
	movl	32(%r12,%r13), %edi
	callq	_upper_32_bits
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_bgmac_write
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_bgmac_dma_rx_enable
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r12,%r13)
	movq	_BGMAC_RX_RING_SLOTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%r15, %r13
	jle	LBB0_9
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_bgmac_dma_rx_skb_for_slot
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_bgmac_dma_rx_setup_desc
	incq	%rbx
	movq	_BGMAC_RX_RING_SLOTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jl	LBB0_16
	jmp	LBB0_9
LBB0_18:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_bgmac_dma_cleanup
	jmp	LBB0_20
LBB0_19:
	xorl	%r12d, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_MAX_TX_RINGS,4,2         ## @BGMAC_MAX_TX_RINGS
	.comm	_BGMAC_DMA_TX_RINGLO,8,3        ## @BGMAC_DMA_TX_RINGLO
	.comm	_BGMAC_DMA_TX_RINGHI,8,3        ## @BGMAC_DMA_TX_RINGHI
	.comm	_BGMAC_MAX_RX_RINGS,4,2         ## @BGMAC_MAX_RX_RINGS
	.comm	_BGMAC_DMA_RX_RINGLO,8,3        ## @BGMAC_DMA_RX_RINGLO
	.comm	_BGMAC_DMA_RX_RINGHI,8,3        ## @BGMAC_DMA_RX_RINGHI
	.comm	_BGMAC_RX_RING_SLOTS,4,2        ## @BGMAC_RX_RING_SLOTS
	.no_dead_strip	_bgmac_dma_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgmac_dma_init
_bgmac_dma_init:                        ; @bgmac_dma_init
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _BGMAC_MAX_TX_RINGS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BGMAC_MAX_TX_RINGS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x23, #0
	mov	x24, #0
Lloh2:
	adrp	x25, _BGMAC_DMA_TX_RINGLO@GOTPAGE
Lloh3:
	ldr	x25, [x25, _BGMAC_DMA_TX_RINGLO@GOTPAGEOFF]
Lloh4:
	adrp	x26, _BGMAC_DMA_TX_RINGHI@GOTPAGE
Lloh5:
	ldr	x26, [x26, _BGMAC_DMA_TX_RINGHI@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	add	x8, x27, x23
	stp	xzr, xzr, [x8, #8]
	ldrsw	x8, [x22]
	add	x23, x23, #48
	cmp	x24, x8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x19, #8]
	add	x20, x27, x23
	ldr	x8, [x20, #24]
	cbnz	x8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_dma_tx_enable
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #40]
	ldr	x9, [x25]
	add	x21, x9, x8
	ldr	w0, [x20, #32]
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_bgmac_write
	ldr	x8, [x20, #40]
	ldr	x9, [x26]
	add	x21, x9, x8
	ldr	w0, [x20, #32]
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_bgmac_write
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_dma_tx_enable
	b	LBB0_2
LBB0_7:
Lloh6:
	adrp	x23, _BGMAC_MAX_RX_RINGS@GOTPAGE
Lloh7:
	ldr	x23, [x23, _BGMAC_MAX_RX_RINGS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.8:
	mov	x24, #0
	mov	w25, #48
Lloh8:
	adrp	x28, _BGMAC_RX_RING_SLOTS@GOTPAGE
Lloh9:
	ldr	x28, [x28, _BGMAC_RX_RING_SLOTS@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_dma_rx_update_index
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.ge	LBB0_19
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	ldr	x22, [x19]
	madd	x20, x24, x25, x22
	mov	x26, x20
	ldr	x8, [x26, #24]!
	cbnz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_dma_rx_enable
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	madd	x27, x24, x25, x22
	ldr	x8, [x27, #40]
Lloh10:
	adrp	x9, _BGMAC_DMA_RX_RINGLO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BGMAC_DMA_RX_RINGLO@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x21, x9, x8
	ldr	w0, [x27, #32]
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_bgmac_write
	ldr	x8, [x27, #40]
Lloh13:
	adrp	x9, _BGMAC_DMA_RX_RINGHI@GOTPAGE
Lloh14:
	ldr	x9, [x9, _BGMAC_DMA_RX_RINGHI@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x21, x9, x8
	ldr	w0, [x27, #32]
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_bgmac_write
	ldr	x8, [x26]
	cbz	x8, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_dma_rx_enable
LBB0_14:                                ;   in Loop: Header=BB0_10 Depth=1
	madd	x8, x24, x25, x22
	stp	xzr, xzr, [x8, #8]
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x26, #0
	mov	x21, #0
LBB0_16:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20]
	add	x1, x8, x26
	mov	x0, x19
	bl	_bgmac_dma_rx_skb_for_slot
	cbnz	w0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_bgmac_dma_rx_setup_desc
	add	x21, x21, #1
	ldrsw	x8, [x28]
	add	x26, x26, #4
	cmp	x21, x8
	b.lt	LBB0_16
	b	LBB0_9
LBB0_18:
	mov	x22, x0
	mov	x0, x19
	bl	_bgmac_dma_cleanup
	b	LBB0_20
LBB0_19:
	mov	w22, #0
LBB0_20:
	mov	x0, x22
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_MAX_TX_RINGS,4,2         ; @BGMAC_MAX_TX_RINGS
	.comm	_BGMAC_DMA_TX_RINGLO,8,3        ; @BGMAC_DMA_TX_RINGLO
	.comm	_BGMAC_DMA_TX_RINGHI,8,3        ; @BGMAC_DMA_TX_RINGHI
	.comm	_BGMAC_MAX_RX_RINGS,4,2         ; @BGMAC_MAX_RX_RINGS
	.comm	_BGMAC_DMA_RX_RINGLO,8,3        ; @BGMAC_DMA_RX_RINGLO
	.comm	_BGMAC_DMA_RX_RINGHI,8,3        ; @BGMAC_DMA_RX_RINGHI
	.comm	_BGMAC_RX_RING_SLOTS,4,2        ; @BGMAC_RX_RING_SLOTS
	.no_dead_strip	_bgmac_dma_init
.subsections_via_symbols
