	.file	"extr_marvell.c_m88e1318_set_wol.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	m88e1318_set_wol, @function
m88e1318_set_wol:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	call	phy_save_page@PLT
	xor	edx, edx
	mov	ebp, eax
	test	eax, eax
	js	.L2
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR WAKE_MAGIC[rip], eax
	je	.L3
	mov	esi, DWORD PTR MII_MARVELL_COPPER_PAGE[rip]
	mov	rdi, r12
	call	marvell_write_page@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	rdi, r12
	call	phy_interrupt_is_valid@PLT
	test	eax, eax
	je	.L8
.L4:
	mov	ecx, DWORD PTR MII_88E1318S_PHY_CSIER_WOL_EIE[rip]
	mov	esi, DWORD PTR MII_88E1318S_PHY_CSIER[rip]
	xor	edx, edx
	mov	rdi, r12
	call	__phy_modify@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	esi, DWORD PTR MII_MARVELL_LED_PAGE[rip]
	mov	rdi, r12
	call	marvell_write_page@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	edx, DWORD PTR MII_88E1318S_PHY_LED_TCR_FORCE_INT[rip]
	mov	esi, DWORD PTR MII_88E1318S_PHY_LED_TCR[rip]
	mov	rdi, r12
	mov	ecx, DWORD PTR MII_88E1318S_PHY_LED_TCR_INTn_ENABLE[rip]
	or	ecx, DWORD PTR MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW[rip]
	call	__phy_modify@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	esi, DWORD PTR MII_MARVELL_WOL_PAGE[rip]
	mov	rdi, r12
	call	marvell_write_page@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	rax, QWORD PTR [r12]
	mov	esi, DWORD PTR MII_88E1318S_PHY_MAGIC_PACKET_WORD2[rip]
	mov	rdi, r12
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR 20[rax]
	sal	edx, 8
	or	edx, DWORD PTR 16[rax]
	call	__phy_write@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	rax, QWORD PTR [r12]
	mov	esi, DWORD PTR MII_88E1318S_PHY_MAGIC_PACKET_WORD1[rip]
	mov	rdi, r12
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR 12[rax]
	sal	edx, 8
	or	edx, DWORD PTR 8[rax]
	call	__phy_write@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	rax, QWORD PTR [r12]
	mov	esi, DWORD PTR MII_88E1318S_PHY_MAGIC_PACKET_WORD0[rip]
	mov	rdi, r12
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR 4[rax]
	sal	edx, 8
	or	edx, DWORD PTR [rax]
	call	__phy_write@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	esi, DWORD PTR MII_88E1318S_PHY_WOL_CTRL[rip]
	mov	ecx, DWORD PTR MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS[rip]
	xor	edx, edx
	mov	rdi, r12
	or	ecx, DWORD PTR MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE[rip]
	call	__phy_modify@PLT
	mov	edx, eax
.L2:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	esi, ebp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	phy_restore_page@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR MII_MARVELL_WOL_PAGE[rip]
	mov	rdi, r12
	call	marvell_write_page@PLT
	mov	edx, eax
	test	eax, eax
	js	.L2
	mov	edx, DWORD PTR MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE[rip]
	mov	esi, DWORD PTR MII_88E1318S_PHY_WOL_CTRL[rip]
	mov	rdi, r12
	mov	ecx, DWORD PTR MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS[rip]
	call	__phy_modify@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	esi, ebp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	edx, eax
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	phy_restore_page@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	esi, DWORD PTR MII_M1011_IEVENT[rip]
	mov	rdi, r12
	call	__phy_read@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	m88e1318_set_wol, .-m88e1318_set_wol
	.comm	WAKE_MAGIC,4,4
	.comm	MII_MARVELL_WOL_PAGE,4,4
	.comm	MII_MARVELL_LED_PAGE,4,4
	.comm	MII_MARVELL_COPPER_PAGE,4,4
	.comm	MII_M1011_IEVENT,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD2,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD1,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD0,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_INTn_ENABLE,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_FORCE_INT,4,4
	.comm	MII_88E1318S_PHY_LED_TCR,4,4
	.comm	MII_88E1318S_PHY_CSIER_WOL_EIE,4,4
	.comm	MII_88E1318S_PHY_CSIER,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_marvell.c_m88e1318_set_wol.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	m88e1318_set_wol, %function
