	.file	"extr_matrix.c_matrix_scan.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"bounce!: "
.LC1:
	.string	"%02X"
	.text
	.p2align 4
	.globl	matrix_scan
	.type	matrix_scan, @function
matrix_scan:
.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
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	cmp	QWORD PTR MATRIX_COLS[rip], 0
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, r12
	call	select_col@PLT
	mov	edi, 3
	call	_delay_us@PLT
	mov	rdi, r12
	call	read_rows@PLT
	cmp	QWORD PTR MATRIX_ROWS[rip], 0
	jle	.L10
	mov	ebp, 1
	mov	ecx, r12d
	mov	r13d, eax
	xor	ebx, ebx
	sal	rbp, cl
	mov	r14d, 1
	mov	r15d, ebp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR DEBOUNCE[rip]
	mov	QWORD PTR debouncing[rip], rax
.L7:
	add	rbx, 1
	cmp	QWORD PTR MATRIX_ROWS[rip], rbx
	jle	.L10
.L9:
	mov	rax, QWORD PTR matrix_debouncing[rip]
	mov	edx, r14d
	mov	ecx, ebx
	mov	edi, r15d
	sal	edx, cl
	lea	rax, [rax+rbx*8]
	and	edx, r13d
	mov	rsi, QWORD PTR [rax]
	and	edi, esi
	cmp	edi, edx
	je	.L7
	xor	rsi, rbp
	mov	QWORD PTR [rax], rsi
	cmp	QWORD PTR debouncing[rip], 0
	je	.L8
	lea	rdi, .LC0[rip]
	call	dprint@PLT
	mov	rsi, QWORD PTR debouncing[rip]
	lea	rdi, .LC1[rip]
	call	dprintf@PLT
	xor	eax, eax
	call	dprintln@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	xor	eax, eax
	add	r12, 1
	call	unselect_cols@PLT
	cmp	QWORD PTR MATRIX_COLS[rip], r12
	jg	.L2
.L6:
	mov	rax, QWORD PTR debouncing[rip]
	test	rax, rax
	je	.L11
	sub	rax, 1
	mov	QWORD PTR debouncing[rip], rax
	jne	.L12
	cmp	QWORD PTR MATRIX_ROWS[rip], 0
	mov	rsi, QWORD PTR matrix_debouncing[rip]
	mov	rcx, QWORD PTR matrix[rip]
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdx, QWORD PTR [rsi+rax*8]
	mov	QWORD PTR [rcx+rax*8], rdx
	add	rax, 1
	cmp	QWORD PTR MATRIX_ROWS[rip], rax
	jg	.L14
.L11:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, 1
	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
.L12:
	.cfi_restore_state
	mov	edi, 1
	call	_delay_ms@PLT
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	matrix_scan, .-matrix_scan
	.comm	matrix_debouncing,8,8
	.comm	matrix,8,8
	.comm	debouncing,8,8
	.comm	MATRIX_ROWS,8,8
	.comm	MATRIX_COLS,8,8
	.comm	DEBOUNCE,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_matrix.c_matrix_scan.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"bounce!: \000"
	.align	2
.LC1:
	.ascii	"%02X\000"
	.text
	.align	2
	.global	matrix_scan
	.syntax unified
	.arm
	.fpu softvfp
	.type	matrix_scan, %function
matrix_scan:
	@ 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	r3, .L26
	ldr	r3, [r3]
	cmp	r3, #0
	ldrle	r6, .L26+4
	ble	.L2
	mov	r9, #0
	ldr	r8, .L26+8
	ldr	r6, .L26+4
	ldr	fp, .L26+12
	ldr	r10, .L26+16
.L7:
	mov	r0, r9
	bl	select_col
	mov	r0, #3
	bl	_delay_us
	mov	r0, r9
	bl	read_rows
	ldr	r3, [r8]
	mov	r7, r0
	cmp	r3, #0
	ble	.L3
	mov	r5, #1
	mov	r4, #0
	lsl	r5, r5, r9
	b	.L6
.L5:
	ldr	r3, [r10]
	str	r3, [r6]
.L4:
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L3
.L6:
	mov	r2, #1
	ldr	r1, [fp]
	and	r2, r7, r2, lsl r4
	ldr	r3, [r1, r4, lsl #2]
	eor	r0, r3, r5
	and	r3, r3, r5
	cmp	r3, r2
	beq	.L4
	str	r0, [r1, r4, lsl #2]
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L5
	ldr	r0, .L26+20
	bl	dprint
	ldr	r1, [r6]
	ldr	r0, .L26+24
	bl	dprintf
	bl	dprintln
	b	.L5
.L3:
	bl	unselect_cols
	ldr	r3, .L26
	add	r9, r9, #1
	ldr	r3, [r3]
	cmp	r3, r9
	bgt	.L7
.L2:
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L11
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r6]
	bne	.L9
	ldr	r8, .L26+8
	ldr	r2, [r8]
	cmp	r2, #0
	ble	.L11
	ldr	r1, .L26+12
	ldr	r2, .L26+28
	ldr	r1, [r1]
	ldr	r2, [r2]
	sub	r1, r1, #4
	sub	r2, r2, #4
.L12:
	ldr	r0, [r1, #4]!
	add	r3, r3, #1
	str	r0, [r2, #4]!
	ldr	r0, [r8]
	cmp	r0, r3
	bgt	.L12
.L11:
	mov	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	mov	r0, #1
	bl	_delay_ms
	mov	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L27:
	.align	2
.L26:
	.word	MATRIX_COLS
	.word	debouncing
	.word	MATRIX_ROWS
	.word	matrix_debouncing
	.word	DEBOUNCE
	.word	.LC0
	.word	.LC1
	.word	matrix
	.size	matrix_scan, .-matrix_scan
	.comm	matrix_debouncing,4,4
	.comm	matrix,4,4
	.comm	debouncing,4,4
	.comm	MATRIX_ROWS,4,4
	.comm	MATRIX_COLS,4,4
	.comm	DEBOUNCE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
