	.file	"117329014.c"
	.intel_syntax noprefix
	.text
	.globl	fd
	.bss
	.align 4
	.type	fd, @object
	.size	fd, 4
fd:
	.zero	4
	.section	.rodata
.LC0:
	.string	"key_val: 0x%x\n"
	.text
	.globl	my_signal_fun
	.type	my_signal_fun, @function
my_signal_fun:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR fd[rip]
	lea	rcx, -9[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	movzx	eax, BYTE PTR -9[rbp]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	my_signal_fun, .-my_signal_fun
	.section	.rodata
.LC1:
	.string	"/dev/buttons"
.LC2:
	.string	"can't open file key_drv"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	lea	rsi, my_signal_fun[rip]
	mov	edi, 29
	call	signal@PLT
	mov	esi, 2
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd[rip], eax
	mov	eax, DWORD PTR fd[rip]
	test	eax, eax
	jns	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L7
.L4:
	call	getpid@PLT
	mov	edx, eax
	mov	eax, DWORD PTR fd[rip]
	mov	esi, 8
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	eax, DWORD PTR fd[rip]
	mov	esi, 3
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	or	ah, 32
	mov	edx, eax
	mov	eax, DWORD PTR fd[rip]
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
.L6:
	mov	edi, 1000
	call	sleep@PLT
	jmp	.L6
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"117329014.c"
	.text
	.comm	fd,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"key_val: 0x%x\012\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	my_signal_fun
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_signal_fun, %function
my_signal_fun:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, .L3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L3+4
	ldr	r3, [r3]
	sub	r1, fp, #9
	mov	r2, #1
	mov	r0, r3
	bl	read
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L3+8
	bl	printf
	nop
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L2
	bl	__stack_chk_fail
.L2:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC1
	.word	fd
	.word	.LC0
	.size	my_signal_fun, .-my_signal_fun
	.section	.rodata
	.align	2
.LC2:
	.ascii	"/dev/buttons\000"
	.align	2
.LC3:
	.ascii	"can't open file key_drv\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r1, .L10
	mov	r0, #29
	bl	signal
	mov	r1, #2
	ldr	r0, .L10+4
	bl	open
	mov	r3, r0
	ldr	r2, .L10+8
	str	r3, [r2]
	ldr	r3, .L10+8
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L10+12
	bl	puts
	mvn	r3, #0
	b	.L9
.L6:
	ldr	r3, .L10+8
	ldr	r4, [r3]
	bl	getpid
	mov	r3, r0
	mov	r2, r3
	mov	r1, #8
	mov	r0, r4
	bl	fcntl
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r1, #3
	mov	r0, r3
	bl	fcntl
	str	r0, [fp, #-16]
	ldr	r3, .L10+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-16]
	orr	r3, r3, #8192
	mov	r2, r3
	mov	r1, #4
	bl	fcntl
.L8:
	mov	r0, #1000
	bl	sleep
	b	.L8
.L9:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L11:
	.align	2
.L10:
	.word	my_signal_fun
	.word	.LC2
	.word	fd
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
