	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emac_resize_rx_ring
_emac_resize_rx_ring:                   ## @emac_resize_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	%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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_emac_rx_sync_size
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	callq	_emac_rx_skb_size
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	leaq	4(%r15), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_emac_netif_stop
	movq	%r15, %rdi
	callq	_emac_rx_disable
	movl	8(%r15), %esi
	movl	12(%r15), %edi
	callq	_mal_disable_rx_channel
	movq	72(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	incl	64(%r15)
	callq	_dev_kfree_skb
	movq	$0, 72(%r15)
LBB0_2:
	movq	_NUM_RX_BUFF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.3:
	movq	56(%r15), %rax
	xorl	%edx, %edx
	movq	_MAL_RX_CTRL_FIRST@GOTPCREL(%rip), %r9
	movq	_MAL_RX_CTRL_EMPTY@GOTPCREL(%rip), %rdi
	movq	_MAL_RX_CTRL_WRAP@GOTPCREL(%rip), %r8
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	orl	(%rdi), %esi
	movl	%esi, (%rax)
	incq	%rdx
	movslq	(%rbx), %rcx
	addq	$24, %rax
	cmpq	%rcx, %rdx
	jge	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r9), %esi
	testl	%esi, (%rax)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	64(%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, 16(%rax)
	decl	%ecx
	xorl	%esi, %esi
	cmpq	%rcx, %rdx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r8), %esi
	jmp	LBB0_8
LBB0_9:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	(%r15), %eax
	jle	LBB0_15
## %bb.10:
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.11:
	movl	$1, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_netdev_alloc_skb_ip_align
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, %r14
	movq	40(%r15), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax,%r13,8)
	sete	%dil
	callq	_BUG_ON
	movq	40(%r15), %rax
	movq	(%rax,%r13,8), %rdi
	callq	_dev_kfree_skb
	movq	48(%r15), %rdi
	movq	(%r14), %rsi
	movq	_NET_IP_ALIGN@GOTPCREL(%rip), %rax
	subq	(%rax), %rsi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_dma_map_single
	movq	_NET_IP_ALIGN@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	56(%r15), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	40(%r15), %rax
	movq	%r14, (%rax,%r13,8)
	incq	%r13
	movslq	(%rbx), %rax
	addq	$3, %r12
	cmpq	%rax, %r13
	jl	LBB0_12
LBB0_15:
	movq	_EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_emac_has_feature
	movq	_ETH_DATA_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testq	%rax, %rax
	je	LBB0_21
## %bb.16:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	cmpl	%r13d, %ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jl	LBB0_18
## %bb.17:
	movq	32(%r15), %rax
	cmpl	%ecx, (%rax)
	jg	LBB0_18
	jmp	LBB0_19
LBB0_21:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	cmpl	%r13d, %ecx
	setl	%al
	movq	32(%r15), %rdx
	cmpl	%ecx, (%rdx)
	setg	%cl
	xorb	%al, %cl
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_19
LBB0_18:
	movq	_MAL_COMMAC_RX_STOPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%r15), %rsi
	callq	_set_bit
	movq	32(%r15), %rax
	movl	%r13d, (%rax)
	movq	%r15, %rdi
	callq	_emac_full_tx_reset
LBB0_19:
	movl	8(%r15), %r14d
	movl	12(%r15), %r12d
	movl	%r13d, %edi
	callq	_emac_rx_size
	movl	%r12d, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_mal_set_rcbs
	xorl	%r14d, %r14d
