	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mii_check_media                ## -- Begin function mii_check_media
	.p2align	4, 0x90
_mii_check_media:                       ## @mii_check_media
	.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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	20(%rdi), %edi
	callq	_netif_carrier_ok
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_mii_link_ok
	testl	%r14d, %r14d
	jne	LBB0_2
## %bb.1:
	xorl	%ecx, %ecx
	testq	%rbx, %rbx
	setne	%cl
	xorl	%ebx, %ebx
	cmpl	%eax, %ecx
	je	LBB0_24
LBB0_2:
	movl	20(%r12), %edi
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	callq	_netif_carrier_on
	cmpq	$0, 40(%r12)
	je	LBB0_9
## %bb.4:
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.5:
	movl	20(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_6:
	callq	_netif_carrier_off
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.7:
	movl	20(%r12), %edi
	leaq	L_.str(%rip), %rsi
LBB0_8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_netdev_info
	jmp	LBB0_24
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_9:
	testl	%r14d, %r14d
	je	LBB0_13
LBB0_10:
	movl	20(%r12), %edi
	movl	24(%r12), %esi
	movq	_MII_ADVERTISE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*8(%r12)
	movl	%eax, %r13d
	movl	%eax, (%r12)
	jmp	LBB0_14
LBB0_13:
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	je	LBB0_10
LBB0_14:
	movl	20(%r12), %edi
	movl	24(%r12), %esi
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*8(%r12)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpq	$0, 32(%r12)
	je	LBB0_16
## %bb.15:
	movl	20(%r12), %edi
	movl	24(%r12), %esi
	movq	_MII_STAT1000@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	*8(%r12)
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	andl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	movl	%r13d, %edi
	callq	_mii_nway_result
	movq	_ADVERTISE_FULL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_LPA_1000FULL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	andl	%ebx, %esi
	xorl	%r13d, %r13d
	orl	%edx, %esi
	setne	%r13b
	testl	%r15d, %r15d
	je	LBB0_21
## %bb.18:
	movl	20(%r12), %edi
	movq	_LPA_1000HALF@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	$1000, %edx                     ## imm = 0x3E8
	testl	%ebx, %ecx
	jne	LBB0_20
## %bb.19:
	movq	_ADVERTISE_100FULL@GOTPCREL(%rip), %rcx
	movq	_ADVERTISE_100HALF@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	movl	$10, %eax
	movl	$100, %edx
	cmovel	%eax, %edx
LBB0_20:
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.4(%rip), %rcx
	testl	%r13d, %r13d
	cmovneq	%rax, %rcx
	leaq	L_.str.2(%rip), %rsi
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_netdev_info
LBB0_21:
	testl	%r14d, %r14d
	jne	LBB0_23
## %bb.22:
	xorl	%ebx, %ebx
	cmpl	%r13d, 16(%r12)
	je	LBB0_24
LBB0_23:
	movl	%r13d, 16(%r12)
	movl	$1, %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"link down\n"

L_.str.1:                               ## @.str.1
	.asciz	"link up\n"

	.comm	_MII_ADVERTISE,4,2              ## @MII_ADVERTISE
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_MII_STAT1000,4,2               ## @MII_STAT1000
	.comm	_ADVERTISE_FULL,4,2             ## @ADVERTISE_FULL
	.comm	_LPA_1000FULL,4,2               ## @LPA_1000FULL
L_.str.2:                               ## @.str.2
	.asciz	"link up, %uMbps, %s-duplex, lpa 0x%04X\n"

	.comm	_LPA_1000HALF,4,2               ## @LPA_1000HALF
	.comm	_ADVERTISE_100FULL,4,2          ## @ADVERTISE_100FULL
	.comm	_ADVERTISE_100HALF,4,2          ## @ADVERTISE_100HALF
L_.str.3:                               ## @.str.3
	.asciz	"full"

L_.str.4:                               ## @.str.4
	.asciz	"half"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mii_check_media                ; -- Begin function mii_check_media
	.p2align	2
_mii_check_media:                       ; @mii_check_media
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_netif_carrier_ok
	mov	x22, x0
	mov	x0, x19
	bl	_mii_link_ok
	cbnz	w20, LBB0_2
; %bb.1:
	cmp	x22, #0
	cset	w8, ne
	cmp	w8, w0
	b.eq	LBB0_22
LBB0_2:
	ldr	w8, [x19, #20]
	cbz	w0, LBB0_6
; %bb.3:
	mov	x0, x8
	bl	_netif_carrier_on
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_9
; %bb.4:
	cbz	w21, LBB0_22
; %bb.5:
	ldr	w0, [x19, #20]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
	mov	x0, x8
	bl	_netif_carrier_off
	cbz	w21, LBB0_22
; %bb.7:
	ldr	w0, [x19, #20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	bl	_netdev_info
	mov	w0, #0
	b	LBB0_24
LBB0_9:
	cbz	w20, LBB0_11
LBB0_10:
	ldr	x8, [x19, #8]
	ldp	w0, w1, [x19, #20]
Lloh4:
	adrp	x9, _MII_ADVERTISE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MII_ADVERTISE@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x9]
	blr	x8
	mov	x23, x0
	str	w0, [x19]
	b	LBB0_12
LBB0_11:
	ldr	w23, [x19]
	cbz	w23, LBB0_10
LBB0_12:
	ldr	x8, [x19, #8]
	ldp	w0, w1, [x19, #20]
Lloh7:
	adrp	x9, _MII_LPA@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MII_LPA@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x9]
	blr	x8
	mov	x22, x0
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_14
; %bb.13:
	ldr	x8, [x19, #8]
	ldp	w0, w1, [x19, #20]
Lloh10:
	adrp	x9, _MII_STAT1000@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MII_STAT1000@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x9]
	blr	x8
	mov	x24, x0
	b	LBB0_15
LBB0_14:
	mov	w24, #0
LBB0_15:
	and	w0, w22, w23
	bl	_mii_nway_result
Lloh13:
	adrp	x9, _ADVERTISE_FULL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ADVERTISE_FULL@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _LPA_1000FULL@GOTPAGE
Lloh17:
	ldr	x10, [x10, _LPA_1000FULL@GOTPAGEOFF]
	and	w11, w9, w0
Lloh18:
	ldr	w9, [x10]
	and	w10, w9, w24
	orr	w10, w10, w11
	cmp	w10, #0
	cset	w23, ne
	cbz	w21, LBB0_20
; %bb.16:
	mov	x8, x0
	ldr	w0, [x19, #20]
Lloh19:
	adrp	x10, _LPA_1000HALF@GOTPAGE
Lloh20:
	ldr	x10, [x10, _LPA_1000HALF@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w24
	b.eq	LBB0_18
; %bb.17:
	mov	w8, #1000
	b	LBB0_19
LBB0_18:
Lloh22:
	adrp	x9, _ADVERTISE_100FULL@GOTPAGE
Lloh23:
	ldr	x9, [x9, _ADVERTISE_100FULL@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
Lloh25:
	adrp	x10, _ADVERTISE_100HALF@GOTPAGE
Lloh26:
	ldr	x10, [x10, _ADVERTISE_100HALF@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	mov	w8, #100
	mov	w9, #10
	csel	w8, w9, w8, eq
LBB0_19:
Lloh28:
	adrp	x9, l_.str.4@PAGE
Lloh29:
	add	x9, x9, l_.str.4@PAGEOFF
Lloh30:
	adrp	x10, l_.str.3@PAGE
Lloh31:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w23, #0
	csel	x9, x10, x9, ne
	stp	x9, x22, [sp, #8]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_info
LBB0_20:
	cbnz	w20, LBB0_23
; %bb.21:
	ldr	w8, [x19, #16]
	cmp	w8, w23
	b.ne	LBB0_23
LBB0_22:
	mov	w0, #0
	b	LBB0_24
LBB0_23:
	str	w23, [x19, #16]
	mov	w0, #1
LBB0_24:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"link down\n"

l_.str.1:                               ; @.str.1
	.asciz	"link up\n"

	.comm	_MII_ADVERTISE,4,2              ; @MII_ADVERTISE
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_MII_STAT1000,4,2               ; @MII_STAT1000
	.comm	_ADVERTISE_FULL,4,2             ; @ADVERTISE_FULL
	.comm	_LPA_1000FULL,4,2               ; @LPA_1000FULL
l_.str.2:                               ; @.str.2
	.asciz	"link up, %uMbps, %s-duplex, lpa 0x%04X\n"

	.comm	_LPA_1000HALF,4,2               ; @LPA_1000HALF
	.comm	_ADVERTISE_100FULL,4,2          ; @ADVERTISE_100FULL
	.comm	_ADVERTISE_100HALF,4,2          ; @ADVERTISE_100HALF
l_.str.3:                               ; @.str.3
	.asciz	"full"

l_.str.4:                               ; @.str.4
	.asciz	"half"

.subsections_via_symbols
