	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cas_mdio_link_not_up
_cas_mdio_link_not_up:                  ## @cas_mdio_link_not_up
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.1:
	cmpl	$130, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_14
## %bb.3:
	movq	_link@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%rbx), %edx
	leaq	L_.str(%rip), %rcx
	movq	%rbx, %rdi
	callq	_netif_info
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%rbx, %rdi
	callq	_cas_phy_write
	movl	$5, 8(%rbx)
	movq	_link_force_ok@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_8
LBB0_9:
	movq	_MII_BMCR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_cas_phy_read
	movl	$5, 8(%rbx)
	movq	_CAS_BMCR_SPEED1000@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_11
## %bb.10:
	notl	%ecx
	andl	%ecx, %eax
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	jmp	LBB0_13
LBB0_4:
	movq	_MII_BMCR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_cas_phy_read
	movq	_BMCR_ANRESTART@GOTPCREL(%rip), %rcx
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_CAS_FLAG_1000MB_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	12(%rbx), %eax
	jne	LBB0_5
## %bb.6:
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_CAS_BMCR_SPEED1000@GOTPCREL(%rip), %rax
LBB0_7:
	orl	(%rax), %edx
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_cas_phy_write
	movl	$5, 8(%rbx)
	movl	$128, (%rbx)
LBB0_8:
	movq	_LINK_TRANSITION_LINK_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	jmp	LBB0_14
LBB0_11:
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_14
## %bb.12:
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	cmovnel	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r14), %esi
	movq	%rbx, %rdi
LBB0_13:
	callq	_cas_phy_write
LBB0_14:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_link,4,2                       ## @link
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Autoneg failed again, keeping forced mode\n"

	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_link_force_ok,4,2              ## @link_force_ok
	.comm	_LINK_TRANSITION_LINK_CONFIG,8,3 ## @LINK_TRANSITION_LINK_CONFIG
	.comm	_BMCR_ANRESTART,4,2             ## @BMCR_ANRESTART
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
	.comm	_BMCR_FULLDPLX,4,2              ## @BMCR_FULLDPLX
	.comm	_CAS_FLAG_1000MB_CAP,4,2        ## @CAS_FLAG_1000MB_CAP
	.comm	_CAS_BMCR_SPEED1000,4,2         ## @CAS_BMCR_SPEED1000
	.comm	_BMCR_SPEED100,4,2              ## @BMCR_SPEED100
	.no_dead_strip	_cas_mdio_link_not_up
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cas_mdio_link_not_up
_cas_mdio_link_not_up:                  ; @cas_mdio_link_not_up
	.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
	ldr	w8, [x0]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #130
	b.eq	LBB0_6
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_11
; %bb.3:
Lloh0:
	adrp	x8, _link@GOTPAGE
Lloh1:
	ldr	x8, [x8, _link@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19, #24]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_info
Lloh5:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x19
	bl	_cas_phy_write
	mov	w8, #5
	str	w8, [x19, #8]
Lloh8:
	adrp	x8, _link_force_ok@GOTPAGE
Lloh9:
	ldr	x8, [x8, _link_force_ok@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x20, _MII_BMCR@GOTPAGE
Lloh12:
	ldr	x20, [x20, _MII_BMCR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cas_phy_read
	mov	w8, #5
	str	w8, [x19, #8]
Lloh13:
	adrp	x8, _CAS_BMCR_SPEED1000@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CAS_BMCR_SPEED1000@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.5:
	bic	w8, w0, w8
Lloh16:
	adrp	x9, _BMCR_SPEED100@GOTPAGE
Lloh17:
	ldr	x9, [x9, _BMCR_SPEED100@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _BMCR_FULLDPLX@GOTPAGE
Lloh20:
	ldr	x10, [x10, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w2, w8, w10
	b	LBB0_10
LBB0_6:
Lloh22:
	adrp	x20, _MII_BMCR@GOTPAGE
Lloh23:
	ldr	x20, [x20, _MII_BMCR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cas_phy_read
Lloh24:
	adrp	x8, _BMCR_ANRESTART@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BMCR_ANRESTART@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _BMCR_ANENABLE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _BMCR_ANENABLE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
Lloh30:
	adrp	x9, _BMCR_FULLDPLX@GOTPAGE
Lloh31:
	ldr	x9, [x9, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x19, #12]
Lloh33:
	adrp	x10, _CAS_FLAG_1000MB_CAP@GOTPAGE
Lloh34:
	ldr	x10, [x10, _CAS_FLAG_1000MB_CAP@GOTPAGEOFF]
Lloh35:
	adrp	x11, _CAS_BMCR_SPEED1000@GOTPAGE
Lloh36:
	ldr	x11, [x11, _CAS_BMCR_SPEED1000@GOTPAGEOFF]
Lloh37:
	adrp	x12, _BMCR_SPEED100@GOTPAGE
Lloh38:
	ldr	x12, [x12, _BMCR_SPEED100@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	tst	w10, w9
	csel	x9, x12, x11, eq
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cas_phy_write
	mov	w8, #5
	str	w8, [x19, #8]
	mov	w8, #128
LBB0_7:
	str	w8, [x19]
Lloh40:
	adrp	x8, _LINK_TRANSITION_LINK_CONFIG@GOTPAGE
Lloh41:
	ldr	x8, [x8, _LINK_TRANSITION_LINK_CONFIG@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	b	LBB0_11
LBB0_8:
Lloh43:
	adrp	x8, _BMCR_SPEED100@GOTPAGE
Lloh44:
	ldr	x8, [x8, _BMCR_SPEED100@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.9:
Lloh46:
	adrp	x9, _BMCR_FULLDPLX@GOTPAGE
Lloh47:
	ldr	x9, [x9, _BMCR_FULLDPLX@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w0
	csel	w8, w8, w9, eq
	bic	w2, w0, w8
LBB0_10:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cas_phy_write
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh39
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_link,4,2                       ; @link
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Autoneg failed again, keeping forced mode\n"

	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_link_force_ok,4,2              ; @link_force_ok
	.comm	_LINK_TRANSITION_LINK_CONFIG,8,3 ; @LINK_TRANSITION_LINK_CONFIG
	.comm	_BMCR_ANRESTART,4,2             ; @BMCR_ANRESTART
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
	.comm	_BMCR_FULLDPLX,4,2              ; @BMCR_FULLDPLX
	.comm	_CAS_FLAG_1000MB_CAP,4,2        ; @CAS_FLAG_1000MB_CAP
	.comm	_CAS_BMCR_SPEED1000,4,2         ; @CAS_BMCR_SPEED1000
	.comm	_BMCR_SPEED100,4,2              ; @BMCR_SPEED100
	.no_dead_strip	_cas_mdio_link_not_up
.subsections_via_symbols
