	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_dma_rx_read
_bgmac_dma_rx_read:                     ## @bgmac_dma_rx_read
	.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
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_BGMAC_DMA_RX_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%rbx), %rsi
	callq	_bgmac_read
	movq	_BGMAC_DMA_RX_STATDPTR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ecx, %eax
	subl	16(%rbx), %eax
	andl	%ecx, %eax
	sarl	$2, %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %eax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_bgmac_dma_rx_poison_buf
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movslq	(%rbx), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bgmac_dma_rx_setup_desc
	movslq	(%rbx), %rcx
	incq	%rcx
	movq	_BGMAC_RX_RING_SLOTS@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	movl	$0, %eax
	cmoval	%ecx, %eax
	movl	%eax, (%rbx)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	-68(%rbp), %ecx                 ## 4-byte Folded Reload
	jge	LBB0_14
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-72(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_14
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%r15), %r13
	movq	8(%rbx), %rcx
	cltq
	shlq	$4, %rax
	movq	%r15, %rdi
	leaq	(%rcx,%rax), %rbx
	movq	8(%rcx,%rax), %r14
	movq	_BGMAC_RX_BUF_OFFSET@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r15
	movl	(%rcx,%rax), %r12d
	movq	%rbx, %rsi
	callq	_bgmac_dma_rx_skb_for_slot
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_BGMAC_RX_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_dma_unmap_single
	movl	4(%r14,%r15,8), %edi
	callq	_le16_to_cpu
	movl	%eax, %r13d
	movl	(%r14,%r15,8), %edi
	callq	_le16_to_cpu
	cmpl	$57005, %r13d                   ## imm = 0xDEAD
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$48879, %eax                    ## imm = 0xBEEF
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	jmp	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_BGMAC_RX_ALLOC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, %r13d
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
	movq	%r14, %rdi
	callq	_virt_to_head_page
	movl	%eax, %edi
	callq	_put_page
	movq	8(%r15), %rax
	incl	12(%rax)
	incl	8(%rax)
	jmp	LBB0_13
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_ETH_FCS_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r14, %rdi
	callq	_build_skb
	movq	%rax, %r12
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_netdev_err
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_virt_to_head_page
	movl	%eax, %edi
	callq	_put_page
	movq	8(%r15), %rax
	incl	8(%rax)
	jmp	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	subl	%r15d, %r13d
	movq	_BGMAC_RX_FRAME_OFFSET@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	addl	%r13d, %esi
	movq	_BGMAC_RX_BUF_OFFSET@GOTPCREL(%rip), %r15
	addl	(%r15), %esi
	movq	%r12, %rdi
	callq	_skb_put
	movl	(%r15), %esi
	addl	(%r14), %esi
	movq	%r12, %rdi
	callq	_skb_pull
	movq	%r12, %rdi
	callq	_skb_checksum_none_assert
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rsi
	movq	%r12, %rdi
	callq	_eth_type_trans
	movl	%eax, (%r12)
	movq	8(%r15), %rax
	addl	%r13d, (%rax)
	incl	4(%rax)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_napi_gro_receive
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	jmp	LBB0_13
LBB0_14:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_bgmac_dma_rx_update_index
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_DMA_RX_STATUS,8,3        ## @BGMAC_DMA_RX_STATUS
	.comm	_BGMAC_DMA_RX_STATDPTR,4,2      ## @BGMAC_DMA_RX_STATDPTR
	.comm	_BGMAC_RX_BUF_OFFSET,4,2        ## @BGMAC_RX_BUF_OFFSET
	.comm	_BGMAC_RX_BUF_SIZE,4,2          ## @BGMAC_RX_BUF_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Found poisoned packet at slot %d, DMA issue!\n"

	.comm	_BGMAC_RX_ALLOC_SIZE,4,2        ## @BGMAC_RX_ALLOC_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Found oversized packet at slot %d, DMA issue!\n"

	.comm	_ETH_FCS_LEN,8,3                ## @ETH_FCS_LEN
L_.str.2:                               ## @.str.2
	.asciz	"build_skb failed\n"

	.comm	_BGMAC_RX_FRAME_OFFSET,4,2      ## @BGMAC_RX_FRAME_OFFSET
	.comm	_BGMAC_RX_RING_SLOTS,8,3        ## @BGMAC_RX_RING_SLOTS
	.no_dead_strip	_bgmac_dma_rx_read
.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_read
_bgmac_dma_rx_read:                     ; @bgmac_dma_rx_read
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1, #24]
Lloh0:
	adrp	x9, _BGMAC_DMA_RX_STATUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BGMAC_DMA_RX_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_bgmac_read
	mov	w22, #0
