	.file	"extr_linenoise.c_linenoiseEditHistoryNext.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	linenoiseEditHistoryNext
	.type	linenoiseEditHistoryNext, @function
linenoiseEditHistoryNext:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR history_len[rip]
	cmp	eax, 1
	jg	.L12
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	rdx, QWORD PTR history[rip]
	sub	eax, 1
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	eax, DWORD PTR [rdi]
	mov	ebx, esi
	cdqe
	mov	edi, DWORD PTR [rdx+rax*4]
	call	free@PLT
	mov	eax, DWORD PTR history_len[rip]
	mov	rdx, QWORD PTR history[rip]
	mov	rdi, QWORD PTR 8[rbp]
	sub	eax, 1
	sub	eax, DWORD PTR 0[rbp]
	cdqe
	lea	r12, [rdx+rax*4]
	call	strdup@PLT
	mov	DWORD PTR [r12], eax
	xor	eax, eax
	cmp	DWORD PTR LINENOISE_HISTORY_PREV[rip], ebx
	sete	al
	lea	eax, -1[rax+rax]
	add	eax, DWORD PTR 0[rbp]
	mov	DWORD PTR 0[rbp], eax
	js	.L13
	mov	ecx, DWORD PTR history_len[rip]
	lea	edx, -1[rcx]
	cmp	eax, ecx
	jl	.L5
	mov	DWORD PTR 0[rbp], edx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	sub	edx, eax
	mov	rax, QWORD PTR history[rip]
	mov	r8d, DWORD PTR 16[rbp]
	movsx	rdx, edx
	mov	rdi, QWORD PTR 8[rbp]
	mov	esi, DWORD PTR [rax+rdx*4]
	mov	edx, r8d
	call	strncpy@PLT
	movsx	rax, DWORD PTR 16[rbp]
	mov	rdx, QWORD PTR 8[rbp]
	mov	BYTE PTR -1[rdx+rax], 0
	mov	rdi, QWORD PTR 8[rbp]
	call	strlen@PLT
	mov	rdi, rbp
	mov	DWORD PTR 20[rbp], eax
	mov	DWORD PTR 24[rbp], eax
	pop	rbx
	.cfi_remember_state
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	refreshLine@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	DWORD PTR 0[rbp], 0
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	linenoiseEditHistoryNext, .-linenoiseEditHistoryNext
	.comm	history_len,4,4
	.comm	history,8,8
	.comm	LINENOISE_HISTORY_PREV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_linenoise.c_linenoiseEditHistoryNext.c"
	.text
	.align	2
	.global	linenoiseEditHistoryNext
	.syntax unified
	.arm
	.fpu softvfp
	.type	linenoiseEditHistoryNext, %function
linenoiseEditHistoryNext:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r6, .L10
	ldr	r3, [r6]
	cmp	r3, #1
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r4, r0
	ldr	r9, .L10+4
	mov	r7, r1
	ldr	r1, [r0]
	ldr	r2, [r9]
	sub	r3, r3, #1
	sub	r3, r3, r1
	ldr	r0, [r2, r3, lsl #2]
	bl	free
	ldm	r4, {r3, r8}
	ldr	r5, [r6]
	mov	r0, r8
	sub	r5, r5, #1
	sub	r5, r5, r3
	ldr	r9, [r9]
	bl	strdup
	ldr	r3, .L10+8
	str	r0, [r9, r5, lsl #2]
	ldr	r2, [r3]
	ldr	r3, [r4]
	cmp	r2, r7
	moveq	r2, #1
	mvnne	r2, #0
	add	r3, r3, r2
	cmp	r3, #0
	str	r3, [r4]
	blt	.L9
	ldr	r2, [r6]
	cmp	r3, r2
	sub	r2, r2, #1
	blt	.L5
	str	r2, [r4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	sub	r2, r2, r3
	ldr	r1, [r9, r2, lsl #2]
	mov	r0, r8
	ldr	r2, [r4, #8]
	bl	strncpy
	ldmib	r4, {r1, r3}
	mov	r2, #0
	add	r3, r3, r1
	strb	r2, [r3, #-1]
	ldr	r0, [r4, #4]
	bl	strlen
	mov	r3, r0
	mov	r0, r4
	str	r3, [r4, #12]
	str	r3, [r4, #16]
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	refreshLine
.L9:
	mov	r3, #0
	str	r3, [r4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	.align	2
.L10:
	.word	history_len
	.word	history
	.word	LINENOISE_HISTORY_PREV
	.size	linenoiseEditHistoryNext, .-linenoiseEditHistoryNext
	.comm	history_len,4,4
	.comm	history,4,4
	.comm	LINENOISE_HISTORY_PREV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
