	.file	"931336.c"
	.intel_syntax noprefix
	.text
	.globl	Len
	.bss
	.align 4
	.type	Len, @object
	.size	Len, 4
Len:
	.zero	4
	.globl	Siz
	.align 4
	.type	Siz, @object
	.size	Siz, 4
Siz:
	.zero	4
	.globl	Line
	.align 8
	.type	Line, @object
	.size	Line, 8
Line:
	.zero	8
	.globl	Data
	.align 8
	.type	Data, @object
	.size	Data, 8
Data:
	.zero	8
	.section	.rodata
.LC0:
	.string	"balance: %s\n"
	.text
	.type	giveup, @function
giveup:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	giveup, .-giveup
	.section	.rodata
.LC1:
	.string	"No memory"
	.text
	.type	getLine, @function
getLine:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -16[rbp], 0
	jmp	.L3
.L6:
	cmp	DWORD PTR -12[rbp], -1
	jne	.L4
	mov	eax, 0
	jmp	.L5
.L4:
	mov	rdx, QWORD PTR Line[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	add	rax, rdx
	mov	edx, DWORD PTR -12[rbp]
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -16[rbp], 1
	mov	eax, DWORD PTR Len[rip]
	cmp	DWORD PTR -16[rbp], eax
	jne	.L3
	mov	eax, DWORD PTR Len[rip]
	add	eax, eax
	mov	DWORD PTR Len[rip], eax
	mov	eax, DWORD PTR Len[rip]
	movsx	rdx, eax
	mov	rax, QWORD PTR Line[rip]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR Line[rip], rax
	mov	rax, QWORD PTR Line[rip]
	test	rax, rax
	jne	.L3
	lea	rdi, .LC1[rip]
	call	giveup
.L3:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	getc_unlocked@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 10
	jne	.L6
	mov	rdx, QWORD PTR Line[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR Line[rip]
	mov	rdi, rax
	call	strdup@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L7
	lea	rdi, .LC1[rip]
	call	giveup
.L7:
	mov	rax, QWORD PTR -8[rbp]
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	getLine, .-getLine
	.type	balance, @function
balance:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	cmp	DWORD PTR -28[rbp], 0
	je	.L10
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 1
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	puts@PLT
	mov	eax, DWORD PTR -12[rbp]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	balance
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -12[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	add	rdx, 8
	mov	esi, eax
	mov	rdi, rdx
	call	balance
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	balance, .-balance
	.section	.rodata
.LC2:
	.string	"Pipe error\n"
.LC3:
	.string	"Fork error\n"
.LC4:
	.string	"r"
.LC5:
	.string	"Pipe open error\n"
.LC6:
	.string	"File open error\n"
.LC7:
	.string	"Pipe close error\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -36[rbp], 0
	mov	rax, QWORD PTR stdin[rip]
	mov	QWORD PTR -32[rbp], rax
	cmp	DWORD PTR -52[rbp], 1
	jle	.L12
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L13
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	pipe@PLT
	test	eax, eax
	jns	.L14
	lea	rdi, .LC2[rip]
	call	giveup
.L14:
	call	fork@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L15
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 1
	je	.L16
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1
	mov	edi, eax
	call	dup2@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
.L16:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	mov	rsi, rdx
	mov	rdi, rax
	call	execvp@PLT
.L15:
	cmp	DWORD PTR -36[rbp], 0
	jns	.L17
	lea	rdi, .LC3[rip]
	call	giveup
.L17:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -16[rbp]
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L12
	lea	rdi, .LC5[rip]
	call	giveup
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L12
	lea	rdi, .LC6[rip]
	call	giveup
.L12:
	mov	DWORD PTR Len[rip], 4096
	mov	edi, 4096
	call	malloc@PLT
	mov	QWORD PTR Line[rip], rax
	mov	DWORD PTR Siz[rip], 4096
	mov	edi, 32768
	call	malloc@PLT
	mov	QWORD PTR Data[rip], rax
	mov	DWORD PTR -40[rbp], 0
	jmp	.L19
.L21:
	mov	eax, DWORD PTR Siz[rip]
	cmp	DWORD PTR -40[rbp], eax
	jne	.L20
	mov	eax, DWORD PTR Siz[rip]
	add	eax, eax
	mov	DWORD PTR Siz[rip], eax
	mov	eax, DWORD PTR Siz[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR Data[rip]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR Data[rip], rax
	mov	rax, QWORD PTR Data[rip]
	test	rax, rax
	jne	.L20
	lea	rdi, .LC1[rip]
	call	giveup
.L20:
	mov	rdx, QWORD PTR Data[rip]
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	sal	rax, 3
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -40[rbp], 1
.L19:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	getLine
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L21
	cmp	DWORD PTR -36[rbp], 0
	je	.L22
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L23
.L24:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L23
	lea	rdi, .LC7[rip]
	call	giveup
.L23:
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	test	eax, eax
	js	.L24
.L22:
	mov	rax, QWORD PTR Data[rip]
	mov	edx, DWORD PTR -40[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	balance
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"931336.c"
	.text
	.comm	Len,4,4
	.comm	Siz,4,4
	.comm	Line,4,4
	.comm	Data,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"balance: %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	giveup, %function
giveup:
	@ 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, .L2
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L2+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.size	giveup, .-giveup
	.section	.rodata
	.align	2
.LC1:
	.ascii	"No memory\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	getLine, %function
getLine:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L5
.L8:
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L6
	mov	r3, #0
	b	.L7
.L6:
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, .L10+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L5
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, .L10+4
	ldr	r3, [r3]
	lsl	r3, r3, #1
	ldr	r1, .L10+4
	str	r3, [r1]
	ldr	r3, .L10+4
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	realloc
	mov	r3, r0
	ldr	r2, .L10
	str	r3, [r2]
	ldr	r3, .L10
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L10+8
	bl	giveup
.L5:
	ldr	r0, [fp, #-24]
	bl	getc_unlocked
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #10
	bne	.L8
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L10
	ldr	r3, [r3]
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L10+8
	bl	giveup
.L9:
	ldr	r3, [fp, #-8]
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	Line
	.word	Len
	.word	.LC1
	.size	getLine, .-getLine
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	balance, %function
balance:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L14
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	balance
	ldr	r3, [fp, #-8]
	add	r0, r3, #4
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	mov	r1, r3
	bl	balance
.L14:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	balance, .-balance
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Pipe error\012\000"
	.align	2
.LC3:
	.ascii	"Fork error\012\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.ascii	"Pipe open error\012\000"
	.align	2
.LC6:
	.ascii	"File open error\012\000"
	.align	2
.LC7:
	.ascii	"Pipe close error\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, .L31+4
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	ble	.L16
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L17
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L31+8
	bl	giveup
.L18:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L19
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	beq	.L20
	ldr	r3, [fp, #-12]
	mov	r1, #1
	mov	r0, r3
	bl	dup2
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
.L20:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	execvp
.L19:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L21
	ldr	r0, .L31+12
	bl	giveup
.L21:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-16]
	ldr	r1, .L31+16
	mov	r0, r3
	bl	fdopen
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L31+20
	bl	giveup
	b	.L16
.L17:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L31+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L16
	ldr	r0, .L31+24
	bl	giveup
.L16:
	ldr	r3, .L31+28
	mov	r2, #4096
	str	r2, [r3]
	mov	r0, #4096
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L31+32
	str	r2, [r3]
	ldr	r3, .L31+36
	mov	r2, #4096
	str	r2, [r3]
	mov	r0, #16384
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L31+40
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L23
.L25:
	ldr	r3, .L31+36
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bne	.L24
	ldr	r3, .L31+40
	ldr	r2, [r3]
	ldr	r3, .L31+36
	ldr	r3, [r3]
	lsl	r3, r3, #1
	ldr	r1, .L31+36
	str	r3, [r1]
	ldr	r3, .L31+36
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r1, r3
	mov	r0, r2
	bl	realloc
	mov	r3, r0
	ldr	r2, .L31+40
	str	r3, [r2]
	ldr	r3, .L31+40
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L24
	ldr	r0, .L31+44
	bl	giveup
.L24:
	ldr	r3, .L31+40
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L23:
	ldr	r0, [fp, #-24]
	bl	getLine
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L25
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L26
	ldr	r0, [fp, #-24]
	bl	fclose
	b	.L27
.L28:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L27
	ldr	r0, .L31+48
	bl	giveup
.L27:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	blt	.L28
.L26:
	ldr	r3, .L31+40
	ldr	r3, [r3]
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	balance
	mov	r3, #0
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L30
	bl	__stack_chk_fail
.L30:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC8
	.word	stdin
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	Len
	.word	Line
	.word	Siz
	.word	Data
	.word	.LC1
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
