	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_SERIAL_UART_INIT
	movq	_SERIAL_UART_DATA@GOTPCREL(%rip), %r15
	movl	$115, (%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -68(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movl	$115, %eax
	movq	_SERIAL_UART_RXD_PRESENT@GOTPCREL(%rip), %r12
	leaq	L_.str(%rip), %r14
	xorl	%ebx, %ebx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, -96(%rbp,%r13,4)
	incq	%r13
	cmpq	$11, %r13
	je	LBB0_7
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movl	%ebx, %ecx
	movl	(%r12), %edx
	cmpl	$10001, %ebx                    ## imm = 0x2711
	movl	$10000, %ebx                    ## imm = 0x2710
	cmovgel	%ecx, %ebx
	incl	%ebx
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testl	%edx, %edx
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	incl	%ecx
	xorl	%edx, %edx
	cmpl	%ecx, %ebx
	jne	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_xprintf
	movl	(%r15), %eax
	jmp	LBB0_6
LBB0_7:
	movl	-96(%rbp), %edi
	movl	-92(%rbp), %r11d
	movl	%r11d, %ecx
	xorl	%edi, %ecx
	movl	-88(%rbp), %r15d
	movl	-84(%rbp), %esi
	movl	%r15d, %edx
	xorl	%esi, %edx
	xorl	%ecx, %edx
	movl	-80(%rbp), %r10d
	movl	-76(%rbp), %r8d
	movl	%r10d, %ecx
	xorl	%r8d, %ecx
	movslq	-72(%rbp), %r9
	movl	%r9d, %ebx
	xorl	%ecx, %ebx
	xorl	%edx, %ebx
	movslq	-68(%rbp), %r14
	movslq	-64(%rbp), %r12
	movl	%r12d, %ecx
	xorl	%r14d, %ecx
	movslq	-60(%rbp), %r13
	movl	%r13d, %eax
	xorl	%ecx, %eax
	movl	-56(%rbp), %edx
	xorl	%edx, %eax
	xorl	%ebx, %eax
	movl	%eax, %ecx
	shrl	$4, %ecx
	xorl	%eax, %ecx
	testb	$15, %cl
	jne	LBB0_13
## %bb.8:
	movq	%r14, -136(%rbp)                ## 8-byte Spill
	movq	%r9, -144(%rbp)                 ## 8-byte Spill
	shll	$8, %edi
	orl	%r11d, %edi
	movq	_MAIN_ROWMASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edi
	movq	_matrix@GOTPCREL(%rip), %r14
	movq	(%r14), %r9
	movl	%edi, (%r9)
	shll	$12, %r11d
	shll	$4, %r15d
	orl	%r11d, %r15d
	movl	%r15d, 4(%r9)
	shll	$8, %esi
	orl	%r10d, %esi
	andl	(%rax), %esi
	movl	%esi, 8(%r9)
	shll	$9, %r10d
	leal	(%r8,%r8), %eax
	orl	%r10d, %eax
	movq	_LOWER_ROWMASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ecx, %eax
	movl	%eax, 12(%r9)
	shll	$7, %r8d
	movl	%edx, %eax
	shll	$6, %eax
	andl	$8192, %eax                     ## imm = 0x2000
	andl	$64, %edx
	orl	%eax, %edx
	orl	%r8d, %edx
	andl	%ecx, %edx
	movl	%edx, 16(%r9)
	movq	_MATRIX_ROWS@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jle	LBB0_12
## %bb.9:
	callq	_bitrev16
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	cmpl	$2, (%rbx)
	jl	LBB0_12
## %bb.10:
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%r15,4), %edi
	callq	_bitrev16
	movq	(%r14), %rcx
	movl	%eax, (%rcx,%r15,4)
	incq	%r15
	movslq	(%rbx), %rax
	cmpq	%rax, %r15
	jl	LBB0_11
LBB0_12:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	leaq	-128(%rbp), %rdi
	xorl	%eax, %eax
	callq	_pointing_device_get_report
	movq	-144(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -104(%rbp)
	movq	-136(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -112(%rbp)
	movq	%r12, -120(%rbp)
	movq	%r13, -128(%rbp)
	movaps	-128(%rbp), %xmm0
	movaps	-112(%rbp), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_pointing_device_set_report
LBB0_13:
	xorl	%eax, %eax
	callq	_matrix_scan_quantum
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	$1, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SERIAL_UART_DATA,4,2           ## @SERIAL_UART_DATA
	.comm	_SERIAL_UART_RXD_PRESENT,4,2    ## @SERIAL_UART_RXD_PRESENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\r\nTime out in keyboard."

	.comm	_MAIN_ROWMASK,4,2               ## @MAIN_ROWMASK
	.comm	_matrix,8,3                     ## @matrix
	.comm	_LOWER_ROWMASK,4,2              ## @LOWER_ROWMASK
	.comm	_MATRIX_ROWS,4,2                ## @MATRIX_ROWS
.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, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_SERIAL_UART_INIT
	mov	x20, #0
	mov	w22, #0
Lloh3:
	adrp	x21, _SERIAL_UART_DATA@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SERIAL_UART_DATA@GOTPAGEOFF]
	mov	w8, #115
	str	w8, [x21]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #60]
	stp	q0, q0, [sp, #32]
Lloh5:
	adrp	x23, _SERIAL_UART_RXD_PRESENT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SERIAL_UART_RXD_PRESENT@GOTPAGEOFF]
	mov	w24, #10000
Lloh7:
	adrp	x19, l_.str@PAGE
Lloh8:
	add	x19, x19, l_.str@PAGEOFF
	add	x25, sp, #32
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x9
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	str	w8, [x25, x20, lsl #2]
	add	x20, x20, #1
	cmp	x20, #11
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	mov	x9, x22
	ldr	w10, [x23]
	cmp	w22, w24
	csel	w11, w22, w24, gt
	add	w22, w11, #1
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbnz	w10, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	add	w9, w9, #1
	cmp	w22, w9
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_xprintf
	ldr	w8, [x21]
	b	LBB0_2
LBB0_7:
	ldp	w13, w10, [sp, #32]
	eor	w8, w10, w13
	ldp	w12, w11, [sp, #40]
	eor	w8, w12, w8
	eor	w14, w11, w8
	ldp	w9, w8, [sp, #48]
	eor	w14, w9, w14
	eor	w14, w8, w14
	ldpsw	x19, x20, [sp, #56]
	eor	w14, w19, w14
	eor	w14, w20, w14
	ldpsw	x21, x22, [sp, #64]
	eor	w14, w21, w14
	eor	w15, w22, w14
	ldr	w14, [sp, #72]
	eor	w15, w14, w15
	eor	w15, w15, w15, lsr #4
	tst	w15, #0xf
	b.ne	LBB0_13
; %bb.8:
	orr	w13, w10, w13, lsl #8
Lloh9:
	adrp	x15, _MAIN_ROWMASK@GOTPAGE
Lloh10:
	ldr	x15, [x15, _MAIN_ROWMASK@GOTPAGEOFF]
	ldr	w16, [x15]
	and	w0, w13, w16
Lloh11:
	adrp	x23, _matrix@GOTPAGE
Lloh12:
	ldr	x23, [x23, _matrix@GOTPAGEOFF]
	ldr	x13, [x23]
	lsl	w12, w12, #4
	orr	w10, w12, w10, lsl #12
	stp	w0, w10, [x13]
	orr	w10, w9, w11, lsl #8
	ldr	w11, [x15]
	and	w10, w10, w11
	lsl	w11, w8, #1
	orr	w9, w11, w9, lsl #9
Lloh13:
	adrp	x11, _LOWER_ROWMASK@GOTPAGE
Lloh14:
	ldr	x11, [x11, _LOWER_ROWMASK@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
	and	w9, w9, w11
	stp	w10, w9, [x13, #8]
	lsr	w9, w14, #7
	and	w10, w14, #0x40
	bfi	w10, w9, #13, #1
	orr	w8, w10, w8, lsl #7
	and	w8, w8, w11
	str	w8, [x13, #16]
Lloh16:
	adrp	x24, _MATRIX_ROWS@GOTPAGE
Lloh17:
	ldr	x24, [x24, _MATRIX_ROWS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	bl	_bitrev16
	ldr	x8, [x23]
	str	w0, [x8]
	ldr	w9, [x24]
	cmp	w9, #2
	b.lt	LBB0_12
; %bb.10:
	mov	w25, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	lsl	x26, x25, #2
	ldr	w0, [x8, x26]
	bl	_bitrev16
	ldr	x8, [x23]
	str	w0, [x8, x26]
	add	x25, x25, #1
	ldrsw	x9, [x24]
	cmp	x25, x9
	b.lt	LBB0_11
LBB0_12:
	mov	x8, sp
	bl	_pointing_device_get_report
	stp	x22, x21, [sp]
	stp	x20, x19, [sp, #16]
	mov	x0, sp
	bl	_pointing_device_set_report
LBB0_13:
	bl	_matrix_scan_quantum
	ldur	x8, [x29, #-72]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	w0, #1
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SERIAL_UART_DATA,4,2           ; @SERIAL_UART_DATA
	.comm	_SERIAL_UART_RXD_PRESENT,4,2    ; @SERIAL_UART_RXD_PRESENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\r\nTime out in keyboard."

	.comm	_MAIN_ROWMASK,4,2               ; @MAIN_ROWMASK
	.comm	_matrix,8,3                     ; @matrix
	.comm	_LOWER_ROWMASK,4,2              ; @LOWER_ROWMASK
	.comm	_MATRIX_ROWS,4,2                ; @MATRIX_ROWS
.subsections_via_symbols
