	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Hist_Add                       ## -- Begin function Hist_Add
	.p2align	4, 0x90
_Hist_Add:                              ## @Hist_Add
	.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	%rdi, %r14
	movq	_hist_count@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movq	_TTY_HISTORY@GOTPCREL(%rip), %r15
	xorl	%edi, %edi
	cmpl	(%r15), %eax
	setle	%dil
	callq	_assert
	movl	(%r13), %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	_hist_current@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpl	$-1, (%r12)
	setge	%dil
	callq	_assert
	movl	(%r12), %eax
	xorl	%edi, %edi
	cmpl	(%r13), %eax
	setle	%dil
	callq	_assert
	movl	(%r15), %eax
	movq	_ttyEditLines@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$2, %eax
	jl	LBB0_17
## %bb.1:
	movl	$4294967294, %edx               ## imm = 0xFFFFFFFE
	xorl	%r10d, %r10d
	movq	%rax, %rsi
	subq	$2, %rsi
	cmovaeq	%rsi, %r10
	incq	%r10
	cmpq	$8, %r10
	jae	LBB0_2
LBB0_15:
	addq	%rax, %rdx
	decq	%rax
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, %esi
	movl	(%rcx,%rsi,4), %esi
	movl	%eax, %edi
	movl	%esi, (%rcx,%rdi,4)
	decq	%rdx
	leaq	-1(%rax), %rsi
	incq	%rax
	cmpq	$2, %rax
	movq	%rsi, %rax
	ja	LBB0_16
LBB0_17:
	movl	(%r14), %eax
	movl	%eax, (%rcx)
	movl	(%r13), %eax
	cmpl	(%r15), %eax
	jge	LBB0_19
## %bb.18:
	incl	%eax
	movl	%eax, (%r13)
LBB0_19:
	movl	$-1, (%r12)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%esi, %esi
	movq	%rax, %rdi
	subq	$2, %rdi
	cmovaeq	%rdi, %rsi
	leal	-1(%rax), %ebx
	cmpl	%esi, %ebx
	jb	LBB0_15
## %bb.3:
	leal	-2(%rax), %r8d
	cmpl	%esi, %r8d
	jb	LBB0_15
## %bb.4:
	leaq	(%rcx,%rbx,4), %rdi
	shlq	$2, %rsi
	movq	%rdi, %rbx
	subq	%rsi, %rbx
	cmpq	%rdi, %rbx
	ja	LBB0_15
## %bb.5:
	leaq	(%rcx,%r8,4), %rbx
	movq	%rbx, %rdi
	subq	%rsi, %rdi
	cmpq	%rbx, %rdi
	ja	LBB0_15
## %bb.6:
	leal	-2(%rax), %esi
	leaq	(%rcx,%rsi,4), %rsi
	leal	-1(%rax), %edi
	leaq	(%rcx,%rdi,4), %rdi
	subq	%rdi, %rsi
	cmpq	$32, %rsi
	jb	LBB0_15
## %bb.7:
	movq	%r10, %rdi
	andq	$-8, %rdi
	leaq	-8(%rdi), %rbx
	movq	%rbx, %r9
	shrq	$3, %r9
	incq	%r9
	testq	%rbx, %rbx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	je	LBB0_8
## %bb.9:
	andq	$-2, %r9
	leaq	(%rdx,%rax), %rsi
	addq	$-8, %rsi
	xorl	%r11d, %r11d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	9(%rsi), %edi
	leal	8(%rsi), %r8d
	movups	-28(%rcx,%r8,4), %xmm0
	movups	-12(%rcx,%r8,4), %xmm1
	movups	%xmm1, -12(%rcx,%rdi,4)
	movups	%xmm0, -28(%rcx,%rdi,4)
	movl	%esi, %edi
	leal	1(%rsi), %ebx
	movups	-28(%rcx,%rdi,4), %xmm0
	movups	-12(%rcx,%rdi,4), %xmm1
	movups	%xmm1, -12(%rcx,%rbx,4)
	movups	%xmm0, -28(%rcx,%rbx,4)
	addq	$16, %r11
	addq	$-16, %rsi
	addq	$-2, %r9
	jne	LBB0_10
