	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_netdev_change_mtu
_nes_netdev_change_mtu:                 ## @nes_netdev_change_mtu
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_netdev_priv
	movq	%rax, %r12
	movq	_ETH_ZLEN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	_max_mtu@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_2
## %bb.3:
	movq	16(%r12), %r13
	movl	%ebx, (%r14)
	movslq	%ebx, %rax
	movq	_VLAN_ETH_HLEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	%rax, %rcx
	movq	%rcx, 8(%r12)
	xorl	%esi, %esi
	cmpl	$1501, %eax                     ## imm = 0x5DD
	setge	%sil
	movq	%r13, %rdi
	callq	_nes_nic_init_timer_defaults
	movq	%r14, %rdi
	callq	_netif_running
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movb	(%r12), %cl
	movl	$1, %r12d
	shll	%cl, %r12d
	movq	_NES_IDX_NIC_MULTICAST_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_nes_read_indexed
	movq	%r13, %rbx
	movl	%eax, %r13d
	andl	%r12d, %r13d
	movq	_NES_IDX_NIC_UNICAST_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nes_read_indexed
	andl	%eax, %r12d
	movq	%r14, %rdi
	callq	_nes_netdev_stop
	movq	%r14, %rdi
	callq	_nes_netdev_open
	movq	_NES_IDX_NIC_MULTICAST_ALL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_nes_read_indexed
	orl	%eax, %r13d
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_nes_write_indexed
	movq	_NES_IDX_NIC_UNICAST_ALL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_nes_read_indexed
	orl	%eax, %r12d
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_nes_write_indexed
	jmp	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ZLEN,4,2                   ## @ETH_ZLEN
	.comm	_max_mtu,4,2                    ## @max_mtu
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VLAN_ETH_HLEN,8,3              ## @VLAN_ETH_HLEN
	.comm	_NES_IDX_NIC_MULTICAST_ALL,4,2  ## @NES_IDX_NIC_MULTICAST_ALL
	.comm	_NES_IDX_NIC_UNICAST_ALL,4,2    ## @NES_IDX_NIC_UNICAST_ALL
	.no_dead_strip	_nes_netdev_change_mtu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_netdev_change_mtu
_nes_netdev_change_mtu:                 ; @nes_netdev_change_mtu
	.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	x20, x0
	bl	_netdev_priv
Lloh0:
	adrp	x8, _ETH_ZLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETH_ZLEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _max_mtu@GOTPAGE
Lloh4:
	ldr	x9, [x9, _max_mtu@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w22
	ccmp	w9, w22, #8, le
	b.ge	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	mov	x21, x0
	ldr	x19, [x0, #16]
Lloh9:
	adrp	x8, _VLAN_ETH_HLEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VLAN_ETH_HLEN@GOTPAGEOFF]
	str	w22, [x20]
Lloh11:
	ldr	x8, [x8]
	add	x8, x8, w22, sxtw
	str	x8, [x0, #8]
	cmp	w22, #1500
	cset	w1, gt
	mov	x0, x19
	bl	_nes_nic_init_timer_defaults
	mov	x0, x20
	bl	_netif_running
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x21]
	mov	w9, #1
	lsl	w21, w9, w8
Lloh12:
	adrp	x22, _NES_IDX_NIC_MULTICAST_ALL@GOTPAGE
Lloh13:
	ldr	x22, [x22, _NES_IDX_NIC_MULTICAST_ALL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nes_read_indexed
	and	w23, w0, w21
Lloh14:
	adrp	x24, _NES_IDX_NIC_UNICAST_ALL@GOTPAGE
Lloh15:
	ldr	x24, [x24, _NES_IDX_NIC_UNICAST_ALL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nes_read_indexed
	and	w21, w0, w21
	mov	x0, x20
	bl	_nes_netdev_stop
	mov	x0, x20
	bl	_nes_netdev_open
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nes_read_indexed
	orr	w2, w0, w23
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nes_write_indexed
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nes_read_indexed
	orr	w2, w0, w21
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nes_write_indexed
	mov	w0, #0
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ZLEN,4,2                   ; @ETH_ZLEN
	.comm	_max_mtu,4,2                    ; @max_mtu
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VLAN_ETH_HLEN,8,3              ; @VLAN_ETH_HLEN
	.comm	_NES_IDX_NIC_MULTICAST_ALL,4,2  ; @NES_IDX_NIC_MULTICAST_ALL
	.comm	_NES_IDX_NIC_UNICAST_ALL,4,2    ; @NES_IDX_NIC_UNICAST_ALL
	.no_dead_strip	_nes_netdev_change_mtu
.subsections_via_symbols
