	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_user               ## -- Begin function matrix_scan_user
	.p2align	4, 0x90
_matrix_scan_user:                      ## @matrix_scan_user
	.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
	xorl	%eax, %eax
	callq	_timer_read
	movq	_prev_loop_time@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	subl	%eax, %ecx
	movq	_layer_time_remaining@GOTPCREL(%rip), %r14
	addl	%ecx, (%r14)
	xorl	%eax, %eax
	callq	_timer_read
	movq	%rax, (%rbx)
	cmpl	$0, (%r14)
	jg	LBB0_2
## %bb.1:
	movq	_LAYER_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_layer_off
LBB0_2:
	movq	_LAYER_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_LAYER_ON
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movl	(%r14), %eax
	movq	_TIMEOUT_WARNING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_4
## %bb.7:
	movq	_B0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_8
LBB0_6:
	movq	_B0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_5
LBB0_4:
	movq	_GET_FLASH_PERIOD@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_B0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testb	$1, %al
	jne	LBB0_5
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_writePinLow                    ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_writePinHigh                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_prev_loop_time,8,3             ## @prev_loop_time
	.comm	_layer_time_remaining,4,2       ## @layer_time_remaining
	.comm	_LAYER_SWITCH,4,2               ## @LAYER_SWITCH
	.comm	_TIMEOUT_WARNING,4,2            ## @TIMEOUT_WARNING
	.comm	_GET_FLASH_PERIOD,4,2           ## @GET_FLASH_PERIOD
	.comm	_B0,4,2                         ## @B0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_user               ; -- Begin function matrix_scan_user
	.p2align	2
_matrix_scan_user:                      ; @matrix_scan_user
	.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
	bl	_timer_read
Lloh0:
	adrp	x20, _prev_loop_time@GOTPAGE
Lloh1:
	ldr	x20, [x20, _prev_loop_time@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x19, _layer_time_remaining@GOTPAGE
Lloh3:
	ldr	x19, [x19, _layer_time_remaining@GOTPAGEOFF]
	ldr	w9, [x19]
	sub	w8, w8, w0
	add	w8, w9, w8
	str	w8, [x19]
	bl	_timer_read
	str	x0, [x20]
	ldr	w8, [x19]
Lloh4:
	adrp	x20, _LAYER_SWITCH@GOTPAGE
Lloh5:
	ldr	x20, [x20, _LAYER_SWITCH@GOTPAGEOFF]
	cmp	w8, #0
	b.gt	LBB0_2
; %bb.1:
	ldr	w0, [x20]
	bl	_layer_off
LBB0_2:
	ldr	w0, [x20]
	bl	_IS_LAYER_ON
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _TIMEOUT_WARNING@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TIMEOUT_WARNING@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _B0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B0@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_5:
Lloh12:
	adrp	x8, _B0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _B0@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_6:
Lloh15:
	adrp	x9, _GET_FLASH_PERIOD@GOTPAGE
Lloh16:
	ldr	x9, [x9, _GET_FLASH_PERIOD@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
Lloh18:
	adrp	x9, _B0@GOTPAGE
Lloh19:
	ldr	x9, [x9, _B0@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x9]
	tbnz	w8, #0, LBB0_8
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_writePinLow
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_writePinHigh
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_prev_loop_time,8,3             ; @prev_loop_time
	.comm	_layer_time_remaining,4,2       ; @layer_time_remaining
	.comm	_LAYER_SWITCH,4,2               ; @LAYER_SWITCH
	.comm	_TIMEOUT_WARNING,4,2            ; @TIMEOUT_WARNING
	.comm	_GET_FLASH_PERIOD,4,2           ; @GET_FLASH_PERIOD
	.comm	_B0,4,2                         ; @B0
.subsections_via_symbols
