	.file	"extr_if_nfe.c_nfe_miibus_readreg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"timeout waiting for PHY\n"
.LC1:
	.string	"could not read PHY\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"mii read phy %d reg 0x%x ret 0x%x\n"
	.text
	.p2align 4
	.type	nfe_miibus_readreg, @function
nfe_miibus_readreg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	device_get_softc@PLT
	mov	esi, DWORD PTR NFE_PHY_STATUS[rip]
	mov	edx, 15
	mov	rdi, rax
	mov	rbp, rax
	call	NFE_WRITE@PLT
	mov	esi, DWORD PTR NFE_PHY_CTL[rip]
	mov	rdi, rbp
	call	NFE_READ@PLT
	mov	edx, DWORD PTR NFE_PHY_BUSY[rip]
	test	eax, edx
	jne	.L18
.L2:
	mov	ecx, DWORD PTR NFE_PHYADD_SHIFT[rip]
	mov	edx, r12d
	mov	rdi, rbp
	xor	ebx, ebx
	mov	esi, DWORD PTR NFE_PHY_CTL[rip]
	sal	edx, cl
	or	edx, r13d
	call	NFE_WRITE@PLT
	mov	eax, DWORD PTR NFE_TIMEOUT[rip]
	test	eax, eax
	jg	.L5
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR NFE_TIMEOUT[rip]
	add	ebx, 1
	cmp	eax, ebx
	jle	.L3
.L5:
	mov	edi, 100
	call	DELAY@PLT
	mov	esi, DWORD PTR NFE_PHY_CTL[rip]
	mov	rdi, rbp
	call	NFE_READ@PLT
	test	DWORD PTR NFE_PHY_BUSY[rip], eax
	jne	.L4
	mov	eax, DWORD PTR NFE_TIMEOUT[rip]
.L3:
	lea	rdx, .LC0[rip]
	cmp	ebx, eax
	je	.L16
	mov	esi, DWORD PTR NFE_PHY_STATUS[rip]
	mov	rdi, rbp
	call	NFE_READ@PLT
	test	DWORD PTR NFE_PHY_ERROR[rip], eax
	jne	.L19
	mov	esi, DWORD PTR NFE_PHY_DATA[rip]
	mov	rdi, rbp
	call	NFE_READ@PLT
	mov	r14d, eax
	lea	eax, 1[rax]
	cmp	eax, 1
	jbe	.L9
	mov	DWORD PTR 0[rbp], r12d
.L9:
	mov	r9d, r14d
	mov	r8d, r13d
	mov	ecx, r12d
	mov	rdi, rbp
	lea	rdx, .LC2[rip]
	mov	esi, 2
	xor	eax, eax
	call	DPRINTFN@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	lea	rdx, .LC1[rip]
.L16:
	mov	rdi, rbp
	xor	r14d, r14d
	mov	esi, 2
	xor	eax, eax
	call	DPRINTFN@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	esi, DWORD PTR NFE_PHY_CTL[rip]
	mov	rdi, rbp
	call	NFE_WRITE@PLT
	mov	edi, 100
	call	DELAY@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	nfe_miibus_readreg, .-nfe_miibus_readreg
	.comm	NFE_TIMEOUT,4,4
	.comm	NFE_PHY_STATUS,4,4
	.comm	NFE_PHY_ERROR,4,4
	.comm	NFE_PHY_DATA,4,4
	.comm	NFE_PHY_CTL,4,4
	.comm	NFE_PHY_BUSY,4,4
	.comm	NFE_PHYADD_SHIFT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_if_nfe.c_nfe_miibus_readreg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"timeout waiting for PHY\012\000"
	.align	2
.LC1:
	.ascii	"could not read PHY\012\000"
	.align	2
.LC2:
	.ascii	"mii read phy %d reg 0x%x ret 0x%x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nfe_miibus_readreg, %function
nfe_miibus_readreg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r9, r1
	mov	r10, r2
	bl	device_get_softc
	mov	r5, r0
	ldr	fp, .L20
	ldr	r6, .L20+4
	mov	r2, #15
	ldr	r1, [fp]
	bl	NFE_WRITE
	mov	r0, r5
	ldr	r1, [r6]
	bl	NFE_READ
	ldr	r8, .L20+8
	ldr	r2, [r8]
	tst	r0, r2
	bne	.L17
.L2:
	ldr	r3, .L20+12
	ldr	r7, .L20+16
	ldr	r2, [r3]
	mov	r0, r5
	ldr	r1, [r6]
	orr	r2, r10, r9, lsl r2
	bl	NFE_WRITE
	ldr	r3, [r7]
	mov	r4, #0
	cmp	r3, #0
	bgt	.L5
	b	.L3
.L4:
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L3
.L5:
	mov	r0, #100
	bl	DELAY
	mov	r0, r5
	ldr	r1, [r6]
	bl	NFE_READ
	ldr	r3, [r8]
	tst	r0, r3
	ldr	r3, [r7]
	bne	.L4
.L3:
	cmp	r4, r3
	beq	.L18
	mov	r0, r5
	ldr	r1, [fp]
	bl	NFE_READ
	ldr	r3, .L20+20
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L19
	ldr	r3, .L20+24
	mov	r0, r5
	ldr	r1, [r3]
	bl	NFE_READ
	mov	r4, r0
	add	r3, r0, #1
	cmp	r3, #1
	strhi	r9, [r5]
	mov	r3, r9
	str	r0, [sp, #4]
	mov	r1, #2
	mov	r0, r5
	ldr	r2, .L20+28
	str	r10, [sp]
	bl	DPRINTFN
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	mov	r0, r5
	ldr	r1, [r6]
	bl	NFE_WRITE
	mov	r0, #100
	bl	DELAY
	b	.L2
.L19:
	mov	r4, #0
	mov	r0, r5
	mov	r1, #2
	ldr	r2, .L20+32
	bl	DPRINTFN
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	mov	r4, #0
	mov	r0, r5
	mov	r1, #2
	ldr	r2, .L20+36
	bl	DPRINTFN
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	.align	2
.L20:
	.word	NFE_PHY_STATUS
	.word	NFE_PHY_CTL
	.word	NFE_PHY_BUSY
	.word	NFE_PHYADD_SHIFT
	.word	NFE_TIMEOUT
	.word	NFE_PHY_ERROR
	.word	NFE_PHY_DATA
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.size	nfe_miibus_readreg, .-nfe_miibus_readreg
	.comm	NFE_TIMEOUT,4,4
	.comm	NFE_PHY_STATUS,4,4
	.comm	NFE_PHY_ERROR,4,4
	.comm	NFE_PHY_DATA,4,4
	.comm	NFE_PHY_CTL,4,4
	.comm	NFE_PHY_BUSY,4,4
	.comm	NFE_PHYADD_SHIFT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
