	.file	"extr_matrix.c_matrix_scan.c"
	.intel_syntax noprefix
	.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
	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
	mov	ecx, DWORD PTR MATRIX_ROWS[rip]
	test	ecx, ecx
	jle	.L2
	xor	r12d, r12d
	lea	r15, .L5[rip]
	lea	r14, .L16[rip]
	.p2align 4,,10
	.p2align 3
.L26:
	mov	r13d, r12d
	cmp	r12d, 8
	ja	.L3
	mov	eax, r12d
	movsx	rax, DWORD PTR [r15+rax*4]
	add	rax, r15
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L5:
	.long	.L13-.L5
	.long	.L12-.L5
	.long	.L11-.L5
	.long	.L10-.L5
	.long	.L9-.L5
	.long	.L8-.L5
	.long	.L7-.L5
	.long	.L6-.L5
	.long	.L4-.L5
	.text
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 10
	call	palSetPad@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, 20
	call	wait_us@PLT
	mov	edi, DWORD PTR GPIOC[rip]
	call	palReadPort@PLT
	mov	edi, DWORD PTR GPIOD[rip]
	mov	ebp, eax
	call	palReadPort@PLT
	mov	edi, DWORD PTR GPIOD[rip]
	sal	ebp, 5
	movsx	rbx, eax
	and	ebp, 192
	call	palReadPort@PLT
	shr	rbx, 2
	and	eax, 3
	and	ebx, 60
	or	ebp, eax
	or	ebx, ebp
	cmp	r13d, 8
	ja	.L14
	movsx	rax, DWORD PTR [r14+r13*4]
	add	rax, r14
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L16:
	.long	.L24-.L16
	.long	.L23-.L16
	.long	.L22-.L16
	.long	.L21-.L16
	.long	.L20-.L16
	.long	.L19-.L16
	.long	.L18-.L16
	.long	.L17-.L16
	.long	.L15-.L16
	.text
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 10
	call	palClearPad@PLT
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rax, QWORD PTR matrix_debouncing[rip]
	lea	rax, [rax+r12*4]
	cmp	DWORD PTR [rax], ebx
	je	.L25
	mov	DWORD PTR [rax], ebx
	xor	eax, eax
	mov	DWORD PTR debouncing[rip], 1
	call	timer_read@PLT
	mov	DWORD PTR debouncing_time[rip], eax
.L25:
	add	r12, 1
	cmp	DWORD PTR MATRIX_ROWS[rip], r12d
	jg	.L26
.L2:
	mov	edx, DWORD PTR debouncing[rip]
	test	edx, edx
	jne	.L36
.L28:
	xor	eax, eax
	call	matrix_scan_quantum@PLT
	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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 9
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L19:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 8
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR GPIOC[rip]
	xor	esi, esi
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 19
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 18
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 3
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 9
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 8
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L24:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 2
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 11
	call	palClearPad@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, DWORD PTR GPIOC[rip]
	xor	esi, esi
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 19
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 2
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR GPIOC[rip]
	mov	esi, 11
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 18
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, DWORD PTR GPIOB[rip]
	mov	esi, 3
	call	palSetPad@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L36:
	mov	edi, DWORD PTR debouncing_time[rip]
	call	timer_elapsed@PLT
	cmp	rax, QWORD PTR DEBOUNCE[rip]
	jle	.L28
	mov	eax, DWORD PTR MATRIX_ROWS[rip]
	test	eax, eax
	jle	.L30
	mov	rsi, QWORD PTR matrix_debouncing[rip]
	mov	rcx, QWORD PTR matrix[rip]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edx, DWORD PTR [rsi+rax*4]
	mov	DWORD PTR [rcx+rax*4], edx
	add	rax, 1
	cmp	DWORD PTR MATRIX_ROWS[rip], eax
	jg	.L31
.L30:
	mov	DWORD PTR debouncing[rip], 0
	jmp	.L28
	.cfi_endproc
.LFE0:
	.size	matrix_scan, .-matrix_scan
	.comm	matrix_debouncing,8,8
	.comm	matrix,8,8
	.comm	debouncing_time,4,4
	.comm	debouncing,4,4
	.comm	MATRIX_ROWS,4,4
	.comm	GPIOD,4,4
	.comm	GPIOC,4,4
	.comm	GPIOB,4,4
	.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
	.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	r7, .L39
	ldr	r3, [r7]
	cmp	r3, #0
	ldrle	r10, .L39+4
	ble	.L2
	mov	fp, #0
	ldr	r6, .L39+8
	ldr	r5, .L39+12
	ldr	r8, .L39+16
	ldr	r10, .L39+4
	ldr	r9, .L39+20
