	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_e1000e_read_phy_reg_mdic       ## -- Begin function e1000e_read_phy_reg_mdic
	.p2align	4, 0x90
_e1000e_read_phy_reg_mdic:              ## @e1000e_read_phy_reg_mdic
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAX_PHY_REG_ADDRESS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jge	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_e_dbg
	movq	_E1000_ERR_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_2:
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	_E1000_MDIC_REG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %eax
	shll	%cl, %eax
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	8(%rdi), %ebx
	movq	_E1000_MDIC_PHY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movq	_E1000_MDIC_OP_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MDIC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	%ebx, %esi
	callq	_ew32
	movq	_E1000_GEN_POLL_TIMEOUT@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_9
## %bb.3:
	xorl	%r15d, %r15d
	movq	_E1000_MDIC_READY@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_udelay
	movl	(%r13), %edi
	callq	_er32
	movl	%eax, %ebx
	movl	(%r12), %eax
	testl	%ebx, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%r15d
	movl	(%r14), %ecx
	leal	(%rcx,%rcx,2), %ecx
	cmpl	%ecx, %r15d
	jl	LBB0_4
LBB0_6:
	testl	%ebx, %eax
	je	LBB0_10
LBB0_7:
	movq	_E1000_MDIC_ERROR@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_15
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
LBB0_9:
	movq	_E1000_MDIC_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ebx, %eax
	jne	LBB0_7
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
LBB0_11:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_e_dbg
LBB0_12:
	movq	_E1000_ERR_PHY@GOTPCREL(%rip), %rax
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_E1000_MDIC_REG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%ebx, %edx
	movq	_E1000_MDIC_REG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	%esi, %edx
	jne	LBB0_18
## %bb.16:
	movslq	%ebx, %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_e1000_pch2lan@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.17:
	movl	$100, %edi
	callq	_udelay
	jmp	LBB0_14
LBB0_18:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_e_dbg
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PHY_REG_ADDRESS,4,2        ## @MAX_PHY_REG_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PHY Address %d is out of range\n"

	.comm	_E1000_ERR_PARAM,4,2            ## @E1000_ERR_PARAM
	.comm	_E1000_MDIC_REG_SHIFT,4,2       ## @E1000_MDIC_REG_SHIFT
	.comm	_E1000_MDIC_PHY_SHIFT,4,2       ## @E1000_MDIC_PHY_SHIFT
	.comm	_E1000_MDIC_OP_READ,4,2         ## @E1000_MDIC_OP_READ
	.comm	_MDIC,4,2                       ## @MDIC
	.comm	_E1000_GEN_POLL_TIMEOUT,4,2     ## @E1000_GEN_POLL_TIMEOUT
	.comm	_E1000_MDIC_READY,4,2           ## @E1000_MDIC_READY
L_.str.1:                               ## @.str.1
	.asciz	"MDI Read did not complete\n"

	.comm	_E1000_ERR_PHY,4,2              ## @E1000_ERR_PHY
	.comm	_E1000_MDIC_ERROR,4,2           ## @E1000_MDIC_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"MDI Error\n"

	.comm	_E1000_MDIC_REG_MASK,4,2        ## @E1000_MDIC_REG_MASK
L_.str.3:                               ## @.str.3
	.asciz	"MDI Read offset error - requested %d, returned %d\n"

	.comm	_e1000_pch2lan,8,3              ## @e1000_pch2lan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_e1000e_read_phy_reg_mdic       ; -- Begin function e1000e_read_phy_reg_mdic
	.p2align	2
_e1000e_read_phy_reg_mdic:              ; @e1000e_read_phy_reg_mdic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
Lloh0:
	adrp	x8, _MAX_PHY_REG_ADDRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_PHY_REG_ADDRESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ge	LBB0_2
; %bb.1:
	str	x19, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_e_dbg
Lloh5:
	adrp	x8, _E1000_ERR_PARAM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _E1000_ERR_PARAM@GOTPAGEOFF]
	b	LBB0_17
LBB0_2:
	mov	x20, x2
	mov	x21, x0
Lloh7:
	adrp	x23, _E1000_MDIC_REG_SHIFT@GOTPAGE
