	.file	"extr_move.c_cursor_correct.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cursor_correct
	.type	cursor_correct, @function
cursor_correct:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR curwin[rip]
	mov	ebp, DWORD PTR p_so[rip]
	cmp	DWORD PTR [rax], 1
	mov	r13d, ebp
	jne	.L2
	mov	eax, DWORD PTR 4[rax]
	mov	r13d, eax
	shr	r13d, 31
	add	r13d, eax
	sar	r13d
	cmp	r13d, ebp
	cmovg	r13d, ebp
	xor	ebp, ebp
.L2:
	xor	eax, eax
	call	validate_botline@PLT
	mov	rdx, QWORD PTR curbuf[rip]
	mov	rax, QWORD PTR curwin[rip]
	mov	edx, DWORD PTR [rdx]
	mov	r14d, DWORD PTR 8[rax]
	add	edx, 1
	cmp	r14d, edx
	jne	.L3
	mov	ecx, DWORD PTR 4[rax]
	sub	ecx, 1
	mov	edx, ecx
	shr	edx, 31
	add	edx, ecx
	sar	edx
	cmp	ebp, edx
	cmovg	ebp, edx
	xor	r13d, r13d
.L3:
	mov	r15d, DWORD PTR [rax]
	mov	esi, DWORD PTR 24[rax]
	lea	edx, [r15+rbp]
	mov	DWORD PTR 12[rsp], esi
	cmp	edx, esi
	jg	.L4
	mov	edx, r14d
	sub	edx, r13d
	cmp	edx, esi
	jg	.L1
.L4:
	sub	r14d, 1
	test	r13d, r13d
	setg	sil
	test	ebp, ebp
	setg	dl
	or	sil, dl
	je	.L6
	cmp	r15d, r14d
	jge	.L6
	xor	ebx, ebx
	xor	r12d, r12d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L39:
	cmp	ebp, ebx
	mov	eax, ebx
	cmovle	eax, ebp
	cmp	eax, r12d
	jle	.L38
.L8:
	cmp	ebp, r12d
	jle	.L9
	cmp	ebx, r12d
	jg	.L18
	cmp	ebx, r13d
	jge	.L18
.L9:
	cmp	ebp, r12d
	setg	dl
	cmp	r13d, ebx
	setg	al
	or	dl, al
	je	.L19
	cmp	r14d, r15d
	jle	.L19
.L11:
	cmp	r13d, ebx
	jg	.L39
	cmp	ebp, r12d
	jg	.L18
.L19:
	mov	rax, QWORD PTR curwin[rip]
.L6:
	mov	edx, DWORD PTR 20[rax]
	cmp	r15d, r14d
	je	.L21
	test	r14d, r14d
	je	.L21
	cmp	r15d, r14d
	jle	.L16
	mov	DWORD PTR 24[rax], r14d
.L15:
	or	edx, DWORD PTR VALID_TOPLINE[rip]
	mov	DWORD PTR 20[rax], edx
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	mov	edi, r14d
	sub	r14d, 1
	call	plines@PLT
	add	ebx, eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, r15d
	add	r15d, 1
	call	plines@PLT
	add	r12d, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	mov	DWORD PTR 24[rax], r15d
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	cmp	DWORD PTR 12[rsp], r15d
	jge	.L17
	cmp	DWORD PTR [rax], 1
	jle	.L17
	mov	ecx, DWORD PTR VALID_WROW[rip]
	or	ecx, DWORD PTR VALID_WCOL[rip]
	mov	DWORD PTR 24[rax], r15d
	or	ecx, DWORD PTR VALID_CHEIGHT[rip]
	or	ecx, DWORD PTR VALID_CROW[rip]
	not	ecx
	and	edx, ecx
	mov	DWORD PTR 20[rax], edx
.L17:
	cmp	DWORD PTR 12[rsp], r14d
	jle	.L15
	mov	rcx, QWORD PTR curbuf[rip]
	mov	ecx, DWORD PTR [rcx]
	cmp	DWORD PTR 8[rax], ecx
	jg	.L15
	mov	ecx, DWORD PTR VALID_WROW[rip]
	or	ecx, DWORD PTR VALID_WCOL[rip]
	mov	DWORD PTR 24[rax], r14d
	or	ecx, DWORD PTR VALID_CHEIGHT[rip]
	or	ecx, DWORD PTR VALID_CROW[rip]
	not	ecx
	and	edx, ecx
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	cursor_correct, .-cursor_correct
	.comm	p_so,4,4
	.comm	mouse_dragging,4,4
	.comm	curwin,8,8
	.comm	curbuf,8,8
	.comm	VALID_WROW,4,4
	.comm	VALID_WCOL,4,4
	.comm	VALID_TOPLINE,4,4
	.comm	VALID_CROW,4,4
	.comm	VALID_CHEIGHT,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_move.c_cursor_correct.c"
	.text
	.align	2
	.global	cursor_correct
	.syntax unified
	.arm
	.fpu softvfp
	.type	cursor_correct, %function
