	.file	"extr_vt_vga.c_vga_bitblt_pixels_block_ncolors.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vga_bitblt_pixels_block_ncolors, @function
vga_bitblt_pixels_block_ncolors:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rsi
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -68[rbp], edx
	mov	QWORD PTR -80[rbp], rdi
	mov	rbx, rsp
	mov	DWORD PTR -84[rbp], ecx
	mov	DWORD PTR -72[rbp], r8d
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	eax, r8d
	and	eax, 1073741823
	sal	rax, 4
	mov	rdx, rax
	and	rdx, -4096
	sub	rbx, rdx
	mov	rdx, rbx
	cmp	rsp, rdx
	je	.L3
.L39:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L39
.L3:
	and	eax, 4095
	sub	rsp, rax
	test	rax, rax
	jne	.L40
.L4:
	mov	r14d, DWORD PTR -72[rbp]
	mov	rax, QWORD PTR -80[rbp]
	mov	r12, rsp
	xor	esi, esi
	mov	rdi, r12
	mov	edx, r14d
	mov	rbx, QWORD PTR [rax]
	sal	edx, 4
	call	memset@PLT
	test	r14d, r14d
	je	.L5
	xor	r15d, r15d
.L11:
	mov	r11d, r15d
	lea	r9d, 0[0+r15*4]
	xor	r8d, r8d
	sal	r11d, 4
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	add	r8d, 1
	cmp	r8d, 16
	je	.L41
.L10:
	lea	eax, [r11+r8]
	mov	r10d, DWORD PTR 0[r13+rax*4]
	test	r10d, r10d
	je	.L6
	mov	esi, 7
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	sub	esi, 1
	cmp	esi, -1
	je	.L6
.L9:
	bt	r10d, esi
	jnc	.L7
	xor	edx, edx
.L8:
	mov	ecx, edx
	mov	eax, r8d
	lea	edi, [r9+rdx]
	add	edx, 1
	shr	eax, cl
	mov	ecx, esi
	and	eax, 1
	sal	eax, cl
	or	DWORD PTR [r12+rdi*4], eax
	cmp	edx, 4
	jne	.L8
	jmp	.L7
.L41:
	add	r15d, 1
	cmp	r14d, r15d
	jne	.L11
.L5:
	mov	rdi, QWORD PTR -80[rbp]
	xor	esi, esi
	call	vga_setwmode@PLT
	mov	edx, DWORD PTR VGA_SEQ_MAP_MASK[rip]
	mov	esi, DWORD PTR VGA_SEQ_ADDRESS[rip]
	mov	rdi, rbx
	call	REG_WRITE1@PLT
	mov	DWORD PTR -80[rbp], 0
.L14:
	mov	r14d, DWORD PTR -80[rbp]
	mov	esi, DWORD PTR VGA_SEQ_DATA[rip]
	mov	edx, 1
	mov	rdi, rbx
	mov	ecx, r14d
	sal	edx, cl
	call	REG_WRITE1@PLT
	mov	eax, DWORD PTR -72[rbp]
	test	eax, eax
	je	.L12
	mov	r15d, DWORD PTR -84[rbp]
	mov	r13d, eax
	add	r13d, r15d
	.p2align 4,,10
	.p2align 3
.L13:
	mov	esi, DWORD PTR VT_VGA_WIDTH[rip]
	mov	eax, r14d
	mov	rdi, rbx
	add	r14d, 4
	mov	edx, DWORD PTR [r12+rax*4]
	imul	esi, r15d
	add	esi, DWORD PTR -68[rbp]
	add	r15d, 1
	shr	esi, 3
	call	MEM_WRITE1@PLT
	cmp	r13d, r15d
	jne	.L13
.L12:
	add	DWORD PTR -80[rbp], 1
	mov	eax, DWORD PTR -80[rbp]
	cmp	eax, 4
	jne	.L14
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L42
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rax], 0
	jmp	.L4
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	vga_bitblt_pixels_block_ncolors, .-vga_bitblt_pixels_block_ncolors
	.comm	VT_VGA_WIDTH,4,4
	.comm	VGA_SEQ_MAP_MASK,4,4
	.comm	VGA_SEQ_DATA,4,4
	.comm	VGA_SEQ_ADDRESS,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_vt_vga.c_vga_bitblt_pixels_block_ncolors.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vga_bitblt_pixels_block_ncolors, %function