Lloh8:
	ldr	x23, [x23, _E1000_MDIC_REG_SHIFT@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w8, w19, w8
	ldr	w9, [x0, #8]
Lloh9:
	adrp	x10, _E1000_MDIC_PHY_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _E1000_MDIC_PHY_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh12:
	adrp	x10, _E1000_MDIC_OP_READ@GOTPAGE
Lloh13:
	ldr	x10, [x10, _E1000_MDIC_OP_READ@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh14:
	ldr	w9, [x10]
	orr	w22, w8, w9
Lloh15:
	adrp	x24, _MDIC@GOTPAGE
Lloh16:
	ldr	x24, [x24, _MDIC@GOTPAGEOFF]
	ldr	w0, [x24]
	mov	x1, x22
	bl	_ew32
Lloh17:
	adrp	x25, _E1000_GEN_POLL_TIMEOUT@GOTPAGE
Lloh18:
	ldr	x25, [x25, _E1000_GEN_POLL_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	w26, #0
Lloh19:
	adrp	x27, _E1000_MDIC_READY@GOTPAGE
Lloh20:
	ldr	x27, [x27, _E1000_MDIC_READY@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_udelay
	ldr	w0, [x24]
	bl	_er32
	mov	x22, x0
	ldr	w8, [x27]
	tst	w8, w0
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w26, w26, #1
	ldr	w9, [x25]
	add	w9, w9, w9, lsl #1
	cmp	w26, w9
	b.lt	LBB0_4
LBB0_6:
	tst	w8, w22
	b.eq	LBB0_10
LBB0_7:
Lloh21:
	adrp	x8, _E1000_MDIC_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _E1000_MDIC_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_11
; %bb.8:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_9:
Lloh26:
	adrp	x8, _E1000_MDIC_READY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _E1000_MDIC_READY@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w22
	b.ne	LBB0_7
LBB0_10:
Lloh29:
	adrp	x0, l_.str.1@PAGE
Lloh30:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_11:
Lloh31:
	adrp	x8, _E1000_MDIC_REG_MASK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _E1000_MDIC_REG_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	and	w8, w8, w22
	ldr	w9, [x23]
	asr	w8, w8, w9
	cmp	w8, w19
	b.ne	LBB0_15
; %bb.12:
	sxtw	x8, w22
	str	x8, [x20]
	ldr	x8, [x21]
Lloh34:
	adrp	x9, _e1000_pch2lan@GOTPAGE
Lloh35:
	ldr	x9, [x9, _e1000_pch2lan@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #100
	bl	_udelay
LBB0_14:
	mov	w0, #0
	b	LBB0_18
LBB0_15:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x19, x8, [sp]
Lloh37:
	adrp	x0, l_.str.3@PAGE
Lloh38:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_16:
	bl	_e_dbg
Lloh39:
	adrp	x8, _E1000_ERR_PHY@GOTPAGE
Lloh40:
	ldr	x8, [x8, _E1000_ERR_PHY@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PHY_REG_ADDRESS,4,2        ; @MAX_PHY_REG_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PHY Address %d is out of range\n"

	.comm	_E1000_ERR_PARAM,4,2            ; @E1000_ERR_PARAM
	.comm	_E1000_MDIC_REG_SHIFT,4,2       ; @E1000_MDIC_REG_SHIFT
	.comm	_E1000_MDIC_PHY_SHIFT,4,2       ; @E1000_MDIC_PHY_SHIFT
	.comm	_E1000_MDIC_OP_READ,4,2         ; @E1000_MDIC_OP_READ
	.comm	_MDIC,4,2                       ; @MDIC
	.comm	_E1000_GEN_POLL_TIMEOUT,4,2     ; @E1000_GEN_POLL_TIMEOUT
	.comm	_E1000_MDIC_READY,4,2           ; @E1000_MDIC_READY
l_.str.1:                               ; @.str.1
	.asciz	"MDI Read did not complete\n"

	.comm	_E1000_ERR_PHY,4,2              ; @E1000_ERR_PHY
	.comm	_E1000_MDIC_ERROR,4,2           ; @E1000_MDIC_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"MDI Error\n"

	.comm	_E1000_MDIC_REG_MASK,4,2        ; @E1000_MDIC_REG_MASK
l_.str.3:                               ; @.str.3
	.asciz	"MDI Read offset error - requested %d, returned %d\n"

	.comm	_e1000_pch2lan,8,3              ; @e1000_pch2lan
.subsections_via_symbols
