	.file	"1172178.c"
	.intel_syntax noprefix
	.text
	.globl	n_sig_rx
	.bss
	.align 4
	.type	n_sig_rx, @object
	.size	n_sig_rx, 4
n_sig_rx:
	.zero	4
	.globl	ign_after
	.align 4
	.type	ign_after, @object
	.size	ign_after, 4
ign_after:
	.zero	4
	.text
	.globl	rnd
	.type	rnd, @function
rnd:
.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	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	call	random@PLT
	mov	edx, DWORD PTR -8[rbp]
	sub	edx, DWORD PTR -4[rbp]
	add	edx, 1
	movsx	rcx, edx
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	rnd, .-rnd
	.section	.rodata
.LC0:
	.string	"%d\t%s"
	.text
	.globl	parent_proc
	.type	parent_proc, @function
parent_proc:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 48
	mov	QWORD PTR -4136[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -4116[rbp], 1
.L7:
	mov	rdx, QWORD PTR -4136[rbp]
	lea	rax, -4112[rbp]
	mov	esi, 4097
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR -4136[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	DWORD PTR -4116[rbp], 1
	jmp	.L7
.L4:
	mov	eax, DWORD PTR n_sig_rx[rip]
	and	eax, 1
	test	eax, eax
	jne	.L6
	lea	rdx, -4112[rbp]
	mov	eax, DWORD PTR -4116[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	add	DWORD PTR -4116[rbp], 1
	jmp	.L7
	.cfi_endproc
.LFE7:
	.size	parent_proc, .-parent_proc
	.section	.rodata
	.align 8
.LC1:
	.string	"received %d signals (of which 5 have been ignored)\n"
	.text
	.globl	sigusr1_handler
	.type	sigusr1_handler, @function
sigusr1_handler:
.LFB8:
	.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	eax, DWORD PTR n_sig_rx[rip]
	add	eax, 1
	mov	DWORD PTR n_sig_rx[rip], eax
	mov	edx, DWORD PTR n_sig_rx[rip]
	mov	eax, DWORD PTR ign_after[rip]
	cmp	edx, eax
	jne	.L10
	mov	esi, 1
	mov	edi, 10
	call	signal@PLT
	jmp	.L12
.L10:
	mov	edx, DWORD PTR n_sig_rx[rip]
	mov	eax, DWORD PTR ign_after[rip]
	cmp	edx, eax
	jle	.L12
	mov	eax, DWORD PTR n_sig_rx[rip]
	add	eax, 5
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sigusr1_handler, .-sigusr1_handler
	.globl	sigusr2_handler
	.type	sigusr2_handler, @function
sigusr2_handler:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	lea	rsi, sigusr1_handler[rip]
	mov	edi, 10
	call	signal@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sigusr2_handler, .-sigusr2_handler
	.section	.rodata
.LC2:
	.string	"USAGE: %s [file]\n"
	.align 8
.LC3:
	.string	"couldn't generate a child process"
.LC4:
	.string	"r"
.LC5:
	.string	"couldn't open the file '%s'\n"
	.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
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	cmp	DWORD PTR -36[rbp], 2
	je	.L15
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L16
.L15:
	mov	DWORD PTR n_sig_rx[rip], 0
	mov	edi, 0
	call	time@PLT
	mov	ebx, eax
	call	getpid@PLT
	add	eax, ebx
	mov	edi, eax
	call	srandom@PLT
	mov	esi, 20
	mov	edi, 10
	call	rnd
	mov	DWORD PTR ign_after[rip], eax
	call	fork@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jns	.L17
	lea	rdi, .LC3[rip]
	call	perror@PLT
	jmp	.L18
.L17:
	cmp	DWORD PTR -28[rbp], 0
	jle	.L19
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L20
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	mov	edi, 2
	call	exit@PLT
.L20:
	lea	rsi, sigusr1_handler[rip]
	mov	edi, 10
	call	signal@PLT
	lea	rsi, sigusr2_handler[rip]
	mov	edi, 12
	call	signal@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	parent_proc
	jmp	.L18
.L19:
	mov	DWORD PTR n_sig_rx[rip], 0
	jmp	.L21
.L23:
	mov	esi, 10
	mov	edi, 1
	call	rnd
	mov	edi, eax
	call	sleep@PLT
	call	getppid@PLT
	mov	esi, 10
	mov	edi, eax
	call	kill@PLT
	mov	eax, DWORD PTR ign_after[rip]
	lea	edx, 4[rax]
	mov	eax, DWORD PTR n_sig_rx[rip]
	cmp	edx, eax
	jne	.L22
	call	getppid@PLT
	mov	esi, 12
	mov	edi, eax
	call	kill@PLT
.L22:
	mov	eax, DWORD PTR n_sig_rx[rip]
	add	eax, 1
	mov	DWORD PTR n_sig_rx[rip], eax
.L21:
	mov	eax, DWORD PTR ign_after[rip]
	lea	edx, 5[rax]
	mov	eax, DWORD PTR n_sig_rx[rip]
	cmp	edx, eax
	jge	.L23
.L18:
	mov	eax, 0
.L16:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"1172178.c"
	.text
	.comm	n_sig_rx,4,4
	.comm	ign_after,4,4
	.global	__aeabi_idivmod
	.align	2
	.global	rnd
	.syntax unified
	.arm
	.fpu softvfp
	.type	rnd, %function
rnd:
	@ 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]
	bl	random
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r1, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	rnd, .-rnd
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\011%s\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	parent_proc
	.syntax unified
	.arm
	.fpu softvfp
	.type	parent_proc, %function
parent_proc:
	@ args = 0, pretend = 0, frame = 4120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #4096
	sub	sp, sp, #24
	sub	r3, fp, #4096
	sub	r3, r3, #4
	str	r0, [r3, #-20]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	mov	r3, #1
	str	r3, [r2, #-12]
.L7:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r2, [r2, #-20]
	ldr	r1, .L9+4
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r0, [r3, #-20]
	bl	rewind
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	mov	r3, #1
	str	r3, [r2, #-12]
	b	.L7
.L4:
	ldr	r3, .L9+8
	ldr	r3, [r3]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L6
	sub	r3, fp, #4096
	sub	r3, r3, #4
	sub	r3, r3, #8
	sub	r2, fp, #4096
	sub	r2, r2, #4
	mov	r1, r2
	mov	r2, r3
	ldr	r1, [r1, #-12]
	ldr	r0, .L9+12
	bl	printf
.L6:
	sub	r3, fp, #4096
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #4
	ldr	r3, [r3, #-12]
	add	r3, r3, #1
	str	r3, [r2, #-12]
	b	.L7
.L10:
	.align	2
.L9:
	.word	.LC1
	.word	4097
	.word	n_sig_rx
	.word	.LC0
	.size	parent_proc, .-parent_proc
	.section	.rodata
	.align	2
.LC2:
	.ascii	"received %d signals (of which 5 have been ignored)\012"
	.ascii	"\000"
	.text
	.align	2
	.global	sigusr1_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr1_handler, %function
sigusr1_handler:
	@ 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	r3, .L15
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15
	str	r3, [r2]
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L12
	mov	r1, #1
	mov	r0, #10
	bl	signal
	b	.L14
.L12:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L14
	ldr	r3, .L15
	ldr	r3, [r3]
	add	r3, r3, #5
	mov	r1, r3
	ldr	r0, .L15+8
	bl	printf
	mov	r0, #0
	bl	exit
.L14:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	n_sig_rx
	.word	ign_after
	.word	.LC2
	.size	sigusr1_handler, .-sigusr1_handler
	.align	2
	.global	sigusr2_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigusr2_handler, %function
sigusr2_handler:
	@ 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	r1, .L18
	mov	r0, #10
	bl	signal
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	sigusr1_handler
	.size	sigusr2_handler, .-sigusr2_handler
	.section	.rodata
	.align	2
.LC3:
	.ascii	"USAGE: %s [file]\012\000"
	.align	2
.LC4:
	.ascii	"couldn't generate a child process\000"
	.align	2
.LC5:
	.ascii	"r\000"
	.align	2
.LC6:
	.ascii	"couldn't open the file '%s'\012\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	r3, [fp, #-24]
	cmp	r3, #2
	beq	.L21
	ldr	r3, .L30
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L30+4
	bl	fprintf
	mov	r3, #1
	b	.L22
.L21:
	ldr	r3, .L30+8
	mov	r2, #0
	str	r2, [r3]
	mov	r0, #0
	bl	time
	mov	r4, r0
	bl	getpid
	mov	r3, r0
	add	r3, r4, r3
	mov	r0, r3
	bl	srandom
	mov	r1, #20
	mov	r0, #10
	bl	rnd
	mov	r3, r0
	ldr	r2, .L30+12
	str	r3, [r2]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L23
	ldr	r0, .L30+16
	bl	perror
	b	.L24
.L23:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L25
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L30+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L26
	ldr	r3, .L30
	ldr	r0, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L30+24
	bl	fprintf
	mov	r1, #15
	ldr	r0, [fp, #-20]
	bl	kill
	mov	r0, #2
	bl	exit
.L26:
	ldr	r1, .L30+28
	mov	r0, #10
	bl	signal
	ldr	r1, .L30+32
	mov	r0, #12
	bl	signal
	ldr	r0, [fp, #-16]
	bl	parent_proc
	b	.L24
.L25:
	ldr	r3, .L30+8
	mov	r2, #0
	str	r2, [r3]
	b	.L27
.L29:
	mov	r1, #10
	mov	r0, #1
	bl	rnd
	mov	r3, r0
	mov	r0, r3
	bl	sleep
	bl	getppid
	mov	r3, r0
	mov	r1, #10
	mov	r0, r3
	bl	kill
	ldr	r3, .L30+12
	ldr	r3, [r3]
	add	r2, r3, #4
	ldr	r3, .L30+8
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L28
	bl	getppid
	mov	r3, r0
	mov	r1, #12
	mov	r0, r3
	bl	kill
.L28:
	ldr	r3, .L30+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L30+8
	str	r3, [r2]
.L27:
	ldr	r3, .L30+12
	ldr	r3, [r3]
	add	r2, r3, #5
	ldr	r3, .L30+8
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L29
.L24:
	mov	r3, #0
.L22:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L31:
	.align	2
.L30:
	.word	stderr
	.word	.LC3
	.word	n_sig_rx
	.word	ign_after
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	sigusr1_handler
	.word	sigusr2_handler
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
