	.file	"extr_autosleep.c_try_to_suspend.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	try_to_suspend, @function
try_to_suspend:
.LFB0:
	.cfi_startproc
	endbr64
	sub	rsp, 24
	.cfi_def_cfa_offset 32
	mov	esi, 1
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rdi, rsp
	call	pm_get_wakeup_count@PLT
	test	eax, eax
	jne	.L20
.L3:
	xor	eax, eax
	call	queue_up_suspend_work@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	lea	rdi, autosleep_lock[rip]
	call	mutex_lock@PLT
	mov	edi, DWORD PTR [rsp]
	call	pm_save_wakeup_count@PLT
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR SYSTEM_RUNNING[rip]
	cmp	QWORD PTR system_state[rip], rax
	jne	.L4
	mov	rdi, QWORD PTR autosleep_state[rip]
	cmp	rdi, QWORD PTR PM_SUSPEND_ON[rip]
	je	.L22
	cmp	rdi, QWORD PTR PM_SUSPEND_MAX[rip]
	jl	.L8
	xor	eax, eax
	call	hibernate@PLT
.L9:
	lea	rdi, autosleep_lock[rip]
	call	mutex_unlock@PLT
	xor	esi, esi
	lea	rdi, 4[rsp]
	call	pm_get_wakeup_count@PLT
	test	eax, eax
	je	.L3
	mov	eax, DWORD PTR [rsp]
	cmp	DWORD PTR 4[rsp], eax
	jne	.L3
	mov	eax, DWORD PTR HZ[rip]
	mov	edi, eax
	shr	edi, 31
	add	edi, eax
	sar	edi
	call	schedule_timeout_uninterruptible@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	lea	rdi, autosleep_lock[rip]
	call	mutex_unlock@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	call	pm_suspend@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L22:
	lea	rdi, autosleep_lock[rip]
	call	mutex_unlock@PLT
	jmp	.L1
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	try_to_suspend, .-try_to_suspend
	.comm	system_state,8,8
	.comm	autosleep_state,8,8
	.comm	autosleep_lock,4,4
	.comm	SYSTEM_RUNNING,8,8
	.comm	PM_SUSPEND_ON,8,8
	.comm	PM_SUSPEND_MAX,8,8
	.comm	HZ,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_autosleep.c_try_to_suspend.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	try_to_suspend, %function
try_to_suspend:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	str	lr, [sp, #-4]!
	ldr	r3, .L23
	sub	sp, sp, #20
	mov	r1, #1
	add	r0, sp, #4
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	pm_get_wakeup_count
	cmp	r0, #0
	bne	.L20
.L3:
	bl	queue_up_suspend_work
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #20
	@ sp needed
	ldr	pc, [sp], #4
.L20:
	ldr	r0, .L23+4
	bl	mutex_lock
	ldr	r0, [sp, #4]
	bl	pm_save_wakeup_count
	cmp	r0, #0
	beq	.L4
	ldr	r2, .L23+8
	ldr	r3, .L23+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L4
	ldr	r2, .L23+16
	ldr	r3, .L23+20
	ldr	r0, [r2]
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L22
	ldr	r3, .L23+24
	ldr	r3, [r3]
	cmp	r0, r3
	blt	.L8
	bl	hibernate
.L9:
	ldr	r0, .L23+4
	bl	mutex_unlock
	mov	r1, #0
	add	r0, sp, #8
	bl	pm_get_wakeup_count
	cmp	r0, #0
	beq	.L3
	ldr	r2, [sp, #8]
	ldr	r3, [sp, #4]
	cmp	r2, r3
	bne	.L3
	ldr	r3, .L23+28
	ldr	r0, [r3]
	add	r0, r0, r0, lsr #31
	asr	r0, r0, #1
	bl	schedule_timeout_uninterruptible
	b	.L3
.L4:
	ldr	r0, .L23+4
	bl	mutex_unlock
	b	.L3
.L8:
	bl	pm_suspend
	b	.L9
.L22:
	ldr	r0, .L23+4
	bl	mutex_unlock
	b	.L1
.L21:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC0
	.word	autosleep_lock
	.word	system_state
	.word	SYSTEM_RUNNING
	.word	autosleep_state
	.word	PM_SUSPEND_ON
	.word	PM_SUSPEND_MAX
	.word	HZ
	.size	try_to_suspend, .-try_to_suspend
	.comm	system_state,4,4
	.comm	autosleep_state,4,4
	.comm	autosleep_lock,4,4
	.comm	SYSTEM_RUNNING,4,4
	.comm	PM_SUSPEND_ON,4,4
	.comm	PM_SUSPEND_MAX,4,4
	.comm	HZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