Lloh3:
	adrp	x8, _BGMAC_DMA_RX_STATDPTR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BGMAC_DMA_RX_STATDPTR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w9, w8, w0
	ldr	w10, [x19, #16]
	sub	w9, w9, w10
	and	w8, w9, w8
	asr	w23, w8, #2
	ldr	w8, [x19]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x27
	mov	x1, x28
	bl	_bgmac_dma_rx_poison_buf
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldrsw	x2, [x19]
	mov	x0, x20
	mov	x1, x19
	bl	_bgmac_dma_rx_setup_desc
	ldrsw	x8, [x19]
	add	x8, x8, #1
Lloh6:
	adrp	x9, _BGMAC_RX_RING_SLOTS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BGMAC_RX_RING_SLOTS@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	csel	w8, w8, wzr, hi
	str	w8, [x19]
	cmp	w22, w21
	b.ge	LBB0_13
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, w23
	b.eq	LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x27, [x20, #16]
	ldr	x9, [x19, #8]
	add	x28, x9, w8, sxtw #4
	ldr	x26, [x28, #8]
Lloh9:
	adrp	x8, _BGMAC_RX_BUF_OFFSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BGMAC_RX_BUF_OFFSET@GOTPAGEOFF]
Lloh11:
	ldrsw	x25, [x8]
	ldr	w24, [x28]
	mov	x0, x20
	mov	x1, x28
	bl	_bgmac_dma_rx_skb_for_slot
	cbnz	x0, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh12:
	adrp	x8, _BGMAC_RX_BUF_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BGMAC_RX_BUF_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	mov	x0, x27
	mov	x1, x24
	bl	_dma_unmap_single
	add	x24, x26, x25, lsl #3
	ldr	w0, [x24, #4]
	bl	_le16_to_cpu
	mov	x28, x0
	ldr	w0, [x24]
	bl	_le16_to_cpu
	mov	w8, #57005
	cmp	w28, w8
	mov	w8, #48879
	ccmp	w0, w8, #0, eq
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh18:
	adrp	x8, _BGMAC_RX_ALLOC_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BGMAC_RX_ALLOC_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	cmp	w28, w1
	b.le	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x20, #8]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_err
	mov	x0, x26
	bl	_virt_to_head_page
	bl	_put_page
	ldr	x8, [x20, #8]
	ldr	d0, [x8, #8]
	movi.2s	v1, #1
	add.2s	v0, v0, v1
	str	d0, [x8, #8]
	b	LBB0_2
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x20, #8]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh25:
	adrp	x8, _ETH_FCS_LEN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ETH_FCS_LEN@GOTPAGEOFF]
Lloh27:
	ldr	x24, [x8]
	mov	x0, x26
	bl	_build_skb
	mov	x27, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x20, #8]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_netdev_err
	mov	x0, x26
	bl	_virt_to_head_page
	bl	_put_page
	ldr	x8, [x20, #8]
	ldr	w9, [x8, #8]
	add	w9, w9, #1
	str	w9, [x8, #8]
	b	LBB0_2
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh30:
	adrp	x26, _BGMAC_RX_FRAME_OFFSET@GOTPAGE
Lloh31:
	ldr	x26, [x26, _BGMAC_RX_FRAME_OFFSET@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh32:
	adrp	x25, _BGMAC_RX_BUF_OFFSET@GOTPAGE
Lloh33:
	ldr	x25, [x25, _BGMAC_RX_BUF_OFFSET@GOTPAGEOFF]
	ldr	w9, [x25]
	sub	w24, w28, w24
	add	w8, w8, w24
	add	w1, w8, w9
	mov	x0, x27
	bl	_skb_put
	ldr	w8, [x26]
	ldr	w9, [x25]
	add	w1, w9, w8
	mov	x0, x27
	bl	_skb_pull
	mov	x0, x27
	bl	_skb_checksum_none_assert
	ldr	x1, [x20, #8]
	mov	x0, x27
	bl	_eth_type_trans
	str	w0, [x27]
	ldr	x8, [x20, #8]
	ldr	d0, [x8]
	movi.2s	v1, #1
	mov.s	v1[0], w24
	add.2s	v0, v0, v1
	str	d0, [x8]
	mov	x0, x20
	mov	x1, x27
	bl	_napi_gro_receive
	add	w22, w22, #1
	b	LBB0_2
LBB0_13:
	mov	x0, x20
	mov	x1, x19
	bl	_bgmac_dma_rx_update_index
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_DMA_RX_STATUS,8,3        ; @BGMAC_DMA_RX_STATUS
	.comm	_BGMAC_DMA_RX_STATDPTR,4,2      ; @BGMAC_DMA_RX_STATDPTR
	.comm	_BGMAC_RX_BUF_OFFSET,4,2        ; @BGMAC_RX_BUF_OFFSET
	.comm	_BGMAC_RX_BUF_SIZE,4,2          ; @BGMAC_RX_BUF_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Found poisoned packet at slot %d, DMA issue!\n"

	.comm	_BGMAC_RX_ALLOC_SIZE,4,2        ; @BGMAC_RX_ALLOC_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Found oversized packet at slot %d, DMA issue!\n"

	.comm	_ETH_FCS_LEN,8,3                ; @ETH_FCS_LEN
l_.str.2:                               ; @.str.2
	.asciz	"build_skb failed\n"

	.comm	_BGMAC_RX_FRAME_OFFSET,4,2      ; @BGMAC_RX_FRAME_OFFSET
	.comm	_BGMAC_RX_RING_SLOTS,8,3        ; @BGMAC_RX_RING_SLOTS
	.no_dead_strip	_bgmac_dma_rx_read
.subsections_via_symbols
