	.file	"469929.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"pipe"
.LC1:
	.string	"fork"
	.align 8
.LC2:
	.string	"close write end of write pipe - child"
	.align 8
.LC3:
	.string	"close read end of read pipe - child"
	.align 8
.LC4:
	.string	"close read end of write pipe - parent"
	.align 8
.LC5:
	.string	"close write end of read pipe - parent"
	.align 8
.LC6:
	.string	"close write end of write pipe - parent"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -24[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	pexit
.L2:
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC0[rip]
	call	pexit
.L3:
	call	fork@PLT
	cdqe
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], -1
	je	.L4
	cmp	QWORD PTR -32[rbp], 0
	je	.L5
	jmp	.L13
.L4:
	lea	rdi, .LC1[rip]
	call	pexit
.L5:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC2[rip]
	call	pexit
.L7:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC3[rip]
	call	pexit
.L8:
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, edx
	mov	edi, eax
	call	childLoop
	mov	edi, 0
	call	_exit@PLT
.L13:
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC4[rip]
	call	pexit
.L9:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L10
	lea	rdi, .LC5[rip]
	call	pexit
.L10:
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, edx
	mov	edi, eax
	call	parentLoop
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L11
	lea	rdi, .LC6[rip]
	call	pexit
.L11:
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 0
	call	wait@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC7:
	.string	">> "
.LC8:
	.string	"parent loop - partial write"
.LC9:
	.string	"parent loop - partial read"
.LC10:
	.string	"%s\n%s"
	.text
	.type	parentLoop, @function
