	.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), %r14
	cmpl	$0, (%r14)
	jle	LBB0_19
## %bb.1:
	movq	_matrix_debouncing@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r15
	movslq	(%r14), %rax
	cmpq	%rax, %r15
	jge	LBB0_19
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$8, %r15d
	ja	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	xorl	%esi, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	jmp	LBB0_15
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$1, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$1, %esi
	jmp	LBB0_16
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$2, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$2, %esi
	jmp	LBB0_16
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$3, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$3, %esi
	jmp	LBB0_16
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$16, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$16, %esi
	jmp	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOB@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$17, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$17, %esi
	jmp	LBB0_16
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$4, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$4, %esi
	jmp	LBB0_16
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	$5, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r13), %edi
	movl	$5, %esi
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_GPIOD@GOTPCREL(%rip), %rax
	movq	%r14, %r13
	movq	%r12, %r14
	movq	%rax, %r12
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_palSetPad
	movl	$20, %edi
	callq	_wait_us
	movl	(%r12), %edi
	callq	_palReadPort
	movl	%eax, %ebx
	movl	(%r12), %edi
	movq	%r14, %r12
	movq	%r13, %r14
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%esi, %esi
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	callq	_palClearPad
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	sarl	%ebx
	movq	(%r12), %rax
	cmpl	%ebx, (%rax,%r15,4)
	je	LBB0_2
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, (%rax,%r15,4)
	movq	_debouncing@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	xorl	%eax, %eax
	callq	_timer_read
	movq	_debouncing_time@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_2
LBB0_19:
	movq	_debouncing@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_25
## %bb.20:
	movq	_debouncing_time@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_timer_elapsed
	movq	_DEBOUNCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_25
## %bb.21:
	cmpl	$0, (%r14)
	jle	LBB0_24
## %bb.22:
	movq	_matrix_debouncing@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rdx,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%r14), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_23
LBB0_24:
	movl	$0, (%rbx)
LBB0_25:
	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
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_12
	.long	L0_0_set_13
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
	.comm	_MATRIX_ROWS,4,2                ## @MATRIX_ROWS
	.comm	_GPIOB,4,2                      ## @GPIOB
	.comm	_GPIOC,4,2                      ## @GPIOC
	.comm	_GPIOD,4,2                      ## @GPIOD
	.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,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	x20, _MATRIX_ROWS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MATRIX_ROWS@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x21, _debouncing@GOTPAGE
Lloh3:
	ldr	x21, [x21, _debouncing@GOTPAGEOFF]
Lloh4:
	adrp	x22, _debouncing_time@GOTPAGE
Lloh5:
	ldr	x22, [x22, _debouncing_time@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x23, #0
Lloh6:
	adrp	x24, _GPIOD@GOTPAGE
Lloh7:
	ldr	x24, [x24, _GPIOD@GOTPAGEOFF]
Lloh8:
	adrp	x25, _matrix_debouncing@GOTPAGE
Lloh9:
	ldr	x25, [x25, _matrix_debouncing@GOTPAGEOFF]
	mov	w26, #1
Lloh10:
	adrp	x27, _GPIOB@GOTPAGE
Lloh11:
	ldr	x27, [x27, _GPIOB@GOTPAGEOFF]
Lloh12:
	adrp	x28, lJTI0_0@PAGE
Lloh13:
	add	x28, x28, lJTI0_0@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x20]
	cmp	x23, x8
	b.ge	LBB0_19
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, #8
	b.hi	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	and	x8, x23, #0xffffffff
	adr	x9, LBB0_5
	ldrb	w10, [x28, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #0
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	b	LBB0_15
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	b	LBB0_17
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #1
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	mov	w1, #1
	b	LBB0_16
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #2
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	mov	w1, #2
	b	LBB0_16
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #3
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	mov	w1, #3
	b	LBB0_16
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #16
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	mov	w1, #16
	b	LBB0_16
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x27]
	mov	w1, #17
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x27]
	mov	w1, #17
	b	LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh14:
	adrp	x21, _GPIOC@GOTPAGE
Lloh15:
	ldr	x21, [x21, _GPIOC@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #4
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x21]
Lloh16:
	adrp	x21, _debouncing@GOTPAGE
Lloh17:
	ldr	x21, [x21, _debouncing@GOTPAGEOFF]
	mov	w1, #4
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh18:
	adrp	x21, _GPIOC@GOTPAGE
Lloh19:
	ldr	x21, [x21, _GPIOC@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #5
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x21]
Lloh20:
	adrp	x21, _debouncing@GOTPAGE
Lloh21:
	ldr	x21, [x21, _debouncing@GOTPAGEOFF]
	mov	w1, #5
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x24]
	mov	w1, #0
	bl	_palSetPad
	mov	w0, #20
	bl	_wait_us
	ldr	w0, [x24]
	bl	_palReadPort
	mov	x19, x0
	ldr	w0, [x24]
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w1, #0
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_palClearPad
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	asr	w8, w19, #1
	ldr	x9, [x25]
	ldr	w10, [x9, x23, lsl #2]
	cmp	w10, w8
	b.eq	LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	str	w8, [x9, x23, lsl #2]
	str	w26, [x21]
	bl	_timer_read
	str	w0, [x22]
	b	LBB0_2
LBB0_19:
	ldr	w8, [x21]
	cbz	w8, LBB0_25
; %bb.20:
	ldr	w0, [x22]
	bl	_timer_elapsed
Lloh22:
	adrp	x8, _DEBOUNCE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DEBOUNCE@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_25
; %bb.21:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.22:
	mov	x8, #0
Lloh25:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh26:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
Lloh28:
	adrp	x10, _matrix@GOTPAGE
Lloh29:
	ldr	x10, [x10, _matrix@GOTPAGEOFF]
Lloh30:
	ldr	x10, [x10]
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #2
	ldr	w12, [x9, x11]
	str	w12, [x10, x11]
	add	x8, x8, #1
	ldrsw	x11, [x20]
	cmp	x8, x11
	b.lt	LBB0_23
LBB0_24:
	str	wzr, [x21]
LBB0_25:
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_5)>>2
	.byte	(LBB0_7-LBB0_5)>>2
	.byte	(LBB0_8-LBB0_5)>>2
	.byte	(LBB0_9-LBB0_5)>>2
	.byte	(LBB0_10-LBB0_5)>>2
	.byte	(LBB0_11-LBB0_5)>>2
	.byte	(LBB0_12-LBB0_5)>>2
	.byte	(LBB0_13-LBB0_5)>>2
	.byte	(LBB0_14-LBB0_5)>>2
                                        ; -- End function
	.comm	_MATRIX_ROWS,4,2                ; @MATRIX_ROWS
	.comm	_GPIOB,4,2                      ; @GPIOB
	.comm	_GPIOC,4,2                      ; @GPIOC
	.comm	_GPIOD,4,2                      ; @GPIOD
	.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,8,3                     ; @matrix
.subsections_via_symbols
