	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcnet32_set_ringparam
_pcnet32_set_ringparam:                 ## @pcnet32_set_ringparam
	.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	%rsi, %rbx
	movq	%rdi, %r12
	callq	_netdev_priv
	cmpq	$0, 16(%rbx)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rax, %r14
	movl	(%r12), %r13d
	movq	%r12, %rdi
	callq	_netif_running
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_pcnet32_netif_stop
LBB0_5:
	movq	%r14, %r15
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	16(%r14), %rax
	movq	_CSR0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CSR0_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r13d, %edi
	callq	*(%rax)
	movl	4(%rbx), %edi
	movq	_TX_MAX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movq	_PCNET32_LOG_MAX_TX_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movl	$1, %esi
	shll	%cl, %esi
	cmpl	%edx, %ecx
	jg	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	%esi, %eax
	ja	LBB0_6
LBB0_8:
	cmpl	(%r14), %esi
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%ecx, %edx
	callq	_pcnet32_realloc_tx_ring
LBB0_10:
	movl	(%rbx), %edi
	movq	_RX_MAX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movq	_PCNET32_LOG_MAX_RX_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movl	$1, %edx
	shll	%cl, %edx
	cmpl	%esi, %ecx
	jg	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	%edx, %eax
	ja	LBB0_11
LBB0_13:
	cmpl	4(%r14), %edx
	je	LBB0_15
## %bb.14:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%ecx, %edx
	callq	_pcnet32_realloc_rx_ring
	movl	4(%r14), %edx
LBB0_15:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, 12(%r14)
	movq	%r12, %rdi
	callq	_netif_running
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_pcnet32_netif_start
	movq	_CSR0_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_pcnet32_restart
LBB0_17:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %r9d
	movl	4(%r14), %r8d
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_netif_info
	xorl	%eax, %eax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CSR0,4,2                       ## @CSR0
	.comm	_CSR0_STOP,4,2                  ## @CSR0_STOP
	.comm	_TX_MAX_RING_SIZE,8,3           ## @TX_MAX_RING_SIZE
	.comm	_PCNET32_LOG_MAX_TX_BUFFERS,4,2 ## @PCNET32_LOG_MAX_TX_BUFFERS
	.comm	_RX_MAX_RING_SIZE,8,3           ## @RX_MAX_RING_SIZE
	.comm	_PCNET32_LOG_MAX_RX_BUFFERS,4,2 ## @PCNET32_LOG_MAX_RX_BUFFERS
	.comm	_CSR0_NORMAL,4,2                ## @CSR0_NORMAL
	.comm	_drv,4,2                        ## @drv
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Ring Param Settings: RX: %d, TX: %d\n"

	.no_dead_strip	_pcnet32_set_ringparam
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcnet32_set_ringparam
_pcnet32_set_ringparam:                 ; @pcnet32_set_ringparam
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x1
	mov	x19, x0
	bl	_netdev_priv
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x20, x0
	ldr	w23, [x19]
	mov	x0, x19
	bl	_netif_running
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_pcnet32_netif_stop
LBB0_6:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _CSR0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CSR0@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
Lloh6:
	adrp	x9, _CSR0_STOP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CSR0_STOP@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x9]
	mov	x0, x23
	blr	x8
	ldr	w0, [x22, #4]
Lloh9:
	adrp	x8, _TX_MAX_RING_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TX_MAX_RING_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_min
Lloh12:
	adrp	x8, _PCNET32_LOG_MAX_TX_BUFFERS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCNET32_LOG_MAX_TX_BUFFERS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mov	w9, #1
	mov	w2, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	w2, w2, #1
	lsl	w10, w9, w2
	cmp	w2, w8
	b.gt	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w0, w10
	b.hi	LBB0_7
LBB0_9:
	ldr	w8, [x20]
	cmp	w10, w8
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_pcnet32_realloc_tx_ring
LBB0_11:
	ldr	w0, [x22]
Lloh15:
	adrp	x8, _RX_MAX_RING_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RX_MAX_RING_SIZE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_min
Lloh18:
	adrp	x8, _PCNET32_LOG_MAX_RX_BUFFERS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCNET32_LOG_MAX_RX_BUFFERS@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x8]
	mov	w10, #1
	mov	w2, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	w2, w2, #1
	lsl	w8, w10, w2
	cmp	w2, w9
	b.gt	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w0, w8
	b.hi	LBB0_12
LBB0_14:
	ldr	w9, [x20, #4]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x19
	mov	x1, x20
	bl	_pcnet32_realloc_rx_ring
	ldr	w8, [x20, #4]
LBB0_16:
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	str	w8, [x20, #12]
	mov	x0, x19
	bl	_netif_running
	cbz	x0, LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_pcnet32_netif_start
Lloh21:
	adrp	x8, _CSR0_NORMAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CSR0_NORMAL@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pcnet32_restart
LBB0_18:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
Lloh24:
	adrp	x8, _drv@GOTPAGE
Lloh25:
	ldr	x8, [x8, _drv@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	ldp	w5, w4, [x20]
Lloh27:
	adrp	x3, l_.str@PAGE
Lloh28:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_netif_info
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CSR0,4,2                       ; @CSR0
	.comm	_CSR0_STOP,4,2                  ; @CSR0_STOP
	.comm	_TX_MAX_RING_SIZE,8,3           ; @TX_MAX_RING_SIZE
	.comm	_PCNET32_LOG_MAX_TX_BUFFERS,4,2 ; @PCNET32_LOG_MAX_TX_BUFFERS
	.comm	_RX_MAX_RING_SIZE,8,3           ; @RX_MAX_RING_SIZE
	.comm	_PCNET32_LOG_MAX_RX_BUFFERS,4,2 ; @PCNET32_LOG_MAX_RX_BUFFERS
	.comm	_CSR0_NORMAL,4,2                ; @CSR0_NORMAL
	.comm	_drv,4,2                        ; @drv
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Ring Param Settings: RX: %d, TX: %d\n"

	.no_dead_strip	_pcnet32_set_ringparam
.subsections_via_symbols
