	.file	"extr_e6000sw.c_e6000sw_writephy.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Wrong register address.\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Timeout while waiting for switch\n"
	.text
	.p2align 4
	.type	e6000sw_writephy, @function
e6000sw_writephy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edx
	call	device_get_softc@PLT
	mov	esi, r13d
	mov	rdi, rax
	mov	rbp, rax
	call	e6000sw_is_phyport@PLT
	test	eax, eax
	je	.L2
	cmp	DWORD PTR E6000SW_NUM_PHY_REGS[rip], ebx
	jg	.L3
.L2:
	mov	edi, r12d
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR EINVAL[rip]
	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
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR SA_XLOCKED[rip]
	mov	rdi, rbp
	call	E6000SW_LOCK_ASSERT@PLT
	mov	edx, DWORD PTR SMI_CMD_BUSY[rip]
	mov	esi, DWORD PTR SMI_PHY_CMD_REG[rip]
	mov	rdi, rbp
	call	E6000SW_WAITREADY2@PLT
	test	rax, rax
	jne	.L11
	mov	ecx, DWORD PTR PHY_DATA_MASK[rip]
	mov	edx, DWORD PTR SMI_PHY_DATA_REG[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR REG_GLOBAL2[rip]
	and	ecx, r14d
	call	e6000sw_writereg@PLT
	mov	ecx, DWORD PTR SMI_CMD_DEV_ADDR[rip]
	mov	rdi, rbp
	and	ebx, DWORD PTR SMI_CMD_REG_ADDR_MASK[rip]
	mov	edx, DWORD PTR SMI_PHY_CMD_REG[rip]
	or	ebx, DWORD PTR SMI_CMD_OP_C22_WRITE[rip]
	sal	r13d, cl
	mov	ecx, DWORD PTR SMI_CMD_DEV_ADDR_MASK[rip]
	mov	esi, DWORD PTR REG_GLOBAL2[rip]
	and	ecx, r13d
	or	ecx, ebx
	call	e6000sw_writereg@PLT
	pop	rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	edi, r12d
	lea	rsi, .LC1[rip]
	call	device_printf@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	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	e6000sw_writephy, .-e6000sw_writephy
	.comm	SMI_PHY_DATA_REG,4,4
	.comm	SMI_PHY_CMD_REG,4,4
	.comm	SMI_CMD_REG_ADDR_MASK,4,4
	.comm	SMI_CMD_OP_C22_WRITE,4,4
	.comm	SMI_CMD_DEV_ADDR_MASK,4,4
	.comm	SMI_CMD_DEV_ADDR,4,4
	.comm	SMI_CMD_BUSY,4,4
	.comm	SA_XLOCKED,4,4
	.comm	REG_GLOBAL2,4,4
	.comm	PHY_DATA_MASK,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EINVAL,4,4
	.comm	E6000SW_NUM_PHY_REGS,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_e6000sw.c_e6000sw_writephy.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Wrong register address.\012\000"
	.align	2
.LC1:
	.ascii	"Timeout while waiting for switch\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	e6000sw_writephy, %function
e6000sw_writephy:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r1
	mov	r4, r2
	mov	r10, r3
	mov	r5, r0
	bl	device_get_softc
	mov	r1, r7
	mov	r6, r0
	bl	e6000sw_is_phyport
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L12
	ldr	r3, [r3]
	cmp	r3, r4
	bgt	.L3
.L2:
	mov	r0, r5
	ldr	r1, .L12+4
	bl	device_printf
	ldr	r3, .L12+8
	ldr	r8, [r3]
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	ldr	r3, .L12+12
	mov	r0, r6
	ldr	r1, [r3]
	bl	E6000SW_LOCK_ASSERT
	ldr	r9, .L12+16
	ldr	r3, .L12+20
	mov	r0, r6
	ldr	r1, [r9]
	ldr	r2, [r3]
	bl	E6000SW_WAITREADY2
	subs	r8, r0, #0
	bne	.L11
	ldr	r3, .L12+24
	ldr	r5, .L12+28
	ldr	r3, [r3]
	ldr	r2, .L12+32
	ldr	r1, [r5]
	and	r3, r3, r10
	mov	r0, r6
	ldr	r2, [r2]
	bl	e6000sw_writereg
	ldr	r0, .L12+36
	ldr	r2, .L12+40
	ldr	r1, .L12+44
	ldr	r3, .L12+48
	ldr	r0, [r0]
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r3, [r3]
	and	r4, r4, r0
	orr	r4, r4, r2
	and	r3, r3, r7, lsl r1
	mov	r0, r6
	ldr	r1, [r5]
	ldr	r2, [r9]
	orr	r3, r4, r3
	bl	e6000sw_writereg
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	mov	r0, r5
	ldr	r1, .L12+52
	bl	device_printf
	ldr	r3, .L12+56
	ldr	r8, [r3]
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	.align	2
.L12:
	.word	E6000SW_NUM_PHY_REGS
	.word	.LC0
	.word	EINVAL
	.word	SA_XLOCKED
	.word	SMI_PHY_CMD_REG
	.word	SMI_CMD_BUSY
	.word	PHY_DATA_MASK
	.word	REG_GLOBAL2
	.word	SMI_PHY_DATA_REG
	.word	SMI_CMD_REG_ADDR_MASK
	.word	SMI_CMD_OP_C22_WRITE
	.word	SMI_CMD_DEV_ADDR
	.word	SMI_CMD_DEV_ADDR_MASK
	.word	.LC1
	.word	ETIMEDOUT
	.size	e6000sw_writephy, .-e6000sw_writephy
	.comm	SMI_PHY_DATA_REG,4,4
	.comm	SMI_PHY_CMD_REG,4,4
	.comm	SMI_CMD_REG_ADDR_MASK,4,4
	.comm	SMI_CMD_OP_C22_WRITE,4,4
	.comm	SMI_CMD_DEV_ADDR_MASK,4,4
	.comm	SMI_CMD_DEV_ADDR,4,4
	.comm	SMI_CMD_BUSY,4,4
	.comm	SA_XLOCKED,4,4
	.comm	REG_GLOBAL2,4,4
	.comm	PHY_DATA_MASK,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EINVAL,4,4
	.comm	E6000SW_NUM_PHY_REGS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
