	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sysport_init_rx_ring
_bcm_sysport_init_rx_ring:              ## @bcm_sysport_init_rx_ring
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	4(%rdi), %eax
	movq	_WORDS_PER_DESC@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, (%rdi)
	movq	_SYS_PORT_RDMA_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	48(%rdi), %rcx
	movq	%rcx, 8(%rdi)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rdi)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movl	(%r15), %r9d
	testl	%r9d, %r9d
	jle	LBB0_10
## %bb.2:
	movq	8(%r15), %rdi
	movq	_DESC_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	leaq	-1(%r9), %rcx
	movl	%r9d, %r8d
	andl	$3, %r8d
	cmpq	$3, %rcx
	jae	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_4:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r15), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
LBB0_5:
	andl	$-4, %r9d
	leaq	(%rdx,%rdx), %r10
	leaq	(,%rdx,4), %r11
	leaq	(%rdx,%rdx,2), %r14
	xorl	%ebx, %ebx
	movq	%rdi, %rcx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, (%rax,%rbx,8)
	leaq	(%rdx,%rcx), %rsi
	movq	%rsi, 8(%rax,%rbx,8)
	leaq	(%r10,%rcx), %rsi
	movq	%rsi, 16(%rax,%rbx,8)
	leaq	(%r14,%rcx), %rsi
	movq	%rsi, 24(%rax,%rbx,8)
	addq	$4, %rbx
	addq	%r11, %rcx
	cmpq	%rbx, %r9
	jne	LBB0_6
LBB0_7:
	testq	%r8, %r8
	je	LBB0_10
## %bb.8:
	leaq	(%rax,%rbx,8), %rax
	imulq	%rdx, %rbx
	addq	%rbx, %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdi, (%rax,%rcx,8)
	incq	%rcx
	addq	%rdx, %rdi
	cmpq	%rcx, %r8
	jne	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_bcm_sysport_alloc_rx_bufs
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r14d
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r15), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_err
	jmp	LBB0_15
LBB0_12:
	movq	_RDMA_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rdma_readl
	movq	_RDMA_DISABLED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_enable_set
