	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_mii_phy_read
_xgene_mii_phy_read:                    ## @xgene_mii_phy_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rdi, %r14
	movl	%esi, %edi
	callq	_PHY_ADDR
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_REG_ADDR
	orl	%eax, %ebx
	movq	_MII_MGMT_ADDRESS_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_xgene_enet_wr_mac
	movq	_MII_MGMT_COMMAND_ADDR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_READ_CYCLE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_xgene_enet_wr_mac
	movq	_MII_MGMT_INDICATORS_ADDR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	movq	_BUSY_MASK@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.2:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.3:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.4:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.5:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.6:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.7:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.8:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.9:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.10:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	testl	%eax, (%rbx)
	je	LBB0_1
## %bb.11:
	movl	$10, %edi
	movl	$20, %esi
	callq	_usleep_range
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_err
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_1:
	movq	_MII_MGMT_STATUS_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_xgene_enet_rd_mac
	movl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_xgene_enet_wr_mac
	movl	%ebx, %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_MGMT_ADDRESS_ADDR,4,2      ## @MII_MGMT_ADDRESS_ADDR
	.comm	_MII_MGMT_COMMAND_ADDR,4,2      ## @MII_MGMT_COMMAND_ADDR
	.comm	_READ_CYCLE_MASK,4,2            ## @READ_CYCLE_MASK
	.comm	_MII_MGMT_INDICATORS_ADDR,4,2   ## @MII_MGMT_INDICATORS_ADDR
	.comm	_BUSY_MASK,4,2                  ## @BUSY_MASK
	.comm	_MII_MGMT_STATUS_ADDR,4,2       ## @MII_MGMT_STATUS_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII_MGMT read failed\n"

	.no_dead_strip	_xgene_mii_phy_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_mii_phy_read
_xgene_mii_phy_read:                    ; @xgene_mii_phy_read
	.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	x20, x2
	mov	x19, x0
	mov	x0, x1
	bl	_PHY_ADDR
	mov	x21, x0
	mov	x0, x20
	bl	_REG_ADDR
	orr	w2, w0, w21
Lloh0:
	adrp	x8, _MII_MGMT_ADDRESS_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_MGMT_ADDRESS_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgene_enet_wr_mac
Lloh3:
	adrp	x21, _MII_MGMT_COMMAND_ADDR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MII_MGMT_COMMAND_ADDR@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh5:
	adrp	x8, _READ_CYCLE_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _READ_CYCLE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_xgene_enet_wr_mac
Lloh8:
	adrp	x20, _MII_MGMT_INDICATORS_ADDR@GOTPAGE
Lloh9:
	ldr	x20, [x20, _MII_MGMT_INDICATORS_ADDR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
Lloh10:
	adrp	x22, _BUSY_MASK@GOTPAGE
Lloh11:
	ldr	x22, [x22, _BUSY_MASK@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.1:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.2:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.3:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.4:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.5:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.6:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.7:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.8:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.9:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w1, [x20]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.10:
	mov	w0, #10
	mov	w1, #20
	bl	_usleep_range
	ldr	w0, [x19]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_err
	mov	w0, #0
	b	LBB0_12
LBB0_11:
Lloh14:
	adrp	x8, _MII_MGMT_STATUS_ADDR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MII_MGMT_STATUS_ADDR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgene_enet_rd_mac
	mov	x20, x0
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_xgene_enet_wr_mac
	mov	x0, x20
LBB0_12:
	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 AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_MGMT_ADDRESS_ADDR,4,2      ; @MII_MGMT_ADDRESS_ADDR
	.comm	_MII_MGMT_COMMAND_ADDR,4,2      ; @MII_MGMT_COMMAND_ADDR
	.comm	_READ_CYCLE_MASK,4,2            ; @READ_CYCLE_MASK
	.comm	_MII_MGMT_INDICATORS_ADDR,4,2   ; @MII_MGMT_INDICATORS_ADDR
	.comm	_BUSY_MASK,4,2                  ; @BUSY_MASK
	.comm	_MII_MGMT_STATUS_ADDR,4,2       ; @MII_MGMT_STATUS_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII_MGMT read failed\n"

	.no_dead_strip	_xgene_mii_phy_read
.subsections_via_symbols