parentLoop:
.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, 1056
	mov	DWORD PTR -1044[rbp], edi
	mov	DWORD PTR -1048[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L15
.L19:
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	movzx	eax, BYTE PTR -1040[rbp+rax]
	cmp	al, 10
	jne	.L16
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -1040[rbp+rax], 0
.L16:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1048[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, 1024
	je	.L17
	lea	rdi, .LC8[rip]
	call	pexit
.L17:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 1024
	je	.L18
	lea	rdi, .LC9[rip]
	call	pexit
.L18:
	lea	rax, -1040[rbp]
	lea	rdx, .LC7[rip]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
.L15:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L19
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	parentLoop, .-parentLoop
	.section	.rodata
.LC11:
	.string	"child loop - write failure"
.LC12:
	.string	"child loop - read failure"
	.text
	.type	childLoop, @function
childLoop:
.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, 1080
	.cfi_offset 3, -24
	mov	DWORD PTR -1076[rbp], edi
	mov	DWORD PTR -1080[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	jmp	.L22
.L25:
	mov	DWORD PTR -1068[rbp], 0
	jmp	.L23
.L24:
	mov	eax, DWORD PTR -1068[rbp]
	movzx	eax, BYTE PTR -1056[rbp+rax]
	movsx	eax, al
	mov	edi, eax
	call	toupper@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -1068[rbp]
	mov	BYTE PTR -1056[rbp+rax], dl
	add	DWORD PTR -1068[rbp], 1
.L23:
	mov	ebx, DWORD PTR -1068[rbp]
	lea	rax, -1056[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	jb	.L24
	lea	rcx, -1056[rbp]
	mov	eax, DWORD PTR -1080[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	rax, 1024
	je	.L22
	lea	rdi, .LC11[rip]
	call	pexit
.L22:
	lea	rcx, -1056[rbp]
	mov	eax, DWORD PTR -1076[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -1064[rbp], rax
	cmp	QWORD PTR -1064[rbp], 1024
	je	.L25
	cmp	QWORD PTR -1064[rbp], -1
	jne	.L28
	lea	rdi, .LC12[rip]
	call	pexit
.L28:
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	childLoop, .-childLoop
	.type	pexit, @function
pexit:
.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	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
.LFE9:
	.size	pexit, .-pexit
	.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	"469929.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"pipe\000"
	.align	2
.LC1:
	.ascii	"fork\000"
	.align	2
.LC2:
	.ascii	"close write end of write pipe - child\000"
	.align	2
.LC3:
	.ascii	"close read end of read pipe - child\000"
	.align	2
.LC4:
	.ascii	"close read end of write pipe - parent\000"
	.align	2
.LC5:
	.ascii	"close write end of read pipe - parent\000"
	.align	2
.LC6:
	.ascii	"close write end of write pipe - parent\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L14+4
	bl	pexit
.L2:
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L14+4
	bl	pexit
.L3:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	beq	.L4
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L5
	b	.L13
.L4:
	ldr	r0, .L14+8
	bl	pexit
.L5:
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L14+12
	bl	pexit
.L7:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L14+16
	bl	pexit
.L8:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-12]
	mov	r1, r2
	mov	r0, r3
	bl	childLoop
	mov	r0, #0
	bl	_exit
.L13:
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L14+20
	bl	pexit
.L9:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L14+24
	bl	pexit
.L10:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-20]
	mov	r1, r2
	mov	r0, r3
	bl	parentLoop
	ldr	r3, [fp, #-20]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L14+28
	bl	pexit
.L11:
	mov	r0, #10
	bl	putchar
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	exit
.L15:
	.align	2
.L14:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.section	.rodata
	.align	2
.LC8:
	.ascii	">> \000"
	.align	2
.LC9:
	.ascii	"parent loop - partial write\000"
	.align	2
.LC10:
	.ascii	"parent loop - partial read\000"
	.align	2
.LC11:
	.ascii	"%s\012%s\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	parentLoop, %function
parentLoop:
	@ args = 0, pretend = 0, frame = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	str	r0, [fp, #-1040]
	str	r1, [fp, #-1044]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L23+4
	bl	printf
	ldr	r3, .L23+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L17
.L21:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-1028]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L18
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-1028]
.L18:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1044]
	bl	write
	mov	r3, r0
	cmp	r3, #1024
	beq	.L19
	ldr	r0, .L23+12
	bl	pexit
.L19:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1040]
	bl	read
	mov	r3, r0
	cmp	r3, #1024
	beq	.L20
	ldr	r0, .L23+16
	bl	pexit
.L20:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L23+4
	mov	r1, r3
	ldr	r0, .L23+20
	bl	printf
	ldr	r3, .L23+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
.L17:
	ldr	r3, .L23+24
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L21
	nop
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC12
	.word	.LC8
	.word	stdout
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	stdin
	.size	parentLoop, .-parentLoop
	.section	.rodata
	.align	2
.LC13:
	.ascii	"child loop - write failure\000"
	.align	2
.LC14:
	.ascii	"child loop - read failure\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	childLoop, %function
childLoop:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	str	r1, [fp, #-1052]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	b	.L26
.L29:
	mov	r3, #0
	str	r3, [fp, #-1040]
	b	.L27
.L28:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-1040]
	add	r3, r3, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	toupper
	mov	r3, r0
	and	r1, r3, #255
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-1040]
	add	r3, r3, r2
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-1040]
	add	r3, r3, #1
	str	r3, [fp, #-1040]
.L27:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-1040]
	cmp	r3, r2
	bcc	.L28
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1052]
	bl	write
	mov	r3, r0
	cmp	r3, #1024
	beq	.L26
	ldr	r0, .L33+4
	bl	pexit
.L26:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1048]
	bl	read
	str	r0, [fp, #-1036]
	ldr	r3, [fp, #-1036]
	cmp	r3, #1024
	beq	.L29
	ldr	r3, [fp, #-1036]
	cmn	r3, #1
	bne	.L32
	ldr	r0, .L33+8
	bl	pexit
.L32:
	nop
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L31
	bl	__stack_chk_fail
.L31:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC15
	.word	.LC13
	.word	.LC14
	.size	childLoop, .-childLoop
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pexit, %function
pexit:
	@ 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	pexit, .-pexit
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
