	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cas_read_mii_link_mode
_cas_read_mii_link_mode:                ## @cas_read_mii_link_mode
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$0, (%rsi)
	movl	$10, (%rdx)
	movl	$0, (%rcx)
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cas_phy_read
	movq	_CAS_LPA_PAUSE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	$1, (%rbx)
LBB0_2:
	movq	_CAS_LPA_ASYM_PAUSE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	orb	$16, (%rbx)
LBB0_4:
	movq	_LPA_DUPLEX@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movl	$1, (%r14)
LBB0_6:
	movq	_LPA_100@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movl	$100, (%r15)
LBB0_8:
	movq	_CAS_FLAG_1000MB_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_13
## %bb.9:
	movq	_CAS_MII_1000_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cas_phy_read
	movq	_CAS_LPA_1000FULL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	movq	_CAS_LPA_1000HALF@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	%ecx, %esi
	testl	%eax, %esi
	je	LBB0_11
## %bb.10:
	movl	$1000, (%r15)                   ## imm = 0x3E8
	movl	(%rdx), %ecx
LBB0_11:
	testl	%eax, %ecx
	je	LBB0_13
## %bb.12:
	movl	$1, (%r14)
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_CAS_LPA_PAUSE,4,2              ## @CAS_LPA_PAUSE
	.comm	_CAS_LPA_ASYM_PAUSE,4,2         ## @CAS_LPA_ASYM_PAUSE
	.comm	_LPA_DUPLEX,4,2                 ## @LPA_DUPLEX
	.comm	_LPA_100,4,2                    ## @LPA_100
	.comm	_CAS_FLAG_1000MB_CAP,4,2        ## @CAS_FLAG_1000MB_CAP
	.comm	_CAS_MII_1000_STATUS,4,2        ## @CAS_MII_1000_STATUS
	.comm	_CAS_LPA_1000FULL,4,2           ## @CAS_LPA_1000FULL
	.comm	_CAS_LPA_1000HALF,4,2           ## @CAS_LPA_1000HALF
	.no_dead_strip	_cas_read_mii_link_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cas_read_mii_link_mode
_cas_read_mii_link_mode:                ; @cas_read_mii_link_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	str	wzr, [x1]
	mov	w8, #10
	str	w8, [x2]
	str	wzr, [x3]
Lloh0:
	adrp	x8, _MII_LPA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_LPA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_cas_phy_read
Lloh3:
	adrp	x8, _CAS_LPA_PAUSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CAS_LPA_PAUSE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [x22]
LBB0_2:
Lloh6:
	adrp	x8, _CAS_LPA_ASYM_PAUSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CAS_LPA_ASYM_PAUSE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x22]
	orr	w8, w8, #0x10
	str	w8, [x22]
LBB0_4:
Lloh9:
	adrp	x8, _LPA_DUPLEX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LPA_DUPLEX@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x19]
LBB0_6:
Lloh12:
	adrp	x8, _LPA_100@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LPA_100@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
	mov	w8, #100
	str	w8, [x20]
LBB0_8:
	ldr	w8, [x21]
Lloh15:
	adrp	x9, _CAS_FLAG_1000MB_CAP@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CAS_FLAG_1000MB_CAP@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.9:
Lloh18:
	adrp	x8, _CAS_MII_1000_STATUS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CAS_MII_1000_STATUS@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_cas_phy_read
Lloh21:
	adrp	x9, _CAS_LPA_1000FULL@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CAS_LPA_1000FULL@GOTPAGEOFF]
	ldr	w8, [x9]
Lloh23:
	adrp	x10, _CAS_LPA_1000HALF@GOTPAGE
Lloh24:
	ldr	x10, [x10, _CAS_LPA_1000HALF@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	orr	w10, w10, w8
	tst	w10, w0
	b.eq	LBB0_11
; %bb.10:
	mov	w8, #1000
	str	w8, [x20]
	ldr	w8, [x9]
LBB0_11:
	tst	w8, w0
	b.eq	LBB0_13
; %bb.12:
	mov	w8, #1
	str	w8, [x19]
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_CAS_LPA_PAUSE,4,2              ; @CAS_LPA_PAUSE
	.comm	_CAS_LPA_ASYM_PAUSE,4,2         ; @CAS_LPA_ASYM_PAUSE
	.comm	_LPA_DUPLEX,4,2                 ; @LPA_DUPLEX
	.comm	_LPA_100,4,2                    ; @LPA_100
	.comm	_CAS_FLAG_1000MB_CAP,4,2        ; @CAS_FLAG_1000MB_CAP
	.comm	_CAS_MII_1000_STATUS,4,2        ; @CAS_MII_1000_STATUS
	.comm	_CAS_LPA_1000FULL,4,2           ; @CAS_LPA_1000FULL
	.comm	_CAS_LPA_1000HALF,4,2           ; @CAS_LPA_1000HALF
	.no_dead_strip	_cas_read_mii_link_mode
.subsections_via_symbols
