	.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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_backlight_status_global@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.1:
	movq	_led_layer_state@GOTPCREL(%rip), %r14
	movq	_layer_state@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	cmpq	%rbx, (%r14)
	je	LBB0_16
## %bb.2:
	movq	_led_mode_global@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_GAME@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_16
## %bb.3:
	movq	_ALL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_16
## %bb.4:
	cmpl	$128, %eax
	je	LBB0_10
## %bb.5:
	cmpl	$129, %eax
	je	LBB0_11
## %bb.6:
	cmpl	$130, %eax
	jne	LBB0_15
## %bb.7:
	movq	%rbx, %rdi
	callq	_biton32
	movq	_max_pages@GOTPCREL(%rip), %rcx
	movl	$1792, %esi                     ## imm = 0x700
	cmpl	(%rcx), %eax
	jg	LBB0_9
## %bb.8:
	movq	(%r15), %rdi
	callq	_biton32
	movl	%eax, %esi
	shll	$8, %esi
LBB0_9:
	movq	_DISPLAY_PAGE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_TIME_IMMEDIATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_led_mailbox@GOTPCREL(%rip), %rdi
	callq	_chMBPost
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_chThdSleepMilliseconds
	movq	(%r15), %rbx
LBB0_10:
	movq	_DISPLAY_PAGE@GOTPCREL(%rip), %rax
	movl	$1792, %esi                     ## imm = 0x700
	orl	(%rax), %esi
	movq	_TIME_IMMEDIATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_led_mailbox@GOTPCREL(%rip), %rdi
	callq	_chMBPost
	shll	$8, %ebx
	movzwl	%bx, %esi
	movq	_SET_FULL_ROW@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	orl	$65536, %esi                    ## imm = 0x10000
	jmp	LBB0_14
LBB0_11:
	movq	%rbx, %rdi
	callq	_biton32
	movq	_max_pages@GOTPCREL(%rip), %rcx
	movl	$1792, %esi                     ## imm = 0x700
	cmpl	(%rcx), %eax
	jg	LBB0_13
## %bb.12:
	movq	(%r15), %rdi
	callq	_biton32
	movl	%eax, %esi
	shll	$8, %esi
LBB0_13:
	movq	_DISPLAY_PAGE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
LBB0_14:
	movq	_TIME_IMMEDIATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_led_mailbox@GOTPCREL(%rip), %rdi
	callq	_chMBPost
LBB0_15:
	movq	(%r15), %rax
	movq	%rax, (%r14)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_backlight_status_global,8,3    ## @backlight_status_global
	.comm	_led_layer_state,8,3            ## @led_layer_state
	.comm	_layer_state,8,3                ## @layer_state
	.comm	_led_mode_global,4,2            ## @led_mode_global
	.comm	_GAME,4,2                       ## @GAME
	.comm	_ALL,4,2                        ## @ALL
	.comm	_max_pages,4,2                  ## @max_pages
	.comm	_DISPLAY_PAGE,4,2               ## @DISPLAY_PAGE
	.comm	_led_mailbox,4,2                ## @led_mailbox
	.comm	_TIME_IMMEDIATE,4,2             ## @TIME_IMMEDIATE
	.comm	_SET_FULL_ROW,4,2               ## @SET_FULL_ROW
.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	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
Lloh0:
	adrp	x8, _backlight_status_global@GOTPAGE
