	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_eth_ring_init
_sh_eth_ring_init:                      ## @sh_eth_ring_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r12
	movl	(%r14), %eax
	cmpl	$1493, %eax                     ## imm = 0x5D5
	jge	LBB0_1
## %bb.2:
	movq	_PKT_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_3
LBB0_1:
	addl	$33, %eax
	andl	$-8, %eax
	addl	$18, %eax
LBB0_3:
	movl	%eax, (%r12)
	movq	_RX_RING_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_kmalloc
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_kmalloc
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	(%rbx), %r13d
	shll	$2, %r13d
	leaq	4(%r12), %rdx
	movl	(%r15), %ecx
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movl	%r13d, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	$0, 32(%r12)
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	shll	$2, %r13d
	movq	%r12, %rdx
	addq	$24, %rdx
	movl	(%r15), %ecx
	xorl	%edi, %edi
	movl	%r13d, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	jne	LBB0_13
## %bb.10:
	leaq	4(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_4:
	addq	$4, %r14
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	leaq	4(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	leaq	4(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r13d, %esi
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r12), %rdx
	movl	4(%r12), %ecx
	xorl	%edi, %edi
	callq	_dma_free_coherent
LBB0_12:
	negl	%ebx
	movq	%r14, %rdi
	callq	_sh_eth_ring_free
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PKT_BUF_SZ,4,2                 ## @PKT_BUF_SZ
	.comm	_RX_RING_SIZE,4,2               ## @RX_RING_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate Rx skb\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TX_RING_SIZE,4,2               ## @TX_RING_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Cannot allocate Tx skb\n"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot allocate Rx Ring (size %d bytes)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Cannot allocate Tx Ring (size %d bytes)\n"

	.no_dead_strip	_sh_eth_ring_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_eth_ring_init
_sh_eth_ring_init:                      ; @sh_eth_ring_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _PKT_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PKT_BUF_SZ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w8, #33
	and	w10, w10, #0xfffffff8
	add	w10, w10, #18
	cmp	w8, #1493
	csel	w8, w9, w10, lt
	str	w8, [x0]
Lloh3:
	adrp	x21, _RX_RING_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _RX_RING_SIZE@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_kmalloc
	str	x0, [x20, #48]
	cbz	x0, LBB0_5
; %bb.1:
Lloh7:
	adrp	x22, _TX_RING_SIZE@GOTPAGE
Lloh8:
	ldr	x22, [x22, _TX_RING_SIZE@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w1, [x23]
	bl	_kmalloc
	str	x0, [x20, #40]
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w8, [x21]
	lsl	w21, w8, #2
	add	x2, x20, #4
	ldr	w3, [x23]
	mov	x0, #0
	mov	x1, x21
	bl	_dma_alloc_coherent
	str	x0, [x20, #8]
	cbz	x0, LBB0_7
; %bb.3:
	str	xzr, [x20, #32]
	ldr	w8, [x22]
	lsl	w22, w8, #2
	add	x2, x20, #24
	ldr	w3, [x23]
	mov	x0, #0
	mov	x1, x22
	bl	_dma_alloc_coherent
	str	x0, [x20, #16]
	cbz	x0, LBB0_8
; %bb.4:
	mov	w20, #0
	b	LBB0_11
LBB0_5:
	add	x0, x19, #4
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_6:
	add	x0, x19, #4
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_7:
	add	x0, x19, #4
	str	x21, [sp]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
	add	x0, x19, #4
	str	x22, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w22, [x8]
	ldr	x2, [x20, #8]
	ldr	w3, [x20, #4]
	mov	x0, #0
	mov	x1, x21
	bl	_dma_free_coherent
LBB0_10:
	neg	w20, w22
	mov	x0, x19
	bl	_sh_eth_ring_free
LBB0_11:
	mov	x0, 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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PKT_BUF_SZ,4,2                 ; @PKT_BUF_SZ
	.comm	_RX_RING_SIZE,4,2               ; @RX_RING_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate Rx skb\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TX_RING_SIZE,4,2               ; @TX_RING_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Cannot allocate Tx skb\n"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot allocate Rx Ring (size %d bytes)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Cannot allocate Tx Ring (size %d bytes)\n"

	.no_dead_strip	_sh_eth_ring_init
.subsections_via_symbols
