	.file	"extr_bxe_elink.c_elink_cl22_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"write phy register failed\n"
	.text
	.p2align 4
	.type	elink_cl22_write, @function
elink_cl22_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sal	ebx, 16
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rsi, QWORD PTR EMAC_REG_EMAC_MDIO_MODE[rip]
	add	rsi, QWORD PTR 8[r12]
	mov	r15d, DWORD PTR ELINK_STATUS_OK[rip]
	call	REG_RD@PLT
	mov	edx, DWORD PTR EMAC_MDIO_MODE_CLAUSE_45[rip]
	mov	rsi, QWORD PTR EMAC_REG_EMAC_MDIO_MODE[rip]
	mov	rdi, r13
	add	rsi, QWORD PTR 8[r12]
	mov	r14d, eax
	not	edx
	and	edx, eax
	call	REG_WR@PLT
	mov	edx, DWORD PTR EMAC_MDIO_COMM_COMMAND_WRITE_22[rip]
	mov	eax, DWORD PTR [r12]
	mov	rdi, r13
	or	edx, DWORD PTR EMAC_MDIO_COMM_START_BUSY[rip]
	mov	rsi, QWORD PTR EMAC_REG_EMAC_MDIO_COMM[rip]
	or	edx, ebp
	sal	eax, 21
	add	rsi, QWORD PTR 8[r12]
	mov	ebp, 50
	or	edx, ebx
	or	edx, eax
	call	REG_WR@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	sub	ebp, 1
	je	.L3
.L5:
	mov	edi, 10
	call	DELAY@PLT
	mov	rsi, QWORD PTR EMAC_REG_EMAC_MDIO_COMM[rip]
	mov	rdi, r13
	add	rsi, QWORD PTR 8[r12]
	call	REG_RD@PLT
	mov	ebx, eax
	test	DWORD PTR EMAC_MDIO_COMM_START_BUSY[rip], eax
	jne	.L2
	mov	edi, 5
	call	DELAY@PLT
	test	DWORD PTR EMAC_MDIO_COMM_START_BUSY[rip], ebx
	jne	.L3
.L4:
	mov	rsi, QWORD PTR EMAC_REG_EMAC_MDIO_MODE[rip]
	mov	edx, r14d
	mov	rdi, r13
	add	rsi, QWORD PTR 8[r12]
	call	REG_WR@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	rdi, r13
	call	ELINK_DEBUG_P0@PLT
	mov	r15d, DWORD PTR ELINK_STATUS_TIMEOUT[rip]
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	elink_cl22_write, .-elink_cl22_write
	.comm	EMAC_REG_EMAC_MDIO_MODE,8,8
	.comm	EMAC_REG_EMAC_MDIO_COMM,8,8
	.comm	EMAC_MDIO_MODE_CLAUSE_45,4,4
	.comm	EMAC_MDIO_COMM_START_BUSY,4,4
	.comm	EMAC_MDIO_COMM_COMMAND_WRITE_22,4,4
	.comm	ELINK_STATUS_TIMEOUT,4,4
	.comm	ELINK_STATUS_OK,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_bxe_elink.c_elink_cl22_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"write phy register failed\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	elink_cl22_write, %function
elink_cl22_write:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, .L9
	ldr	ip, .L9+4
	ldr	lr, [r1, #4]
	mov	r6, r1
	ldr	r1, [r10]
	mov	r5, r3
	ldr	r3, [ip]
	sub	sp, sp, #12
	add	r1, lr, r1
	mov	r4, r2
	mov	r7, r0
	str	r3, [sp, #4]
	bl	REG_RD
	ldr	r2, .L9+8
	ldr	r3, [r10]
	ldr	r1, [r6, #4]
	ldr	r2, [r2]
	add	r1, r1, r3
	bic	r2, r0, r2
	mov	r9, r0
	mov	r0, r7
	bl	REG_WR
	ldr	fp, .L9+12
	ldr	r2, .L9+16
	ldr	r0, [fp]
	ldr	r2, [r2]
	ldr	r8, .L9+20
	orr	r2, r2, r0
	orr	r0, r2, r5
	ldr	lr, [r6]
	ldr	ip, [r6, #4]
	ldr	r1, [r8]
	orr	r2, r0, r4, lsl #16
	orr	r2, r2, lr, lsl #21
	mov	r0, r7
	add	r1, ip, r1
	bl	REG_WR
	mov	r5, #50
	b	.L5
.L2:
	subs	r5, r5, #1
	beq	.L3
.L5:
	mov	r0, #10
	bl	DELAY
	ldr	r2, [r8]
	ldr	r1, [r6, #4]
	mov	r0, r7
	add	r1, r1, r2
	bl	REG_RD
	ldr	r2, [fp]
	mov	r4, r0
	tst	r0, r2
	bne	.L2
	mov	r0, #5
	bl	DELAY
	ldr	r3, [fp]
	tst	r4, r3
	bne	.L3
.L4:
	ldr	r1, [r6, #4]
	ldr	r3, [r10]
	mov	r2, r9
	mov	r0, r7
	add	r1, r1, r3
	bl	REG_WR
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	r0, r7
	ldr	r1, .L9+24
	bl	ELINK_DEBUG_P0
	ldr	r3, .L9+28
	ldr	r3, [r3]
	str	r3, [sp, #4]
	b	.L4
.L10:
	.align	2
.L9:
	.word	EMAC_REG_EMAC_MDIO_MODE
	.word	ELINK_STATUS_OK
	.word	EMAC_MDIO_MODE_CLAUSE_45
	.word	EMAC_MDIO_COMM_START_BUSY
	.word	EMAC_MDIO_COMM_COMMAND_WRITE_22
	.word	EMAC_REG_EMAC_MDIO_COMM
	.word	.LC0
	.word	ELINK_STATUS_TIMEOUT
	.size	elink_cl22_write, .-elink_cl22_write
	.comm	EMAC_REG_EMAC_MDIO_MODE,4,4
	.comm	EMAC_REG_EMAC_MDIO_COMM,4,4
	.comm	EMAC_MDIO_MODE_CLAUSE_45,4,4
	.comm	EMAC_MDIO_COMM_START_BUSY,4,4
	.comm	EMAC_MDIO_COMM_COMMAND_WRITE_22,4,4
	.comm	ELINK_STATUS_TIMEOUT,4,4
	.comm	ELINK_STATUS_OK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