LBB0_20:
	movq	_MAL_COMMAC_RX_STOPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%r15), %rsi
	callq	_clear_bit
	movq	$0, 16(%r15)
	movl	8(%r15), %esi
	movl	12(%r15), %edi
	callq	_mal_enable_rx_channel
	movq	%r15, %rdi
	callq	_emac_rx_enable
	movq	%r15, %rdi
	callq	_emac_netif_start
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_RX_BUFF,4,2                ## @NUM_RX_BUFF
	.comm	_MAL_RX_CTRL_FIRST,4,2          ## @MAL_RX_CTRL_FIRST
	.comm	_MAL_RX_CTRL_EMPTY,4,2          ## @MAL_RX_CTRL_EMPTY
	.comm	_MAL_RX_CTRL_WRAP,4,2           ## @MAL_RX_CTRL_WRAP
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NET_IP_ALIGN,8,3               ## @NET_IP_ALIGN
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE,4,2 ## @EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE
	.comm	_ETH_DATA_LEN,4,2               ## @ETH_DATA_LEN
	.comm	_MAL_COMMAC_RX_STOPPED,4,2      ## @MAL_COMMAC_RX_STOPPED
	.no_dead_strip	_emac_resize_rx_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emac_resize_rx_ring
_emac_resize_rx_ring:                   ; @emac_resize_rx_ring
	.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	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_emac_rx_sync_size
	mov	x22, x0
	str	w20, [sp, #4]                   ; 4-byte Folded Spill
	mov	x0, x20
	bl	_emac_rx_skb_size
	mov	x23, x0
	add	x0, x19, #4
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_mutex_lock
	mov	x0, x19
	bl	_emac_netif_stop
	mov	x0, x19
	bl	_emac_rx_disable
	ldp	w1, w0, [x19, #8]
	bl	_mal_disable_rx_channel
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #64]
	add	w8, w8, #1
	str	w8, [x19, #64]
	bl	_dev_kfree_skb
	str	xzr, [x19, #72]
LBB0_2:
Lloh0:
	adrp	x26, _NUM_RX_BUFF@GOTPAGE
Lloh1:
	ldr	x26, [x26, _NUM_RX_BUFF@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.3:
	mov	x9, #0
	ldr	x10, [x19, #56]
Lloh2:
	adrp	x11, _MAL_RX_CTRL_FIRST@GOTPAGE
Lloh3:
	ldr	x11, [x11, _MAL_RX_CTRL_FIRST@GOTPAGEOFF]
Lloh4:
	adrp	x12, _MAL_RX_CTRL_EMPTY@GOTPAGE
Lloh5:
	ldr	x12, [x12, _MAL_RX_CTRL_EMPTY@GOTPAGEOFF]
Lloh6:
	adrp	x13, _MAL_RX_CTRL_WRAP@GOTPAGE
Lloh7:
	ldr	x13, [x13, _MAL_RX_CTRL_WRAP@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [x10, #16]
	ldr	w14, [x12]
	sub	w8, w8, #1
	ldr	w15, [x13]
	cmp	x9, x8
	csel	w8, w15, wzr, eq
	orr	w8, w8, w14
	str	w8, [x10], #24
	add	x9, x9, #1
	ldrsw	x8, [x26]
	cmp	x9, x8
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x10]
	ldr	w15, [x11]
	tst	w15, w14
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w14, [x19, #64]
	add	w14, w14, #1
	str	w14, [x19, #64]
	b	LBB0_4
LBB0_7:
	ldr	w9, [x19]
	cmp	w23, w9
	b.le	LBB0_12
; %bb.8:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x27, #0
	mov	w28, #8
Lloh8:
	adrp	x25, _NET_IP_ALIGN@GOTPAGE
Lloh9:
	ldr	x25, [x25, _NET_IP_ALIGN@GOTPAGEOFF]
Lloh10:
	adrp	x20, _DMA_FROM_DEVICE@GOTPAGE
Lloh11:
	ldr	x20, [x20, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #32]
	mov	x1, x23
	bl	_netdev_alloc_skb_ip_align
	cbz	x0, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x24, x0
	ldr	x8, [x19, #40]
	lsl	x21, x27, #3
	ldr	x8, [x8, x21]
	cmp	x8, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x21]
	bl	_dev_kfree_skb
	ldr	x0, [x19, #48]
	ldr	x8, [x24]
	ldr	x9, [x25]
	sub	x1, x8, x9
	ldr	w3, [x20]
	mov	x2, x22
	bl	_dma_map_single
	ldr	x8, [x25]
	add	x8, x8, x0
	ldr	x9, [x19, #56]
	str	x8, [x9, x28]
	ldr	x8, [x19, #40]
	str	x24, [x8, x21]
	add	x27, x27, #1
	ldrsw	x8, [x26]
	add	x28, x28, #24
	cmp	x27, x8
	b.lt	LBB0_10
LBB0_12:
Lloh12:
	adrp	x8, _EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_emac_has_feature
Lloh15:
	adrp	x8, _ETH_DATA_LEN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETH_DATA_LEN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cbz	x0, LBB0_15
; %bb.13:
	ldr	w21, [sp, #4]                   ; 4-byte Folded Reload
	cmp	w8, w21
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
Lloh18:
	adrp	x24, _MAL_COMMAC_RX_STOPPED@GOTPAGE
Lloh19:
	ldr	x24, [x24, _MAL_COMMAC_RX_STOPPED@GOTPAGEOFF]
	b.lt	LBB0_16
; %bb.14:
	ldr	x9, [x19, #32]
	ldr	w9, [x9]
	cmp	w9, w8
	b.gt	LBB0_16
	b	LBB0_17
LBB0_15:
	ldr	w21, [sp, #4]                   ; 4-byte Folded Reload
	cmp	w8, w21
	cset	w9, lt
	ldr	x10, [x19, #32]
	ldr	w10, [x10]
	cmp	w10, w8
	cset	w8, gt
	eor	w8, w9, w8
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
Lloh20:
	adrp	x24, _MAL_COMMAC_RX_STOPPED@GOTPAGE
Lloh21:
	ldr	x24, [x24, _MAL_COMMAC_RX_STOPPED@GOTPAGEOFF]
	tbz	w8, #0, LBB0_17
LBB0_16:
	ldr	w0, [x24]
	add	x1, x19, #24
	bl	_set_bit
	ldr	x8, [x19, #32]
	str	w21, [x8]
	mov	x0, x19
	bl	_emac_full_tx_reset
LBB0_17:
	ldp	w23, w22, [x19, #8]
	mov	x0, x21
	bl	_emac_rx_size
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_mal_set_rcbs
	mov	w21, #0
LBB0_18:
	ldr	w0, [x24]
	add	x1, x19, #24
	bl	_clear_bit
	str	xzr, [x19, #16]
	ldp	w1, w0, [x19, #8]
	bl	_mal_enable_rx_channel
	mov	x0, x19
	bl	_emac_rx_enable
	mov	x0, x19
	bl	_emac_netif_start
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x21
	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
LBB0_19:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
Lloh25:
	adrp	x24, _MAL_COMMAC_RX_STOPPED@GOTPAGE
Lloh26:
	ldr	x24, [x24, _MAL_COMMAC_RX_STOPPED@GOTPAGEOFF]
	b	LBB0_18
	.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 AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_RX_BUFF,4,2                ; @NUM_RX_BUFF
	.comm	_MAL_RX_CTRL_FIRST,4,2          ; @MAL_RX_CTRL_FIRST
	.comm	_MAL_RX_CTRL_EMPTY,4,2          ; @MAL_RX_CTRL_EMPTY
	.comm	_MAL_RX_CTRL_WRAP,4,2           ; @MAL_RX_CTRL_WRAP
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NET_IP_ALIGN,8,3               ; @NET_IP_ALIGN
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE,4,2 ; @EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE
	.comm	_ETH_DATA_LEN,4,2               ; @ETH_DATA_LEN
	.comm	_MAL_COMMAC_RX_STOPPED,4,2      ; @MAL_COMMAC_RX_STOPPED
	.no_dead_strip	_emac_resize_rx_ring
.subsections_via_symbols
