	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	__matrix_scan
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_is_keyboard_master
	movq	_matrix@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	_thatHand@GOTPCREL(%rip), %r15
	movslq	(%r15), %rax
	leaq	(%rcx,%rax,8), %rdi
	callq	_transport_master
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movq	$0, _matrix_scan.error_count(%rip)
	jmp	LBB0_6
LBB0_7:
	movq	_thisHand@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%rcx,%rax,8), %rdi
	callq	_transport_slave
	xorl	%eax, %eax
	callq	_matrix_slave_scan_user
	jmp	LBB0_8
LBB0_2:
	movq	_matrix_scan.error_count(%rip), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, _matrix_scan.error_count(%rip)
	movq	_ERROR_DISCONNECT_COUNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_6
## %bb.3:
	movq	_ROWS_PER_HAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_6
## %bb.4:
	movslq	(%r15), %rdi
	shlq	$3, %rdi
	addq	(%r14), %rdi
	shlq	$3, %rsi
	callq	___bzero
LBB0_6:
	xorl	%eax, %eax
	callq	_matrix_scan_quantum
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_matrix_scan.error_count,8,3 ## @matrix_scan.error_count
	.comm	_matrix,8,3                     ## @matrix
	.comm	_thatHand,4,2                   ## @thatHand
	.comm	_ERROR_DISCONNECT_COUNT,8,3     ## @ERROR_DISCONNECT_COUNT
	.comm	_ROWS_PER_HAND,4,2              ## @ROWS_PER_HAND
	.comm	_thisHand,4,2                   ## @thisHand
.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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	__matrix_scan
	mov	x19, x0
	bl	_is_keyboard_master
Lloh0:
	adrp	x20, _matrix@GOTPAGE
Lloh1:
	ldr	x20, [x20, _matrix@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x21, _thatHand@GOTPAGE
Lloh3:
	ldr	x21, [x21, _thatHand@GOTPAGEOFF]
	ldrsw	x9, [x21]
	add	x0, x8, x9, lsl #3
	bl	_transport_master
	adrp	x8, _matrix_scan.error_count@PAGE
	cbz	w0, LBB0_4
; %bb.2:
	str	xzr, [x8, _matrix_scan.error_count@PAGEOFF]
	b	LBB0_7
LBB0_3:
Lloh4:
	adrp	x9, _thisHand@GOTPAGE
Lloh5:
	ldr	x9, [x9, _thisHand@GOTPAGEOFF]
Lloh6:
	ldrsw	x9, [x9]
	add	x0, x8, x9, lsl #3
	bl	_transport_slave
	bl	_matrix_slave_scan_user
	b	LBB0_8
LBB0_4:
	ldr	x9, [x8, _matrix_scan.error_count@PAGEOFF]
	add	x10, x9, #1
	str	x10, [x8, _matrix_scan.error_count@PAGEOFF]
Lloh7:
	adrp	x8, _ERROR_DISCONNECT_COUNT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERROR_DISCONNECT_COUNT@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x9, x8
	b.lt	LBB0_7
; %bb.5:
Lloh10:
	adrp	x8, _ROWS_PER_HAND@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ROWS_PER_HAND@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.6:
	ldr	x9, [x20]
	ldrsw	x10, [x21]
	add	x0, x9, x10, lsl #3
	lsl	x1, x8, #3
	bl	_bzero
LBB0_7:
	bl	_matrix_scan_quantum
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_matrix_scan.error_count,8,3 ; @matrix_scan.error_count
	.comm	_matrix,8,3                     ; @matrix
	.comm	_thatHand,4,2                   ; @thatHand
	.comm	_ERROR_DISCONNECT_COUNT,8,3     ; @ERROR_DISCONNECT_COUNT
	.comm	_ROWS_PER_HAND,4,2              ; @ROWS_PER_HAND
	.comm	_thisHand,4,2                   ; @thisHand
.subsections_via_symbols
