	.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), %rax
	cmpq	$0, (%rax)
	jle	LBB0_10
## %bb.1:
	xorl	%ebx, %ebx
	movq	_debouncing@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_release_column
	incq	%rbx
	movq	_MATRIX_COLS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jge	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_pull_column
	movl	$5, %edi
	callq	__delay_us
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	movq	_matrix_debouncing@GOTPCREL(%rip), %r8
	movq	_row_pin@GOTPCREL(%rip), %r9
	movq	_row_bit@GOTPCREL(%rip), %r10
	jle	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r13d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	shll	%cl, %r13d
	movl	$1, %r14d
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %r14
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	_DEBOUNCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%r12)
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r15
	cmpq	%rax, %r15
	jge	LBB0_9
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r8), %rcx
	movl	(%rcx,%r15,4), %edx
	movl	%edx, %esi
	andl	%r13d, %esi
	movq	(%r9), %rdi
	movq	(%rdi,%r15,8), %rdi
	movq	(%r10), %rbx
	movl	(%rbx,%r15,4), %ebx
	andl	(%rdi), %ebx
	cmpl	%ebx, %esi
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	xorl	%r14d, %edx
	movl	%edx, (%rcx,%r15,4)
	movq	(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	leaq	L_.str(%rip), %rdi
	callq	_dprintf
	movq	_row_bit@GOTPCREL(%rip), %r10
	movq	_row_pin@GOTPCREL(%rip), %r9
	movq	_matrix_debouncing@GOTPCREL(%rip), %r8
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_7
LBB0_10:
	movq	_debouncing@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_27
## %bb.11:
	decq	%rcx
	movq	%rcx, (%rax)
	je	LBB0_12
## %bb.28:
	movl	$1, %edi
	callq	__delay_ms
LBB0_27:
	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
LBB0_12:
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	testq	%r8, %r8
	jle	LBB0_27
## %bb.13:
	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_23
## %bb.14:
	movq	%rdx, %rax
	subq	%rcx, %rax
	cmpq	$32, %rax
	jb	LBB0_23
## %bb.15:
	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_17
## %bb.16:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_17:
	andq	$-4, %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_18:                                ## =>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_18
LBB0_19:
	testq	%r9, %r9
	je	LBB0_22
## %bb.20:
	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_21:                                ## =>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_21
LBB0_22:
	cmpq	%rsi, %r8
	je	LBB0_27
LBB0_23:
	movq	%rsi, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdi
	andq	$3, %rdi
	je	LBB0_25
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %ebx
	movl	%ebx, (%rdx,%rsi,4)
	incq	%rsi
	decq	%rdi
	jne	LBB0_24
LBB0_25:
	cmpq	$3, %rax
	jb	LBB0_27
	.p2align	4, 0x90
LBB0_26:                                ## =>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_26
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_MATRIX_COLS,8,3                ## @MATRIX_COLS
	.comm	_MATRIX_ROWS,8,3                ## @MATRIX_ROWS
	.comm	_matrix_debouncing,8,3          ## @matrix_debouncing
	.comm	_row_pin,8,3                    ## @row_pin
	.comm	_row_bit,8,3                    ## @row_bit
	.comm	_debouncing,8,3                 ## @debouncing
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bounce!: %02X\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	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _MATRIX_COLS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MATRIX_COLS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x21, _debouncing@GOTPAGE
Lloh4:
	ldr	x21, [x21, _debouncing@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x19, #0
Lloh5:
	adrp	x23, _MATRIX_ROWS@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MATRIX_ROWS@GOTPAGEOFF]
Lloh7:
	adrp	x25, _matrix_debouncing@GOTPAGE
Lloh8:
	ldr	x25, [x25, _matrix_debouncing@GOTPAGEOFF]
Lloh9:
	adrp	x26, _row_pin@GOTPAGE
Lloh10:
	ldr	x26, [x26, _row_pin@GOTPAGEOFF]
Lloh11:
	adrp	x27, _row_bit@GOTPAGE
Lloh12:
	ldr	x27, [x27, _row_bit@GOTPAGEOFF]
Lloh13:
	adrp	x28, _DEBOUNCE@GOTPAGE
Lloh14:
	ldr	x28, [x28, _DEBOUNCE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_release_column
	add	x19, x19, #1
Lloh15:
	adrp	x8, _MATRIX_COLS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MATRIX_COLS@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x19, x8
	b.ge	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x0, x19
	bl	_pull_column
	mov	w0, #5
	bl	__delay_us
	ldr	x8, [x23]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, #0
	mov	w9, #1
	lsl	w24, w9, w19
	lsl	x20, x9, x19
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	x9, [x28]
	str	x9, [x21]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x22, x22, #1
	cmp	x22, x8
	b.ge	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x25]
	lsl	x11, x22, #2
	ldr	w10, [x9, x11]
	and	w12, w10, w24
	ldr	x13, [x26]
	ldr	x13, [x13, x22, lsl #3]
	ldr	w13, [x13]
	ldr	x14, [x27]
	ldr	w11, [x14, x11]
	and	w11, w11, w13
	cmp	w12, w11
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	eor	w10, w10, w20
	str	w10, [x9, x22, lsl #2]
	ldr	x1, [x21]
	cbz	x1, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintf
	ldr	x8, [x23]
	b	LBB0_5
LBB0_10:
	ldr	x8, [x21]
	cbz	x8, LBB0_21
; %bb.11:
	subs	x8, x8, #1
	str	x8, [x21]
	b.eq	LBB0_13
; %bb.12:
	mov	w0, #1
	bl	__delay_ms
	b	LBB0_21
LBB0_13:
Lloh20:
	adrp	x8, _MATRIX_ROWS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MATRIX_ROWS@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_21
; %bb.14:
	mov	x10, #0
Lloh23:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh24:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
Lloh26:
	adrp	x11, _matrix@GOTPAGE
Lloh27:
	ldr	x11, [x11, _matrix@GOTPAGEOFF]
Lloh28:
	ldr	x11, [x11]
	cmp	x8, #16
	b.lo	LBB0_19
; %bb.15:
	sub	x12, x11, x9
	cmp	x12, #64
	b.lo	LBB0_19
; %bb.16:
	and	x10, x8, #0xfffffffffffffff0
	add	x12, x9, #32
	add	x13, x11, #32
	mov	x14, x10
LBB0_17:                                ; =>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_17
; %bb.18:
	cmp	x8, x10
	b.eq	LBB0_21
LBB0_19:
	sub	x8, x8, x10
	lsl	x12, x10, #2
	add	x10, x11, x12
	add	x9, x9, x12
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #4
	str	w11, [x10], #4
	subs	x8, x8, #1
	b.ne	LBB0_20
LBB0_21:
	bl	_matrix_scan_quantum
	mov	w0, #1
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MATRIX_COLS,8,3                ; @MATRIX_COLS
	.comm	_MATRIX_ROWS,8,3                ; @MATRIX_ROWS
	.comm	_matrix_debouncing,8,3          ; @matrix_debouncing
	.comm	_row_pin,8,3                    ; @row_pin
	.comm	_row_bit,8,3                    ; @row_bit
	.comm	_debouncing,8,3                 ; @debouncing
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bounce!: %02X\n"

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