	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_mii
_init_mii:                              ## @init_mii
	.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	%rdi, %r15
	callq	_netdev_priv
	movq	%rax, %r14
	movq	_if_port@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$4, %eax
	je	LBB0_2
## %bb.1:
	cmpl	$1, %eax
	jne	LBB0_3
LBB0_2:
	movl	%eax, 4(%r15)
	movq	$0, 8(%r14)
LBB0_18:
	movl	$1, %r12d
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%r15), %r13d
	xorl	%r12d, %r12d
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_mii_rd
	andl	$65280, %eax                    ## imm = 0xFF00
	cmpl	$30720, %eax                    ## imm = 0x7800
	jne	LBB0_19
## %bb.4:
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$2, %edx
	callq	_mii_rd
	xorl	%ecx, %ecx
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	setne	%cl
	movl	%ecx, (%r14)
	movl	$4096, %ecx                     ## imm = 0x1000
	cmpq	$0, 8(%r14)
	jne	LBB0_6
## %bb.5:
	xorl	%ecx, %ecx
	cmpl	$4, 4(%r15)
	sete	%cl
	shll	$13, %ecx
LBB0_6:
	xorl	%r12d, %r12d
	movl	%r13d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$16, %r8d
	callq	_mii_wr
	movl	$100, %edi
	callq	_udelay
	movl	%r13d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mii_rd
	testl	$1024, %eax                     ## imm = 0x400
	jne	LBB0_7
## %bb.8:
	cmpq	$0, 8(%r14)
	je	LBB0_18
## %bb.9:
	movl	$34, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	$100, %edi
	callq	_msleep
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_mii_rd
	movl	%eax, %edx
	notl	%edx
	subl	$1, %ebx
	setb	%cl
	testb	$36, %dl
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	testb	%cl, %cl
	je	LBB0_10
LBB0_12:
	testb	$32, %al
	jne	LBB0_15
## %bb.13:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_netdev_info
	movl	$1, %r12d
	cmpl	$0, (%r14)
	jne	LBB0_19
## %bb.14:
	movl	%r13d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$16, %r8d
	callq	_mii_wr
	movl	$100, %edi
	callq	_udelay
	xorl	%edi, %edi
	callq	_SelectPage
	movq	_XIRCREG_ESR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GetByte
	movq	_MediaSelect@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	$1, %eax
	adcl	$1, %ebx
	movl	%ebx, 4(%r15)
	jmp	LBB0_19
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_netdev_notice
	movq	$0, 8(%r14)
	jmp	LBB0_19
LBB0_15:
	movl	%r13d, %edi
	xorl	%esi, %esi
	movl	$5, %edx
	callq	_mii_rd
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_netdev_info
	testb	$-128, %bl
	jne	LBB0_16
## %bb.17:
	movl	$1, 4(%r15)
	jmp	LBB0_18
LBB0_16:
	movl	$4, 4(%r15)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_if_port,4,2                    ## @if_port
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't take PHY out of isolation mode\n"

L_.str.1:                               ## @.str.1
	.asciz	"autonegotiation failed; using 10mbs\n"

	.comm	_XIRCREG_ESR,4,2                ## @XIRCREG_ESR
	.comm	_MediaSelect,4,2                ## @MediaSelect
L_.str.2:                               ## @.str.2
	.asciz	"MII link partner: %04x\n"

	.no_dead_strip	_init_mii
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_mii
_init_mii:                              ; @init_mii
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	bl	_netdev_priv
	mov	x20, x0
Lloh0:
	adrp	x8, _if_port@GOTPAGE
Lloh1:
	ldr	x8, [x8, _if_port@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #4
	ccmp	w8, #1, #4, ne
	b.ne	LBB0_4
; %bb.1:
	str	w8, [x19, #4]
	str	xzr, [x20, #8]
LBB0_2:
	mov	w22, #1
LBB0_3:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	ldr	w21, [x19]
	mov	x0, x21
	mov	w1, #0
	mov	w2, #1
	bl	_mii_rd
	mov	w22, #0
	and	w8, w0, #0xff00
	mov	w9, #30720
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.5:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #2
	bl	_mii_rd
	mov	w8, #65535
	cmp	w0, w8
	cset	w8, ne
	str	w8, [x20]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	w3, #4096
	b	LBB0_8
LBB0_7:
	ldr	w8, [x19, #4]
	cmp	w8, #4
	cset	w8, eq
	lsl	w3, w8, #13
LBB0_8:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	mov	w4, #16
	bl	_mii_wr
	mov	w0, #100
	bl	_udelay
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_mii_rd
	tbnz	w0, #10, LBB0_15
; %bb.9:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.10:
	mov	w22, #34
	mov	w23, #36
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	w0, #100
	bl	_msleep
	mov	x0, x21
	mov	w1, #0
	mov	w2, #1
	bl	_mii_rd
	bic	w8, w23, w0
	cmp	w8, #0
	ccmp	w22, #0, #4, ne
	sub	w22, w22, #1
	b.ne	LBB0_11
; %bb.12:
	tbnz	w0, #5, LBB0_16
; %bb.13:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
	ldr	w8, [x20]
	mov	w22, #1
	cbnz	w8, LBB0_3
; %bb.14:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #16
	bl	_mii_wr
	mov	w0, #100
	bl	_udelay
	mov	w0, #0
	bl	_SelectPage
Lloh5:
	adrp	x8, _XIRCREG_ESR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _XIRCREG_ESR@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_GetByte
Lloh8:
	adrp	x8, _MediaSelect@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MediaSelect@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	cinc	w8, w22, eq
	str	w8, [x19, #4]
	b	LBB0_3
LBB0_15:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netdev_notice
	mov	w22, #0
	str	xzr, [x20, #8]
	b	LBB0_3
LBB0_16:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #5
	bl	_mii_rd
	mov	x20, x0
	str	x20, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netdev_info
	tbnz	w20, #7, LBB0_18
; %bb.17:
	mov	w22, #1
	str	w22, [x19, #4]
	b	LBB0_3
LBB0_18:
	mov	w8, #4
	str	w8, [x19, #4]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_if_port,4,2                    ; @if_port
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't take PHY out of isolation mode\n"

l_.str.1:                               ; @.str.1
	.asciz	"autonegotiation failed; using 10mbs\n"

	.comm	_XIRCREG_ESR,4,2                ; @XIRCREG_ESR
	.comm	_MediaSelect,4,2                ; @MediaSelect
l_.str.2:                               ; @.str.2
	.asciz	"MII link partner: %04x\n"

	.no_dead_strip	_init_mii
.subsections_via_symbols
