	.file	"extr_vgastate.c_restore_vga_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	restore_vga_mode, @function
restore_vga_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	esi, DWORD PTR VGA_MIS_W[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, 2
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r12, QWORD PTR 24[rdi]
	mov	rbx, rdi
	mov	edi, DWORD PTR 16[rdi]
	mov	edx, DWORD PTR [r12]
	call	vga_w@PLT
	mov	eax, DWORD PTR [r12]
	mov	rsi, QWORD PTR VGA_SEQ_CLOCK_MODE[rip]
	mov	edi, DWORD PTR 16[rbx]
	and	eax, 1
	cmp	eax, 1
	sbb	r14d, r14d
	and	r14d, -32
	add	r14d, 976
	cmp	eax, 1
	mov	rax, QWORD PTR 8[r12]
	sbb	r13d, r13d
	mov	edx, DWORD PTR [rax+rsi*4]
	and	r13d, -32
	add	r13d, 986
	or	edx, 32
	call	vga_wseq@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, 1
	mov	rsi, QWORD PTR VGA_SEQ_RESET[rip]
	call	vga_wseq@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, r13d
	call	vga_r@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, DWORD PTR VGA_ATT_W[rip]
	xor	edx, edx
	call	vga_w@PLT
	cmp	DWORD PTR [rbx], 2
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR 8[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	rsi, rbp
	mov	edx, DWORD PTR [rax+rbp*4]
	add	rbp, 1
	call	vga_wseq@PLT
	cmp	DWORD PTR [rbx], ebp
	jg	.L3
.L6:
	mov	rax, QWORD PTR 16[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, 17
	mov	esi, r14d
	xor	ebp, ebp
	mov	ecx, DWORD PTR 68[rax]
	and	cl, 127
	call	vga_wcrtcs@PLT
	mov	ecx, DWORD PTR 4[rbx]
	test	ecx, ecx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 16[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, ebp
	mov	esi, r14d
	mov	ecx, DWORD PTR [rax+rbp*4]
	add	rbp, 1
	call	vga_wcrtcs@PLT
	cmp	DWORD PTR 4[rbx], ebp
	jg	.L4
.L5:
	mov	edx, DWORD PTR 8[rbx]
	xor	ebp, ebp
	test	edx, edx
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR 32[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, ebp
	mov	edx, DWORD PTR [rax+rbp*4]
	add	rbp, 1
	call	vga_wgfx@PLT
	cmp	DWORD PTR 8[rbx], ebp
	jg	.L7
.L8:
	mov	eax, DWORD PTR 12[rbx]
	xor	ebp, ebp
	test	eax, eax
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, r13d
	call	vga_r@PLT
	mov	rax, QWORD PTR 24[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, ebp
	mov	edx, DWORD PTR [rax+rbp*4]
	add	rbp, 1
	call	vga_wattr@PLT
	cmp	DWORD PTR 12[rbx], ebp
	jg	.L9
.L10:
	mov	edi, DWORD PTR 16[rbx]
	mov	rsi, QWORD PTR VGA_SEQ_RESET[rip]
	mov	edx, 3
	call	vga_wseq@PLT
	mov	rsi, QWORD PTR VGA_SEQ_CLOCK_MODE[rip]
	mov	rax, QWORD PTR 8[r12]
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, DWORD PTR [rax+rsi*4]
	and	edx, -33
	call	vga_wseq@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	esi, r13d
	call	vga_r@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, 32
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	esi, DWORD PTR VGA_ATT_W[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	vga_w@PLT
	.cfi_endproc
.LFE0:
	.size	restore_vga_mode, .-restore_vga_mode
	.comm	VGA_SEQ_RESET,8,8
	.comm	VGA_SEQ_CLOCK_MODE,8,8
	.comm	VGA_MIS_W,4,4
	.comm	VGA_ATT_W,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_vgastate.c_restore_vga_mode.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	restore_vga_mode, %function
restore_vga_mode:
	@ 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	r6, [r0, #20]
	ldr	r3, .L22
	mov	r4, r0
	ldr	r1, [r3]
	ldr	r2, [r6]
	ldr	r0, [r0, #16]
	bl	vga_w
	ldr	r3, [r6]
	ldr	ip, .L22+4
	and	r3, r3, #1
	cmp	r3, #0
	ldr	r7, .L22+8
	moveq	r7, ip
	ldr	r10, .L22+12
	ldr	r2, [r6, #4]
	ldr	r1, [r10]
	ldr	r9, .L22+16
	ldr	r2, [r2, r1, lsl #2]
	ldr	r0, [r4, #16]
	orr	r2, r2, #32
	movne	fp, #976
	moveq	fp, #944
	ldr	r8, .L22+20
	bl	vga_wseq
	mov	r2, #1
	ldr	r1, [r9]
	ldr	r0, [r4, #16]
	bl	vga_wseq
	mov	r1, r7
	ldr	r0, [r4, #16]
	bl	vga_r
	mov	r2, #0
	ldr	r0, [r4, #16]
	ldr	r1, [r8]
	bl	vga_w
	ldr	r3, [r4]
	cmp	r3, #2
	movgt	r5, #2
	ble	.L6
.L3:
	ldr	r3, [r6, #4]
	mov	r1, r5
	ldr	r2, [r3, r5, lsl #2]
	ldr	r0, [r4, #16]
	bl	vga_wseq
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L3
.L6:
	ldr	r3, [r6, #8]
	mov	r2, #17
	ldr	r3, [r3, #68]
	mov	r1, fp
	bic	r3, r3, #128
	ldr	r0, [r4, #16]
	bl	vga_wcrtcs
	ldr	r3, [r4, #4]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L5
.L4:
	ldr	r3, [r6, #8]
	mov	r2, r5
	ldr	r3, [r3, r5, lsl #2]
	mov	r1, fp
	ldr	r0, [r4, #16]
	bl	vga_wcrtcs
	ldr	r3, [r4, #4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L4
.L5:
	ldr	r3, [r4, #8]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L8
.L7:
	ldr	r3, [r6, #16]
	mov	r1, r5
	ldr	r2, [r3, r5, lsl #2]
	ldr	r0, [r4, #16]
	bl	vga_wgfx
	ldr	r3, [r4, #8]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L7
.L8:
	ldr	r3, [r4, #12]
	cmp	r3, #0
	movgt	r5, #0
	ble	.L10
.L9:
	mov	r1, r7
	ldr	r0, [r4, #16]
	bl	vga_r
	ldr	r3, [r6, #12]
	mov	r1, r5
	ldr	r2, [r3, r5, lsl #2]
	ldr	r0, [r4, #16]
	bl	vga_wattr
	ldr	r3, [r4, #12]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L9
.L10:
	ldr	r1, [r9]
	mov	r2, #3
	ldr	r0, [r4, #16]
	bl	vga_wseq
	ldr	r1, [r10]
	ldr	r3, [r6, #4]
	ldr	r0, [r4, #16]
	ldr	r2, [r3, r1, lsl #2]
	bic	r2, r2, #32
	bl	vga_wseq
	mov	r1, r7
	ldr	r0, [r4, #16]
	bl	vga_r
	ldr	r1, [r8]
	ldr	r0, [r4, #16]
	mov	r2, #32
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	vga_w
.L23:
	.align	2
.L22:
	.word	VGA_MIS_W
	.word	954
	.word	986
	.word	VGA_SEQ_CLOCK_MODE
	.word	VGA_SEQ_RESET
	.word	VGA_ATT_W
	.size	restore_vga_mode, .-restore_vga_mode
	.comm	VGA_SEQ_RESET,4,4
	.comm	VGA_SEQ_CLOCK_MODE,4,4
	.comm	VGA_MIS_W,4,4
	.comm	VGA_ATT_W,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
