	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_slave_scan              ## -- Begin function matrix_slave_scan
	.p2align	4, 0x90
_matrix_slave_scan:                     ## @matrix_slave_scan
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	xorl	%eax, %eax
	callq	__matrix_scan
	movq	_ROWS_PER_HAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	testl	%r11d, %r11d
	jle	LBB0_18
## %bb.1:
	movq	_isLeftHand@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	cmpq	$0, (%rax)
	movq	_matrix@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_serial_slave_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movl	$0, %r9d
	cmoveq	%r11, %r9
	cmpl	$4, %r11d
	jb	LBB0_12
## %bb.2:
	leaq	(%r8,%r9,8), %rax
	movq	%rcx, %rdx
	subq	%rax, %rdx
	cmpq	$32, %rdx
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	jmp	LBB0_12
LBB0_4:
	movl	%r11d, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rax
	movq	%rax, %rsi
	shrq	$2, %rsi
	incq	%rsi
	movl	%esi, %r10d
	andl	$3, %r10d
	cmpq	$12, %rax
	jae	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	jmp	LBB0_8
LBB0_6:
	andq	$-4, %rsi
	leaq	(%r8,%r9,8), %rax
	addq	$112, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movups	-112(%rax,%rdi,8), %xmm0
	movups	-96(%rax,%rdi,8), %xmm1
	movups	%xmm0, (%rcx,%rdi,8)
	movups	%xmm1, 16(%rcx,%rdi,8)
	movups	-80(%rax,%rdi,8), %xmm0
	movups	-64(%rax,%rdi,8), %xmm1
	movups	%xmm0, 32(%rcx,%rdi,8)
	movups	%xmm1, 48(%rcx,%rdi,8)
	movups	-48(%rax,%rdi,8), %xmm0
	movups	-32(%rax,%rdi,8), %xmm1
	movups	%xmm0, 64(%rcx,%rdi,8)
	movups	%xmm1, 80(%rcx,%rdi,8)
	movups	-16(%rax,%rdi,8), %xmm0
	movups	(%rax,%rdi,8), %xmm1
	movups	%xmm0, 96(%rcx,%rdi,8)
	movups	%xmm1, 112(%rcx,%rdi,8)
	addq	$16, %rdi
	addq	$-4, %rsi
	jne	LBB0_7
LBB0_8:
	testq	%r10, %r10
	je	LBB0_11
## %bb.9:
	leaq	(%rcx,%rdi,8), %rax
	addq	$16, %rax
	addq	%r9, %rdi
	leaq	(%r8,%rdi,8), %rsi
	addq	$16, %rsi
	shlq	$5, %r10
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rsi,%rdi), %xmm0
	movups	(%rsi,%rdi), %xmm1
	movups	%xmm0, -16(%rax,%rdi)
	movups	%xmm1, (%rax,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %r10
	jne	LBB0_10
LBB0_11:
	cmpq	%r11, %rdx
	je	LBB0_18
LBB0_12:
	movq	%rdx, %r10
	notq	%r10
	addq	%r11, %r10
	movq	%r11, %rsi
	andq	$3, %rsi
	je	LBB0_15
## %bb.13:
	leaq	(%r8,%r9,8), %rdi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdi,%rdx,8), %rax
	movq	%rax, (%rcx,%rdx,8)
	incq	%rdx
	decq	%rsi
	jne	LBB0_14
LBB0_15:
	cmpq	$3, %r10
	jb	LBB0_18
## %bb.16:
	leaq	(%r8,%r9,8), %rax
	addq	$24, %rax
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	-24(%rax,%rdx,8), %rsi
	movq	%rsi, (%rcx,%rdx,8)
	movq	-16(%rax,%rdx,8), %rsi
	movq	%rsi, 8(%rcx,%rdx,8)
	movq	-8(%rax,%rdx,8), %rsi
	movq	%rsi, 16(%rcx,%rdx,8)
	movq	(%rax,%rdx,8), %rsi
	movq	%rsi, 24(%rcx,%rdx,8)
	addq	$4, %rdx
	cmpq	%rdx, %r11
	jne	LBB0_17
LBB0_18:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_isLeftHand,8,3                 ## @isLeftHand
	.comm	_ROWS_PER_HAND,4,2              ## @ROWS_PER_HAND
	.comm	_matrix,8,3                     ## @matrix
	.comm	_serial_slave_buffer,8,3        ## @serial_slave_buffer
	.comm	_i2c_slave_buffer,8,3           ## @i2c_slave_buffer
	.comm	_slave_buffer_change_count,4,2  ## @slave_buffer_change_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_slave_scan              ; -- Begin function matrix_slave_scan
	.p2align	2
_matrix_slave_scan:                     ; @matrix_slave_scan
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	bl	__matrix_scan
Lloh0:
	adrp	x8, _ROWS_PER_HAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ROWS_PER_HAND@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x11, #0
Lloh3:
	adrp	x9, _isLeftHand@GOTPAGE
Lloh4:
	ldr	x9, [x9, _isLeftHand@GOTPAGEOFF]
Lloh5:
	ldr	x12, [x9]
Lloh6:
	adrp	x9, _matrix@GOTPAGE
Lloh7:
	ldr	x9, [x9, _matrix@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _serial_slave_buffer@GOTPAGE
Lloh10:
	ldr	x10, [x10, _serial_slave_buffer@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x12, #0
	csel	x12, x8, xzr, eq
	cmp	w8, #8
	b.lo	LBB0_7
; %bb.2:
	add	x14, x9, x12, lsl #3
	sub	x11, x10, x14
	cmp	x11, #64
	b.hs	LBB0_4
; %bb.3:
	mov	x11, #0
	b	LBB0_7
LBB0_4:
	and	x11, x8, #0xfffffff8
	add	x13, x10, #32
	add	x14, x14, #32
	mov	x15, x11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x14, #-32]
	ldp	q2, q3, [x14], #64
	stp	q0, q1, [x13, #-32]
	stp	q2, q3, [x13], #64
	subs	x15, x15, #8
	b.ne	LBB0_5
; %bb.6:
	cmp	x11, x8
	b.eq	LBB0_9
LBB0_7:
	add	x12, x12, x11
	add	x9, x9, x12, lsl #3
	add	x10, x10, x11, lsl #3
	sub	x8, x8, x11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9], #8
	str	x11, [x10], #8
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_isLeftHand,8,3                 ; @isLeftHand
	.comm	_ROWS_PER_HAND,4,2              ; @ROWS_PER_HAND
	.comm	_matrix,8,3                     ; @matrix
	.comm	_serial_slave_buffer,8,3        ; @serial_slave_buffer
	.comm	_i2c_slave_buffer,8,3           ; @i2c_slave_buffer
	.comm	_slave_buffer_change_count,4,2  ; @slave_buffer_change_count
.subsections_via_symbols
