	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Hist_Next                      ## -- Begin function Hist_Next
	.p2align	4, 0x90
_Hist_Next:                             ## @Hist_Next
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_hist_count@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	_TTY_HISTORY@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setle	%dil
	callq	_assert
	movl	(%r14), %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	_hist_current@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpl	$-1, (%rbx)
	setge	%dil
	callq	_assert
	movl	(%rbx), %eax
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	setle	%dil
	callq	_assert
	movl	(%rbx), %eax
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	decl	%eax
	movl	%eax, (%rbx)
LBB0_2:
	movq	_ttyEditLines@GOTPCREL(%rip), %rcx
	movslq	%eax, %rdx
	leaq	(,%rdx,4), %rsi
	addq	(%rcx), %rsi
	xorl	%eax, %eax
	cmpl	$-1, %edx
	cmovneq	%rsi, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.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_Next                      ; -- Begin function Hist_Next
	.p2align	2
_Hist_Next:                             ; @Hist_Next
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _hist_count@GOTPAGE
Lloh1:
	ldr	x20, [x20, _hist_count@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _TTY_HISTORY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TTY_HISTORY@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	w8, [x20]
	mvn	w8, w8
	lsr	w0, w8, #31
	bl	_assert
Lloh5:
	adrp	x19, _hist_current@GOTPAGE
Lloh6:
	ldr	x19, [x19, _hist_current@GOTPAGEOFF]
	ldr	w8, [x19]
	cmn	w8, #2
	cset	w0, gt
	bl	_assert
	ldr	w8, [x19]
	ldr	w9, [x20]
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_2
; %bb.1:
	sub	w8, w8, #1
	str	w8, [x19]
LBB0_2:
Lloh7:
	adrp	x9, _ttyEditLines@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ttyEditLines@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x9, x9, w8, sxtw #2
	cmn	w8, #1
	csel	x0, xzr, x9, eq
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.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
