	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trewind                        ## -- Begin function trewind
	.p2align	4, 0x90
_trewind:                               ## @trewind
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SLAVES@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jle	LBB0_8
## %bb.1:
	movq	_slaves@GOTPCREL(%rip), %r14
	movq	_writesize@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax,%r15), %edi
	callq	_close
	incq	%r13
	movslq	(%rbx), %rax
	addq	$16, %r15
	cmpq	%rax, %r13
	jge	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	cmpq	$0, 8(%rax,%r15)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax,%r15), %esi
	leaq	-52(%rbp), %rdx
	movl	$4, %ecx
	callq	_atomic
	cmpl	$4, %eax
	jne	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rax
	movq	$0, 8(%rax,%r15)
	movl	-52(%rbp), %ecx
	cmpl	(%r12), %ecx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_msg
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_msg
	leaq	L_.str.3(%rip), %rdi
	callq	_quit
	movq	(%r14), %rax
	jmp	LBB0_7
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	callq	_trewind.cold.1
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	callq	_wait
	testq	%rax, %rax
	jns	LBB0_8
## %bb.9:
	movq	_pipeout@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.10:
	movq	_tape@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_msg
	movq	_popenout@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_tapefd@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	movq	_popenfp@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_pclose
	movq	$0, (%rbx)
	jmp	LBB0_20
LBB0_12:
	movq	_tapefd@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	-48(%rbp), %rsi
	callq	_fstat
	testq	%rax, %rax
	je	LBB0_13
LBB0_15:
	movl	(%r14), %edi
	callq	_close
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_open
	testl	%eax, %eax
	jns	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	$10, %edi
	callq	_sleep
	jmp	LBB0_17
LBB0_18:
	movl	%eax, %edi
	jmp	LBB0_19
LBB0_13:
	movl	-48(%rbp), %edi
	callq	_S_ISFIFO
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	(%r14), %edi
LBB0_19:
	callq	_close
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function trewind.cold.1
_trewind.cold.1:                        ## @trewind.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	callq	_perror
	xorl	%edi, %edi
	callq	_dumpabort
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SLAVES,4,2                     ## @SLAVES
	.comm	_slaves,8,3                     ## @slaves
	.comm	_read,4,2                       ## @read
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  DUMP: error reading command pipe in master"

	.comm	_writesize,4,2                  ## @writesize
L_.str.1:                               ## @.str.1
	.asciz	"EOT detected in last 2 tape records!\n"

L_.str.2:                               ## @.str.2
	.asciz	"Use a longer tape, decrease the size estimate\n"

L_.str.3:                               ## @.str.3
	.asciz	"or use no size estimate at all.\n"

	.comm	_pipeout,8,3                    ## @pipeout
L_.str.4:                               ## @.str.4
	.asciz	"Closing %s\n"

	.comm	_tape,4,2                       ## @tape
	.comm	_popenout,8,3                   ## @popenout
	.comm	_tapefd,4,2                     ## @tapefd
	.comm	_popenfp,8,3                    ## @popenfp
	.comm	_host,8,3                       ## @host
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trewind                        ; -- Begin function trewind
	.p2align	2
_trewind:                               ; @trewind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x22, _SLAVES@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SLAVES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x23, #0
	mov	x24, #0
Lloh2:
	adrp	x25, _slaves@GOTPAGE
Lloh3:
	ldr	x25, [x25, _slaves@GOTPAGEOFF]
Lloh4:
	adrp	x26, _read@GOTPAGE
Lloh5:
	ldr	x26, [x26, _read@GOTPAGEOFF]
Lloh6:
	adrp	x27, _writesize@GOTPAGE
Lloh7:
	ldr	x27, [x27, _writesize@GOTPAGEOFF]
Lloh8:
	adrp	x19, l_.str.1@PAGE
Lloh9:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh10:
	adrp	x20, l_.str.2@PAGE
Lloh11:
	add	x20, x20, l_.str.2@PAGEOFF
