	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_dma_rx_setup_desc
_bgmac_dma_rx_setup_desc:               ## @bgmac_dma_rx_setup_desc
	.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, %r12
	movq	8(%rsi), %rax
	movq	16(%rsi), %r13
	movq	_BGMAC_RX_RING_SLOTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	xorl	%esi, %esi
	cmpl	%edx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	_BGMAC_DESC_CTL0_EOT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_2:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movslq	%edx, %r14
	movq	_BGMAC_RX_BUF_SIZE@GOTPCREL(%rip), %rcx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	_BGMAC_DESC_CTL1_LEN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	andl	(%rcx), %ebx
	movl	(%rax,%r14,4), %edi
	callq	_lower_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%r14, %r15
	shlq	$5, %r15
	movq	%rax, 24(%r13,%r15)
	movq	8(%r12), %rax
	movl	(%rax,%r14,4), %edi
	callq	_upper_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, 16(%r13,%r15)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movq	%rax, 8(%r13,%r15)
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r13,%r15)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r12)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_RX_RING_SLOTS,4,2        ## @BGMAC_RX_RING_SLOTS
	.comm	_BGMAC_DESC_CTL0_EOT,4,2        ## @BGMAC_DESC_CTL0_EOT
	.comm	_BGMAC_RX_BUF_SIZE,4,2          ## @BGMAC_RX_BUF_SIZE
	.comm	_BGMAC_DESC_CTL1_LEN,4,2        ## @BGMAC_DESC_CTL1_LEN
	.no_dead_strip	_bgmac_dma_rx_setup_desc
.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_setup_desc
_bgmac_dma_rx_setup_desc:               ; @bgmac_dma_rx_setup_desc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _BGMAC_RX_RING_SLOTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGMAC_RX_RING_SLOTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, #1
Lloh3:
	adrp	x9, _BGMAC_DESC_CTL0_EOT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BGMAC_DESC_CTL0_EOT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w2
	csel	w21, w9, wzr, eq
	sxtw	x23, w19
Lloh6:
	adrp	x8, _BGMAC_RX_BUF_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BGMAC_RX_BUF_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _BGMAC_DESC_CTL1_LEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BGMAC_DESC_CTL1_LEN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w22, w9, w8
	ldp	x8, x24, [x1, #8]
	sbfiz	x25, x19, #2, #32
	ldr	w0, [x8, x25]
	bl	_lower_32_bits
	bl	_cpu_to_le32
	add	x23, x24, x23, lsl #5
	str	x0, [x23, #24]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x25]
	bl	_upper_32_bits
	bl	_cpu_to_le32
	str	x0, [x23, #16]
	mov	x0, x21
	bl	_cpu_to_le32
	str	x0, [x23, #8]
	mov	x0, x22
	bl	_cpu_to_le32
	str	x0, [x23]
	str	w19, [x20]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_RX_RING_SLOTS,4,2        ; @BGMAC_RX_RING_SLOTS
	.comm	_BGMAC_DESC_CTL0_EOT,4,2        ; @BGMAC_DESC_CTL0_EOT
	.comm	_BGMAC_RX_BUF_SIZE,4,2          ; @BGMAC_RX_BUF_SIZE
	.comm	_BGMAC_DESC_CTL1_LEN,4,2        ; @BGMAC_DESC_CTL1_LEN
	.no_dead_strip	_bgmac_dma_rx_setup_desc
.subsections_via_symbols
