	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xge_mdio_read
_xge_mdio_read:                         ## @xge_mdio_read
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %edx
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	movl	$0, -44(%rbp)
	movq	_PHY_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r12
	movq	%r12, %rdi
	callq	_SET_REG_BITS
	movq	_REG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_SET_REG_BITS
	movq	_MII_MGMT_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	callq	_xge_wr_csr
	movq	_MII_MGMT_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MII_READ_CYCLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_xge_wr_csr
	movl	$-10, %ebx
	movq	_MII_MGMT_INDICATORS@GOTPCREL(%rip), %r12
	movq	_MII_MGMT_BUSY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$5, %edi
	movl	$10, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_xge_rd_csr
	andl	(%r15), %eax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %ecx
	testl	%ebx, %ebx
	movl	%ecx, %ebx
	jne	LBB0_1
LBB0_3:
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_5:
	movq	_MII_MGMT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_xge_rd_csr
	movl	%eax, %r14d
	movq	_MII_MGMT_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_xge_wr_csr
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_ADDR,4,2                   ## @PHY_ADDR
	.comm	_REG_ADDR,4,2                   ## @REG_ADDR
	.comm	_MII_MGMT_ADDRESS,4,2           ## @MII_MGMT_ADDRESS
	.comm	_MII_MGMT_COMMAND,4,2           ## @MII_MGMT_COMMAND
	.comm	_MII_READ_CYCLE,4,2             ## @MII_READ_CYCLE
	.comm	_MII_MGMT_INDICATORS,4,2        ## @MII_MGMT_INDICATORS
	.comm	_MII_MGMT_BUSY,4,2              ## @MII_MGMT_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII_MGMT read failed\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MII_MGMT_STATUS,4,2            ## @MII_MGMT_STATUS
	.no_dead_strip	_xge_mdio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xge_mdio_read
_xge_mdio_read:                         ; @xge_mdio_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x2, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _PHY_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x0, sp, #12
	bl	_SET_REG_BITS
Lloh3:
	adrp	x8, _REG_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_SET_REG_BITS
Lloh6:
	adrp	x8, _MII_MGMT_ADDRESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_MGMT_ADDRESS@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_xge_wr_csr
Lloh9:
	adrp	x21, _MII_MGMT_COMMAND@GOTPAGE
Lloh10:
	ldr	x21, [x21, _MII_MGMT_COMMAND@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh11:
	adrp	x8, _MII_READ_CYCLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MII_READ_CYCLE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_xge_wr_csr
	mov	w22, #-10
Lloh14:
	adrp	x23, _MII_MGMT_INDICATORS@GOTPAGE
Lloh15:
	ldr	x23, [x23, _MII_MGMT_INDICATORS@GOTPAGEOFF]
Lloh16:
	adrp	x24, _MII_MGMT_BUSY@GOTPAGE
Lloh17:
	ldr	x24, [x24, _MII_MGMT_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #5
	mov	w1, #10
	bl	_usleep_range
	ldr	w1, [x23]
	mov	x0, x19
	bl	_xge_rd_csr
	ldr	w8, [x24]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w22, #0, #4, ne
	add	w22, w22, #1
	b.ne	LBB0_1
; %bb.2:
	cbz	w8, LBB0_4
; %bb.3:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
Lloh23:
	adrp	x8, _MII_MGMT_STATUS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MII_MGMT_STATUS@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xge_rd_csr
	mov	x20, x0
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_xge_wr_csr
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_ADDR,4,2                   ; @PHY_ADDR
	.comm	_REG_ADDR,4,2                   ; @REG_ADDR
	.comm	_MII_MGMT_ADDRESS,4,2           ; @MII_MGMT_ADDRESS
	.comm	_MII_MGMT_COMMAND,4,2           ; @MII_MGMT_COMMAND
	.comm	_MII_READ_CYCLE,4,2             ; @MII_READ_CYCLE
	.comm	_MII_MGMT_INDICATORS,4,2        ; @MII_MGMT_INDICATORS
	.comm	_MII_MGMT_BUSY,4,2              ; @MII_MGMT_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII_MGMT read failed\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MII_MGMT_STATUS,4,2            ; @MII_MGMT_STATUS
	.no_dead_strip	_xge_mdio_read
.subsections_via_symbols
