	.file	"45061.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s string\n"
.LC1:
	.string	"pipe"
.LC2:
	.string	"fork"
.LC3:
	.string	"close - parent"
.LC4:
	.string	"\n"
.LC5:
	.string	"close"
.LC6:
	.string	"write - partial/failed write"
	.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
	push	rbx
	sub	rsp, 184
	.cfi_offset 3, -24
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -180[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -192[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -168[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	call	fork@PLT
	cmp	eax, -1
	je	.L4
	test	eax, eax
	je	.L5
	jmp	.L13
.L4:
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	edi, 3
	call	sleep@PLT
	mov	eax, DWORD PTR -168[rbp]
	lea	rcx, -160[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -176[rbp], rax
	mov	rdx, QWORD PTR -176[rbp]
	lea	rax, -160[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	mov	edx, 1
	lea	rsi, .LC4[rip]
	mov	edi, 1
	call	write@PLT
	mov	eax, DWORD PTR -168[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	edi, 0
	call	_exit@PLT
.L13:
	mov	eax, DWORD PTR -168[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -164[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	rbx, rax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	je	.L10
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L11
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	edi, 0
	call	wait@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.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	"45061.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s string\012\000"
	.align	2
.LC1:
	.ascii	"pipe\000"
	.align	2
.LC2:
	.ascii	"fork\000"
	.align	2
.LC3:
	.ascii	"close - parent\000"
	.align	2
.LC4:
	.ascii	"\012\000"
	.align	2
.LC5:
	.ascii	"close\000"
	.align	2
.LC6:
	.ascii	"write - partial/failed write\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 = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #152
	str	r0, [fp, #-160]
	str	r1, [fp, #-164]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-160]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L14+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-164]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L14+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #152
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L14+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	bl	fork
	mov	r3, r0
	cmn	r3, #1
	beq	.L4
	cmp	r3, #0
	beq	.L5
	b	.L13
.L4:
	ldr	r0, .L14+16
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, [fp, #-148]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L14+20
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	mov	r0, #3
	bl	sleep
	ldr	r3, [fp, #-152]
	sub	r1, fp, #144
	mov	r2, #128
	mov	r0, r3
	bl	read
	str	r0, [fp, #-156]
	ldr	r2, [fp, #-156]
	sub	r3, fp, #144
	mov	r1, r3
	mov	r0, #1
	bl	write
	mov	r2, #1
	ldr	r1, .L14+24
	mov	r0, #1
	bl	write
	ldr	r3, [fp, #-152]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L14+28
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	mov	r0, #0
	bl	_exit
.L13:
	ldr	r3, [fp, #-152]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L14+20
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r4, [fp, #-148]
	ldr	r3, [fp, #-164]
	add	r3, r3, #4
	ldr	r5, [r3]
	ldr	r3, [fp, #-164]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	mov	r1, r5
	mov	r0, r4
	bl	write
	mov	r3, r0
	mov	r4, r3
	ldr	r3, [fp, #-164]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r4, r3
	beq	.L10
	ldr	r0, .L14+32
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, [fp, #-148]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L14+28
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	exit
.L15:
	.align	2
.L14:
	.word	.LC7
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
