	.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_ROWS@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	testq	%rax, %rax
	jle	LBB0_7
## %bb.1:
	movq	_matrix_debouncing@GOTPCREL(%rip), %r13
	movq	_debouncing@GOTPCREL(%rip), %r14
	movq	_DEBOUNCE@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rax
	movq	%rax, (%r14)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_unselect_rows
	incq	%rbx
	movq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_select_rows
	movq	%rbx, %rdi
	callq	_read_row
	movq	(%r13), %rcx
	cmpq	%rax, (%rcx,%rbx,8)
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, (%rcx,%rbx,8)
	cmpq	$0, (%r14)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_debug
	movq	(%r14), %rdi
	callq	_debug_hex
	leaq	L_.str.1(%rip), %rdi
	callq	_debug
	jmp	LBB0_5
LBB0_7:
	movq	_debouncing@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.8:
	decq	%rdx
	movq	%rdx, (%rcx)
	je	LBB0_9
## %bb.13:
	movl	$1, %edi
	callq	__delay_ms
	jmp	LBB0_12
LBB0_9:
	testq	%rax, %rax
	jle	LBB0_12
## %bb.10:
	movq	_matrix_debouncing@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rdx,8), %rsi
	movq	%rsi, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	(%r12), %rdx
	jl	LBB0_11
LBB0_12:
	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_ROWS,8,3                ## @MATRIX_ROWS
	.comm	_matrix_debouncing,8,3          ## @matrix_debouncing
	.comm	_debouncing,8,3                 ## @debouncing
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bounce!: "

L_.str.1:                               ## @.str.1
	.asciz	"\n"

	.comm	_DEBOUNCE,8,3                   ## @DEBOUNCE
	.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	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x22, _MATRIX_ROWS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MATRIX_ROWS@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x23, _debouncing@GOTPAGE
Lloh3:
	ldr	x23, [x23, _debouncing@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x19, #0
Lloh4:
	adrp	x24, _matrix_debouncing@GOTPAGE
Lloh5:
	ldr	x24, [x24, _matrix_debouncing@GOTPAGEOFF]
Lloh6:
	adrp	x25, _DEBOUNCE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _DEBOUNCE@GOTPAGEOFF]
Lloh8:
	adrp	x20, l_.str@PAGE
Lloh9:
	add	x20, x20, l_.str@PAGEOFF
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	str	x8, [x23]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_unselect_rows
	add	x19, x19, #1
	ldr	x8, [x22]
	cmp	x19, x8
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_select_rows
	mov	x0, x19
	bl	_read_row
	ldr	x8, [x24]
	ldr	x9, [x8, x19, lsl #3]
	cmp	x9, x0
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x0, [x8, x19, lsl #3]
	ldr	x8, [x23]
	cbz	x8, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_debug
	ldr	x0, [x23]
	bl	_debug_hex
	mov	x0, x21
	bl	_debug
	b	LBB0_2
LBB0_7:
	ldr	x9, [x23]
	cbz	x9, LBB0_13
; %bb.8:
	subs	x9, x9, #1
	str	x9, [x23]
	b.eq	LBB0_10
; %bb.9:
	mov	w0, #1
	bl	__delay_ms
	b	LBB0_13
LBB0_10:
	cmp	x8, #1
	b.lt	LBB0_13
; %bb.11:
	mov	x8, #0
Lloh12:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh13:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
Lloh15:
	adrp	x10, _matrix@GOTPAGE
Lloh16:
	ldr	x10, [x10, _matrix@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x10]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #3
	ldr	x12, [x9, x11]
	str	x12, [x10, x11]
	add	x8, x8, #1
	ldr	x11, [x22]
	cmp	x8, x11
	b.lt	LBB0_12
LBB0_13:
	bl	_matrix_scan_quantum
	mov	w0, #1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MATRIX_ROWS,8,3                ; @MATRIX_ROWS
	.comm	_matrix_debouncing,8,3          ; @matrix_debouncing
	.comm	_debouncing,8,3                 ; @debouncing
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bounce!: "

l_.str.1:                               ; @.str.1
	.asciz	"\n"

	.comm	_DEBOUNCE,8,3                   ; @DEBOUNCE
	.comm	_matrix,8,3                     ; @matrix
.subsections_via_symbols
