	.file	"extr_if_jme.c_jme_miibus_readreg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"phy read timeout : %d\n"
	.text
	.p2align 4
	.type	jme_miibus_readreg, @function
jme_miibus_readreg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, esi
	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
	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	r12, rax
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR JME_FLAG_FPGA[rip], eax
	je	.L9
	xor	eax, eax
	test	r14d, r14d
	je	.L1
.L9:
	mov	edi, r14d
	mov	ebp, DWORD PTR SMI_OP_READ[rip]
	or	ebp, DWORD PTR SMI_OP_EXECUTE[rip]
	call	SMI_PHY_ADDR@PLT
	mov	edi, r13d
	or	ebp, eax
	call	SMI_REG_ADDR@PLT
	mov	edx, ebp
	mov	esi, DWORD PTR JME_SMI[rip]
	mov	rdi, r12
	or	edx, eax
	call	CSR_WRITE_4@PLT
	mov	ebp, DWORD PTR JME_PHY_TIMEOUT[rip]
	test	ebp, ebp
	jg	.L6
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	sub	ebp, 1
	je	.L7
.L6:
	mov	edi, 1
	call	DELAY@PLT
	mov	esi, DWORD PTR JME_SMI[rip]
	mov	rdi, r12
	call	CSR_READ_4@PLT
	mov	ebx, eax
	test	DWORD PTR SMI_OP_EXECUTE[rip], eax
	jne	.L19
.L5:
	mov	ecx, DWORD PTR SMI_DATA_SHIFT[rip]
	and	ebx, DWORD PTR SMI_DATA_MASK[rip]
	mov	eax, ebx
	sar	eax, cl
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L4:
	.cfi_restore_state
	jne	.L5
.L7:
	mov	edi, DWORD PTR 4[r12]
	mov	edx, r13d
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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
	.cfi_endproc
.LFE0:
	.size	jme_miibus_readreg, .-jme_miibus_readreg
	.comm	SMI_OP_READ,4,4
	.comm	SMI_OP_EXECUTE,4,4
	.comm	SMI_DATA_SHIFT,4,4
	.comm	SMI_DATA_MASK,4,4
	.comm	JME_SMI,4,4
	.comm	JME_PHY_TIMEOUT,4,4
	.comm	JME_FLAG_FPGA,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_jme.c_jme_miibus_readreg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"phy read timeout : %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	jme_miibus_readreg, %function
jme_miibus_readreg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r1
	mov	r9, r2
	bl	device_get_softc
	ldr	r3, .L15
	ldr	r2, [r0]
	ldr	r3, [r3]
	tst	r2, r3
	movne	r3, #1
	moveq	r3, #0
	cmp	r5, #0
	movne	r3, #0
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L15+4
	ldr	r8, .L15+8
	ldr	r2, [r3]
	ldr	r7, .L15+12
	ldr	r3, [r8]
	mov	r6, r0
	mov	r0, r5
	ldr	r10, [r7]
	orr	r5, r2, r3
	bl	SMI_PHY_ADDR
	mov	r2, r0
	mov	r0, r9
	orr	r5, r5, r2
	bl	SMI_REG_ADDR
	mov	r1, r10
	orr	r2, r5, r0
	mov	r0, r6
	bl	CSR_WRITE_4
	ldr	r3, .L15+16
	ldr	r5, [r3]
	cmp	r5, #0
	bgt	.L5
	b	.L3
.L14:
	subs	r5, r5, #1
	beq	.L6
.L5:
	mov	r0, #1
	bl	DELAY
	mov	r0, r6
	ldr	r1, [r7]
	bl	CSR_READ_4
	ldr	r3, [r8]
	mov	r4, r0
	tst	r0, r3
	bne	.L14
.L4:
	ldr	r2, .L15+20
	ldr	r3, .L15+24
	ldr	r0, [r2]
	ldr	r3, [r3]
	and	r0, r0, r4
	asr	r0, r0, r3
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	bne	.L4
.L6:
	mov	r2, r9
	ldr	r0, [r6, #4]
	ldr	r1, .L15+28
	bl	device_printf
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L7:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	.align	2
.L15:
	.word	JME_FLAG_FPGA
	.word	SMI_OP_READ
	.word	SMI_OP_EXECUTE
	.word	JME_SMI
	.word	JME_PHY_TIMEOUT
	.word	SMI_DATA_MASK
	.word	SMI_DATA_SHIFT
	.word	.LC0
	.size	jme_miibus_readreg, .-jme_miibus_readreg
	.comm	SMI_OP_READ,4,4
	.comm	SMI_OP_EXECUTE,4,4
	.comm	SMI_DATA_SHIFT,4,4
	.comm	SMI_DATA_MASK,4,4
	.comm	JME_SMI,4,4
	.comm	JME_PHY_TIMEOUT,4,4
	.comm	JME_FLAG_FPGA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
