	.file	"extr_rtl8366s.c_rtl8366s_set_green_port.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rtl8366s_set_green_port, @function
rtl8366s_set_green_port:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR RTL8366S_NUM_PORTS[rip], esi
	jg	.L2
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L9
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR RTL8366S_PHY_POWER_SAVING_CTRL_REG[rip]
	mov	ebx, edx
	lea	r8, 4[rsp]
	xor	edx, edx
	mov	r12, rdi
	mov	ebp, esi
	call	rtl8366s_read_phy_reg@PLT
	test	eax, eax
	jne	.L1
	mov	eax, DWORD PTR RTL8366S_PHY_POWER_SAVING_MASK[rip]
	mov	r8d, DWORD PTR 4[rsp]
	mov	esi, ebp
	mov	rdi, r12
	mov	ecx, DWORD PTR RTL8366S_PHY_POWER_SAVING_CTRL_REG[rip]
	mov	edx, eax
	not	eax
	or	edx, r8d
	and	eax, r8d
	test	ebx, ebx
	cmove	edx, eax
	mov	DWORD PTR 4[rsp], edx
	mov	r8d, edx
	xor	edx, edx
	call	rtl8366s_write_phy_reg@PLT
	jmp	.L1
.L9:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rtl8366s_set_green_port, .-rtl8366s_set_green_port
	.comm	RTL8366S_PHY_POWER_SAVING_MASK,4,4
	.comm	RTL8366S_PHY_POWER_SAVING_CTRL_REG,4,4
	.comm	RTL8366S_NUM_PORTS,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_rtl8366s.c_rtl8366s_set_green_port.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtl8366s_set_green_port, %function
rtl8366s_set_green_port:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L10
	mov	r6, r2
	ldr	r3, [r3]
	ldr	r2, .L10+4
	sub	sp, sp, #20
	cmp	r3, r1
	ldr	r2, [r2]
	str	r2, [sp, #12]
	mov	r2,#0
	bgt	.L2
	ldr	r3, .L10+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L10+4
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r7, .L10+12
	add	r2, sp, #8
	str	r2, [sp]
	ldr	r3, [r7]
	mov	r2, #0
	mov	r4, r1
	mov	r5, r0
	bl	rtl8366s_read_phy_reg
	cmp	r0, #0
	bne	.L1
	ldr	r3, .L10+16
	ldr	ip, [sp, #8]
	ldr	r3, [r3]
	cmp	r6, #0
	orrne	ip, r3, ip
	biceq	ip, ip, r3
	mov	r1, r4
	mov	r0, r5
	mov	r2, #0
	ldr	r3, [r7]
	str	ip, [sp]
	str	ip, [sp, #8]
	bl	rtl8366s_write_phy_reg
	b	.L1
.L9:
	bl	__stack_chk_fail
.L11:
	.align	2
.L10:
	.word	RTL8366S_NUM_PORTS
	.word	.LC0
	.word	EINVAL
	.word	RTL8366S_PHY_POWER_SAVING_CTRL_REG
	.word	RTL8366S_PHY_POWER_SAVING_MASK
	.size	rtl8366s_set_green_port, .-rtl8366s_set_green_port
	.comm	RTL8366S_PHY_POWER_SAVING_MASK,4,4
	.comm	RTL8366S_PHY_POWER_SAVING_CTRL_REG,4,4
	.comm	RTL8366S_NUM_PORTS,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