Lloh1:
	ldr	x8, [x8, _backlight_status_global@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.1:
Lloh3:
	adrp	x20, _led_layer_state@GOTPAGE
Lloh4:
	ldr	x20, [x20, _led_layer_state@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh5:
	adrp	x21, _layer_state@GOTPAGE
Lloh6:
	ldr	x21, [x21, _layer_state@GOTPAGEOFF]
	ldr	x19, [x21]
	cmp	x8, x19
	b.eq	LBB0_17
; %bb.2:
Lloh7:
	adrp	x8, _led_mode_global@GOTPAGE
Lloh8:
	ldr	x8, [x8, _led_mode_global@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _GAME@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GAME@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _ALL@GOTPAGE
Lloh14:
	ldr	x10, [x10, _ALL@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.eq	LBB0_17
; %bb.3:
	cmp	w8, #128
	b.eq	LBB0_14
; %bb.4:
	cmp	w8, #129
	b.eq	LBB0_8
; %bb.5:
	cmp	w8, #130
	b.ne	LBB0_16
; %bb.6:
	mov	x0, x19
	bl	_biton32
Lloh16:
	adrp	x8, _max_pages@GOTPAGE
Lloh17:
	ldr	x8, [x8, _max_pages@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_12
; %bb.7:
	mov	w8, #1792
	b	LBB0_13
LBB0_8:
	mov	x0, x19
	bl	_biton32
Lloh19:
	adrp	x8, _max_pages@GOTPAGE
Lloh20:
	ldr	x8, [x8, _max_pages@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_10
; %bb.9:
	mov	w8, #1792
	b	LBB0_11
LBB0_10:
	ldr	x0, [x21]
	bl	_biton32
	lsl	w8, w0, #8
LBB0_11:
Lloh22:
	adrp	x9, _DISPLAY_PAGE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _DISPLAY_PAGE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w1, w9, w8
	b	LBB0_15
LBB0_12:
	ldr	x0, [x21]
	bl	_biton32
	lsl	w8, w0, #8
LBB0_13:
Lloh25:
	adrp	x9, _DISPLAY_PAGE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _DISPLAY_PAGE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh28:
	adrp	x8, _TIME_IMMEDIATE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _TIME_IMMEDIATE@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
Lloh31:
	adrp	x0, _led_mailbox@GOTPAGE
Lloh32:
	ldr	x0, [x0, _led_mailbox@GOTPAGEOFF]
	bl	_chMBPost
	mov	w0, #500
	bl	_chThdSleepMilliseconds
	ldr	x19, [x21]
LBB0_14:
Lloh33:
	adrp	x8, _DISPLAY_PAGE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DISPLAY_PAGE@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	orr	w1, w8, #0x700
Lloh36:
	adrp	x8, _TIME_IMMEDIATE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _TIME_IMMEDIATE@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
Lloh39:
	adrp	x0, _led_mailbox@GOTPAGE
Lloh40:
	ldr	x0, [x0, _led_mailbox@GOTPAGEOFF]
	bl	_chMBPost
	ubfiz	w8, w19, #8, #8
Lloh41:
	adrp	x9, _SET_FULL_ROW@GOTPAGE
Lloh42:
	ldr	x9, [x9, _SET_FULL_ROW@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w1, w8, #0x10000
LBB0_15:
Lloh44:
	adrp	x8, _TIME_IMMEDIATE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _TIME_IMMEDIATE@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
Lloh47:
	adrp	x0, _led_mailbox@GOTPAGE
Lloh48:
	ldr	x0, [x0, _led_mailbox@GOTPAGEOFF]
	bl	_chMBPost
LBB0_16:
	ldr	x8, [x21]
	str	x8, [x20]
LBB0_17:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_backlight_status_global,8,3    ; @backlight_status_global
	.comm	_led_layer_state,8,3            ; @led_layer_state
	.comm	_layer_state,8,3                ; @layer_state
	.comm	_led_mode_global,4,2            ; @led_mode_global
	.comm	_GAME,4,2                       ; @GAME
	.comm	_ALL,4,2                        ; @ALL
	.comm	_max_pages,4,2                  ; @max_pages
	.comm	_DISPLAY_PAGE,4,2               ; @DISPLAY_PAGE
	.comm	_led_mailbox,4,2                ; @led_mailbox
	.comm	_TIME_IMMEDIATE,4,2             ; @TIME_IMMEDIATE
	.comm	_SET_FULL_ROW,4,2               ; @SET_FULL_ROW
.subsections_via_symbols
