	.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
	subq	$24, %rsp
	.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), %r15
	cmpl	$0, (%r15)
	jle	LBB0_9
## %bb.1:
	leaq	l_switch.table.matrix_scan.3(%rip), %r14
	leaq	l_switch.table.matrix_scan.2(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	(%r15), %rax
	addq	$4, %r14
	addq	$8, %r12
	cmpq	%rax, %r13
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$7, %r13d
	ja	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rax
	movl	(%r14), %esi
	movl	(%rax), %edi
	callq	_palSetPad
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$20, %edi
	callq	_wait_us
	movq	_GPIOB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$11, %esi
	callq	_palReadPad
	movl	%eax, %ebx
	movq	_GPIOA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rax, %r15
	movl	$6, %esi
	callq	_palReadPad
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	addl	%eax, %r14d
	orl	%ebx, %r14d
	movl	(%r15), %edi
	movq	%r15, %rbx
	movl	$3, %esi
	callq	_palReadPad
	movl	%eax, %r15d
	shll	$2, %r15d
	movl	(%rbx), %edi
	movl	$2, %esi
	callq	_palReadPad
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %r12d
	shll	$3, %r12d
	orl	%r15d, %r12d
	orl	%r14d, %r12d
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_palReadPad
	movl	%eax, %r14d
	shll	$4, %r14d
	movq	_GPIOB@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$5, %esi
	callq	_palReadPad
	movl	%eax, %ebx
	shll	$5, %ebx
	orl	%r14d, %ebx
	movl	(%r15), %edi
	movl	$6, %esi
	callq	_palReadPad
	movl	%eax, %r14d
	shll	$6, %r14d
	orl	%ebx, %r14d
	orl	%r12d, %r14d
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	_GPIOC@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$15, %esi
	callq	_palReadPad
	movl	%eax, %ebx
	shll	$7, %ebx
	movl	(%r15), %edi
	movl	$14, %esi
	callq	_palReadPad
	movl	%eax, %r15d
	shll	$8, %r15d
	orl	%ebx, %r15d
	movq	_GPIOC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$13, %esi
	callq	_palReadPad
	movl	%eax, %ebx
	shll	$9, %ebx
	orl	%r15d, %ebx
	orl	%r14d, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	cmpl	$7, %r13d
	ja	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rax
	movl	(%r14), %esi
	movl	(%rax), %edi
	callq	_palClearPad
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_matrix_debouncing@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	%ebx, (%rax,%r13,4)
	movq	_MATRIX_COLS@GOTPCREL(%rip), %r15
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, (%rax,%r13,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_8
LBB0_9:
	movq	_debouncing@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_18
## %bb.10:
	movq	_debouncing_time@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_timer_elapsed
	movq	_DEBOUNCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_18
## %bb.11:
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %r8
	cmpl	$0, (%r8)
	jle	LBB0_17
## %bb.12:
	movq	_matrix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_matrix_debouncing@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	xorl	%edi, %edi
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rdi
	movslq	(%r8), %rcx
	cmpq	%rcx, %rdi
	jge	LBB0_17
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movl	$0, (%rdx,%rdi,4)
	cmpl	$0, (%r15)
	jle	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r9,%rcx,4), %eax
	xorl	%esi, %esi
	btl	%edi, %eax
	setb	%sil
	shll	%cl, %esi
	orl	%esi, %ebx
	movl	%ebx, (%rdx,%rdi,4)
	incq	%rcx
	movslq	(%r15), %rax
	cmpq	%rax, %rcx
	jl	LBB0_15
	jmp	LBB0_16
LBB0_17:
	movl	$0, (%r14)
LBB0_18:
	xorl	%eax, %eax
	callq	_matrix_scan_quantum
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MATRIX_COLS,4,2                ## @MATRIX_COLS
	.comm	_GPIOB,4,2                      ## @GPIOB
	.comm	_GPIOA,4,2                      ## @GPIOA
	.comm	_GPIOC,4,2                      ## @GPIOC
	.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,4,2                ## @MATRIX_ROWS
	.comm	_matrix,8,3                     ## @matrix
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.matrix_scan.2
l_switch.table.matrix_scan.2:
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOA
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB

	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.matrix_scan.3
l_switch.table.matrix_scan.3:
	.long	10                              ## 0xa
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	7                               ## 0x7
	.long	4                               ## 0x4
	.long	3                               ## 0x3
	.long	7                               ## 0x7

.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:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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_COLS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MATRIX_COLS@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x19, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x19, x19, #1
Lloh2:
	adrp	x20, _MATRIX_COLS@GOTPAGE
Lloh3:
	ldr	x20, [x20, _MATRIX_COLS@GOTPAGEOFF]
	ldrsw	x8, [x20]
	cmp	x19, x8
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w19, #7
	b.hi	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh4:
	adrp	x8, l_switch.table.matrix_scan.2@PAGE
Lloh5:
	add	x8, x8, l_switch.table.matrix_scan.2@PAGEOFF
	ldr	x8, [x8, x19, lsl #3]
Lloh6:
	adrp	x9, l_switch.table.matrix_scan.3@PAGE
Lloh7:
	add	x9, x9, l_switch.table.matrix_scan.3@PAGEOFF
	ldr	w1, [x9, x19, lsl #2]
	ldr	w0, [x8]
	bl	_palSetPad
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #20
	bl	_wait_us
Lloh8:
	adrp	x25, _GPIOB@GOTPAGE
Lloh9:
	ldr	x25, [x25, _GPIOB@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	w1, #11
	bl	_palReadPad
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
Lloh10:
	adrp	x23, _GPIOA@GOTPAGE
Lloh11:
	ldr	x23, [x23, _GPIOA@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	w1, #6
	bl	_palReadPad
	mov	x20, x0
	ldr	w0, [x23]
	mov	w1, #3
	bl	_palReadPad
	mov	x21, x0
	ldr	w0, [x23]
	mov	w1, #2
	bl	_palReadPad
	mov	x22, x0
	ldr	w0, [x23]
	mov	w1, #1
	bl	_palReadPad
	mov	x23, x0
	ldr	w0, [x25]
	mov	w1, #5
	bl	_palReadPad
	mov	x24, x0
	ldr	w0, [x25]
	mov	w1, #6
	bl	_palReadPad
	mov	x25, x0
Lloh12:
	adrp	x28, _GPIOC@GOTPAGE
Lloh13:
	ldr	x28, [x28, _GPIOC@GOTPAGEOFF]
	ldr	w0, [x28]
	mov	w1, #15
	bl	_palReadPad
	mov	x26, x0
	ldr	w0, [x28]
	mov	w1, #14
	bl	_palReadPad
	mov	x27, x0
	ldr	w0, [x28]
	mov	w1, #13
	bl	_palReadPad
	mov	x28, x0
	cmp	w19, #7
	b.hi	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh14:
	adrp	x8, l_switch.table.matrix_scan.2@PAGE
Lloh15:
	add	x8, x8, l_switch.table.matrix_scan.2@PAGEOFF
	ldr	x8, [x8, x19, lsl #3]
Lloh16:
	adrp	x9, l_switch.table.matrix_scan.3@PAGE
Lloh17:
	add	x9, x9, l_switch.table.matrix_scan.3@PAGEOFF
	ldr	w1, [x9, x19, lsl #2]
	ldr	w0, [x8]
	bl	_palClearPad
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	orr	w8, w8, w20, lsl #1
	orr	w8, w8, w21, lsl #2
	orr	w8, w8, w22, lsl #3
	orr	w8, w8, w23, lsl #4
	orr	w8, w8, w24, lsl #5
	orr	w8, w8, w25, lsl #6
	orr	w8, w8, w26, lsl #7
	orr	w8, w8, w27, lsl #8
	orr	w8, w8, w28, lsl #9
Lloh18:
	adrp	x9, _matrix_debouncing@GOTPAGE
Lloh19:
	ldr	x9, [x9, _matrix_debouncing@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	ldr	w10, [x9, x19, lsl #2]
	cmp	w10, w8
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w8, [x9, x19, lsl #2]
Lloh21:
	adrp	x8, _debouncing@GOTPAGE
Lloh22:
	ldr	x8, [x8, _debouncing@GOTPAGEOFF]
	mov	w9, #1
Lloh23:
	str	w9, [x8]
	bl	_timer_read
Lloh24:
	adrp	x8, _debouncing_time@GOTPAGE
Lloh25:
	ldr	x8, [x8, _debouncing_time@GOTPAGEOFF]
Lloh26:
	str	w0, [x8]
	b	LBB0_2
LBB0_9:
Lloh27:
	adrp	x8, _debouncing@GOTPAGE
Lloh28:
	ldr	x8, [x8, _debouncing@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cbz	w8, LBB0_18
; %bb.10:
Lloh30:
	adrp	x8, _debouncing_time@GOTPAGE
Lloh31:
	ldr	x8, [x8, _debouncing_time@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_timer_elapsed
Lloh33:
	adrp	x8, _DEBOUNCE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DEBOUNCE@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_18
; %bb.11:
Lloh36:
	adrp	x8, _MATRIX_ROWS@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MATRIX_ROWS@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.12:
	mov	x9, #0
Lloh38:
	adrp	x10, _matrix@GOTPAGE
Lloh39:
	ldr	x10, [x10, _matrix@GOTPAGEOFF]
Lloh40:
	ldr	x10, [x10]
Lloh41:
	adrp	x11, _matrix_debouncing@GOTPAGE
Lloh42:
	ldr	x11, [x11, _matrix_debouncing@GOTPAGEOFF]
Lloh43:
	ldr	x11, [x11]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.ge	LBB0_17
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
	str	wzr, [x10, x9, lsl #2]
	ldr	w12, [x20]
	cmp	w12, #1
	b.lt	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w12, #0
	mov	x13, #0
LBB0_16:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w14, [x11, x13, lsl #2]
	lsr	w14, w14, w9
	and	w14, w14, #0x1
	lsl	w14, w14, w13
	orr	w12, w14, w12
	str	w12, [x10, x9, lsl #2]
	add	x13, x13, #1
	ldrsw	x14, [x20]
	cmp	x13, x14
	b.lt	LBB0_16
	b	LBB0_13
LBB0_17:
Lloh44:
	adrp	x8, _debouncing@GOTPAGE
Lloh45:
	ldr	x8, [x8, _debouncing@GOTPAGEOFF]
Lloh46:
	str	wzr, [x8]
LBB0_18:
	bl	_matrix_scan_quantum
	mov	w0, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotStr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_MATRIX_COLS,4,2                ; @MATRIX_COLS
	.comm	_GPIOB,4,2                      ; @GPIOB
	.comm	_GPIOA,4,2                      ; @GPIOA
	.comm	_GPIOC,4,2                      ; @GPIOC
	.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,4,2                ; @MATRIX_ROWS
	.comm	_matrix,8,3                     ; @matrix
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.matrix_scan.2
l_switch.table.matrix_scan.2:
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOA
	.quad	_GPIOB
	.quad	_GPIOB
	.quad	_GPIOB

	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.matrix_scan.3
l_switch.table.matrix_scan.3:
	.long	10                              ; 0xa
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	7                               ; 0x7
	.long	4                               ; 0x4
	.long	3                               ; 0x3
	.long	7                               ; 0x7

.subsections_via_symbols
