	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_swphy_read_reg                 ## -- Begin function swphy_read_reg
	.p2align	4, 0x90
_swphy_read_reg:                        ## @swphy_read_reg
	.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	_MII_REGS_NUM@GOTPCREL(%rip), %rcx
	movl	$-1, %eax
	cmpl	%edi, (%rcx)
	jl	LBB0_20
## %bb.1:
	movq	%rsi, %r14
	movl	%edi, %r15d
	movq	_BMSR_ANEGCAPABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	32(%rsi), %edi
	callq	_swphy_decode_speed
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_WARN_ON
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_2
LBB0_20:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movslq	%ebx, %rcx
	shlq	$4, %rcx
	cmpq	$0, 24(%r14)
	movq	_speed@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	_duplex@GOTPCREL(%rip), %rax
	movq	(%rax), %r11
	jne	LBB0_3
## %bb.4:
	movq	_SWMII_DUPLEX_HALF@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_SWMII_DUPLEX_FULL@GOTPCREL(%rip), %rax
LBB0_5:
	movslq	(%rax), %rdi
	shlq	$4, %rdi
	movl	(%r11,%rdi), %eax
	andl	(%r10,%rcx), %eax
	orl	%r12d, %eax
	cmpq	$0, 16(%r14)
	je	LBB0_6
## %bb.7:
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movq	_BMSR_ANEGCOMPLETE@GOTPCREL(%rip), %r9
	movl	8(%r11,%rdi), %edx
	movl	12(%r11,%rdi), %r8d
	xorl	%ebx, %ebx
	andl	8(%r10,%rcx), %edx
	cmpq	$0, 8(%r14)
	je	LBB0_9
## %bb.8:
	movq	_LPA_PAUSE_CAP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
LBB0_9:
	orl	%edx, %ebx
	orl	(%r9), %eax
	andl	12(%r10,%rcx), %r8d
	cmpq	$0, (%r14)
	je	LBB0_11
## %bb.10:
	movq	_LPA_PAUSE_ASYM@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ebx
	jmp	LBB0_11
LBB0_6:
	xorl	%r8d, %r8d
	xorl	%ebx, %ebx
LBB0_11:
	addl	$-128, %r15d
	cmpl	$8, %r15d
	ja	LBB0_19
## %bb.12:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%r15,4), %rsi
	addq	%rdx, %rsi
	jmpq	*%rsi
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_18:
	movl	$-1, %eax
	jmp	LBB0_20
LBB0_19:
	movl	$65535, %eax                    ## imm = 0xFFFF
	jmp	LBB0_20
LBB0_16:
	movl	%r8d, %eax
	jmp	LBB0_20
LBB0_15:
	movl	%ebx, %eax
	jmp	LBB0_20
LBB0_17:
	movl	4(%r11,%rdi), %eax
	andl	4(%r10,%rcx), %eax
	jmp	LBB0_20
LBB0_13:
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_20
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_16
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_15
	.long	L0_0_set_17
	.long	L0_0_set_20
	.long	L0_0_set_13
	.end_data_region
                                        ## -- End function
	.comm	_BMSR_ANEGCAPABLE,4,2           ## @BMSR_ANEGCAPABLE
	.comm	_MII_REGS_NUM,4,2               ## @MII_REGS_NUM
	.comm	_SWMII_DUPLEX_FULL,4,2          ## @SWMII_DUPLEX_FULL
	.comm	_SWMII_DUPLEX_HALF,4,2          ## @SWMII_DUPLEX_HALF
	.comm	_speed,8,3                      ## @speed
	.comm	_duplex,8,3                     ## @duplex
	.comm	_BMSR_LSTATUS,4,2               ## @BMSR_LSTATUS
	.comm	_BMSR_ANEGCOMPLETE,4,2          ## @BMSR_ANEGCOMPLETE
	.comm	_LPA_PAUSE_CAP,4,2              ## @LPA_PAUSE_CAP
	.comm	_LPA_PAUSE_ASYM,4,2             ## @LPA_PAUSE_ASYM
	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_swphy_read_reg                 ; -- Begin function swphy_read_reg
	.p2align	2
_swphy_read_reg:                        ; @swphy_read_reg
	.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
Lloh0:
	adrp	x8, _MII_REGS_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_REGS_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ge	LBB0_2
LBB0_1:
	mov	w0, #-1
	b	LBB0_4
LBB0_2:
	mov	x20, x1
	mov	x19, x0
Lloh3:
	adrp	x8, _BMSR_ANEGCAPABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMSR_ANEGCAPABLE@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	ldr	w0, [x1, #32]
	bl	_swphy_decode_speed
	mov	x21, x0
	lsr	w0, w0, #31
	bl	_WARN_ON
	cbz	x0, LBB0_5
LBB0_3:
	mov	w0, #0
LBB0_4:
	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
LBB0_5:
Lloh6:
	adrp	x9, _SWMII_DUPLEX_FULL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SWMII_DUPLEX_FULL@GOTPAGEOFF]
