	.file	"extr_nsphyter.c_nsphyter_reset.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	nsphyter_reset, @function
nsphyter_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR 16[rdi]
	mov	edx, DWORD PTR BMCR_RESET[rip]
	mov	r13, QWORD PTR [rax]
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR MIIF_NOISOLATE[rip], eax
	jne	.L2
	or	edx, DWORD PTR BMCR_ISO[rip]
.L2:
	mov	esi, DWORD PTR MII_BMCR[rip]
	mov	rdi, r12
	mov	ebp, 1000
	call	PHY_WRITE@PLT
	mov	edi, 1000
	call	DELAY@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, 2000
	call	DELAY@PLT
	sub	ebp, 1
	je	.L7
.L6:
	mov	esi, DWORD PTR MII_BMCR[rip]
	mov	rdi, r12
	call	PHY_READ@PLT
	mov	ebx, eax
	test	eax, eax
	je	.L3
	test	DWORD PTR BMCR_RESET[rip], eax
	jne	.L3
.L7:
	mov	eax, DWORD PTR [r12]
	test	DWORD PTR MIIF_NOISOLATE[rip], eax
	jne	.L1
	test	r13, r13
	je	.L17
	mov	edi, DWORD PTR 0[r13]
	call	IFM_INST@PLT
	cmp	rax, QWORD PTR 8[r12]
	je	.L1
.L10:
	mov	edx, DWORD PTR BMCR_ISO[rip]
	mov	esi, DWORD PTR MII_BMCR[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	or	edx, ebx
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	PHY_WRITE@PLT
.L17:
	.cfi_restore_state
	cmp	QWORD PTR 8[r12], 0
	jne	.L10
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	nsphyter_reset, .-nsphyter_reset
	.comm	MII_BMCR,4,4
	.comm	MIIF_NOISOLATE,4,4
	.comm	BMCR_RESET,4,4
	.comm	BMCR_ISO,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_nsphyter.c_nsphyter_reset.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nsphyter_reset, %function
nsphyter_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r9, .L22
	ldr	r1, [r0]
	ldr	r2, [r9]
	ldr	r3, [r0, #8]
	tst	r1, r2
	ldr	r10, [r3]
	ldr	r8, .L22+4
	ldreq	r3, .L22+8
	ldr	r2, [r8]
	ldreq	r3, [r3]
	ldr	r7, .L22+12
	orreq	r2, r2, r3
	ldr	r1, [r7]
	mov	r6, r0
	bl	PHY_WRITE
	mov	r0, #1000
	bl	DELAY
	mov	r5, #1000
	b	.L6
.L3:
	mov	r0, #2000
	bl	DELAY
	subs	r5, r5, #1
	beq	.L7
.L6:
	mov	r0, r6
	ldr	r1, [r7]
	bl	PHY_READ
	subs	r4, r0, #0
	beq	.L3
	ldr	r3, [r8]
	tst	r4, r3
	bne	.L3
.L7:
	ldr	r3, [r9]
	ldr	r2, [r6]
	tst	r2, r3
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	cmp	r10, #0
	beq	.L21
	ldr	r0, [r10]
	bl	IFM_INST
	ldr	r3, [r6, #4]
	cmp	r0, r3
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L10:
	ldr	r3, .L22+8
	mov	r0, r6
	ldr	r2, [r3]
	ldr	r1, [r7]
	orr	r2, r4, r2
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	PHY_WRITE
.L21:
	ldr	r3, [r6, #4]
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	b	.L10
.L23:
	.align	2
.L22:
	.word	MIIF_NOISOLATE
	.word	BMCR_RESET
	.word	BMCR_ISO
	.word	MII_BMCR
	.size	nsphyter_reset, .-nsphyter_reset
	.comm	MII_BMCR,4,4
	.comm	MIIF_NOISOLATE,4,4
	.comm	BMCR_RESET,4,4
	.comm	BMCR_ISO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
