	.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	_isLeftHand@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpq	$0, (%rax)
	movq	_ROWS_PER_HAND@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	%eax, %edx
	cmovnel	%ecx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	testq	%rax, %rax
	jle	LBB0_5
## %bb.1:
	movslq	-44(%rbp), %r12                 ## 4-byte Folded Reload
	shlq	$3, %r12
	movq	_matrix_debouncing@GOTPCREL(%rip), %r13
	movq	_debouncing@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_unselect_rows
	incq	%rbx
	movq	(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_select_row
	movl	$30, %edi
	callq	__delay_us
	xorl	%eax, %eax
	callq	_read_cols
	movq	(%r13), %rcx
	addq	%r12, %rcx
	cmpq	%rax, (%rcx,%rbx,8)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, (%rcx,%rbx,8)
	movq	_DEBOUNCE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	jmp	LBB0_4
LBB0_5:
	movq	_debouncing@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.6:
	decq	%rdx
	movq	%rdx, (%rcx)
	je	LBB0_7
## %bb.11:
	movl	$1, %edi
	callq	__delay_ms
	jmp	LBB0_10
LBB0_7:
	testq	%rax, %rax
	jle	LBB0_10
## %bb.8:
	movq	_matrix_debouncing@GOTPCREL(%rip), %rdx
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	movq	_matrix@GOTPCREL(%rip), %rcx
	shlq	$3, %rax
	movq	(%rcx), %rcx
	addq	%rax, %rcx
	addq	(%rdx), %rax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rdx,8), %rsi
	movq	%rsi, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	(%r14), %rdx
	jl	LBB0_9
LBB0_10:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_isLeftHand,8,3                 ## @isLeftHand
	.comm	_ROWS_PER_HAND,8,3              ## @ROWS_PER_HAND
	.comm	_matrix_debouncing,8,3          ## @matrix_debouncing
	.comm	_DEBOUNCE,8,3                   ## @DEBOUNCE
	.comm	_debouncing,8,3                 ## @debouncing
	.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	x8, _isLeftHand@GOTPAGE
Lloh1:
	ldr	x8, [x8, _isLeftHand@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
Lloh3:
	adrp	x20, _ROWS_PER_HAND@GOTPAGE
Lloh4:
	ldr	x20, [x20, _ROWS_PER_HAND@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x9, #0
	csel	w21, w8, wzr, eq
Lloh5:
	adrp	x22, _debouncing@GOTPAGE
Lloh6:
	ldr	x22, [x22, _debouncing@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x19, #0
	sbfiz	x23, x21, #3, #32
Lloh7:
	adrp	x24, _matrix_debouncing@GOTPAGE
Lloh8:
	ldr	x24, [x24, _matrix_debouncing@GOTPAGEOFF]
Lloh9:
	adrp	x25, _DEBOUNCE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _DEBOUNCE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_unselect_rows
	add	x19, x19, #1
	ldr	x8, [x20]
	cmp	x19, x8
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_select_row
	mov	w0, #30
	bl	__delay_us
	bl	_read_cols
	ldr	x8, [x24]
	add	x8, x8, x23
	ldr	x9, [x8, x19, lsl #3]
	cmp	x9, x0
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x0, [x8, x19, lsl #3]
	ldr	x8, [x25]
	str	x8, [x22]
	b	LBB0_2
LBB0_5:
	ldr	x9, [x22]
	cbz	x9, LBB0_11
; %bb.6:
	subs	x9, x9, #1
	str	x9, [x22]
	b.eq	LBB0_8
; %bb.7:
	mov	w0, #1
	bl	__delay_ms
	b	LBB0_11
LBB0_8:
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x8, #0
Lloh11:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh12:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh13:
	adrp	x10, _matrix@GOTPAGE
Lloh14:
	ldr	x10, [x10, _matrix@GOTPAGEOFF]
Lloh15:
	ldr	x11, [x9]
Lloh16:
	ldr	x9, [x10]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	sbfiz	x10, x21, #3, #32
	add	x9, x9, x10
	add	x10, x11, x10
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #3
	ldr	x12, [x10, x11]
	str	x12, [x9, x11]
	add	x8, x8, #1
	ldr	x11, [x20]
	cmp	x8, x11
	b.lt	LBB0_10
LBB0_11:
	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	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_isLeftHand,8,3                 ; @isLeftHand
	.comm	_ROWS_PER_HAND,8,3              ; @ROWS_PER_HAND
	.comm	_matrix_debouncing,8,3          ; @matrix_debouncing
	.comm	_DEBOUNCE,8,3                   ; @DEBOUNCE
	.comm	_debouncing,8,3                 ; @debouncing
	.comm	_matrix,8,3                     ; @matrix
.subsections_via_symbols
