	.file	"extr_early_printk.c_early_vga_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	early_vga_write, @function
early_vga_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	rax, 1[rsi]
	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
	movzx	r12d, BYTE PTR [rsi]
	mov	QWORD PTR [rsp], rax
	test	r12b, r12b
	je	.L1
	lea	eax, -1[rdx]
	test	edx, edx
	je	.L1
	lea	rax, 2[rsi+rax]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	r12b, 10
	je	.L32
	cmp	r12b, 13
	je	.L12
	mov	esi, DWORD PTR max_xpos[rip]
	mov	eax, DWORD PTR current_xpos[rip]
	movsx	di, r12b
	imul	esi, DWORD PTR current_ypos[rip]
	or	di, 1792
	lea	edx, 1[rax]
	movzx	edi, di
	mov	DWORD PTR current_xpos[rip], edx
	add	esi, eax
	add	esi, esi
	movsx	rsi, esi
	add	rsi, QWORD PTR VGABASE[rip]
	call	writew@PLT
	mov	eax, DWORD PTR max_xpos[rip]
	cmp	DWORD PTR current_xpos[rip], eax
	jl	.L12
.L32:
	add	DWORD PTR current_ypos[rip], 1
	mov	DWORD PTR current_xpos[rip], 0
.L12:
	add	QWORD PTR [rsp], 1
	mov	rax, QWORD PTR [rsp]
	movzx	r12d, BYTE PTR -1[rax]
	test	r12b, r12b
	je	.L1
	mov	rdx, QWORD PTR 8[rsp]
	cmp	rax, rdx
	je	.L1
.L15:
	mov	edx, DWORD PTR max_ypos[rip]
	cmp	DWORD PTR current_ypos[rip], edx
	jl	.L4
	mov	eax, DWORD PTR max_xpos[rip]
	mov	ebx, 1
	xor	r13d, r13d
	cmp	edx, 1
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	r13d, ebx
	lea	ebp, -1[rbx]
	xor	r15d, r15d
	test	eax, eax
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, ebp
	mov	rcx, QWORD PTR VGABASE[rip]
	imul	esi, eax
	imul	eax, ebx
	add	esi, r15d
	lea	edi, [rax+r15]
	add	esi, esi
	add	r15d, 1
	add	edi, edi
	movsx	rsi, esi
	movsx	rdi, edi
	lea	r14, [rsi+rcx]
	add	rdi, rcx
	call	readw@PLT
	mov	rsi, r14
	mov	edi, eax
	call	writew@PLT
	mov	eax, DWORD PTR max_xpos[rip]
	cmp	eax, r15d
	jg	.L7
.L8:
	add	ebx, 1
	cmp	DWORD PTR max_ypos[rip], ebx
	jg	.L5
.L6:
	xor	ebx, ebx
	test	eax, eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	imul	eax, r13d
	mov	edi, 1824
	lea	esi, [rax+rbx]
	add	ebx, 1
	add	esi, esi
	movsx	rsi, esi
	add	rsi, QWORD PTR VGABASE[rip]
	call	writew@PLT
	mov	eax, DWORD PTR max_xpos[rip]
	cmp	eax, ebx
	jg	.L9
.L10:
	mov	eax, DWORD PTR max_ypos[rip]
	sub	eax, 1
	mov	DWORD PTR current_ypos[rip], eax
	jmp	.L4
.L1:
	add	rsp, 24
	.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
	.cfi_endproc
.LFE0:
	.size	early_vga_write, .-early_vga_write
	.comm	max_ypos,4,4
	.comm	max_xpos,4,4
	.comm	current_ypos,4,4
	.comm	current_xpos,4,4
	.comm	VGABASE,8,8
	.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_early_printk.c_early_vga_write.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	early_vga_write, %function
early_vga_write:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldrb	r0, [r3], #1	@ zero_extendqisi2
	sub	sp, sp, #20
	cmp	r0, #0
	stmib	sp, {r0, r3}
	beq	.L1
	cmp	r2, #0
	beq	.L1
	add	r3, r2, #1
	add	r3, r1, r3
	ldr	r9, .L31
	ldr	fp, .L31+4
	ldr	r4, .L31+8
	ldr	r10, .L31+12
	str	r3, [sp, #12]
	b	.L15
.L11:
	ldr	r0, [sp, #4]
	cmp	r0, #13
	beq	.L12
	ldr	ip, .L31+16
	ldr	r1, [fp]
	mov	r5, ip
	ldr	r3, [ip]
	ldr	r2, [r4]
	orr	r0, r0, #1792
	mla	r2, r1, r2, r3
	ldr	r1, [r10]
	add	r3, r3, #1
	add	r1, r1, r2, lsl #1
	str	r3, [ip]
	bl	writew
	ldr	r3, [r4]
	ldr	r2, [r5]
	cmp	r2, r3
	movge	r2, #0
	ldrge	r3, [fp]
	strge	r2, [r5]
	addge	r3, r3, #1
	strge	r3, [fp]
.L12:
	ldr	r3, [sp, #8]
	ldrb	r2, [r3], #1	@ zero_extendqisi2
	cmp	r2, #0
	stmib	sp, {r2, r3}
	beq	.L1
	ldr	r2, [sp, #12]
	cmp	r2, r3
	beq	.L1
.L15:
	ldr	r3, [r9]
	ldr	r2, [fp]
	cmp	r2, r3
	bge	.L30
.L4:
	ldr	r3, [sp, #4]
	cmp	r3, #10
	bne	.L11
	mov	r1, #0
	ldr	r3, [fp]
	ldr	r2, .L31+16
	add	r3, r3, #1
	str	r1, [r2]
	str	r3, [fp]
	b	.L12
.L30:
	cmp	r3, #1
	movle	r7, #0
	ldr	r0, [r4]
	ble	.L6
	mov	r5, #1
.L5:
	cmp	r0, #0
	mov	r7, r5
	movgt	r8, #0
	sub	r6, r5, #1
	ble	.L8
.L7:
	mla	r0, r5, r0, r8
	ldr	r3, [r10]
	add	r0, r3, r0, lsl #1
	bl	readw
	ldr	r3, [r4]
	ldr	r1, [r10]
	mla	r3, r6, r3, r8
	add	r1, r1, r3, lsl #1
	bl	writew
	ldr	r0, [r4]
	add	r8, r8, #1
	cmp	r0, r8
	bgt	.L7
.L8:
	ldr	r3, [r9]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L5
.L6:
	cmp	r0, #0
	movgt	r5, #0
	ble	.L10
.L9:
	mla	r1, r7, r0, r5
	ldr	r3, [r10]
	mov	r0, #1824
	add	r1, r3, r1, lsl #1
	bl	writew
	ldr	r0, [r4]
	add	r5, r5, #1
	cmp	r0, r5
	bgt	.L9
.L10:
	ldr	r3, [r9]
	sub	r3, r3, #1
	str	r3, [fp]
	b	.L4
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L32:
	.align	2
.L31:
	.word	max_ypos
	.word	current_ypos
	.word	max_xpos
	.word	VGABASE
	.word	current_xpos
	.size	early_vga_write, .-early_vga_write
	.comm	max_ypos,4,4
	.comm	max_xpos,4,4
	.comm	current_ypos,4,4
	.comm	current_xpos,4,4
	.comm	VGABASE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
