	.file	"extr_tape.c_trewind.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"  DUMP: error reading command pipe in master"
	.align 8
.LC1:
	.string	"EOT detected in last 2 tape records!\n"
	.align 8
.LC2:
	.string	"Use a longer tape, decrease the size estimate\n"
	.align 8
.LC3:
	.string	"or use no size estimate at all.\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"Closing %s\n"
	.text
	.p2align 4
	.globl	trewind
	.type	trewind, @function
trewind:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR SLAVES[rip]
	test	eax, eax
	jle	.L3
	xor	ebx, ebx
	lea	r12, 4[rsp]
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	call	close@PLT
	add	rbx, 1
	cmp	DWORD PTR SLAVES[rip], ebx
	jle	.L3
.L2:
	mov	rax, QWORD PTR slaves[rip]
	mov	rbp, rbx
	sal	rbp, 4
	add	rax, rbp
	cmp	QWORD PTR 8[rax], 0
	mov	edi, DWORD PTR [rax]
	je	.L4
	mov	esi, edi
	mov	edi, DWORD PTR read[rip]
	mov	ecx, 4
	mov	rdx, r12
	call	atomic@PLT
	cmp	eax, 4
	je	.L5
	lea	rdi, .LC0[rip]
	call	perror@PLT
	xor	edi, edi
	call	dumpabort@PLT
.L5:
	mov	rax, QWORD PTR slaves[rip]
	mov	edx, DWORD PTR writesize[rip]
	add	rax, rbp
	mov	QWORD PTR 8[rax], 0
	cmp	DWORD PTR 4[rsp], edx
	jne	.L6
	mov	edi, DWORD PTR [rax]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	xor	edi, edi
	call	wait@PLT
	test	rax, rax
	jns	.L3
	cmp	QWORD PTR pipeout[rip], 0
	je	.L27
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	msg@PLT
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	msg@PLT
	lea	rdi, .LC3[rip]
	call	quit@PLT
	mov	rax, QWORD PTR slaves[rip]
	mov	edi, DWORD PTR [rax+rbp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L27:
	mov	esi, DWORD PTR tape[rip]
	xor	eax, eax
	lea	rdi, .LC4[rip]
	call	msg@PLT
	cmp	QWORD PTR popenout[rip], 0
	jne	.L29
	mov	edi, DWORD PTR tapefd[rip]
	mov	rsi, rsp
	call	fstat@PLT
	test	rax, rax
	je	.L30
.L10:
	mov	edi, DWORD PTR tapefd[rip]
	call	close@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, 10
	call	sleep@PLT
.L11:
	mov	edi, DWORD PTR tape[rip]
	xor	esi, esi
	call	open@PLT
	test	eax, eax
	js	.L12
	mov	edi, eax
	call	close@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edi, DWORD PTR [rsp]
	call	S_ISFIFO@PLT
	test	rax, rax
	je	.L10
	mov	edi, DWORD PTR tapefd[rip]
	call	close@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, QWORD PTR popenfp[rip]
	mov	DWORD PTR tapefd[rip], -1
	call	pclose@PLT
	mov	QWORD PTR popenfp[rip], 0
	jmp	.L1
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	trewind, .-trewind
	.comm	writesize,4,4
	.comm	tapefd,4,4
	.comm	tape,4,4
	.comm	slaves,8,8
	.comm	read,4,4
	.comm	popenout,8,8
	.comm	popenfp,8,8
	.comm	pipeout,8,8
	.comm	host,8,8
	.comm	SLAVES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_tape.c_trewind.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"  DUMP: error reading command pipe in master\000"
	.align	2
.LC1:
	.ascii	"EOT detected in last 2 tape records!\012\000"
	.align	2
.LC2:
	.ascii	"Use a longer tape, decrease the size estimate\012\000"
	.align	2
.LC3:
	.ascii	"or use no size estimate at all.\012\000"
	.align	2
.LC4:
	.ascii	"Closing %s\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	trewind
	.syntax unified
	.arm
	.fpu softvfp
	.type	trewind, %function
trewind:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L34
	ldr	r7, .L34+4
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L3
	mov	r4, #0
	ldr	r6, .L34+8
	ldr	r9, .L34+12
	ldr	r8, .L34+16
	ldr	fp, .L34+20
	ldr	r10, .L34+24
	b	.L2
.L4:
	bl	close
	ldr	r3, [r7]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L3
.L2:
	ldr	r3, [r6]
	lsl	r5, r4, #3
	add	r2, r3, r4, lsl #3
	ldr	r2, [r2, #4]
	ldr	r0, [r3, r4, lsl #3]
	cmp	r2, #0
	beq	.L4
	mov	r1, r0
	mov	r3, #4
	ldr	r0, [r9]
	add	r2, sp, #8
	bl	atomic
	cmp	r0, #4
	beq	.L5
	ldr	r0, .L34+28
	bl	perror
	mov	r0, #0
	bl	dumpabort
.L5:
	mov	r1, #0
	ldr	r3, [r6]
	ldr	ip, [sp, #8]
	ldr	r0, [r8]
	add	r2, r3, r5
	cmp	ip, r0
	str	r1, [r2, #4]
	beq	.L28
	mov	r0, fp
	bl	msg
	mov	r0, r10
	bl	msg
	ldr	r0, .L34+32
	bl	quit
	ldr	r3, [r6]
.L28:
	ldr	r0, [r3, r5]
	b	.L4
.L3:
	mov	r0, #0
	bl	wait
	cmp	r0, #0
	bge	.L3
	ldr	r3, .L34+36
	ldr	r5, [r3]
	cmp	r5, #0
	beq	.L30
.L1:
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L31
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L30:
	ldr	r4, .L34+40
	ldr	r0, .L34+44
	ldr	r1, [r4]
	bl	msg
	ldr	r3, .L34+48
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L32
	ldr	r5, .L34+52
	add	r1, sp, #4
	ldr	r0, [r5]
	bl	fstat
	cmp	r0, #0
	beq	.L33
.L10:
	ldr	r0, [r5]
	bl	close
	b	.L11
.L12:
	mov	r0, #10
	bl	sleep
.L11:
	mov	r1, #0
	ldr	r0, [r4]
	bl	open
	cmp	r0, #0
	blt	.L12
	bl	close
	b	.L1
.L33:
	ldr	r0, [sp, #4]
	bl	S_ISFIFO
	cmp	r0, #0
	beq	.L10
	ldr	r0, [r5]
	bl	close
	b	.L1
.L32:
	mvn	r2, #0
	ldr	r4, .L34+56
	ldr	r3, .L34+52
	ldr	r0, [r4]
	str	r2, [r3]
	bl	pclose
	str	r5, [r4]
	b	.L1
.L31:
	bl	__stack_chk_fail
.L35:
	.align	2
.L34:
	.word	.LC5
	.word	SLAVES
	.word	slaves
	.word	read
	.word	writesize
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.word	.LC3
	.word	pipeout
	.word	tape
	.word	.LC4
	.word	popenout
	.word	tapefd
	.word	popenfp
	.size	trewind, .-trewind
	.comm	writesize,4,4
	.comm	tapefd,4,4
	.comm	tape,4,4
	.comm	slaves,4,4
	.comm	read,4,4
	.comm	popenout,4,4
	.comm	popenfp,4,4
	.comm	pipeout,4,4
	.comm	host,4,4
	.comm	SLAVES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