LBB0_14:
	movq	_RDMA_WRITE_PTR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movq	_RDMA_WRITE_PTR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movq	_RDMA_PROD_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movq	_RDMA_CONS_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movl	(%r15), %esi
	movq	_RDMA_RING_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_RX_BUF_LENGTH@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_RDMA_RING_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_rdma_writel
	movq	_RDMA_START_ADDR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movq	_RDMA_START_ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movq	_RDMA_END_ADDR_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rdma_writel
	movl	4(%r15), %esi
	decl	%esi
	movq	_RDMA_END_ADDR_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_rdma_writel
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%r15), %edx
	movl	(%r15), %r8d
	movq	8(%r15), %r9
	leaq	L_.str.2(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_dbg
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WORDS_PER_DESC,4,2             ## @WORDS_PER_DESC
	.comm	_SYS_PORT_RDMA_OFFSET,8,3       ## @SYS_PORT_RDMA_OFFSET
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CB allocation failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DESC_SIZE,4,2                  ## @DESC_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"SKB allocation failed\n"

	.comm	_RDMA_STATUS,4,2                ## @RDMA_STATUS
	.comm	_RDMA_DISABLED,4,2              ## @RDMA_DISABLED
	.comm	_RDMA_WRITE_PTR_LO,4,2          ## @RDMA_WRITE_PTR_LO
	.comm	_RDMA_WRITE_PTR_HI,4,2          ## @RDMA_WRITE_PTR_HI
	.comm	_RDMA_PROD_INDEX,4,2            ## @RDMA_PROD_INDEX
	.comm	_RDMA_CONS_INDEX,4,2            ## @RDMA_CONS_INDEX
	.comm	_RDMA_RING_SIZE_SHIFT,4,2       ## @RDMA_RING_SIZE_SHIFT
	.comm	_RX_BUF_LENGTH,4,2              ## @RX_BUF_LENGTH
	.comm	_RDMA_RING_BUF_SIZE,4,2         ## @RDMA_RING_BUF_SIZE
	.comm	_RDMA_START_ADDR_HI,4,2         ## @RDMA_START_ADDR_HI
	.comm	_RDMA_START_ADDR_LO,4,2         ## @RDMA_START_ADDR_LO
	.comm	_RDMA_END_ADDR_HI,4,2           ## @RDMA_END_ADDR_HI
	.comm	_RDMA_END_ADDR_LO,4,2           ## @RDMA_END_ADDR_LO
L_.str.2:                               ## @.str.2
	.asciz	"RDMA cfg, num_rx_bds=%d, rx_bds=%p\n"

	.no_dead_strip	_bcm_sysport_init_rx_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sysport_init_rx_ring
_bcm_sysport_init_rx_ring:              ; @bcm_sysport_init_rx_ring
	.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
	mov	x19, x0
	ldr	w8, [x0, #4]
Lloh0:
	adrp	x9, _WORDS_PER_DESC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WORDS_PER_DESC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w0, w8, w9
	str	w0, [x19]
	ldr	x8, [x19, #48]
Lloh3:
	adrp	x9, _SYS_PORT_RDMA_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SYS_PORT_RDMA_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [x19, #8]
	stp	xzr, xzr, [x19, #32]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.2:
	ldr	x10, [x19, #8]
Lloh9:
	adrp	x8, _DESC_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DESC_SIZE@GOTPAGEOFF]
Lloh11:
	ldrsw	x8, [x8]
	cmp	w9, #4
	b.hs	LBB0_5
; %bb.3:
	mov	x11, #0
	b	LBB0_8
LBB0_4:
Lloh12:
	adrp	x8, _hw@GOTPAGE
Lloh13:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [x19, #16]
Lloh15:
	adrp	x3, l_.str@PAGE
Lloh16:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_err
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_15
LBB0_5:
	and	x11, x9, #0xfffffffc
	lsl	x12, x8, #1
	add	x13, x12, x8
	lsl	x14, x8, #2
	add	x15, x0, #16
	mov	x16, x11
	mov	x17, x10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x8, x17
	add	x2, x12, x17
	add	x3, x13, x17
	stp	x17, x1, [x15, #-16]
	stp	x2, x3, [x15], #32
	add	x17, x17, x14
	subs	x16, x16, #4
	b.ne	LBB0_6
; %bb.7:
	cmp	x11, x9
	b.eq	LBB0_10
LBB0_8:
	madd	x10, x11, x8, x10
	add	x12, x0, x11, lsl #3
	sub	x9, x9, x11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	x10, [x12], #8
	add	x10, x10, x8
	subs	x9, x9, #1
	b.ne	LBB0_9
LBB0_10:
	mov	x0, x19
	bl	_bcm_sysport_alloc_rx_bufs
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
Lloh20:
	adrp	x8, _hw@GOTPAGE
Lloh21:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w2, [x19, #16]
Lloh23:
	adrp	x3, l_.str.1@PAGE
Lloh24:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netif_err
	b	LBB0_15
LBB0_12:
Lloh25:
	adrp	x8, _RDMA_STATUS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RDMA_STATUS@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rdma_readl
Lloh28:
	adrp	x8, _RDMA_DISABLED@GOTPAGE
Lloh29:
	ldr	x8, [x8, _RDMA_DISABLED@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_enable_set
LBB0_14:
Lloh31:
	adrp	x8, _RDMA_WRITE_PTR_LO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _RDMA_WRITE_PTR_LO@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
Lloh34:
	adrp	x8, _RDMA_WRITE_PTR_HI@GOTPAGE
Lloh35:
	ldr	x8, [x8, _RDMA_WRITE_PTR_HI@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
Lloh37:
	adrp	x8, _RDMA_PROD_INDEX@GOTPAGE
Lloh38:
	ldr	x8, [x8, _RDMA_PROD_INDEX@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
Lloh40:
	adrp	x8, _RDMA_CONS_INDEX@GOTPAGE
Lloh41:
	ldr	x8, [x8, _RDMA_CONS_INDEX@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
	ldr	w8, [x19]
Lloh43:
	adrp	x9, _RDMA_RING_SIZE_SHIFT@GOTPAGE
Lloh44:
	ldr	x9, [x9, _RDMA_RING_SIZE_SHIFT@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
Lloh46:
	adrp	x10, _RX_BUF_LENGTH@GOTPAGE
Lloh47:
	ldr	x10, [x10, _RX_BUF_LENGTH@GOTPAGEOFF]
	lsl	w8, w8, w9
Lloh48:
	ldr	w9, [x10]
	orr	w1, w8, w9
Lloh49:
	adrp	x8, _RDMA_RING_BUF_SIZE@GOTPAGE
Lloh50:
	ldr	x8, [x8, _RDMA_RING_BUF_SIZE@GOTPAGEOFF]
Lloh51:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rdma_writel
Lloh52:
	adrp	x8, _RDMA_START_ADDR_HI@GOTPAGE
Lloh53:
	ldr	x8, [x8, _RDMA_START_ADDR_HI@GOTPAGEOFF]
Lloh54:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
Lloh55:
	adrp	x8, _RDMA_START_ADDR_LO@GOTPAGE
Lloh56:
	ldr	x8, [x8, _RDMA_START_ADDR_LO@GOTPAGEOFF]
Lloh57:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
Lloh58:
	adrp	x8, _RDMA_END_ADDR_HI@GOTPAGE
Lloh59:
	ldr	x8, [x8, _RDMA_END_ADDR_HI@GOTPAGEOFF]
Lloh60:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_rdma_writel
	ldr	w8, [x19, #4]
	sub	w1, w8, #1
Lloh61:
	adrp	x8, _RDMA_END_ADDR_LO@GOTPAGE
Lloh62:
	ldr	x8, [x8, _RDMA_END_ADDR_LO@GOTPAGEOFF]
Lloh63:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rdma_writel
Lloh64:
	adrp	x8, _hw@GOTPAGE
Lloh65:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh66:
	ldr	w1, [x8]
	ldr	w2, [x19, #16]
	ldr	w4, [x19]
	ldr	x5, [x19, #8]
Lloh67:
	adrp	x3, l_.str.2@PAGE
Lloh68:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netif_dbg
	mov	w20, #0
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_WORDS_PER_DESC,4,2             ; @WORDS_PER_DESC
	.comm	_SYS_PORT_RDMA_OFFSET,8,3       ; @SYS_PORT_RDMA_OFFSET
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CB allocation failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DESC_SIZE,4,2                  ; @DESC_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"SKB allocation failed\n"

	.comm	_RDMA_STATUS,4,2                ; @RDMA_STATUS
	.comm	_RDMA_DISABLED,4,2              ; @RDMA_DISABLED
	.comm	_RDMA_WRITE_PTR_LO,4,2          ; @RDMA_WRITE_PTR_LO
	.comm	_RDMA_WRITE_PTR_HI,4,2          ; @RDMA_WRITE_PTR_HI
	.comm	_RDMA_PROD_INDEX,4,2            ; @RDMA_PROD_INDEX
	.comm	_RDMA_CONS_INDEX,4,2            ; @RDMA_CONS_INDEX
	.comm	_RDMA_RING_SIZE_SHIFT,4,2       ; @RDMA_RING_SIZE_SHIFT
	.comm	_RX_BUF_LENGTH,4,2              ; @RX_BUF_LENGTH
	.comm	_RDMA_RING_BUF_SIZE,4,2         ; @RDMA_RING_BUF_SIZE
	.comm	_RDMA_START_ADDR_HI,4,2         ; @RDMA_START_ADDR_HI
	.comm	_RDMA_START_ADDR_LO,4,2         ; @RDMA_START_ADDR_LO
	.comm	_RDMA_END_ADDR_HI,4,2           ; @RDMA_END_ADDR_HI
	.comm	_RDMA_END_ADDR_LO,4,2           ; @RDMA_END_ADDR_LO
l_.str.2:                               ; @.str.2
	.asciz	"RDMA cfg, num_rx_bds=%d, rx_bds=%p\n"

	.no_dead_strip	_bcm_sysport_init_rx_ring
.subsections_via_symbols