vga_bitblt_pixels_block_ncolors:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	mov	ip, r0
	str	r0, [fp, #-60]
	mov	r0, sp
	ldr	lr, [fp, #4]
	str	r3, [fp, #-52]
	sub	r0, r0, lr, lsl #4
	mov	sp, r0
	mov	r6, sp
	ldr	r3, .L35
	str	r6, [fp, #-56]
	mov	r7, r1
	mov	r10, r2
	mov	r1, #0
	lsl	r2, lr, #4
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r5, [ip]
	bl	memset
	ldr	r3, [fp, #4]
	cmp	r3, #0
	beq	.L2
	mov	r8, #0
	sub	r7, r7, #4
	lsl	r9, r3, #2
.L8:
	mov	r4, r7
	mov	ip, #0
	b	.L7
.L3:
	add	ip, ip, #1
	cmp	ip, #16
	beq	.L33
.L7:
	ldr	lr, [r4, #4]!
	cmp	lr, #0
	beq	.L3
	mov	r1, #7
	b	.L6
.L4:
	subs	r1, r1, #1
	bcc	.L3
.L6:
	asr	r3, lr, r1
	tst	r3, #1
	beq	.L4
	mov	r0, r6
	mov	r3, #0
	str	lr, [fp, #-48]
.L5:
	ldr	lr, [r0]
	lsr	r2, ip, r3
	and	r2, r2, #1
	add	r3, r3, #1
	orr	r2, lr, r2, lsl r1
	cmp	r3, #4
	str	r2, [r0], #4
	bne	.L5
	ldr	lr, [fp, #-48]
	b	.L4
.L33:
	add	r8, r8, #4
	cmp	r9, r8
	add	r7, r7, #64
	add	r6, r6, #16
	bne	.L8
.L2:
	mov	r8, #0
	ldr	r0, [fp, #-60]
	mov	r1, r8
	bl	vga_setwmode
	ldr	r3, .L35+4
	ldr	r2, .L35+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r5
	bl	REG_WRITE1
	ldr	r3, [fp, #-52]
	ldr	r2, [fp, #-56]
	rsb	r4, r3, r3, lsl #28
	add	r4, r2, r4, lsl #4
	ldr	r2, [fp, #4]
	ldr	r7, .L35+12
	add	r6, r2, r3
.L11:
	mov	r3, #1
	lsl	r2, r3, r8
	ldr	r3, .L35+16
	mov	r0, r5
	ldr	r1, [r3]
	bl	REG_WRITE1
	ldr	r3, [fp, #4]
	cmp	r3, #0
	beq	.L9
	ldr	r9, [fp, #-52]
.L10:
	ldr	r1, [r7]
	ldr	r2, [r4, r9, lsl #4]
	mla	r1, r9, r1, r10
	mov	r0, r5
	lsr	r1, r1, #3
	add	r9, r9, #1
	bl	MEM_WRITE1
	cmp	r6, r9
	bne	.L10
.L9:
	add	r8, r8, #1
	cmp	r8, #4
	add	r4, r4, #4
	bne	.L11
	ldr	r3, .L35
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L34
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L34:
	bl	__stack_chk_fail
.L36:
	.align	2
.L35:
	.word	.LC0
	.word	VGA_SEQ_ADDRESS
	.word	VGA_SEQ_MAP_MASK
	.word	VT_VGA_WIDTH
	.word	VGA_SEQ_DATA
	.size	vga_bitblt_pixels_block_ncolors, .-vga_bitblt_pixels_block_ncolors
	.comm	VT_VGA_WIDTH,4,4
	.comm	VGA_SEQ_MAP_MASK,4,4
	.comm	VGA_SEQ_DATA,4,4
	.comm	VGA_SEQ_ADDRESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
