	.file	"extr_rtl8367b.c_rtl8367b_write_phy_reg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"phy_write: addr:%02x, reg:%02x, val:%04x\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"phy write timed out\n"
	.text
	.p2align 4
	.type	rtl8367b_write_phy_reg, @function
rtl8367b_write_phy_reg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r8, rcx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rcx
	mov	rcx, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdx
	mov	rdx, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	lea	rsi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	dev_dbg@PLT
	cmp	QWORD PTR RTL8367B_PHY_ADDR_MAX[rip], rbp
	jl	.L4
	cmp	QWORD PTR RTL8367B_PHY_REG_MAX[rip], r12
	jge	.L12
.L4:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR 8[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L13
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	esi, DWORD PTR RTL8367B_IA_STATUS_REG[rip]
	mov	r14, rsp
	mov	rdi, rbx
	mov	rdx, r14
	call	REG_RD@PLT
	mov	rax, QWORD PTR [rsp]
	test	QWORD PTR RTL8367B_IA_STATUS_PHY_BUSY[rip], rax
	je	.L5
.L10:
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, DWORD PTR RTL8367B_IA_WRITE_DATA_REG[rip]
	mov	rdx, r13
	mov	rdi, rbx
	call	REG_WR@PLT
	mov	rsi, r12
	mov	rdi, rbp
	call	RTL8367B_INTERNAL_PHY_REG@PLT
	mov	esi, DWORD PTR RTL8367B_IA_ADDRESS_REG[rip]
	mov	rdi, rbx
	mov	rdx, rax
	call	REG_WR@PLT
	mov	esi, DWORD PTR RTL8367B_IA_CTRL_REG[rip]
	mov	rdx, QWORD PTR RTL8367B_IA_CTRL_CMD_MASK[rip]
	mov	rdi, rbx
	or	rdx, QWORD PTR RTL8367B_IA_CTRL_RW_WRITE[rip]
	call	REG_WR@PLT
	mov	esi, DWORD PTR RTL8367B_IA_STATUS_REG[rip]
	mov	rdx, r14
	mov	rdi, rbx
	call	REG_RD@PLT
	mov	rdx, QWORD PTR [rsp]
	xor	eax, eax
	test	QWORD PTR RTL8367B_IA_STATUS_PHY_BUSY[rip], rdx
	je	.L1
	mov	edi, DWORD PTR [rbx]
	lea	rsi, .LC1[rip]
	call	dev_err@PLT
	jmp	.L10
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtl8367b_write_phy_reg, .-rtl8367b_write_phy_reg
	.comm	RTL8367B_PHY_REG_MAX,8,8
	.comm	RTL8367B_PHY_ADDR_MAX,8,8
	.comm	RTL8367B_IA_WRITE_DATA_REG,4,4
	.comm	RTL8367B_IA_STATUS_REG,4,4
	.comm	RTL8367B_IA_STATUS_PHY_BUSY,8,8
	.comm	RTL8367B_IA_CTRL_RW_WRITE,8,8
	.comm	RTL8367B_IA_CTRL_REG,4,4
	.comm	RTL8367B_IA_CTRL_CMD_MASK,8,8
	.comm	RTL8367B_IA_ADDRESS_REG,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EINVAL,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_rtl8367b.c_rtl8367b_write_phy_reg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"phy_write: addr:%02x, reg:%02x, val:%04x\012\000"
	.align	2
.LC1:
	.ascii	"phy write timed out\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtl8367b_write_phy_reg, %function
rtl8367b_write_phy_reg:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r7, r3
	mov	r4, r1
	sub	sp, sp, #20
	str	r7, [sp]
	ldr	ip, .L15
	mov	r3, r2
	mov	r5, r0
	mov	r6, r2
	ldr	r0, [r0]
	mov	r2, r1
	ldr	r1, .L15+4
	ldr	ip, [ip]
	str	ip, [sp, #12]
	mov	ip,#0
	bl	dev_dbg
	ldr	r2, .L15+8
	ldr	r2, [r2]
	cmp	r2, r4
	blt	.L4
	ldr	r3, .L15+12
	ldr	r3, [r3]
	cmp	r3, r6
	bge	.L13
.L4:
	ldr	r3, .L15+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L13:
	ldr	r9, .L15+20
	ldr	r8, .L15+24
	add	r2, sp, #8
	mov	r0, r5
	ldr	r1, [r9]
	bl	REG_RD
	ldr	r3, [r8]
	ldr	r2, [sp, #8]
	tst	r2, r3
	beq	.L5
.L11:
	ldr	r3, .L15+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L5:
	ldr	r3, .L15+32
	mov	r2, r7
	ldr	r1, [r3]
	mov	r0, r5
	bl	REG_WR
	ldr	r3, .L15+36
	mov	r1, r6
	mov	r0, r4
	ldr	r4, [r3]
	bl	RTL8367B_INTERNAL_PHY_REG
	mov	r1, r4
	mov	r2, r0
	mov	r0, r5
	bl	REG_WR
	ldr	r2, .L15+40
	ldr	r3, .L15+44
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L15+48
	orr	r2, r1, r2
	mov	r0, r5
	ldr	r1, [r3]
	bl	REG_WR
	mov	r0, r5
	ldr	r1, [r9]
	add	r2, sp, #8
	bl	REG_RD
	ldr	r3, [r8]
	ldr	r0, [sp, #8]
	ands	r0, r0, r3
	beq	.L1
	ldr	r0, [r5]
	ldr	r1, .L15+52
	bl	dev_err
	b	.L11
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC2
	.word	.LC0
	.word	RTL8367B_PHY_ADDR_MAX
	.word	RTL8367B_PHY_REG_MAX
	.word	EINVAL
	.word	RTL8367B_IA_STATUS_REG
	.word	RTL8367B_IA_STATUS_PHY_BUSY
	.word	ETIMEDOUT
	.word	RTL8367B_IA_WRITE_DATA_REG
	.word	RTL8367B_IA_ADDRESS_REG
	.word	RTL8367B_IA_CTRL_CMD_MASK
	.word	RTL8367B_IA_CTRL_RW_WRITE
	.word	RTL8367B_IA_CTRL_REG
	.word	.LC1
	.size	rtl8367b_write_phy_reg, .-rtl8367b_write_phy_reg
	.comm	RTL8367B_PHY_REG_MAX,4,4
	.comm	RTL8367B_PHY_ADDR_MAX,4,4
	.comm	RTL8367B_IA_WRITE_DATA_REG,4,4
	.comm	RTL8367B_IA_STATUS_REG,4,4
	.comm	RTL8367B_IA_STATUS_PHY_BUSY,4,4
	.comm	RTL8367B_IA_CTRL_RW_WRITE,4,4
	.comm	RTL8367B_IA_CTRL_REG,4,4
	.comm	RTL8367B_IA_CTRL_CMD_MASK,4,4
	.comm	RTL8367B_IA_ADDRESS_REG,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
