	.file	"15763194.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"PID %ld: caught signal %2d (%s)\n"
	.text
	.type	handler, @function
handler:
.LFB6:
	.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, 24
	.cfi_offset 3, -24
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	strsignal@PLT
	mov	rbx, rax
	call	getpid@PLT
	cdqe
	mov	edx, DWORD PTR -20[rbp]
	mov	rcx, rbx
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	handler, .-handler
	.section	.rodata
.LC1:
	.string	"--help"
	.align 8
.LC2:
	.string	"%s {d|s}... [> sig.log 2>&1 ]\n"
	.align 8
.LC3:
	.string	"PID of parent process is :\t%ld\n"
	.align 8
.LC4:
	.string	"Foreground process group ID is: %ld\n"
.LC5:
	.string	"fork"
.LC6:
	.string	"setpgid"
.LC7:
	.string	"sigaction"
.LC8:
	.string	"PID=%ld, PPID=%ld\n"
	.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
	push	rbx
	sub	rsp, 200
	.cfi_offset 3, -24
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	cmp	DWORD PTR -196[rbp], 1
	jle	.L3
	mov	rax, QWORD PTR -208[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L4
.L3:
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L4:
	call	getpid@PLT
	mov	DWORD PTR -184[rbp], eax
	mov	eax, DWORD PTR -184[rbp]
	cdqe
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	tcgetpgrp@PLT
	cdqe
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -188[rbp], 1
	jmp	.L5
.L11:
	call	fork@PLT
	mov	DWORD PTR -180[rbp], eax
	cmp	DWORD PTR -180[rbp], -1
	jne	.L6
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	cmp	DWORD PTR -180[rbp], 0
	jne	.L7
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -208[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 100
	jne	.L8
	mov	esi, 0
	mov	edi, 0
	call	setpgid@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	lea	rax, -176[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -40[rbp], 0
	lea	rax, handler[rip]
	mov	QWORD PTR -176[rbp], rax
	lea	rax, -176[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 1
	call	sigaction@PLT
	cmp	eax, -1
	jne	.L14
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	add	DWORD PTR -188[rbp], 1
.L5:
	mov	eax, DWORD PTR -188[rbp]
	cmp	eax, DWORD PTR -196[rbp]
	jl	.L11
	jmp	.L10
.L14:
	nop
.L10:
	mov	edi, 60
	call	alarm@PLT
	call	getppid@PLT
	movsx	rbx, eax
	call	getpid@PLT
	cdqe
	mov	rdx, rbx
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
.L12:
	call	pause@PLT
	jmp	.L12
	.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	"15763194.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"PID %ld: caught signal %2d (%s)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler, %function
handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	str	r0, [fp, #-16]
	bl	getpid
	mov	r4, r0
	ldr	r0, [fp, #-16]
	bl	strsignal
	mov	r3, r0
	ldr	r2, [fp, #-16]
	mov	r1, r4
	ldr	r0, .L2
	bl	printf
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	handler, .-handler
	.section	.rodata
	.align	2
.LC1:
	.ascii	"--help\000"
	.align	2
.LC2:
	.ascii	"%s {d|s}... [> sig.log 2>&1 ]\012\000"
	.align	2
.LC3:
	.ascii	"PID of parent process is :\011%ld\012\000"
	.align	2
.LC4:
	.ascii	"Foreground process group ID is: %ld\012\000"
	.align	2
.LC5:
	.ascii	"fork\000"
	.align	2
.LC6:
	.ascii	"setpgid\000"
	.align	2
.LC7:
	.ascii	"sigaction\000"
	.align	2
.LC8:
	.ascii	"PID=%ld, PPID=%ld\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #172
	str	r0, [fp, #-176]
	str	r1, [fp, #-180]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L17+4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
	ldr	r3, [fp, #-176]
	cmp	r3, #1
	ble	.L5
	ldr	r3, [fp, #-180]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L17+8
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
.L5:
	ldr	r3, [fp, #-180]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L17+12
	bl	printf
	mov	r0, #0
	bl	exit
.L6:
	bl	getpid
	str	r0, [fp, #-164]
	ldr	r1, [fp, #-164]
	ldr	r0, .L17+16
	bl	printf
	mov	r0, #0
	bl	tcgetpgrp
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L17+20
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-168]
	b	.L7
.L13:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-160]
	ldr	r3, [fp, #-160]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L17+24
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-160]
	cmp	r3, #0
	bne	.L9
	ldr	r3, [fp, #-168]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-180]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #100
	bne	.L10
	mov	r1, #0
	mov	r0, #0
	bl	setpgid
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L17+28
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	sub	r3, fp, #156
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, .L17+32
	str	r3, [fp, #-156]
	sub	r3, fp, #156
	mov	r2, #0
	mov	r1, r3
	mov	r0, #1
	bl	sigaction
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L17+36
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-168]
	add	r3, r3, #1
	str	r3, [fp, #-168]
.L7:
	ldr	r2, [fp, #-168]
	ldr	r3, [fp, #-176]
	cmp	r2, r3
	blt	.L13
	b	.L12
.L16:
	nop
.L12:
	mov	r0, #60
	bl	alarm
	bl	getpid
	mov	r4, r0
	bl	getppid
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L17+40
	bl	printf
.L14:
	bl	pause
	b	.L14
.L18:
	.align	2
.L17:
	.word	.LC9
	.word	stdout
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	handler
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
