	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_init_phy                   ## -- Begin function nes_init_phy
	.p2align	4, 0x90
_nes_init_phy:                          ## @nes_init_phy
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	(%rcx), %rdx
	movq	8(%rcx), %rcx
	movl	(%rdx,%rax,4), %r15d
	movl	(%rcx,%rax,4), %r14d
	movq	_NES_IDX_MAC_TX_CONFIG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_nes_read_indexed
	movl	%eax, %edx
	andl	$-29, %edx
	orq	$4, %rdx
	orl	$29, %eax
	cmpl	$131, %r15d
	cmovneq	%rax, %rdx
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_nes_write_indexed
	movq	8(%rbx), %rdi
	addq	$16, %rdi
	callq	_spin_lock_irqsave
	leal	-128(%r15), %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.3:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_nes_init_2025_phy
	jmp	LBB0_4
LBB0_1:
	xorl	%r12d, %r12d
	cmpl	$131, %r15d
	jne	LBB0_5
## %bb.2:
	movq	%rbx, %rdi
	movl	$131, %esi
	movl	%r14d, %edx
	callq	_nes_init_1g_phy
LBB0_4:
	movl	%eax, %r12d
LBB0_5:
	movq	8(%rbx), %rdi
	addq	$16, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_IDX_MAC_TX_CONFIG,4,2      ## @NES_IDX_MAC_TX_CONFIG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_init_phy                   ; -- Begin function nes_init_phy
	.p2align	2
_nes_init_phy:                          ; @nes_init_phy
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	ldp	x9, x8, [x0]
	lsl	x9, x9, #2
	ldp	x10, x8, [x8]
	ldr	w21, [x10, x9]
	ldr	w20, [x8, x9]
Lloh0:
	adrp	x22, _NES_IDX_MAC_TX_CONFIG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NES_IDX_MAC_TX_CONFIG@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_nes_read_indexed
	mov	w8, #-30
	orr	x8, x8, #0x1
	and	x8, x0, x8
	orr	x8, x8, #0x4
	and	x9, x0, #0xfffffffe
	mov	w10, #29
	orr	x9, x9, x10
	cmp	w21, #131
	csel	x2, x8, x9, eq
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nes_write_indexed
	ldr	x8, [x19, #8]
	add	x0, x8, #16
	bl	_spin_lock_irqsave
	sub	w8, w21, #128
	cmp	w8, #3
	b.hs	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_nes_init_2025_phy
	b	LBB0_4
LBB0_2:
	cmp	w21, #131
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	w1, #131
	mov	x2, x20
	bl	_nes_init_1g_phy
LBB0_4:
	mov	x20, x0
	b	LBB0_6
LBB0_5:
	mov	w20, #0
LBB0_6:
	ldr	x8, [x19, #8]
	add	x0, x8, #16
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_IDX_MAC_TX_CONFIG,4,2      ; @NES_IDX_MAC_TX_CONFIG
.subsections_via_symbols
