	.file	"extr_ar9300_power.c_ar9300_set_power_mode_sleep.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar9300_set_power_mode_sleep, @function
ar9300_set_power_mode_sleep:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	AH9300@PLT
	mov	edx, DWORD PTR AR_STA_ID1_PWR_SAV[rip]
	mov	esi, DWORD PTR AR_STA_ID1[rip]
	mov	rdi, rbp
	mov	rbx, rax
	call	OS_REG_SET_BIT@PLT
	test	r12d, r12d
	jne	.L13
.L3:
	mov	r12d, DWORD PTR AR_WA_D3_TO_L1_DISABLE[rip]
	mov	esi, DWORD PTR AR_WA[rip]
	mov	rdi, rbp
	not	r12d
	and	r12d, DWORD PTR [rbx]
	call	AR_HOSTIF_REG@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	edx, r12d
	mov	rdi, rbp
	mov	esi, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	OS_REG_WRITE@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rdi, rbp
	call	AR_SREV_JUPITER@PLT
	test	rax, rax
	je	.L4
.L6:
	mov	esi, DWORD PTR AR_TIMER_MODE[rip]
	mov	rdi, rbp
	call	OS_REG_READ@PLT
	mov	esi, DWORD PTR AR_TIMER_MODE[rip]
	mov	rdi, rbp
	xor	al, al
	mov	edx, eax
	call	OS_REG_WRITE@PLT
	mov	esi, DWORD PTR AR_GEN_TIMERS2_MODE[rip]
	mov	rdi, rbp
	call	OS_REG_READ@PLT
	mov	esi, DWORD PTR AR_GEN_TIMERS2_MODE[rip]
	mov	rdi, rbp
	xor	al, al
	mov	edx, eax
	call	OS_REG_WRITE@PLT
	mov	esi, DWORD PTR AR_SLP32_INC[rip]
	mov	rdi, rbp
	call	OS_REG_READ@PLT
	mov	esi, DWORD PTR AR_SLP32_INC[rip]
	mov	rdi, rbp
	and	eax, -1048576
	mov	edx, eax
	call	OS_REG_WRITE@PLT
	mov	esi, DWORD PTR AR_MCI_INTERRUPT_RX_MSG_EN[rip]
	mov	rdi, rbp
	xor	edx, edx
	call	OS_REG_WRITE@PLT
	mov	edi, 100
	call	OS_DELAY@PLT
.L5:
	mov	edx, DWORD PTR AR_RTC_FORCE_WAKE_EN[rip]
	mov	esi, DWORD PTR AR_RTC_FORCE_WAKE[rip]
	mov	rdi, rbp
	call	OS_REG_CLR_BIT@PLT
	mov	rdi, rbp
	call	AR_SREV_JUPITER@PLT
	test	rax, rax
	je	.L7
.L9:
	mov	edi, 100
	call	OS_DELAY@PLT
.L8:
	mov	rdi, rbp
	call	AR_SREV_JUPITER_10@PLT
	test	eax, eax
	jne	.L3
	mov	edx, DWORD PTR AR_RTC_RESET_EN[rip]
	mov	esi, DWORD PTR AR_RTC_RESET[rip]
	mov	rdi, rbp
	call	OS_REG_CLR_BIT@PLT
	mov	edi, 2
	call	OS_DELAY@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, rbp
	call	AR_SREV_APHRODITE@PLT
	test	rax, rax
	jne	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbp
	call	AR_SREV_APHRODITE@PLT
	test	rax, rax
	jne	.L6
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ar9300_set_power_mode_sleep, .-ar9300_set_power_mode_sleep
	.comm	HAL_WOW_OFFLOAD_SET_4004_BIT14,4,4
	.comm	AR_WA_D3_TO_L1_DISABLE,4,4
	.comm	AR_WA,4,4
	.comm	AR_TIMER_MODE,4,4
	.comm	AR_STA_ID1_PWR_SAV,4,4
	.comm	AR_STA_ID1,4,4
	.comm	AR_SLP32_INC,4,4
	.comm	AR_RTC_RESET_EN,4,4
	.comm	AR_RTC_RESET,4,4
	.comm	AR_RTC_FORCE_WAKE_EN,4,4
	.comm	AR_RTC_FORCE_WAKE,4,4
	.comm	AR_MCI_INTERRUPT_RX_MSG_EN,4,4
	.comm	AR_GEN_TIMERS2_MODE,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_ar9300_power.c_ar9300_set_power_mode_sleep.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar9300_set_power_mode_sleep, %function
