	.file	"922066.c"
	.intel_syntax noprefix
	.text
	.globl	readpid
	.bss
	.align 4
	.type	readpid, @object
	.size	readpid, 4
readpid:
	.zero	4
	.globl	writepid
	.align 4
	.type	writepid, @object
	.size	writepid, 4
writepid:
	.zero	4
	.globl	shellpid
	.align 4
	.type	shellpid, @object
	.size	shellpid, 4
shellpid:
	.zero	4
	.text
	.globl	sigforward
	.type	sigforward, @function
sigforward:
.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	eax, DWORD PTR shellpid[rip]
	test	eax, eax
	je	.L3
	mov	eax, DWORD PTR shellpid[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	kill@PLT
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	sigforward, .-sigforward
	.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, 1104
	mov	DWORD PTR -1076[rbp], edi
	mov	QWORD PTR -1088[rbp], rsi
	mov	QWORD PTR -1096[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1072[rbp]
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	forkpty@PLT
	mov	DWORD PTR shellpid[rip], eax
	mov	eax, DWORD PTR shellpid[rip]
	test	eax, eax
	jne	.L5
	mov	rax, QWORD PTR -1088[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -1088[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
.L5:
	call	fork@PLT
	mov	DWORD PTR readpid[rip], eax
	mov	eax, DWORD PTR readpid[rip]
	test	eax, eax
	jne	.L6
	mov	QWORD PTR -1064[rbp], 1
	mov	QWORD PTR -1056[rbp], 1
	jmp	.L7
.L10:
	lea	rax, -1040[rbp]
	mov	edx, 1024
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	QWORD PTR -1064[rbp], rax
	cmp	QWORD PTR -1064[rbp], 0
	jle	.L8
	mov	rdx, QWORD PTR -1064[rbp]
	mov	eax, DWORD PTR -1072[rbp]
	lea	rcx, -1040[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -1056[rbp], rax
	jmp	.L7
.L8:
	mov	BYTE PTR -1040[rbp], 4
	mov	eax, DWORD PTR -1072[rbp]
	lea	rcx, -1040[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -1056[rbp], rax
.L7:
	cmp	QWORD PTR -1064[rbp], 0
	jle	.L9
	cmp	QWORD PTR -1056[rbp], 0
	jg	.L10
.L9:
	mov	edi, 0
	call	close@PLT
	mov	eax, DWORD PTR -1072[rbp]
	mov	edi, eax
	call	close@PLT
.L11:
	mov	edi, 1024
	call	sleep@PLT
	jmp	.L11
.L6:
	call	fork@PLT
	mov	DWORD PTR writepid[rip], eax
	mov	eax, DWORD PTR writepid[rip]
	test	eax, eax
	jne	.L12
	mov	QWORD PTR -1048[rbp], 1
	mov	QWORD PTR -1056[rbp], 1
	jmp	.L13
.L19:
	mov	eax, DWORD PTR -1072[rbp]
	lea	rcx, -1040[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -1048[rbp], rax
	cmp	QWORD PTR -1048[rbp], 0
	jle	.L14
.L15:
	mov	rdx, QWORD PTR -1048[rbp]
	lea	rax, -1040[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	mov	QWORD PTR -1056[rbp], rax
	cmp	QWORD PTR -1056[rbp], -1
	jne	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L15
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L15
	jmp	.L13
.L14:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	je	.L16
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 11
	jne	.L17
.L16:
	mov	QWORD PTR -1048[rbp], 0
.L17:
	mov	QWORD PTR -1056[rbp], 1
.L13:
	cmp	QWORD PTR -1048[rbp], 0
	js	.L18
	cmp	QWORD PTR -1056[rbp], 0
	jg	.L19
.L18:
	mov	eax, DWORD PTR -1072[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 1
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L12:
	lea	rsi, sigforward[rip]
	mov	edi, 15
	call	signal@PLT
	lea	rsi, sigforward[rip]
	mov	edi, 2
	call	signal@PLT
	lea	rsi, sigforward[rip]
	mov	edi, 3
	call	signal@PLT
	lea	rsi, sigforward[rip]
	mov	edi, 1
	call	signal@PLT
	lea	rsi, sigforward[rip]
	mov	edi, 13
	call	signal@PLT
	mov	eax, DWORD PTR shellpid[rip]
	lea	rcx, -1068[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	mov	eax, DWORD PTR readpid[rip]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	mov	eax, DWORD PTR readpid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	mov	eax, DWORD PTR writepid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	mov	eax, DWORD PTR -1068[rbp]
	sar	eax, 8
	movzx	eax, al
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	"922066.c"
	.text
	.global	readpid
	.bss
	.align	2
	.type	readpid, %object
	.size	readpid, 4
readpid:
	.space	4
	.global	writepid
	.align	2
	.type	writepid, %object
	.size	writepid, 4
writepid:
	.space	4
	.global	shellpid
	.align	2
	.type	shellpid, %object
	.size	shellpid, 4
shellpid:
	.space	4
	.text
	.align	2
	.global	sigforward
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigforward, %function
sigforward:
	@ 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, .L4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L4
	ldr	r3, [r3]
	ldr	r1, [fp, #-8]
	mov	r0, r3
	bl	kill
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	shellpid
	.size	sigforward, .-sigforward
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1072
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1072
	str	r0, [fp, #-1064]
	str	r1, [fp, #-1068]
	str	r2, [fp, #-1072]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #1040
	sub	r0, r0, #4
	sub	r0, r0, #12
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	bl	forkpty
	mov	r3, r0
	ldr	r2, .L24+4
	str	r3, [r2]
	ldr	r3, .L24+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-1068]
	add	r3, r3, #4
	ldr	r2, [r3]
	ldr	r3, [fp, #-1068]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	execvp
.L7:
	bl	fork
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L24+8
	str	r2, [r3]
	ldr	r3, .L24+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L8
	mov	r3, #1
	str	r3, [fp, #-1048]
	mov	r3, #1
	str	r3, [fp, #-1044]
	b	.L9
.L12:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1024
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-1048]
	ldr	r3, [fp, #-1048]
	cmp	r3, #0
	ble	.L10
	ldr	r0, [fp, #-1056]
	ldr	r2, [fp, #-1048]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r3
	bl	write
	str	r0, [fp, #-1044]
	b	.L9
.L10:
	mov	r3, #4
	strb	r3, [fp, #-1036]
	ldr	r0, [fp, #-1056]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1
	mov	r1, r3
	bl	write
	str	r0, [fp, #-1044]
.L9:
	ldr	r3, [fp, #-1048]
	cmp	r3, #0
	ble	.L11
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bgt	.L12
.L11:
	mov	r0, #0
	bl	close
	ldr	r3, [fp, #-1056]
	mov	r0, r3
	bl	close
.L13:
	mov	r0, #1024
	bl	sleep
	b	.L13
.L8:
	bl	fork
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L24+12
	str	r2, [r3]
	ldr	r3, .L24+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L14
	mov	r3, #1
	str	r3, [fp, #-1040]
	mov	r3, #1
	str	r3, [fp, #-1044]
	b	.L15
.L21:
	ldr	r0, [fp, #-1056]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1024
	mov	r1, r3
	bl	read
	str	r0, [fp, #-1040]
	ldr	r3, [fp, #-1040]
	cmp	r3, #0
	ble	.L16
.L17:
	ldr	r2, [fp, #-1040]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r3
	mov	r0, #1
	bl	write
	str	r0, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	bne	.L15
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L17
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L17
	b	.L15
.L16:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	beq	.L18
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #11
	bne	.L19
.L18:
	mov	r3, #0
	str	r3, [fp, #-1040]
.L19:
	mov	r3, #1
	str	r3, [fp, #-1044]
.L15:
	ldr	r3, [fp, #-1040]
	cmp	r3, #0
	blt	.L20
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bgt	.L21
.L20:
	ldr	r3, [fp, #-1056]
	mov	r0, r3
	bl	close
	mov	r0, #1
	bl	close
	mov	r0, #0
	bl	exit
.L14:
	ldr	r1, .L24+16
	mov	r0, #15
	bl	signal
	ldr	r1, .L24+16
	mov	r0, #2
	bl	signal
	ldr	r1, .L24+16
	mov	r0, #3
	bl	signal
	ldr	r1, .L24+16
	mov	r0, #1
	bl	signal
	ldr	r1, .L24+16
	mov	r0, #13
	bl	signal
	ldr	r3, .L24+4
	ldr	r0, [r3]
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #0
	mov	r1, r3
	bl	waitpid
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r1, #15
	mov	r0, r3
	bl	kill
	ldr	r3, .L24+8
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, .L24+12
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-1052]
	asr	r3, r3, #8
	and	r3, r3, #255
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC0
	.word	shellpid
	.word	readpid
	.word	writepid
	.word	sigforward
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
