	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function t3000_sync
_t3000_sync:                            ## @t3000_sync
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXRETRY@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_8
## %bb.1:
	xorl	%r12d, %r12d
	movq	_FD@GOTPCREL(%rip), %r15
	leaq	-96(%rbp), %r13
	movl	$1, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_sleep
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edx
	callq	_t3000_write
	movl	$1, %edi
	callq	_sleep
	movl	(%r15), %edi
	movq	_TIOCCDTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ioctl
	movl	$1, %edi
	callq	_sleep
	movl	(%r15), %edi
	movq	_TIOCSDTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ioctl
	incl	%r12d
	cmpl	(%r14), %r12d
	jge	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	_TCIOFLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_tcflush
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	$6, %edx
	callq	_t3000_write
	movq	%r13, %rdi
	movl	$40, %esi
	callq	_bzero
	movl	$2, %edi
	callq	_sleep
	movl	(%r15), %edi
	movq	_FIONREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-100(%rbp), %rdx
	callq	_ioctl
	cmpl	$0, -100(%rbp)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, -100(%rbp)
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	movq	%r13, %rsi
	movl	$40, %edx
	callq	_read
	movl	%eax, -100(%rbp)
	movq	%r13, %rdi
	movl	$48, %esi
	callq	_strchr
	testq	%rax, %rax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	$79, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	$75, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_7
	jmp	LBB0_9
LBB0_8:
	movq	_FD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	$6, %edx
	callq	_t3000_write
	xorl	%ebx, %ebx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXRETRY,4,2                   ## @MAXRETRY
	.comm	_FD,4,2                         ## @FD
	.comm	_TCIOFLUSH,4,2                  ## @TCIOFLUSH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\rAT Z\r"

	.comm	_FIONREAD,4,2                   ## @FIONREAD
L_.str.1:                               ## @.str.1
	.asciz	"+++"

	.comm	_TIOCCDTR,4,2                   ## @TIOCCDTR
	.comm	_TIOCSDTR,4,2                   ## @TIOCSDTR
	.no_dead_strip	_t3000_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function t3000_sync
_t3000_sync:                            ; @t3000_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
Lloh3:
	adrp	x21, _MAXRETRY@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MAXRETRY@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh5:
	adrp	x22, _FD@GOTPAGE
Lloh6:
	ldr	x22, [x22, _FD@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	w23, #0
Lloh7:
	adrp	x24, _TCIOFLUSH@GOTPAGE
Lloh8:
	ldr	x24, [x24, _TCIOFLUSH@GOTPAGEOFF]
Lloh9:
	adrp	x19, l_.str@PAGE
Lloh10:
	add	x19, x19, l_.str@PAGEOFF
Lloh11:
	adrp	x25, _FIONREAD@GOTPAGE
Lloh12:
	ldr	x25, [x25, _FIONREAD@GOTPAGEOFF]
	mov	w26, #1
Lloh13:
	adrp	x27, _TIOCCDTR@GOTPAGE
Lloh14:
	ldr	x27, [x27, _TIOCCDTR@GOTPAGEOFF]
Lloh15:
	adrp	x28, _TIOCSDTR@GOTPAGE
Lloh16:
	ldr	x28, [x28, _TIOCSDTR@GOTPAGEOFF]
Lloh17:
	adrp	x20, l_.str.1@PAGE
Lloh18:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_sleep
	ldr	w0, [x22]
	mov	x1, x20
	mov	w2, #3
	bl	_t3000_write
	mov	w0, #1
	bl	_sleep
	ldr	w0, [x22]
	ldr	w1, [x27]
	mov	x2, #0
	bl	_ioctl
	mov	w0, #1
	bl	_sleep
	ldr	w0, [x22]
	ldr	w1, [x28]
	mov	x2, #0
	bl	_ioctl
	ldr	w8, [x21]
	add	w23, w23, #1
	cmp	w23, w8
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	w1, [x24]
	bl	_tcflush
	ldr	w0, [x22]
	mov	x1, x19
	mov	w2, #6
	bl	_t3000_write
	add	x0, sp, #16
	mov	w1, #40
	bl	_bzero
	mov	w0, #2
	bl	_sleep
	ldr	w0, [x22]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_ioctl
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w26, [sp, #12]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x22]
	add	x1, sp, #16
	mov	w2, #40
	bl	_read
	str	w0, [sp, #12]
	add	x0, sp, #16
	mov	w1, #48
	bl	_strchr
	cbnz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #16
	mov	w1, #79
	bl	_strchr
	cbz	x0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #16
	mov	w1, #75
	bl	_strchr
	cbz	x0, LBB0_2
LBB0_8:
	mov	w0, #1
	b	LBB0_10
LBB0_9:
	ldr	w0, [x22]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #6
	bl	_t3000_write
	mov	w0, #0
LBB0_10:
	ldr	x8, [sp, #56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXRETRY,4,2                   ; @MAXRETRY
	.comm	_FD,4,2                         ; @FD
	.comm	_TCIOFLUSH,4,2                  ; @TCIOFLUSH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\rAT Z\r"

	.comm	_FIONREAD,4,2                   ; @FIONREAD
l_.str.1:                               ; @.str.1
	.asciz	"+++"

	.comm	_TIOCCDTR,4,2                   ; @TIOCCDTR
	.comm	_TIOCSDTR,4,2                   ; @TIOCSDTR
	.no_dead_strip	_t3000_sync
.subsections_via_symbols
