	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function korina_alloc_ring
_korina_alloc_ring:                     ## @korina_alloc_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	%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, -56(%rbp)                 ## 8-byte Spill
	callq	_netdev_priv
	movq	%rax, %r15
	movq	_KORINA_NUM_TDS@GOTPCREL(%rip), %r8
	cmpl	$0, (%r8)
	jle	LBB0_3
## %bb.1:
	movq	96(%r15), %rcx
	xorl	%edx, %edx
	movq	_DMA_DESC_IOF@GOTPCREL(%rip), %rsi
	movq	_ETH_TX_FD@GOTPCREL(%rip), %rdi
	movq	_ETH_TX_LD@GOTPCREL(%rip), %rbx
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %eax
	movl	%eax, 24(%rcx)
	movl	(%rbx), %eax
	orl	(%rdi), %eax
	movl	%eax, (%rcx)
	incq	%rdx
	movups	%xmm0, 8(%rcx)
	movslq	(%r8), %rax
	addq	$32, %rcx
	cmpq	%rax, %rdx
	jl	LBB0_2
LBB0_3:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%r15)
	movups	%xmm0, 56(%r15)
	movq	$0, 88(%r15)
	movq	_desc_empty@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 48(%r15)
	movq	_KORINA_NUM_RDS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_4
## %bb.5:
	movq	$-1, %r14
	movl	$32, %r12d
	xorl	%r13d, %r13d
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_KORINA_RBSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_netdev_alloc_skb_ip_align
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %rbx
	movq	40(%r15), %rax
	movq	%rbx, (%rax,%r13)
	movq	_DMA_DESC_IOD@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_KORINA_RBSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DMA_COUNT
	orl	%r15d, %eax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	32(%r15), %rcx
	movl	%eax, (%rcx,%r13,4)
	movq	$0, 24(%rcx,%r13,4)
	movq	(%rbx), %rdi
	callq	_CPHYSADDR
	movq	32(%r15), %rdi
	movq	%rax, 16(%rdi,%r13,4)
	addq	%r12, %rdi
	callq	_CPHYSADDR
	movq	32(%r15), %rdi
	movq	%rax, 8(%rdi,%r13,4)
	movq	_KORINA_NUM_RDS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	1(%r14), %rbx
	addq	$8, %r13
	addq	$2, %r14
	addq	$32, %r12
	cmpq	%rax, %r14
	movq	%rbx, %r14
	jl	LBB0_6
	jmp	LBB0_9
LBB0_4:
	movq	32(%r15), %rdi
	movq	$-1, %rbx
LBB0_9:
	callq	_CPHYSADDR
	movq	32(%r15), %rcx
	shlq	$5, %rbx
	movq	%rax, 8(%rcx,%rbx)
	movq	_DMA_DESC_COD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rcx,%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15)
	movq	$0, 24(%r15)
	movq	_desc_empty@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KORINA_NUM_TDS,4,2             ## @KORINA_NUM_TDS
	.comm	_DMA_DESC_IOF,4,2               ## @DMA_DESC_IOF
	.comm	_ETH_TX_FD,4,2                  ## @ETH_TX_FD
	.comm	_ETH_TX_LD,4,2                  ## @ETH_TX_LD
	.comm	_desc_empty,8,3                 ## @desc_empty
	.comm	_KORINA_NUM_RDS,4,2             ## @KORINA_NUM_RDS
	.comm	_KORINA_RBSIZE,4,2              ## @KORINA_RBSIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_DESC_IOD,4,2               ## @DMA_DESC_IOD
	.comm	_DMA_DESC_COD,4,2               ## @DMA_DESC_COD
	.no_dead_strip	_korina_alloc_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function korina_alloc_ring
