	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_link
_update_link:                           ## @update_link
	.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, %r14
	callq	_netdev_priv
	movq	%rax, %r15
	movq	8(%rax), %rax
	movl	(%rax), %esi
	movq	_MII_BMSR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_mdio_read
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	je	LBB0_1
## %bb.2:
	movq	8(%r15), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_mdio_read
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_netif_carrier_ok
	testb	$4, %bl
	jne	LBB0_8
## %bb.3:
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	8(%r15), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_6:
	movq	%r14, %rdi
	callq	_netif_carrier_off
LBB0_1:
	movl	(%r15), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movq	_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	movq	8(%r15), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
LBB0_11:
	movq	%r14, %rdi
	callq	_netif_carrier_on
LBB0_12:
	movl	4(%r15), %eax
	andl	$-16, %eax
	movq	_MII_DAVICOM_DM9101@GOTPCREL(%rip), %rcx
	movq	8(%r15), %rdx
	movl	(%rdx), %esi
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.13:
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mdio_read
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rdx
	andl	(%rdx), %eax
	jmp	LBB0_15
LBB0_14:
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mdio_read
	andl	16(%r15), %eax
	movq	_LPA_100FULL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	setne	%cl
	movl	%eax, %edx
	andl	$704, %edx                      ## imm = 0x2C0
	movq	_LPA_10FULL@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	sete	%dl
	orb	%cl, %dl
	movzbl	%dl, %ecx
	andl	$896, %eax                      ## imm = 0x380
LBB0_15:
	movl	(%r15), %edx
	movl	%edx, %esi
	andl	$-536871425, %esi               ## imm = 0xDFFFFDFF
	orl	20(%r15), %ecx
	leal	512(%rsi), %edi
	cmovel	%esi, %edi
	leal	536870912(%rdi), %ebx
	testl	%eax, %eax
	cmovel	%edi, %ebx
	cmpl	%edx, %ebx
	je	LBB0_18
## %bb.16:
	movq	_debug@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	je	LBB0_18
## %bb.17:
	testl	%eax, %eax
	movl	$10, %eax
	movl	$100, %edx
	cmovel	%eax, %edx
	testl	%ecx, %ecx
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	8(%r15), %rax
	movl	(%rax), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_debug,8,3                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII #%d reports no link. Disabling watchdog\n"

L_.str.1:                               ## @.str.1
	.asciz	"MII #%d link is back. Enabling watchdog\n"

	.comm	_MII_DAVICOM_DM9101,4,2         ## @MII_DAVICOM_DM9101
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_FULLDPLX,4,2              ## @BMCR_FULLDPLX
	.comm	_BMCR_SPEED100,4,2              ## @BMCR_SPEED100
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_LPA_100FULL,4,2                ## @LPA_100FULL
	.comm	_LPA_10FULL,4,2                 ## @LPA_10FULL
L_.str.2:                               ## @.str.2
	.asciz	"Setting %dMBit-%s-duplex based on MII#%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"full"

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

	.no_dead_strip	_update_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_link
_update_link:                           ; @update_link
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_netdev_priv
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w1, [x8]
Lloh0:
	adrp	x21, _MII_BMSR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MII_BMSR@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_mdio_read
	mov	w8, #65535
	cmp	w0, w8
	b.eq	LBB0_6
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_mdio_read
	mov	x21, x0
	mov	x0, x19
	bl	_netif_carrier_ok
	tbnz	w21, #2, LBB0_8
; %bb.2:
	cbz	x0, LBB0_6
; %bb.3:
Lloh2:
	adrp	x8, _debug@GOTPAGE
Lloh3:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_5:
	mov	x0, x19
	bl	_netif_carrier_off
LBB0_6:
	ldr	w21, [x20]
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
Lloh7:
	adrp	x22, _debug@GOTPAGE
Lloh8:
	ldr	x22, [x22, _debug@GOTPAGEOFF]
	cbnz	x0, LBB0_12
; %bb.9:
	ldr	x8, [x22]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_11:
	mov	x0, x19
	bl	_netif_carrier_on
LBB0_12:
	ldr	w8, [x20, #4]
	and	w8, w8, #0xfffffff0
Lloh11:
	adrp	x9, _MII_DAVICOM_DM9101@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MII_DAVICOM_DM9101@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	ldr	x10, [x20, #8]
	ldr	w1, [x10]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.13:
Lloh14:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mdio_read
Lloh17:
	adrp	x8, _BMCR_FULLDPLX@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	and	w9, w8, w0
Lloh20:
	adrp	x8, _BMCR_SPEED100@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BMCR_SPEED100@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w0
	b	LBB0_15
LBB0_14:
Lloh23:
	adrp	x8, _MII_LPA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MII_LPA@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mdio_read
	ldr	w8, [x20, #16]
	and	w8, w8, w0
Lloh26:
	adrp	x9, _LPA_100FULL@GOTPAGE
Lloh27:
	ldr	x9, [x9, _LPA_100FULL@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w8, w9
	mov	w9, #704
	and	w9, w8, w9
Lloh29:
	adrp	x10, _LPA_10FULL@GOTPAGE
Lloh30:
	ldr	x10, [x10, _LPA_10FULL@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	ccmp	w9, w10, #4, eq
	cset	w9, eq
	and	w8, w8, #0x380
LBB0_15:
	ldr	w10, [x20, #20]
	orr	w9, w10, w9
	ldr	w10, [x20]
	mov	w11, #65023
	movk	w11, #57343, lsl #16
	and	w11, w10, w11
	orr	w12, w11, #0x200
	cmp	w9, #0
	csel	w11, w11, w12, eq
	orr	w12, w11, #0x20000000
	cmp	w8, #0
	csel	w21, w11, w12, eq
	ldr	x11, [x22]
	cmp	w21, w10
	ccmp	x11, #0, #4, ne
	b.eq	LBB0_7
; %bb.16:
	mov	w10, #100
	mov	w11, #10
	cmp	w8, #0
	csel	w2, w11, w10, eq
Lloh32:
	adrp	x8, l_.str.3@PAGE
Lloh33:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh34:
	adrp	x10, l_.str.4@PAGE
Lloh35:
	add	x10, x10, l_.str.4@PAGEOFF
	cmp	w9, #0
	csel	x8, x10, x8, eq
	ldr	x9, [x20, #8]
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_debug,8,3                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII #%d reports no link. Disabling watchdog\n"

l_.str.1:                               ; @.str.1
	.asciz	"MII #%d link is back. Enabling watchdog\n"

	.comm	_MII_DAVICOM_DM9101,4,2         ; @MII_DAVICOM_DM9101
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_FULLDPLX,4,2              ; @BMCR_FULLDPLX
	.comm	_BMCR_SPEED100,4,2              ; @BMCR_SPEED100
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_LPA_100FULL,4,2                ; @LPA_100FULL
	.comm	_LPA_10FULL,4,2                 ; @LPA_10FULL
l_.str.2:                               ; @.str.2
	.asciz	"Setting %dMBit-%s-duplex based on MII#%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"full"

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

	.no_dead_strip	_update_link
.subsections_via_symbols
