	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mii_speed
_mii_speed:                             ## @mii_speed
	.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	%rdi, %rbx
	callq	_mii_link_ok
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	_MII_BMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*(%rbx)
	movq	_BMSR_ANEGCOMPLETE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.2:
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	_MII_ADVERTISE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*(%rbx)
	movl	%eax, %r14d
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*(%rbx)
	andl	%eax, %r14d
	movl	%r14d, %edi
	callq	_mii_nway_result
	movl	%eax, %r14d
	cmpq	$0, 16(%rbx)
	je	LBB0_3
## %bb.4:
	movl	8(%rbx), %esi
	movl	12(%rbx), %edi
	movq	_MII_STAT1000@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*(%rbx)
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
LBB0_5:
	movq	_LPA_1000FULL@GOTPCREL(%rip), %rcx
	movq	_LPA_1000HALF@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	$1000, %r15d                    ## imm = 0x3E8
	testl	%eax, %edx
	jne	LBB0_7
## %bb.6:
	movq	_ADVERTISE_100FULL@GOTPCREL(%rip), %rax
	movq	_ADVERTISE_100HALF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%r14d, %ecx
	movl	$10, %eax
	movl	$100, %r15d
	cmovel	%eax, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_BMSR_ANEGCOMPLETE,4,2          ## @BMSR_ANEGCOMPLETE
	.comm	_MII_ADVERTISE,4,2              ## @MII_ADVERTISE
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_MII_STAT1000,4,2               ## @MII_STAT1000
	.comm	_LPA_1000FULL,4,2               ## @LPA_1000FULL
	.comm	_LPA_1000HALF,4,2               ## @LPA_1000HALF
	.comm	_ADVERTISE_100FULL,4,2          ## @ADVERTISE_100FULL
	.comm	_ADVERTISE_100HALF,4,2          ## @ADVERTISE_100HALF
	.no_dead_strip	_mii_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mii_speed
_mii_speed:                             ; @mii_speed
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_mii_link_ok
	cbz	w0, LBB0_9
; %bb.1:
	ldr	x8, [x19]
	ldp	w1, w0, [x19, #8]
Lloh0:
	adrp	x9, _MII_BMSR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MII_BMSR@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x9]
	blr	x8
Lloh3:
	adrp	x8, _BMSR_ANEGCOMPLETE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMSR_ANEGCOMPLETE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [x19]
	ldp	w1, w0, [x19, #8]
Lloh6:
	adrp	x9, _MII_ADVERTISE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MII_ADVERTISE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x9]
	blr	x8
	mov	x20, x0
	ldr	x8, [x19]
	ldp	w1, w0, [x19, #8]
Lloh9:
	adrp	x9, _MII_LPA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MII_LPA@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x9]
	blr	x8
	and	w0, w0, w20
	bl	_mii_nway_result
	mov	x20, x0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x19]
	ldp	w1, w0, [x19, #8]
Lloh12:
	adrp	x9, _MII_STAT1000@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MII_STAT1000@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x9]
	blr	x8
	b	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_9
LBB0_5:
	mov	w0, #0
LBB0_6:
Lloh15:
	adrp	x8, _LPA_1000FULL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LPA_1000FULL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _LPA_1000HALF@GOTPAGE
Lloh19:
	ldr	x9, [x9, _LPA_1000HALF@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
	mov	w0, #1000
	b	LBB0_9
LBB0_8:
Lloh21:
	adrp	x8, _ADVERTISE_100FULL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ADVERTISE_100FULL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _ADVERTISE_100HALF@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ADVERTISE_100HALF@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w20
	mov	w8, #100
	mov	w9, #10
	csel	w0, w9, w8, eq
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_BMSR_ANEGCOMPLETE,4,2          ; @BMSR_ANEGCOMPLETE
	.comm	_MII_ADVERTISE,4,2              ; @MII_ADVERTISE
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_MII_STAT1000,4,2               ; @MII_STAT1000
	.comm	_LPA_1000FULL,4,2               ; @LPA_1000FULL
	.comm	_LPA_1000HALF,4,2               ; @LPA_1000HALF
	.comm	_ADVERTISE_100FULL,4,2          ; @ADVERTISE_100FULL
	.comm	_ADVERTISE_100HALF,4,2          ; @ADVERTISE_100HALF
	.no_dead_strip	_mii_speed
.subsections_via_symbols
