	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan                    ## -- Begin function matrix_scan
	.p2align	4, 0x90
_matrix_scan:                           ## @matrix_scan
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MATRIX_COLS@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	jle	LBB0_5
## %bb.1:
	movq	_matrix_debouncing@GOTPCREL(%rip), %r15
	movq	_debouncing@GOTPCREL(%rip), %r12
	movq	_debouncing_time@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	(%r14), %rbx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_read_rows_on_col
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, (%r12)
	xorl	%eax, %eax
	callq	_timer_read
	movl	%eax, (%r13)
	jmp	LBB0_4
LBB0_5:
	movq	_debouncing@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_22
## %bb.6:
	movq	_debouncing_time@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_timer_elapsed
	movq	_DEBOUNCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_22
## %bb.7:
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	testq	%r8, %r8
	jle	LBB0_21
## %bb.8:
	movq	_matrix_debouncing@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_matrix@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%esi, %esi
	cmpq	$8, %r8
	jb	LBB0_18
## %bb.9:
	movq	%rdx, %rax
	subq	%rcx, %rax
	cmpq	$32, %rax
	jb	LBB0_18
## %bb.10:
	movq	%r8, %rsi
	andq	$-8, %rsi
	leaq	-8(%rsi), %rax
	movq	%rax, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$24, %rax
	jae	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	andq	$-4, %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rcx,%rax,4), %xmm0
	movups	16(%rcx,%rax,4), %xmm1
	movups	%xmm0, (%rdx,%rax,4)
	movups	%xmm1, 16(%rdx,%rax,4)
	movups	32(%rcx,%rax,4), %xmm0
	movups	48(%rcx,%rax,4), %xmm1
	movups	%xmm0, 32(%rdx,%rax,4)
	movups	%xmm1, 48(%rdx,%rax,4)
	movups	64(%rcx,%rax,4), %xmm0
	movups	80(%rcx,%rax,4), %xmm1
	movups	%xmm0, 64(%rdx,%rax,4)
	movups	%xmm1, 80(%rdx,%rax,4)
	movups	96(%rcx,%rax,4), %xmm0
	movups	112(%rcx,%rax,4), %xmm1
	movups	%xmm0, 96(%rdx,%rax,4)
	movups	%xmm1, 112(%rdx,%rax,4)
	addq	$32, %rax
	addq	$-4, %rdi
	jne	LBB0_13
LBB0_14:
	testq	%r9, %r9
	je	LBB0_17
## %bb.15:
	leaq	(%rdx,%rax,4), %rdi
	addq	$16, %rdi
	leaq	(%rcx,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rax,%rbx), %xmm0
	movups	(%rax,%rbx), %xmm1
	movups	%xmm0, -16(%rdi,%rbx)
	movups	%xmm1, (%rdi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r9
	jne	LBB0_16
LBB0_17:
	cmpq	%rsi, %r8
	je	LBB0_21
LBB0_18:
	movq	%rsi, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdi
	andq	$3, %rdi
	je	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %ebx
	movl	%ebx, (%rdx,%rsi,4)
	incq	%rsi
	decq	%rdi
	jne	LBB0_19
LBB0_20:
	cmpq	$3, %rax
	jb	LBB0_21
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %eax
	movl	%eax, (%rdx,%rsi,4)
	movl	4(%rcx,%rsi,4), %eax
	movl	%eax, 4(%rdx,%rsi,4)
	movl	8(%rcx,%rsi,4), %eax
	movl	%eax, 8(%rdx,%rsi,4)
	movl	12(%rcx,%rsi,4), %eax
	movl	%eax, 12(%rdx,%rsi,4)
	addq	$4, %rsi
	cmpq	%rsi, %r8
	jne	LBB0_23
LBB0_21:
	movl	$0, (%r14)
LBB0_22:
	xorl	%eax, %eax
	callq	_matrix_scan_quantum
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MATRIX_COLS,8,3                ## @MATRIX_COLS
	.comm	_matrix_debouncing,8,3          ## @matrix_debouncing
	.comm	_debouncing,4,2                 ## @debouncing
	.comm	_debouncing_time,4,2            ## @debouncing_time
	.comm	_DEBOUNCE,8,3                   ## @DEBOUNCE
	.comm	_MATRIX_ROWS,8,3                ## @MATRIX_ROWS
	.comm	_matrix,8,3                     ## @matrix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan                    ; -- Begin function matrix_scan
	.p2align	2
_matrix_scan:                           ; @matrix_scan
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x22, _MATRIX_COLS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MATRIX_COLS@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x20, _debouncing@GOTPAGE
Lloh3:
	ldr	x20, [x20, _debouncing@GOTPAGEOFF]
Lloh4:
	adrp	x21, _debouncing_time@GOTPAGE
Lloh5:
	ldr	x21, [x21, _debouncing_time@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x19, #0
Lloh6:
	adrp	x23, _matrix_debouncing@GOTPAGE
Lloh7:
	ldr	x23, [x23, _matrix_debouncing@GOTPAGEOFF]
	mov	w24, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x19, x19, #1
	ldr	x8, [x22]
	cmp	x19, x8
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	mov	x1, x19
	bl	_read_rows_on_col
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w24, [x20]
	bl	_timer_read
	str	w0, [x21]
	b	LBB0_2
LBB0_5:
	ldr	w8, [x20]
	cbz	w8, LBB0_16
; %bb.6:
	ldr	w0, [x21]
	bl	_timer_elapsed
Lloh8:
	adrp	x8, _DEBOUNCE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DEBOUNCE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_16
; %bb.7:
Lloh11:
	adrp	x8, _MATRIX_ROWS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MATRIX_ROWS@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.8:
	mov	x10, #0
Lloh14:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh15:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
Lloh17:
	adrp	x11, _matrix@GOTPAGE
Lloh18:
	ldr	x11, [x11, _matrix@GOTPAGEOFF]
Lloh19:
	ldr	x11, [x11]
	cmp	x8, #16
	b.lo	LBB0_13
; %bb.9:
	sub	x12, x11, x9
	cmp	x12, #64
	b.lo	LBB0_13
; %bb.10:
	and	x10, x8, #0xfffffffffffffff0
	add	x12, x9, #32
	add	x13, x11, #32
	mov	x14, x10
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x13, #-32]
	stp	q2, q3, [x13], #64
	subs	x14, x14, #16
	b.ne	LBB0_11
; %bb.12:
	cmp	x8, x10
	b.eq	LBB0_15
LBB0_13:
	sub	x8, x8, x10
	lsl	x12, x10, #2
	add	x10, x11, x12
	add	x9, x9, x12
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	str	w11, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_14
LBB0_15:
	str	wzr, [x20]
LBB0_16:
	bl	_matrix_scan_quantum
	mov	w0, #1
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MATRIX_COLS,8,3                ; @MATRIX_COLS
	.comm	_matrix_debouncing,8,3          ; @matrix_debouncing
	.comm	_debouncing,4,2                 ; @debouncing
	.comm	_debouncing_time,4,2            ; @debouncing_time
	.comm	_DEBOUNCE,8,3                   ; @DEBOUNCE
	.comm	_MATRIX_ROWS,8,3                ; @MATRIX_ROWS
	.comm	_matrix,8,3                     ; @matrix
.subsections_via_symbols