cursor_correct:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, .L29
	ldr	r2, .L29+4
	ldr	r3, [r7]
	ldr	r5, [r2]
	ldr	r2, [r3]
	sub	sp, sp, #12
	cmp	r2, #1
	movne	r10, r5
	bne	.L2
	ldr	r10, [r3, #4]
	add	r10, r10, r10, lsr #31
	asr	r10, r10, #1
	cmp	r10, r5
	movge	r10, r5
	mov	r5, #0
.L2:
	ldr	r9, .L29+8
	bl	validate_botline
	ldr	r2, [r9]
	ldr	r3, [r7]
	ldr	r2, [r2]
	ldr	fp, [r3, #8]
	add	r2, r2, #1
	cmp	fp, r2
	bne	.L3
	ldr	r2, [r3, #4]
	mov	r10, #0
	sub	r2, r2, #1
	add	r2, r2, r2, lsr #31
	asr	r2, r2, #1
	cmp	r5, r2
	movge	r5, r2
.L3:
	ldr	r8, [r3]
	ldr	r2, [r3, #24]
	add	r1, r8, r5
	cmp	r1, r2
	str	r2, [sp, #4]
	bgt	.L4
	sub	r1, fp, r10
	cmp	r1, r2
	bgt	.L1
.L4:
	cmp	r5, #0
	cmple	r10, #0
	movgt	r1, #1
	movle	r1, #0
	sub	fp, fp, #1
	cmp	r8, fp
	movge	r1, #0
	andlt	r1, r1, #1
	cmp	r1, #0
	beq	.L6
	mov	r4, #0
	mov	r6, r4
	b	.L10
.L28:
	cmp	r5, r4
	movlt	r3, r5
	movge	r3, r4
	cmp	r3, r6
	ble	.L27
.L8:
	cmp	r5, r6
	ble	.L9
	cmp	r4, r6
	cmple	r4, r10
	bge	.L15
.L9:
	cmp	r10, r4
	cmple	r5, r6
	movgt	r3, #1
	movle	r3, #0
	cmp	fp, r8
	movle	r3, #0
	andgt	r3, r3, #1
	cmp	r3, #0
	beq	.L16
.L10:
	cmp	r10, r4
	bgt	.L28
	cmp	r5, r6
	bgt	.L15
.L16:
	ldr	r3, [r7]
.L6:
	cmp	fp, #0
	cmpne	r8, fp
	ldr	r1, [r3, #20]
	streq	r8, [r3, #24]
	beq	.L12
	cmp	r8, fp
	strgt	fp, [r3, #24]
	bgt	.L12
	ldr	r2, [sp, #4]
	cmp	r2, r8
	bge	.L14
	ldr	r0, [r3]
	cmp	r0, #1
	ble	.L14
	ldr	ip, .L29+12
	ldr	r0, .L29+16
	ldr	lr, [ip]
	ldr	r0, [r0]
	ldr	ip, .L29+20
	orr	r0, r0, lr
	ldr	lr, [ip]
	ldr	ip, .L29+24
	orr	r0, r0, lr
	ldr	ip, [ip]
	str	r8, [r3, #24]
	orr	r2, r0, ip
	bic	r1, r1, r2
	str	r1, [r3, #20]
.L14:
	ldr	r2, [sp, #4]
	cmp	r2, fp
	ble	.L12
	ldr	r2, [r9]
	ldr	r0, [r3, #8]
	ldr	r2, [r2]
	cmp	r0, r2
	bgt	.L12
	ldr	r2, .L29+16
	ldr	r0, .L29+12
	ldr	r2, [r2]
	ldr	r0, [r0]
	ldr	ip, .L29+20
	orr	r2, r2, r0
	ldr	r0, .L29+24
	ldr	ip, [ip]
	ldr	r0, [r0]
	orr	r2, r2, ip
	orr	r2, r2, r0
	str	fp, [r3, #24]
	bic	r1, r1, r2
.L12:
	ldr	r2, .L29+28
	ldr	r2, [r2]
	orr	r2, r2, r1
	str	r2, [r3, #20]
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L27:
	mov	r0, fp
	bl	plines
	sub	fp, fp, #1
	add	r4, r4, r0
	b	.L8
.L15:
	mov	r0, r8
	bl	plines
	add	r8, r8, #1
	add	r6, r6, r0
	b	.L9
.L30:
	.align	2
.L29:
	.word	curwin
	.word	p_so
	.word	curbuf
	.word	VALID_WCOL
	.word	VALID_WROW
	.word	VALID_CHEIGHT
	.word	VALID_CROW
	.word	VALID_TOPLINE
	.size	cursor_correct, .-cursor_correct
	.comm	p_so,4,4
	.comm	mouse_dragging,4,4
	.comm	curwin,4,4
	.comm	curbuf,4,4
	.comm	VALID_WROW,4,4
	.comm	VALID_WCOL,4,4
	.comm	VALID_TOPLINE,4,4
	.comm	VALID_CROW,4,4
	.comm	VALID_CHEIGHT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