m88e1318_set_wol:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r6, r1
	mov	r4, r0
	bl	phy_save_page
	subs	r5, r0, #0
	movlt	r2, #0
	blt	.L2
	ldr	r3, .L9
	ldr	r2, [r6]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L3
	ldr	r3, .L9+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	marvell_write_page
	subs	r2, r0, #0
	blt	.L2
	mov	r0, r4
	bl	phy_interrupt_is_valid
	cmp	r0, #0
	beq	.L8
.L4:
	ldr	r2, .L9+8
	ldr	r3, .L9+12
	ldr	r1, [r2]
	mov	r0, r4
	mov	r2, #0
	ldr	r3, [r3]
	bl	__phy_modify
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, .L9+16
	mov	r0, r4
	ldr	r1, [r3]
	bl	marvell_write_page
	subs	r2, r0, #0
	blt	.L2
	ldr	r2, .L9+20
	ldr	r3, .L9+24
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, .L9+28
	ldr	r1, .L9+32
	ldr	r2, [r2]
	orr	r3, r0, r3
	ldr	r1, [r1]
	mov	r0, r4
	bl	__phy_modify
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, .L9+36
	mov	r0, r4
	ldr	r1, [r3]
	bl	marvell_write_page
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, [r4]
	ldr	r2, .L9+40
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, [r3, #20]
	ldr	r3, [r3, #16]
	mov	r0, r4
	orr	r2, r3, r2, lsl #8
	bl	__phy_write
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, [r4]
	ldr	r2, .L9+44
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, [r3, #12]
	ldr	r3, [r3, #8]
	mov	r0, r4
	orr	r2, r3, r2, lsl #8
	bl	__phy_write
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, [r4]
	ldr	r2, .L9+48
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, [r3, #4]
	ldr	r3, [r3]
	mov	r0, r4
	orr	r2, r3, r2, lsl #8
	bl	__phy_write
	subs	r2, r0, #0
	blt	.L2
	ldr	r2, .L9+52
	ldr	r3, .L9+56
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, .L9+60
	orr	r3, r1, r3
	mov	r0, r4
	ldr	r1, [r2]
	mov	r2, #0
	bl	__phy_modify
	mov	r2, r0
.L2:
	mov	r1, r5
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	phy_restore_page
.L3:
	ldr	r3, .L9+36
	mov	r0, r4
	ldr	r1, [r3]
	bl	marvell_write_page
	subs	r2, r0, #0
	blt	.L2
	ldr	r3, .L9+52
	ldr	r2, .L9+56
	ldr	r1, .L9+60
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r3, [r3]
	bl	__phy_modify
	mov	r1, r5
	mov	r2, r0
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	phy_restore_page
.L8:
	ldr	r3, .L9+64
	mov	r0, r4
	ldr	r1, [r3]
	bl	__phy_read
	b	.L4
.L10:
	.align	2
.L9:
	.word	WAKE_MAGIC
	.word	MII_MARVELL_COPPER_PAGE
	.word	MII_88E1318S_PHY_CSIER
	.word	MII_88E1318S_PHY_CSIER_WOL_EIE
	.word	MII_MARVELL_LED_PAGE
	.word	MII_88E1318S_PHY_LED_TCR_INTn_ENABLE
	.word	MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW
	.word	MII_88E1318S_PHY_LED_TCR_FORCE_INT
	.word	MII_88E1318S_PHY_LED_TCR
	.word	MII_MARVELL_WOL_PAGE
	.word	MII_88E1318S_PHY_MAGIC_PACKET_WORD2
	.word	MII_88E1318S_PHY_MAGIC_PACKET_WORD1
	.word	MII_88E1318S_PHY_MAGIC_PACKET_WORD0
	.word	MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS
	.word	MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE
	.word	MII_88E1318S_PHY_WOL_CTRL
	.word	MII_M1011_IEVENT
	.size	m88e1318_set_wol, .-m88e1318_set_wol
	.comm	WAKE_MAGIC,4,4
	.comm	MII_MARVELL_WOL_PAGE,4,4
	.comm	MII_MARVELL_LED_PAGE,4,4
	.comm	MII_MARVELL_COPPER_PAGE,4,4
	.comm	MII_M1011_IEVENT,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS,4,4
	.comm	MII_88E1318S_PHY_WOL_CTRL,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD2,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD1,4,4
	.comm	MII_88E1318S_PHY_MAGIC_PACKET_WORD0,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_INTn_ENABLE,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW,4,4
	.comm	MII_88E1318S_PHY_LED_TCR_FORCE_INT,4,4
	.comm	MII_88E1318S_PHY_LED_TCR,4,4
	.comm	MII_88E1318S_PHY_CSIER_WOL_EIE,4,4
	.comm	MII_88E1318S_PHY_CSIER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