Lloh8:
	adrp	x11, _SWMII_DUPLEX_HALF@GOTPAGE
Lloh9:
	ldr	x11, [x11, _SWMII_DUPLEX_HALF@GOTPAGEOFF]
Lloh10:
	adrp	x8, _speed@GOTPAGE
Lloh11:
	ldr	x8, [x8, _speed@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x8]
	add	x8, x10, w21, sxtw #4
	ldr	w12, [x8]
Lloh13:
	adrp	x13, _duplex@GOTPAGE
Lloh14:
	ldr	x13, [x13, _duplex@GOTPAGEOFF]
Lloh15:
	ldr	x13, [x13]
	ldp	x15, x14, [x20, #16]
	cmp	x14, #0
	csel	x9, x11, x9, eq
	ldrsw	x9, [x9]
	add	x9, x13, x9, lsl #4
	ldr	w11, [x9]
	and	w11, w11, w12
	orr	w0, w11, w22
	cbz	x15, LBB0_8
; %bb.6:
	sxtw	x11, w21
Lloh16:
	adrp	x12, _BMSR_LSTATUS@GOTPAGE
Lloh17:
	ldr	x12, [x12, _BMSR_LSTATUS@GOTPAGEOFF]
Lloh18:
	ldr	w12, [x12]
Lloh19:
	adrp	x13, _BMSR_ANEGCOMPLETE@GOTPAGE
Lloh20:
	ldr	x13, [x13, _BMSR_ANEGCOMPLETE@GOTPAGEOFF]
Lloh21:
	ldr	w13, [x13]
	orr	w12, w12, w0
	orr	w0, w12, w13
	add	x10, x10, x11, lsl #4
	ldp	w11, w10, [x10, #8]
	ldp	w12, w13, [x9, #8]
	and	w11, w12, w11
	and	w10, w13, w10
Lloh22:
	adrp	x12, _LPA_PAUSE_CAP@GOTPAGE
Lloh23:
	ldr	x12, [x12, _LPA_PAUSE_CAP@GOTPAGEOFF]
Lloh24:
	ldr	w12, [x12]
	ldp	x14, x13, [x20]
	cmp	x13, #0
	csel	w12, wzr, w12, eq
	orr	w11, w12, w11
	cbz	x14, LBB0_9
; %bb.7:
Lloh25:
	adrp	x12, _LPA_PAUSE_ASYM@GOTPAGE
Lloh26:
	ldr	x12, [x12, _LPA_PAUSE_ASYM@GOTPAGEOFF]
Lloh27:
	ldr	w12, [x12]
	orr	w11, w12, w11
	b	LBB0_9
LBB0_8:
	mov	w10, #0
	mov	w11, #0
LBB0_9:
	sub	w12, w19, #128
	cmp	w12, #8
	b.hi	LBB0_12
; %bb.10:
Lloh28:
	adrp	x13, lJTI0_0@PAGE
Lloh29:
	add	x13, x13, lJTI0_0@PAGEOFF
	adr	x14, LBB0_1
	ldrb	w15, [x13, x12]
	add	x14, x14, x15, lsl #2
	br	x14
LBB0_11:
	mov	x0, x10
	b	LBB0_4
LBB0_12:
	mov	w0, #65535
	b	LBB0_4
LBB0_13:
	mov	x0, x11
	b	LBB0_4
LBB0_14:
	ldr	w8, [x8, #4]
	ldr	w9, [x9, #4]
	and	w0, w9, w8
	b	LBB0_4
LBB0_15:
Lloh30:
	adrp	x8, _BMCR_ANENABLE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BMCR_ANENABLE@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_11-LBB0_1)>>2
	.byte	(LBB0_3-LBB0_1)>>2
	.byte	(LBB0_3-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_13-LBB0_1)>>2
	.byte	(LBB0_14-LBB0_1)>>2
	.byte	(LBB0_4-LBB0_1)>>2
	.byte	(LBB0_15-LBB0_1)>>2
                                        ; -- End function
	.comm	_BMSR_ANEGCAPABLE,4,2           ; @BMSR_ANEGCAPABLE
	.comm	_MII_REGS_NUM,4,2               ; @MII_REGS_NUM
	.comm	_SWMII_DUPLEX_FULL,4,2          ; @SWMII_DUPLEX_FULL
	.comm	_SWMII_DUPLEX_HALF,4,2          ; @SWMII_DUPLEX_HALF
	.comm	_speed,8,3                      ; @speed
	.comm	_duplex,8,3                     ; @duplex
	.comm	_BMSR_LSTATUS,4,2               ; @BMSR_LSTATUS
	.comm	_BMSR_ANEGCOMPLETE,4,2          ; @BMSR_ANEGCOMPLETE
	.comm	_LPA_PAUSE_CAP,4,2              ; @LPA_PAUSE_CAP
	.comm	_LPA_PAUSE_ASYM,4,2             ; @LPA_PAUSE_ASYM
	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
.subsections_via_symbols
