	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mii_discover_phy
_mii_discover_phy:                      ## @mii_discover_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r15d
	movq	%rsi, %rdi
	callq	_netdev_priv
	movq	%rax, %rbx
	movl	(%rax), %eax
	cmpl	$31, %eax
	jg	LBB0_5
## %bb.1:
	leal	1(%r15), %ecx
	cmpw	$2, %cx
	jae	LBB0_2
## %bb.3:
	incl	%eax
	movl	%eax, (%rbx)
	movq	_MII_REG_PHYIR1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mk_mii_read
	leaq	_mii_discover_phy(%rip), %rdx
	jmp	LBB0_4
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movq	_FEC_MII_SPEED@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	$0, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	shll	$16, %r15d
	movl	%r15d, 4(%rbx)
	movq	_MII_REG_PHYIR2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mk_mii_read
	movq	_mii_discover_phy3@GOTPCREL(%rip), %rdx
LBB0_4:
	movq	%r14, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mii_queue_unlocked             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_REG_PHYIR2,4,2             ## @MII_REG_PHYIR2
	.comm	_MII_REG_PHYIR1,4,2             ## @MII_REG_PHYIR1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FEC: No PHY device found.\n"

	.comm	_FEC_MII_SPEED,8,3              ## @FEC_MII_SPEED
	.no_dead_strip	_mii_discover_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mii_discover_phy
_mii_discover_phy:                      ; @mii_discover_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, x1
	mov	x21, x0
	mov	x0, x1
	bl	_netdev_priv
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #31
	b.gt	LBB0_4
; %bb.1:
	ands	w9, w21, #0xffff
	b.eq	LBB0_3
; %bb.2:
	mov	w10, #65535
	cmp	w9, w10
	b.ne	LBB0_5
LBB0_3:
	add	w8, w8, #1
	str	w8, [x20]
Lloh0:
	adrp	x8, _MII_REG_PHYIR1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_REG_PHYIR1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_mk_mii_read
	mov	x1, x0
Lloh3:
	adrp	x2, _mii_discover_phy@PAGE
Lloh4:
	add	x2, x2, _mii_discover_phy@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	ldr	x8, [x20, #16]
Lloh7:
	adrp	x9, _FEC_MII_SPEED@GOTPAGE
Lloh8:
	ldr	x9, [x9, _FEC_MII_SPEED@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	str	xzr, [x20, #8]
	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
LBB0_5:
	lsl	w8, w21, #16
	str	w8, [x20, #4]
Lloh10:
	adrp	x8, _MII_REG_PHYIR2@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MII_REG_PHYIR2@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_mk_mii_read
	mov	x1, x0
Lloh13:
	adrp	x2, _mii_discover_phy3@GOTPAGE
Lloh14:
	ldr	x2, [x2, _mii_discover_phy3@GOTPAGEOFF]
LBB0_6:
	mov	x0, x19
	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
	b	_mii_queue_unlocked
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_REG_PHYIR2,4,2             ; @MII_REG_PHYIR2
	.comm	_MII_REG_PHYIR1,4,2             ; @MII_REG_PHYIR1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FEC: No PHY device found.\n"

	.comm	_FEC_MII_SPEED,8,3              ; @FEC_MII_SPEED
	.no_dead_strip	_mii_discover_phy
.subsections_via_symbols