.L26:
	cmp	fp, #8
	ldrls	pc, [pc, fp, asl #2]
	b	.L3
.L5:
	.word	.L13
	.word	.L12
	.word	.L11
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L4
.L4:
	mov	r1, #11
	ldr	r0, [r6]
	bl	palSetPad
.L3:
	mov	r0, #20
	bl	wait_us
	ldr	r0, [r6]
	bl	palReadPort
	mov	r4, r0
	ldr	r0, [r5]
	bl	palReadPort
	lsl	r4, r4, #5
	lsr	r2, r0, #2
	and	r2, r2, #60
	ldr	r0, [r5]
	and	r4, r4, #192
	orr	r4, r4, r2
	bl	palReadPort
	and	r0, r0, #3
	orr	r4, r0, r4
	cmp	fp, #8
	ldrls	pc, [pc, fp, asl #2]
	b	.L14
.L16:
	.word	.L24
	.word	.L23
	.word	.L22
	.word	.L21
	.word	.L20
	.word	.L19
	.word	.L18
	.word	.L17
	.word	.L15
.L15:
	mov	r1, #11
	ldr	r0, [r6]
	bl	palClearPad
.L14:
	ldr	r2, [r8]
	ldr	r1, [r2, fp, lsl #2]
	cmp	r1, r4
	beq	.L25
	mov	r1, #1
	str	r4, [r2, fp, lsl #2]
	str	r1, [r10]
	bl	timer_read
	ldr	r3, .L39+24
	str	r0, [r3]
.L25:
	ldr	r2, [r7]
	add	fp, fp, #1
	cmp	r2, fp
	bgt	.L26
.L2:
	ldr	r3, [r10]
	cmp	r3, #0
	bne	.L38
.L28:
	bl	matrix_scan_quantum
	mov	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	mov	r1, #10
	ldr	r0, [r6]
	bl	palClearPad
	b	.L14
.L18:
	mov	r1, #9
	ldr	r0, [r6]
	bl	palClearPad
	b	.L14
.L19:
	mov	r1, #8
	ldr	r0, [r6]
	bl	palClearPad
	b	.L14
.L20:
	mov	r1, #0
	ldr	r0, [r6]
	bl	palClearPad
	b	.L14
.L21:
	mov	r1, #19
	ldr	r0, [r9]
	bl	palClearPad
	b	.L14
.L22:
	mov	r1, #18
	ldr	r0, [r9]
	bl	palClearPad
	b	.L14
.L6:
	mov	r1, #10
	ldr	r0, [r6]
	bl	palSetPad
	b	.L3
.L7:
	mov	r1, #9
	ldr	r0, [r6]
	bl	palSetPad
	b	.L3
.L23:
	mov	r1, #3
	ldr	r0, [r9]
	bl	palClearPad
	b	.L14
.L24:
	mov	r1, #2
	ldr	r0, [r9]
	bl	palClearPad
	b	.L14
.L8:
	mov	r1, #8
	ldr	r0, [r6]
	bl	palSetPad
	b	.L3
.L9:
	mov	r1, #0
	ldr	r0, [r6]
	bl	palSetPad
	b	.L3
.L12:
	mov	r1, #3
	ldr	r0, [r9]
	bl	palSetPad
	b	.L3
.L13:
	mov	r1, #2
	ldr	r0, [r9]
	bl	palSetPad
	b	.L3
.L10:
	mov	r1, #19
	ldr	r0, [r9]
	bl	palSetPad
	b	.L3
.L11:
	mov	r1, #18
	ldr	r0, [r9]
	bl	palSetPad
	b	.L3
.L38:
	ldr	r3, .L39+24
	ldr	r0, [r3]
	bl	timer_elapsed
	ldr	r3, .L39+28
	ldr	r3, [r3]
	cmp	r0, r3
	ble	.L28
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L30
	mov	r3, #0
	ldr	r1, .L39+16
	ldr	r2, .L39+32
	ldr	r1, [r1]
	ldr	r2, [r2]
	sub	r1, r1, #4
	sub	r2, r2, #4
.L31:
	ldr	r0, [r1, #4]!
	add	r3, r3, #1
	str	r0, [r2, #4]!
	ldr	r0, [r7]
	cmp	r0, r3
	bgt	.L31
.L30:
	mov	r3, #0
	str	r3, [r10]
	b	.L28
.L40:
	.align	2
.L39:
	.word	MATRIX_ROWS
	.word	debouncing
	.word	GPIOC
	.word	GPIOD
	.word	matrix_debouncing
	.word	GPIOB
	.word	debouncing_time
	.word	DEBOUNCE
	.word	matrix
	.size	matrix_scan, .-matrix_scan
	.comm	matrix_debouncing,4,4
	.comm	matrix,4,4
	.comm	debouncing_time,4,4
	.comm	debouncing,4,4
	.comm	MATRIX_ROWS,4,4
	.comm	GPIOD,4,4
	.comm	GPIOC,4,4
	.comm	GPIOB,4,4
	.comm	DEBOUNCE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
