	.file	"340912.c"
	.intel_syntax noprefix
	.text
	.globl	counter
	.bss
	.align 4
	.type	counter, @object
	.size	counter, 4
counter:
	.zero	4
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.globl	check
	.type	check, @function
check:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	cmp	DWORD PTR -4[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	error
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	check, .-check
	.section	.rodata
	.align 8
.LC0:
	.string	"Handling signal %s (counter -> %d)\n"
.LC1:
	.string	"Unable to unblock SIGALRM"
	.text
	.globl	timer_handler
	.type	timer_handler, @function
timer_handler:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 168
	.cfi_offset 3, -24
	mov	DWORD PTR -164[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	ebx, DWORD PTR counter[rip]
	lea	eax, 1[rbx]
	mov	DWORD PTR counter[rip], eax
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	strsignal@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -160[rbp]
	mov	rdi, rax
	call	sigemptyset@PLT
	lea	rax, -160[rbp]
	mov	esi, 14
	mov	rdi, rax
	call	sigaddset@PLT
	lea	rax, -160[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 1
	call	sigprocmask@PLT
	lea	rsi, .LC1[rip]
	mov	edi, eax
	call	check
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	timer_handler, .-timer_handler
	.section	.rodata
	.align 8
.LC2:
	.string	"Setting up timer handler and timer."
	.align 8
.LC3:
	.string	"Failed to setup signal handler"
.LC4:
	.string	"Failed to set timer running"
	.text
	.globl	setup_timer
	.type	setup_timer, @function
setup_timer:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rax, timer_handler[rip]
	mov	QWORD PTR -160[rbp], rax
	mov	DWORD PTR -24[rbp], 0
	lea	rax, -160[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigfillset@PLT
	lea	rax, -160[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 14
	call	sigaction@PLT
	lea	rsi, .LC3[rip]
	mov	edi, eax
	call	check
	mov	QWORD PTR -176[rbp], 1
	mov	QWORD PTR -168[rbp], 0
	mov	rax, QWORD PTR -176[rbp]
	mov	rdx, QWORD PTR -168[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	QWORD PTR -184[rbp], rdx
	lea	rax, -192[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 0
	call	setitimer@PLT
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	check
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	setup_timer, .-setup_timer
	.section	.rodata
	.align 8
.LC5:
	.string	"Playing with signals and signal handlers"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 0
	call	setup_timer
.L10:
	jmp	.L10
	.cfi_endproc
.LFE10:
	.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	"340912.c"
	.text
	.global	counter
	.bss
	.align	2
	.type	counter, %object
	.size	counter, 4
counter:
	.space	4
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.align	2
	.global	check
	.syntax unified
	.arm
	.fpu softvfp
	.type	check, %function
check:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L4
	ldr	r0, [fp, #-12]
	bl	error
.L4:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	check, .-check
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Handling signal %s (counter -> %d)\012\000"
	.align	2
.LC1:
	.ascii	"Unable to unblock SIGALRM\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	timer_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	timer_handler, %function
timer_handler:
	@ args = 0, pretend = 0, frame = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	str	r0, [fp, #-144]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, [fp, #-144]
	bl	strsignal
	mov	r1, r0
	ldr	r3, .L7+4
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r0, .L7+4
	str	r2, [r0]
	mov	r2, r3
	ldr	r0, .L7+8
	bl	printf
	sub	r3, fp, #136
	mov	r0, r3
	bl	sigemptyset
	sub	r3, fp, #136
	mov	r1, #14
	mov	r0, r3
	bl	sigaddset
	sub	r3, fp, #136
	mov	r2, #0
	mov	r1, r3
	mov	r0, #1
	bl	sigprocmask
	mov	r3, r0
	ldr	r1, .L7+12
	mov	r0, r3
	bl	check
	nop
	ldr	r3, .L7
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC2
	.word	counter
	.word	.LC0
	.word	.LC1
	.size	timer_handler, .-timer_handler
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Setting up timer handler and timer.\000"
	.align	2
.LC4:
	.ascii	"Failed to setup signal handler\000"
	.align	2
.LC5:
	.ascii	"Failed to set timer running\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	setup_timer
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_timer, %function
setup_timer:
	@ args = 0, pretend = 0, frame = 160
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #160
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L11+4
	bl	puts
	ldr	r3, .L11+8
	str	r3, [fp, #-148]
	mov	r3, #0
	str	r3, [fp, #-16]
	sub	r3, fp, #148
	add	r3, r3, #4
	mov	r0, r3
	bl	sigfillset
	sub	r3, fp, #148
	mov	r2, #0
	mov	r1, r3
	mov	r0, #14
	bl	sigaction
	mov	r3, r0
	ldr	r1, .L11+12
	mov	r0, r3
	bl	check
	mov	r3, #1
	str	r3, [fp, #-156]
	mov	r3, #0
	str	r3, [fp, #-152]
	sub	r3, fp, #164
	sub	r2, fp, #156
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	sub	r3, fp, #164
	mov	r2, #0
	mov	r1, r3
	mov	r0, #0
	bl	setitimer
	mov	r3, r0
	ldr	r1, .L11+16
	mov	r0, r3
	bl	check
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	.LC3
	.word	timer_handler
	.word	.LC4
	.word	.LC5
	.size	setup_timer, .-setup_timer
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Playing with signals and signal handlers\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L15
	bl	puts
	bl	setup_timer
.L14:
	b	.L14
.L16:
	.align	2
.L15:
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