## %bb.11:
	testb	$1, -48(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_13
LBB0_12:
	movl	%eax, %esi
	subl	%r11d, %esi
	leal	(%rdx,%rsi), %edi
	addl	%edx, %esi
	incl	%esi
	movups	-28(%rcx,%rdi,4), %xmm0
	movups	-12(%rcx,%rdi,4), %xmm1
	movups	%xmm1, -12(%rcx,%rsi,4)
	movups	%xmm0, -28(%rcx,%rsi,4)
LBB0_13:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%rsi, %r10
	je	LBB0_17
## %bb.14:
	subq	%rsi, %rax
	jmp	LBB0_15
LBB0_8:
	xorl	%r11d, %r11d
	testb	$1, -48(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_12
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_hist_count,4,2                 ## @hist_count
	.comm	_TTY_HISTORY,4,2                ## @TTY_HISTORY
	.comm	_hist_current,4,2               ## @hist_current
	.comm	_ttyEditLines,8,3               ## @ttyEditLines
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Hist_Add                       ; -- Begin function Hist_Add
	.p2align	2
_Hist_Add:                              ; @Hist_Add
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _hist_count@GOTPAGE
Lloh1:
	ldr	x20, [x20, _hist_count@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x21, _TTY_HISTORY@GOTPAGE
Lloh3:
	ldr	x21, [x21, _TTY_HISTORY@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	w8, [x20]
	mvn	w8, w8
	lsr	w0, w8, #31
	bl	_assert
Lloh4:
	adrp	x22, _hist_current@GOTPAGE
Lloh5:
	ldr	x22, [x22, _hist_current@GOTPAGEOFF]
	ldr	w8, [x22]
	cmn	w8, #2
	cset	w0, gt
	bl	_assert
	ldr	w8, [x22]
	ldr	w9, [x20]
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	w11, [x21]
Lloh6:
	adrp	x8, _ttyEditLines@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ttyEditLines@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	w11, #2
	b.lt	LBB0_11
; %bb.1:
	subs	x9, x11, #2
	csel	x9, xzr, x9, lo
	add	x9, x9, #1
	cmp	x9, #16
	b.hs	LBB0_3
; %bb.2:
	mov	x10, x11
	b	LBB0_10
LBB0_3:
	subs	x10, x11, #2
	csel	x10, xzr, x10, lo
	sub	w12, w11, #1
	sub	w13, w11, #2
	add	x14, x8, w12, uxtw #2
	lsl	x15, x10, #2
	sub	x16, x14, x15
	add	x17, x8, w13, uxtw #2
	sub	x15, x17, x15
	cmp	w12, w10
	ccmp	w13, w10, #0, hs
	ccmp	x16, x14, #2, hs
	ccmp	x15, x17, #2, ls
	b.ls	LBB0_5
; %bb.4:
	mov	x10, x11
	b	LBB0_10
LBB0_5:
	sub	w10, w11, #2
	add	x10, x8, w10, uxtw #2
	sub	w12, w11, #1
	add	x12, x8, w12, uxtw #2
	sub	x10, x10, x12
	cmp	x10, #64
	b.hs	LBB0_7
; %bb.6:
	mov	x10, x11
	b	LBB0_10
LBB0_7:
	and	x12, x9, #0xfffffffffffffff0
	sub	x10, x11, x12
	mov	w13, #-1
	add	x11, x11, x13
	mov	x13, x12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	w14, w11, #1
	add	x14, x8, w14, uxtw #2
	ldur	q0, [x14, #-12]
	ldur	q1, [x14, #-28]
	ldur	q2, [x14, #-44]
	ldur	q3, [x14, #-60]
	add	x14, x8, w11, uxtw #2
	stur	q0, [x14, #-12]
	stur	q1, [x14, #-28]
	stur	q2, [x14, #-44]
	stur	q3, [x14, #-60]
	sub	x11, x11, #16
	sub	x13, x13, #16
	cbnz	x13, LBB0_8
; %bb.9:
	cmp	x9, x12
	b.eq	LBB0_11
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	w9, w10, #2
	sub	x11, x10, #1
	ldr	w9, [x8, w9, uxtw #2]
	str	w9, [x8, w11, uxtw #2]
	cmp	x10, #2
	mov	x10, x11
	b.hi	LBB0_10
LBB0_11:
	ldr	w9, [x19]
	str	w9, [x8]
	ldr	w8, [x20]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ge	LBB0_13
; %bb.12:
	add	w8, w8, #1
	str	w8, [x20]
LBB0_13:
	mov	w8, #-1
	str	w8, [x22]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_hist_count,4,2                 ; @hist_count
	.comm	_TTY_HISTORY,4,2                ; @TTY_HISTORY
	.comm	_hist_current,4,2               ; @hist_current
	.comm	_ttyEditLines,8,3               ; @ttyEditLines
.subsections_via_symbols