_korina_alloc_ring:                     ; @korina_alloc_ring
	.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	x20, x0
	bl	_netdev_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _KORINA_NUM_TDS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KORINA_NUM_TDS@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x9, #0
	ldr	x10, [x19, #96]
Lloh2:
	adrp	x11, _DMA_DESC_IOF@GOTPAGE
Lloh3:
	ldr	x11, [x11, _DMA_DESC_IOF@GOTPAGEOFF]
Lloh4:
	adrp	x12, _ETH_TX_FD@GOTPAGE
Lloh5:
	ldr	x12, [x12, _ETH_TX_FD@GOTPAGEOFF]
Lloh6:
	adrp	x13, _ETH_TX_LD@GOTPAGE
Lloh7:
	ldr	x13, [x13, _ETH_TX_LD@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x11]
	str	w14, [x10, #24]
	ldr	w14, [x12]
	ldr	w15, [x13]
	orr	w14, w15, w14
	str	w14, [x10]
	add	x9, x9, #1
	stp	xzr, xzr, [x10, #8]
	ldrsw	x14, [x8]
	add	x10, x10, #32
	cmp	x9, x14
	b.lt	LBB0_2
LBB0_3:
	str	xzr, [x19, #88]
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #72]
	stur	q0, [x19, #56]
Lloh8:
	adrp	x22, _desc_empty@GOTPAGE
Lloh9:
	ldr	x22, [x22, _desc_empty@GOTPAGEOFF]
	ldr	x8, [x22]
	str	x8, [x19, #48]
Lloh10:
	adrp	x23, _KORINA_NUM_RDS@GOTPAGE
Lloh11:
	ldr	x23, [x23, _KORINA_NUM_RDS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #0
	b.le	LBB0_8
; %bb.4:
	mov	x25, #0
	mov	x24, #0
Lloh12:
	adrp	x26, _KORINA_RBSIZE@GOTPAGE
Lloh13:
	ldr	x26, [x26, _KORINA_RBSIZE@GOTPAGEOFF]
Lloh14:
	adrp	x27, _DMA_DESC_IOD@GOTPAGE
Lloh15:
	ldr	x27, [x27, _DMA_DESC_IOD@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x20
	bl	_netdev_alloc_skb_ip_align
	cbz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	ldr	x8, [x19, #40]
	str	x0, [x8, x24, lsl #3]
	ldr	w28, [x27]
	ldr	w0, [x26]
	bl	_DMA_COUNT
	orr	w8, w0, w28
	ldr	x9, [x19, #32]
	add	x9, x9, x25
	str	w8, [x9]
	str	xzr, [x9, #24]
	ldr	x0, [x21]
	bl	_CPHYSADDR
	ldr	x8, [x19, #32]
	add	x8, x8, x25
	str	x0, [x8, #16]
	add	x24, x24, #1
	add	x0, x8, #32
	bl	_CPHYSADDR
	mov	x8, x0
	ldr	x0, [x19, #32]
	add	x9, x0, x25
	str	x8, [x9, #8]
	ldrsw	x8, [x23]
	add	x25, x25, #32
	cmp	x24, x8
	b.lt	LBB0_5
; %bb.7:
	sub	x20, x24, #1
	b	LBB0_9
LBB0_8:
	ldr	x0, [x19, #32]
	mov	x20, #-1
LBB0_9:
	bl	_CPHYSADDR
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #32]
	add	x9, x9, x20, lsl #5
	str	x8, [x9, #8]
Lloh16:
	adrp	x8, _DMA_DESC_COD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_DESC_COD@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	stp	xzr, xzr, [x19, #16]
	ldr	x8, [x22]
	stp	x8, xzr, [x19]
	b	LBB0_11
LBB0_10:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_KORINA_NUM_TDS,4,2             ; @KORINA_NUM_TDS
	.comm	_DMA_DESC_IOF,4,2               ; @DMA_DESC_IOF
	.comm	_ETH_TX_FD,4,2                  ; @ETH_TX_FD
	.comm	_ETH_TX_LD,4,2                  ; @ETH_TX_LD
	.comm	_desc_empty,8,3                 ; @desc_empty
	.comm	_KORINA_NUM_RDS,4,2             ; @KORINA_NUM_RDS
	.comm	_KORINA_RBSIZE,4,2              ; @KORINA_RBSIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_DESC_IOD,4,2               ; @DMA_DESC_IOD
	.comm	_DMA_DESC_COD,4,2               ; @DMA_DESC_COD
	.no_dead_strip	_korina_alloc_ring
.subsections_via_symbols