ar9300_set_power_mode_sleep:
	@ 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	AH9300
	ldr	r3, .L14
	ldr	r2, .L14+4
	mov	r5, r0
	ldr	r2, [r2]
	mov	r0, r4
	ldr	r1, [r3]
	bl	OS_REG_SET_BIT
	cmp	r6, #0
	bne	.L13
.L3:
	ldr	r3, .L14+8
	mov	r0, r4
	ldr	r1, [r3]
	bl	AR_HOSTIF_REG
	ldr	r2, .L14+12
	ldr	r3, [r5]
	ldr	r2, [r2]
	mov	r1, r0
	bic	r2, r3, r2
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	OS_REG_WRITE
.L13:
	mov	r0, r4
	bl	AR_SREV_JUPITER
	cmp	r0, #0
	beq	.L4
.L6:
	ldr	r3, .L14+16
	mov	r0, r4
	ldr	r6, [r3]
	mov	r1, r6
	bl	OS_REG_READ
	mov	r1, r6
	bic	r2, r0, #255
	mov	r0, r4
	bl	OS_REG_WRITE
	ldr	r3, .L14+20
	mov	r0, r4
	ldr	r6, [r3]
	mov	r1, r6
	bl	OS_REG_READ
	mov	r1, r6
	bic	r2, r0, #255
	mov	r0, r4
	bl	OS_REG_WRITE
	ldr	r3, .L14+24
	mov	r0, r4
	ldr	r6, [r3]
	mov	r1, r6
	bl	OS_REG_READ
	lsr	r2, r0, #20
	mov	r1, r6
	lsl	r2, r2, #20
	mov	r0, r4
	bl	OS_REG_WRITE
	ldr	r3, .L14+28
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r3]
	bl	OS_REG_WRITE
	mov	r0, #100
	bl	OS_DELAY
.L5:
	ldr	r3, .L14+32
	ldr	r2, .L14+36
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	bl	OS_REG_CLR_BIT
	mov	r0, r4
	bl	AR_SREV_JUPITER
	cmp	r0, #0
	beq	.L7
.L9:
	mov	r0, #100
	bl	OS_DELAY
.L8:
	mov	r0, r4
	bl	AR_SREV_JUPITER_10
	cmp	r0, #0
	bne	.L3
	ldr	r3, .L14+40
	ldr	r2, .L14+44
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	OS_REG_CLR_BIT
	mov	r0, #2
	bl	OS_DELAY
	b	.L3
.L7:
	mov	r0, r4
	bl	AR_SREV_APHRODITE
	cmp	r0, #0
	bne	.L9
	b	.L8
.L4:
	mov	r0, r4
	bl	AR_SREV_APHRODITE
	cmp	r0, #0
	bne	.L6
	b	.L5
.L15:
	.align	2
.L14:
	.word	AR_STA_ID1
	.word	AR_STA_ID1_PWR_SAV
	.word	AR_WA
	.word	AR_WA_D3_TO_L1_DISABLE
	.word	AR_TIMER_MODE
	.word	AR_GEN_TIMERS2_MODE
	.word	AR_SLP32_INC
	.word	AR_MCI_INTERRUPT_RX_MSG_EN
	.word	AR_RTC_FORCE_WAKE
	.word	AR_RTC_FORCE_WAKE_EN
	.word	AR_RTC_RESET
	.word	AR_RTC_RESET_EN
	.size	ar9300_set_power_mode_sleep, .-ar9300_set_power_mode_sleep
	.comm	HAL_WOW_OFFLOAD_SET_4004_BIT14,4,4
	.comm	AR_WA_D3_TO_L1_DISABLE,4,4
	.comm	AR_WA,4,4
	.comm	AR_TIMER_MODE,4,4
	.comm	AR_STA_ID1_PWR_SAV,4,4
	.comm	AR_STA_ID1,4,4
	.comm	AR_SLP32_INC,4,4
	.comm	AR_RTC_RESET_EN,4,4
	.comm	AR_RTC_RESET,4,4
	.comm	AR_RTC_FORCE_WAKE_EN,4,4
	.comm	AR_RTC_FORCE_WAKE,4,4
	.comm	AR_MCI_INTERRUPT_RX_MSG_EN,4,4
	.comm	AR_GEN_TIMERS2_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
