	.file	"extr_logind-button.c_button_suitable.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	button_suitable, @function
button_suitable:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r14
	push	r13
	push	r12
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	mov	r12d, edi
	push	rbx
	sub	rsp, 16
	.cfi_offset 3, -48
	mov	esi, DWORD PTR EV_SW[rip]
	mov	edi, DWORD PTR EV_KEY[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	call	CONST_MAX@PLT
	mov	rcx, rsp
	cdq
	idiv	DWORD PTR ULONG_BITS[rip]
	lea	ebx, 1[rax]
	movsx	rax, ebx
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L38:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L38
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L39
.L4:
	mov	edi, r12d
	mov	r13, rsp
	not	edi
	shr	edi, 31
	call	assert@PLT
	mov	edi, DWORD PTR EV_SYN[rip]
	lea	esi, 0[0+rbx*8]
	call	EVIOCGBIT@PLT
	mov	rdx, r13
	mov	edi, r12d
	mov	esi, eax
	call	ioctl@PLT
	test	rax, rax
	js	.L40
	mov	esi, DWORD PTR EV_KEY[rip]
	mov	rdi, r13
	call	bitset_get@PLT
	test	rax, rax
	je	.L7
	mov	ecx, DWORD PTR KEY_SUSPEND[rip]
	mov	edx, DWORD PTR KEY_SLEEP[rip]
	mov	rbx, rsp
	mov	esi, DWORD PTR KEY_POWER2[rip]
	mov	edi, DWORD PTR KEY_POWER[rip]
	call	CONST_MAX4@PLT
	mov	rsi, rsp
	cdq
	idiv	DWORD PTR ULONG_BITS[rip]
	add	eax, 1
	movsx	rdx, eax
	lea	rdx, 15[0+rdx*8]
	mov	rcx, rdx
	and	rdx, -4096
	sub	rsi, rdx
	and	rcx, -16
	mov	rdx, rsi
	cmp	rsp, rdx
	je	.L9
.L41:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L41
.L9:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L42
.L10:
	mov	edi, DWORD PTR EV_KEY[rip]
	lea	esi, 0[0+rax*8]
	mov	r14, rsp
	call	EVIOCGBIT@PLT
	mov	rdx, r14
	mov	edi, r12d
	mov	esi, eax
	call	ioctl@PLT
	test	rax, rax
	js	.L36
	mov	esi, DWORD PTR KEY_POWER[rip]
	mov	rdi, r14
	call	bitset_get@PLT
	test	rax, rax
	jne	.L19
	mov	esi, DWORD PTR KEY_POWER2[rip]
	mov	rdi, r14
	call	bitset_get@PLT
	test	rax, rax
	je	.L43
.L19:
	mov	eax, 1
.L18:
	mov	rsp, rbx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L40:
	mov	eax, DWORD PTR errno[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR -40[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L44
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	mov	esi, DWORD PTR KEY_SLEEP[rip]
	mov	rdi, r14
	call	bitset_get@PLT
	test	rax, rax
	jne	.L19
	mov	esi, DWORD PTR KEY_SUSPEND[rip]
	mov	rdi, r14
	call	bitset_get@PLT
	test	rax, rax
	jne	.L19
	mov	rsp, rbx
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR EV_SW[rip]
	mov	rdi, r13
	call	bitset_get@PLT
	mov	r8, rax
	xor	eax, eax
	test	r8, r8
	je	.L1
	mov	esi, DWORD PTR SW_DOCK[rip]
	mov	edi, DWORD PTR SW_LID[rip]
	mov	rbx, rsp
	call	CONST_MAX@PLT
	mov	rsi, rsp
	cdq
	idiv	DWORD PTR ULONG_BITS[rip]
	add	eax, 1
	movsx	rdx, eax
	lea	rdx, 15[0+rdx*8]
	mov	rcx, rdx
	and	rdx, -4096
	sub	rsi, rdx
	and	rcx, -16
	mov	rdx, rsi
	cmp	rsp, rdx
	je	.L15
.L45:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L45
.L15:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	je	.L16
	or	QWORD PTR -8[rsp+rcx], 0
.L16:
	mov	edi, DWORD PTR EV_SW[rip]
	lea	esi, 0[0+rax*8]
	mov	r13, rsp
	call	EVIOCGBIT@PLT
	mov	rdx, r13
	mov	edi, r12d
	mov	esi, eax
	call	ioctl@PLT
	test	rax, rax
	js	.L36
	mov	esi, DWORD PTR SW_LID[rip]
	mov	rdi, r13
	call	bitset_get@PLT
	test	rax, rax
	jne	.L19
	mov	esi, DWORD PTR SW_DOCK[rip]
	mov	rdi, r13
	call	bitset_get@PLT
	test	rax, rax
	je	.L18
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L36:
	mov	eax, DWORD PTR errno[rip]
	neg	eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L42:
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L10
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	button_suitable, .-button_suitable
	.comm	errno,4,4
	.comm	ULONG_BITS,4,4
	.comm	SW_LID,4,4
	.comm	SW_DOCK,4,4
	.comm	KEY_SUSPEND,4,4
	.comm	KEY_SLEEP,4,4
	.comm	KEY_POWER2,4,4
	.comm	KEY_POWER,4,4
	.comm	EV_SYN,4,4
	.comm	EV_SW,4,4
	.comm	EV_KEY,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_logind-button.c_button_suitable.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	button_suitable, %function
button_suitable:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #12
	ldr	r7, .L28
	ldr	r6, .L28+4
	ldr	r3, .L28+8
	ldr	r8, .L28+12
	mov	r4, r0
	ldr	r1, [r7]
	ldr	r0, [r6]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	CONST_MAX
	ldr	r1, [r8]
	bl	__aeabi_idiv
	add	r5, r0, #1
	mvn	r0, r4
	lsl	r5, r5, #2
	add	r3, r5, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	lsr	r0, r0, #31
	bl	assert
	ldr	r3, .L28+16
	mov	r1, r5
	ldr	r0, [r3]
	bl	EVIOCGBIT
	mov	r5, sp
	mov	r1, r0
	mov	r2, r5
	mov	r0, r4
	bl	ioctl
	cmp	r0, #0
	blt	.L20
	mov	r0, r5
	ldr	r1, [r6]
	bl	bitset_get
	cmp	r0, #0
	bne	.L21
.L4:
	mov	r0, r5
	ldr	r1, [r7]
	bl	bitset_get
	cmp	r0, #0
	bne	.L22
.L1:
	ldr	r3, .L28+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	ldr	r3, .L28+20
	ldr	r2, .L28+24
	ldr	r1, .L28+28
	ldr	r0, .L28+32
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r0, [r0]
	bl	CONST_MAX4
	ldr	r1, [r8]
	bl	__aeabi_idiv
	add	r1, r0, #1
	lsl	r1, r1, #2
	add	r3, r1, #7
	bic	r3, r3, #7
	ldr	r0, [r6]
	mov	r10, sp
	sub	sp, sp, r3
	bl	EVIOCGBIT
	mov	r6, sp
	mov	r1, r0
	mov	r2, r6
	mov	r0, r4
	bl	ioctl
	cmp	r0, #0
	blt	.L24
	ldr	r3, .L28+32
	mov	r0, r6
	ldr	r1, [r3]
	bl	bitset_get
	cmp	r0, #0
	bne	.L7
	ldr	r3, .L28+28
	mov	r0, r6
	ldr	r1, [r3]
	bl	bitset_get
	cmp	r0, #0
	beq	.L25
.L7:
	mov	r0, #1
	b	.L6
.L20:
	ldr	r3, .L28+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L24:
	ldr	r3, .L28+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L6:
	mov	sp, r10
	b	.L1
.L22:
	ldr	r6, .L28+40
	ldr	r9, .L28+44
	ldr	r1, [r6]
	ldr	r0, [r9]
	bl	CONST_MAX
	ldr	r1, [r8]
	bl	__aeabi_idiv
	add	r1, r0, #1
	lsl	r1, r1, #2
	add	r3, r1, #7
	bic	r3, r3, #7
	ldr	r0, [r7]
	mov	r5, sp
	sub	sp, sp, r3
	bl	EVIOCGBIT
	mov	r7, sp
	mov	r1, r0
	mov	r2, r7
	mov	r0, r4
	bl	ioctl
	cmp	r0, #0
	blt	.L26
	mov	r0, r7
	ldr	r1, [r9]
	bl	bitset_get
	cmp	r0, #0
	beq	.L27
.L10:
	mov	r0, #1
.L9:
	mov	sp, r5
	b	.L1
.L25:
	ldr	r3, .L28+24
	mov	r0, r6
	ldr	r1, [r3]
	bl	bitset_get
	cmp	r0, #0
	bne	.L7
	ldr	r3, .L28+20
	mov	r0, r6
	ldr	r1, [r3]
	bl	bitset_get
	cmp	r0, #0
	bne	.L7
	mov	sp, r5
	b	.L4
.L27:
	mov	r0, r7
	ldr	r1, [r6]
	bl	bitset_get
	cmp	r0, #0
	beq	.L9
	b	.L10
.L26:
	ldr	r3, .L28+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L9
.L23:
	bl	__stack_chk_fail
.L29:
	.align	2
.L28:
	.word	EV_SW
	.word	EV_KEY
	.word	.LC0
	.word	ULONG_BITS
	.word	EV_SYN
	.word	KEY_SUSPEND
	.word	KEY_SLEEP
	.word	KEY_POWER2
	.word	KEY_POWER
	.word	errno
	.word	SW_DOCK
	.word	SW_LID
	.size	button_suitable, .-button_suitable
	.comm	errno,4,4
	.comm	ULONG_BITS,4,4
	.comm	SW_LID,4,4
	.comm	SW_DOCK,4,4
	.comm	KEY_SUSPEND,4,4
	.comm	KEY_SLEEP,4,4
	.comm	KEY_POWER2,4,4
	.comm	KEY_POWER,4,4
	.comm	EV_SYN,4,4
	.comm	EV_SW,4,4
	.comm	EV_KEY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
