	.file	"extr_vgacon.c_vgacon_scrolldelta.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vgacon_scrolldelta, @function
vgacon_scrolldelta:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	ecx, DWORD PTR 4[rdi]
	test	esi, esi
	jne	.L2
	mov	DWORD PTR [rdi], ecx
	call	vga_set_mem_top@PLT
	mov	eax, 1
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r10d, DWORD PTR 8[rdi]
	mov	r11d, DWORD PTR vga_vram_base[rip]
	mov	r8d, DWORD PTR 12[rdi]
	mov	r9d, DWORD PTR vga_rolled_over[rip]
	lea	ebx, 0[0+r10*4]
	sub	r8d, r11d
	lea	eax, [r8+rbx]
	cmp	eax, r9d
	jl	.L12
	mov	r9d, DWORD PTR vga_vram_size[rip]
	xor	r8d, r8d
.L5:
	mov	eax, DWORD PTR [rdi]
	imul	esi, r10d
	sub	ecx, r11d
	sal	r10d, 3
	sub	ecx, r8d
	sub	eax, r11d
	sub	eax, r8d
	add	eax, r9d
	cdq
	idiv	r9d
	lea	eax, [rcx+r9]
	add	esi, edx
	cdq
	idiv	r9d
	mov	eax, edx
	cmp	r10d, edx
	jg	.L9
	sub	eax, ebx
.L6:
	cmp	ebx, esi
	mov	ecx, 0
	cmovg	esi, ecx
	cmp	esi, eax
	cmovg	esi, edx
	lea	eax, [r8+rsi]
	cdq
	idiv	r9d
	lea	eax, [rdx+r11]
	mov	DWORD PTR [rdi], eax
	call	vga_set_mem_top@PLT
	mov	eax, 1
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	add	r9d, r10d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	xor	ebx, ebx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	vgacon_scrolldelta, .-vgacon_scrolldelta
	.comm	vga_vram_size,4,4
	.comm	vga_vram_base,4,4
	.comm	vga_rolled_over,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_vgacon.c_vgacon_scrolldelta.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vgacon_scrolldelta, %function
vgacon_scrolldelta:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, [r0, #4]
	subs	r4, r1, #0
	mov	r5, r0
	streq	r7, [r0]
	beq	.L3
	ldr	r3, .L12
	ldr	r8, [r0, #12]
	ldr	r9, [r3]
	ldr	r3, .L12+4
	ldr	r10, [r0, #8]
	ldr	r6, [r3]
	sub	r8, r8, r9
	add	r3, r8, r10, lsl #2
	cmp	r3, r6
	movge	r8, #0
	ldrge	r3, .L12+8
	ldr	r0, [r0]
	ldrge	r6, [r3]
	sub	r0, r0, r9
	addlt	r6, r10, r6
	sub	r0, r0, r8
	mov	r1, r6
	add	r0, r0, r6
	bl	__aeabi_idivmod
	mov	r3, r1
	sub	r0, r7, r9
	sub	r0, r0, r8
	mov	r1, r6
	add	r0, r0, r6
	mla	r4, r10, r4, r3
	bl	__aeabi_idivmod
	cmp	r1, r10, lsl #3
	lsl	fp, r10, #2
	movlt	fp, #0
	movlt	r3, r1
	subge	r3, r1, fp
	cmp	fp, r4
	movgt	r4, #0
	cmp	r4, r3
	movgt	r4, r1
	mov	r1, r6
	add	r0, r8, r4
	bl	__aeabi_idivmod
	add	r9, r1, r9
	str	r9, [r5]
.L3:
	mov	r0, r5
	bl	vga_set_mem_top
	mov	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	.align	2
.L12:
	.word	vga_vram_base
	.word	vga_rolled_over
	.word	vga_vram_size
	.size	vgacon_scrolldelta, .-vgacon_scrolldelta
	.comm	vga_vram_size,4,4
	.comm	vga_vram_base,4,4
	.comm	vga_rolled_over,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
