	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hay_sync
_hay_sync:                              ## @hay_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAXRETRY@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_7
## %bb.1:
	xorl	%r14d, %r14d
	movq	_FD@GOTPCREL(%rip), %r15
	movq	_dumbuf@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	movq	_TIOCCDTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ioctl
	movl	(%r15), %edi
	movq	_TIOCSDTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ioctl
	incl	%r14d
	movq	_MAXRETRY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jg	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	$3, %edx
	callq	_write
	movl	$1, %edi
	callq	_sleep
	movl	(%r15), %edi
	movq	_FIONREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_ioctl
	movl	-44(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %ebx
	movq	(%r13), %r12
	movq	_DUMBUFLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movl	%ebx, %edi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_read
	movl	%eax, -44(%rbp)
	movq	(%r13), %rdi
	movl	$48, %esi
	callq	_strchr
	movl	$1, %ebx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdi
	movl	$79, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdi
	movl	$75, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_6
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_printf
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXRETRY,4,2                   ## @MAXRETRY
	.comm	_FD,4,2                         ## @FD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AT\r"

	.comm	_FIONREAD,4,2                   ## @FIONREAD
	.comm	_dumbuf,8,3                     ## @dumbuf
	.comm	_DUMBUFLEN,4,2                  ## @DUMBUFLEN
	.comm	_TIOCCDTR,4,2                   ## @TIOCCDTR
	.comm	_TIOCSDTR,4,2                   ## @TIOCSDTR
L_.str.1:                               ## @.str.1
	.asciz	"Cannot synchronize with hayes...\n\r"

	.no_dead_strip	_hay_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hay_sync
_hay_sync:                              ; @hay_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, _MAXRETRY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAXRETRY@GOTPAGEOFF]
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_8
; %bb.1:
	mov	w23, #0
Lloh2:
	adrp	x24, _FD@GOTPAGE
Lloh3:
	ldr	x24, [x24, _FD@GOTPAGEOFF]
Lloh4:
	adrp	x25, _FIONREAD@GOTPAGE
Lloh5:
	ldr	x25, [x25, _FIONREAD@GOTPAGEOFF]
Lloh6:
	adrp	x19, l_.str@PAGE
Lloh7:
	add	x19, x19, l_.str@PAGEOFF
Lloh8:
	adrp	x26, _TIOCCDTR@GOTPAGE
Lloh9:
	ldr	x26, [x26, _TIOCCDTR@GOTPAGEOFF]
Lloh10:
	adrp	x27, _TIOCSDTR@GOTPAGE
Lloh11:
	ldr	x27, [x27, _TIOCSDTR@GOTPAGEOFF]
Lloh12:
	adrp	x28, _dumbuf@GOTPAGE
Lloh13:
	ldr	x28, [x28, _dumbuf@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x24]
	ldr	w1, [x26]
	mov	x2, #0
	bl	_ioctl
	ldr	w0, [x24]
	ldr	w1, [x27]
	mov	x2, #0
	bl	_ioctl
	ldr	w8, [x22]
	add	w23, w23, #1
	cmp	w23, w8
	b.gt	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	mov	x1, x19
	mov	w2, #3
	bl	_write
	mov	w0, #1
	bl	_sleep
	ldr	w0, [x24]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_ioctl
	ldr	w0, [sp, #12]
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w20, [x24]
	ldr	x21, [x28]
Lloh14:
	adrp	x8, _DUMBUFLEN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DUMBUFLEN@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_min
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_read
	str	w0, [sp, #12]
	ldr	x0, [x28]
	mov	w1, #48
	bl	_strchr
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x28]
	mov	w1, #79
	bl	_strchr
	cbz	x0, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x28]
	mov	w1, #75
	bl	_strchr
	cbz	x0, LBB0_2
LBB0_7:
	mov	w0, #1
	b	LBB0_9
LBB0_8:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXRETRY,4,2                   ; @MAXRETRY
	.comm	_FD,4,2                         ; @FD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AT\r"

	.comm	_FIONREAD,4,2                   ; @FIONREAD
	.comm	_dumbuf,8,3                     ; @dumbuf
	.comm	_DUMBUFLEN,4,2                  ; @DUMBUFLEN
	.comm	_TIOCCDTR,4,2                   ; @TIOCCDTR
	.comm	_TIOCSDTR,4,2                   ; @TIOCSDTR
l_.str.1:                               ; @.str.1
	.asciz	"Cannot synchronize with hayes...\n\r"

	.no_dead_strip	_hay_sync
.subsections_via_symbols
