	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_init                    ## -- Begin function matrix_init
	.p2align	4, 0x90
_matrix_init:                           ## @matrix_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_debug_enable@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	xorl	%eax, %eax
	callq	_serial_init
	xorl	%eax, %eax
	callq	_pins_init
	leaq	L_.str(%rip), %rdi
	callq	_print
	movq	_VCC_PIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PinLevelHigh@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	callq	_digitalWrite
	movq	_DCD_PIN@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	callq	_digitalRead
	cmpq	(%r14), %rax
	jne	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	callq	_print
	xorl	%eax, %eax
	callq	_rts_reset
	xorl	%eax, %eax
	callq	_palm_handshake
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_timer_read
	movq	_last_activity@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_print
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	__delay_ms
LBB0_5:
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:
	movq	_matrix@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	shlq	$2, %rsi
	callq	___bzero
LBB0_7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_matrix_init_quantum            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_debug_enable,4,2               ## @debug_enable
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"power up\n"

	.comm	_VCC_PIN,4,2                    ## @VCC_PIN
	.comm	_PinLevelHigh,8,3               ## @PinLevelHigh
	.comm	_DCD_PIN,4,2                    ## @DCD_PIN
L_.str.1:                               ## @.str.1
	.asciz	"dcd\n"

	.comm	_last_activity,4,2              ## @last_activity
L_.str.2:                               ## @.str.2
	.asciz	"failed handshake"

	.comm	_MATRIX_ROWS,8,3                ## @MATRIX_ROWS
	.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_init                    ; -- Begin function matrix_init
	.p2align	2
_matrix_init:                           ; @matrix_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _debug_enable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug_enable@GOTPAGEOFF]
	mov	w9, #1
Lloh2:
	str	w9, [x8]
	bl	_serial_init
	bl	_pins_init
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_print
Lloh5:
	adrp	x8, _VCC_PIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VCC_PIN@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x19, _PinLevelHigh@GOTPAGE
Lloh9:
	ldr	x19, [x19, _PinLevelHigh@GOTPAGEOFF]
	ldr	x1, [x19]
	bl	_digitalWrite
Lloh10:
	adrp	x20, _DCD_PIN@GOTPAGE
Lloh11:
	ldr	x20, [x20, _DCD_PIN@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_digitalRead
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_1
; %bb.2:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_print
	bl	_rts_reset
	bl	_palm_handshake
	cbz	x0, LBB0_4
; %bb.3:
	bl	_timer_read
Lloh14:
	adrp	x8, _last_activity@GOTPAGE
Lloh15:
	ldr	x8, [x8, _last_activity@GOTPAGEOFF]
Lloh16:
	str	w0, [x8]
	b	LBB0_5
LBB0_4:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_print
	mov	w0, #1000
	bl	__delay_ms
LBB0_5:
Lloh19:
	adrp	x8, _MATRIX_ROWS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MATRIX_ROWS@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
Lloh22:
	adrp	x9, _matrix@GOTPAGE
Lloh23:
	ldr	x9, [x9, _matrix@GOTPAGEOFF]
Lloh24:
	ldr	x0, [x9]
	lsl	x1, x8, #2
	bl	_bzero
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_matrix_init_quantum
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_debug_enable,4,2               ; @debug_enable
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"power up\n"

	.comm	_VCC_PIN,4,2                    ; @VCC_PIN
	.comm	_PinLevelHigh,8,3               ; @PinLevelHigh
	.comm	_DCD_PIN,4,2                    ; @DCD_PIN
l_.str.1:                               ; @.str.1
	.asciz	"dcd\n"

	.comm	_last_activity,4,2              ; @last_activity
l_.str.2:                               ; @.str.2
	.asciz	"failed handshake"

	.comm	_MATRIX_ROWS,8,3                ; @MATRIX_ROWS
	.comm	_matrix,8,3                     ; @matrix
.subsections_via_symbols
