	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_netdev_set_settings
_nes_netdev_set_settings:               ## @nes_netdev_set_settings
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_netdev_priv
	movq	(%rax), %r15
	movq	8(%r15), %rbx
	cmpq	$0, 24(%rbx)
	je	LBB0_3
## %bb.1:
	movq	(%rbx), %rcx
	movq	(%r15), %rax
	movq	(%rcx,%rax,8), %rcx
	movq	_NES_PHY_TYPE_PUMA_1G@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_3
## %bb.2:
	movq	16(%rbx), %rcx
	movl	(%rcx,%rax,4), %r12d
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_nes_read_1G_phy_reg
	movl	-36(%rbp), %ecx
	movl	%ecx, %eax
	andl	$-4097, %eax                    ## imm = 0xEFFF
	orl	$4864, %ecx                     ## imm = 0x1300
	cmpq	$0, (%r14)
	cmovel	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_nes_write_1G_phy_reg
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
LBB0_3:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_PHY_TYPE_PUMA_1G,8,3       ## @NES_PHY_TYPE_PUMA_1G
	.no_dead_strip	_nes_netdev_set_settings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_netdev_set_settings
_nes_netdev_set_settings:               ; @nes_netdev_set_settings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	bl	_netdev_priv
	ldr	x19, [x0]
	ldr	x8, [x19, #8]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_3
; %bb.1:
	ldr	x10, [x8]
	ldr	x9, [x19]
	ldr	x10, [x10, x9, lsl #3]
Lloh0:
	adrp	x11, _NES_PHY_TYPE_PUMA_1G@GOTPAGE
Lloh1:
	ldr	x11, [x11, _NES_PHY_TYPE_PUMA_1G@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_3
; %bb.2:
	ldr	x10, [x8, #16]
	ldr	w21, [x10, x9, lsl #2]
	add	x22, x8, #8
	mov	x0, x22
	bl	_spin_lock_irqsave
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	bl	_nes_read_1G_phy_reg
	ldr	x8, [x20]
	ldr	w9, [sp, #12]
	and	w10, w9, #0xffffefff
	mov	w11, #4864
	orr	w9, w9, w11
	cmp	x8, #0
	csel	w3, w10, w9, eq
	str	w3, [sp, #12]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	bl	_nes_write_1G_phy_reg
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_3:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_PHY_TYPE_PUMA_1G,8,3       ; @NES_PHY_TYPE_PUMA_1G
	.no_dead_strip	_nes_netdev_set_settings
.subsections_via_symbols