Lloh12:
	adrp	x21, l_.str.3@PAGE
Lloh13:
	add	x21, x21, l_.str.3@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x8, x23]
	bl	_close
	add	x24, x24, #1
	ldrsw	x8, [x22]
	add	x23, x23, #16
	cmp	x24, x8
	b.ge	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	add	x9, x8, x23
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x26]
	ldr	w1, [x8, x23]
	add	x2, sp, #20
	mov	w3, #4
	bl	_atomic
	cmp	w0, #4
	b.ne	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25]
	add	x9, x8, x23
	str	xzr, [x9, #8]
	ldr	w9, [sp, #20]
	ldr	w10, [x27]
	cmp	w9, w10
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_msg
	mov	x0, x20
	bl	_msg
	mov	x0, x21
	bl	_quit
	ldr	x8, [x25]
	b	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_trewind.cold.1
	b	LBB0_5
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, #0
	bl	_wait
	tbz	x0, #63, LBB0_8
; %bb.9:
Lloh14:
	adrp	x8, _pipeout@GOTPAGE
Lloh15:
	ldr	x8, [x8, _pipeout@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbnz	x8, LBB0_19
; %bb.10:
Lloh17:
	adrp	x19, _tape@GOTPAGE
Lloh18:
	ldr	x19, [x19, _tape@GOTPAGEOFF]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_msg
Lloh21:
	adrp	x8, _popenout@GOTPAGE
Lloh22:
	ldr	x8, [x8, _popenout@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_12
; %bb.11:
Lloh24:
	adrp	x8, _tapefd@GOTPAGE
Lloh25:
	ldr	x8, [x8, _tapefd@GOTPAGEOFF]
	mov	w9, #-1
Lloh26:
	str	w9, [x8]
Lloh27:
	adrp	x19, _popenfp@GOTPAGE
Lloh28:
	ldr	x19, [x19, _popenfp@GOTPAGEOFF]
	ldr	x0, [x19]
	bl	_pclose
	str	xzr, [x19]
	b	LBB0_19
LBB0_12:
Lloh29:
	adrp	x20, _tapefd@GOTPAGE
Lloh30:
	ldr	x20, [x20, _tapefd@GOTPAGEOFF]
	ldr	w0, [x20]
	add	x1, sp, #24
	bl	_fstat
	cbz	x0, LBB0_16
LBB0_13:
	ldr	w0, [x20]
	bl	_close
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	mov	w1, #0
	bl	_open
	tbz	w0, #31, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w0, #10
	bl	_sleep
	b	LBB0_14
LBB0_16:
	ldr	w0, [sp, #24]
	bl	_S_ISFIFO
	cbz	x0, LBB0_13
; %bb.17:
	ldr	w0, [x20]
LBB0_18:
	bl	_close
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function trewind.cold.1
_trewind.cold.1:                        ; @trewind.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w0, #0
	bl	_dumpabort
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_SLAVES,4,2                     ; @SLAVES
	.comm	_slaves,8,3                     ; @slaves
	.comm	_read,4,2                       ; @read
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  DUMP: error reading command pipe in master"

	.comm	_writesize,4,2                  ; @writesize
l_.str.1:                               ; @.str.1
	.asciz	"EOT detected in last 2 tape records!\n"

l_.str.2:                               ; @.str.2
	.asciz	"Use a longer tape, decrease the size estimate\n"

l_.str.3:                               ; @.str.3
	.asciz	"or use no size estimate at all.\n"

	.comm	_pipeout,8,3                    ; @pipeout
l_.str.4:                               ; @.str.4
	.asciz	"Closing %s\n"

	.comm	_tape,4,2                       ; @tape
	.comm	_popenout,8,3                   ; @popenout
	.comm	_tapefd,4,2                     ; @tapefd
	.comm	_popenfp,8,3                    ; @popenfp
	.comm	_host,8,3                       ; @host
.subsections_via_symbols
