	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_keymap             ## -- Begin function matrix_scan_keymap
	.p2align	4, 0x90
_matrix_scan_keymap:                    ## @matrix_scan_keymap
	.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	_get_mods
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_host_keyboard_leds
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_get_oneshot_mods
	movl	%eax, %ebx
	movq	_skip_leds@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%eax, %eax
	callq	_ergodox_board_led_off
	xorl	%eax, %eax
	callq	_ergodox_right_led_1_off
	xorl	%eax, %eax
	callq	_ergodox_right_led_2_off
	xorl	%eax, %eax
	callq	_ergodox_right_led_3_off
	orl	%r15d, %ebx
	movq	_MOD_MASK_SHIFT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_USB_LED_CAPS_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	btl	%eax, %r14d
	jae	LBB0_4
LBB0_3:
	xorl	%eax, %eax
	callq	_ergodox_right_led_2_on
	movl	$50, %edi
	callq	_ergodox_right_led_2_set
LBB0_4:
	movq	_MOD_MASK_CTRL@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_ergodox_right_led_1_on
	movl	$10, %edi
	callq	_ergodox_right_led_1_set
LBB0_6:
	movq	_MOD_MASK_ALT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_7
## %bb.8:
	xorl	%eax, %eax
	callq	_ergodox_right_led_3_on
	movl	$10, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ergodox_right_led_3_set        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_skip_leds,4,2                  ## @skip_leds
	.comm	_MOD_MASK_SHIFT,4,2             ## @MOD_MASK_SHIFT
	.comm	_USB_LED_CAPS_LOCK,4,2          ## @USB_LED_CAPS_LOCK
	.comm	_MOD_MASK_CTRL,4,2              ## @MOD_MASK_CTRL
	.comm	_MOD_MASK_ALT,4,2               ## @MOD_MASK_ALT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_keymap             ; -- Begin function matrix_scan_keymap
	.p2align	2
_matrix_scan_keymap:                    ; @matrix_scan_keymap
	.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	_get_mods
	mov	x20, x0
	bl	_host_keyboard_leds
	mov	x19, x0
	bl	_get_oneshot_mods
Lloh0:
	adrp	x8, _skip_leds@GOTPAGE
Lloh1:
	ldr	x8, [x8, _skip_leds@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_2
LBB0_1:
	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
LBB0_2:
	mov	x21, x0
	bl	_ergodox_board_led_off
	bl	_ergodox_right_led_1_off
	bl	_ergodox_right_led_2_off
	bl	_ergodox_right_led_3_off
	orr	w20, w21, w20
Lloh3:
	adrp	x8, _MOD_MASK_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MOD_MASK_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _USB_LED_CAPS_LOCK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _USB_LED_CAPS_LOCK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsr	w8, w19, w8
	tbz	w8, #0, LBB0_5
LBB0_4:
	bl	_ergodox_right_led_2_on
	mov	w0, #50
	bl	_ergodox_right_led_2_set
LBB0_5:
Lloh9:
	adrp	x8, _MOD_MASK_CTRL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MOD_MASK_CTRL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_7
; %bb.6:
	bl	_ergodox_right_led_1_on
	mov	w0, #10
	bl	_ergodox_right_led_1_set
LBB0_7:
Lloh12:
	adrp	x8, _MOD_MASK_ALT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MOD_MASK_ALT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_1
; %bb.8:
	bl	_ergodox_right_led_3_on
	mov	w0, #10
	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
	b	_ergodox_right_led_3_set
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_skip_leds,4,2                  ; @skip_leds
	.comm	_MOD_MASK_SHIFT,4,2             ; @MOD_MASK_SHIFT
	.comm	_USB_LED_CAPS_LOCK,4,2          ; @USB_LED_CAPS_LOCK
	.comm	_MOD_MASK_CTRL,4,2              ; @MOD_MASK_CTRL
	.comm	_MOD_MASK_ALT,4,2               ; @MOD_MASK_ALT
.subsections_via_symbols
