	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_echo_byte
_add_echo_byte:                         ## @add_echo_byte
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movslq	(%rsi), %rdx
	movq	_N_TTY_BUF_SIZE@GOTPCREL(%rip), %r8
	movl	(%r8), %ecx
	movslq	4(%rsi), %rax
	movq	%rax, %r10
	cmpl	%ecx, %edx
	jne	LBB0_4
## %bb.1:
	movq	8(%rsi), %r9
	movb	(%r9,%r10), %cl
	movq	_ECHO_OP_START@GOTPCREL(%rip), %r11
	incq	%rax
	cmpb	(%r11), %cl
	jne	LBB0_3
## %bb.2:
	movq	%rdx, %rcx
	decq	%rcx
	andq	%rcx, %rax
	movb	(%r9,%rax), %al
	movq	_ECHO_OP_ERASE_TAB@GOTPCREL(%rip), %r11
	addl	$-2, %edx
	xorl	%ebx, %ebx
	cmpb	(%r11), %al
	sete	%bl
	cmovnel	%ecx, %edx
	leal	(%rbx,%r10), %eax
	addl	$2, %eax
	movl	%edx, (%rsi)
LBB0_3:
	movl	(%r8), %ecx
	decl	%ecx
	andl	%eax, %ecx
	movl	%ecx, 4(%rsi)
	movl	$1, 16(%rsi)
	jmp	LBB0_5
LBB0_4:
	leal	(%r10,%rdx), %eax
	decl	%ecx
	andl	%eax, %ecx
	incl	%edx
	movl	%edx, (%rsi)
	movq	8(%rsi), %r9
	movslq	%ecx, %r10
LBB0_5:
	movb	%dil, (%r9,%r10)
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_N_TTY_BUF_SIZE,4,2             ## @N_TTY_BUF_SIZE
	.comm	_ECHO_OP_START,1,0              ## @ECHO_OP_START
	.comm	_ECHO_OP_ERASE_TAB,1,0          ## @ECHO_OP_ERASE_TAB
	.no_dead_strip	_add_echo_byte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_echo_byte
_add_echo_byte:                         ; @add_echo_byte
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x10, _N_TTY_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _N_TTY_BUF_SIZE@GOTPAGEOFF]
	ldr	w9, [x10]
	ldpsw	x11, x8, [x1]
	cmp	w11, w9
	b.ne	LBB0_4
; %bb.1:
	ldr	x9, [x1, #8]
	ldrb	w13, [x9, x8]
Lloh2:
	adrp	x12, _ECHO_OP_START@GOTPAGE
Lloh3:
	ldr	x12, [x12, _ECHO_OP_START@GOTPAGEOFF]
	ldrb	w14, [x12]
	add	x12, x8, #1
	cmp	w13, w14
	b.ne	LBB0_3
; %bb.2:
	sub	x13, x11, #1
	and	x12, x12, x13
	ldrb	w12, [x9, x12]
Lloh4:
	adrp	x14, _ECHO_OP_ERASE_TAB@GOTPAGE
Lloh5:
	ldr	x14, [x14, _ECHO_OP_ERASE_TAB@GOTPAGEOFF]
	ldrb	w14, [x14]
	sub	w11, w11, #2
	cmp	w12, w14
	csel	w11, w11, w13, eq
	mov	w12, #2
	cinc	w12, w12, eq
	add	w12, w8, w12
	str	w11, [x1]
LBB0_3:
	ldr	w10, [x10]
	sub	w10, w10, #1
	and	w10, w12, w10
	str	w10, [x1, #4]
	mov	w10, #1
	str	w10, [x1, #16]
	strb	w0, [x9, x8]
	ret
LBB0_4:
	sub	w9, w9, #1
	add	w8, w8, w11
	and	w8, w8, w9
	add	w9, w11, #1
	str	w9, [x1]
	ldr	x9, [x1, #8]
	sxtw	x8, w8
	strb	w0, [x9, x8]
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_N_TTY_BUF_SIZE,4,2             ; @N_TTY_BUF_SIZE
	.comm	_ECHO_OP_START,1,0              ; @ECHO_OP_START
	.comm	_ECHO_OP_ERASE_TAB,1,0          ; @ECHO_OP_ERASE_TAB
	.no_dead_strip	_add_echo_byte
.subsections_via_symbols
