	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_host_keyboard_leds
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_get_oneshot_mods
	movl	%eax, %r14d
	movq	_layer_state@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_biton32
	movl	%eax, %ebx
	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
	addl	$-128, %ebx
	cmpl	$5, %ebx
	ja	LBB0_14
## %bb.1:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movq	_MODS_SHIFT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r12d, %eax
	jne	LBB0_4
## %bb.3:
	movq	_USB_LED_CAPS_LOCK@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	andl	%r15d, %edx
	andl	%r14d, %eax
	orl	%edx, %eax
	je	LBB0_5
LBB0_4:
	xorl	%eax, %eax
	callq	_ergodox_right_led_1_on
	movl	$25, %edi
	callq	_ergodox_right_led_1_set
LBB0_5:
	movq	_MODS_GUI_MASK@GOTPCREL(%rip), %rax
	orl	%r14d, %r12d
	testl	%r12d, (%rax)
	movq	_MODS_CTRL_MASK@GOTPCREL(%rip), %rcx
	sete	%al
	testl	%r12d, (%rcx)
	jne	LBB0_7
## %bb.6:
	testb	%al, %al
	je	LBB0_8
	jmp	LBB0_10
LBB0_7:
	movl	$50, %ebx
	testb	%al, %al
	je	LBB0_9
LBB0_8:
	movl	$10, %ebx
LBB0_9:
	xorl	%eax, %eax
	callq	_ergodox_right_led_2_on
	movl	%ebx, %edi
	callq	_ergodox_right_led_2_set
LBB0_10:
	movq	_MODS_ALT_MASK@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	jne	LBB0_11
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%eax, %eax
	callq	_ergodox_right_led_3_on
	movl	$10, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ergodox_right_led_3_set        ## TAILCALL
LBB0_12:
	xorl	%eax, %eax
	callq	_ergodox_right_led_2_on
	movl	$10, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ergodox_right_led_2_set        ## TAILCALL
LBB0_13:
	xorl	%eax, %eax
	callq	_ergodox_right_led_1_on
	movl	$10, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ergodox_right_led_1_set        ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_11
	.long	L0_0_set_13
	.long	L0_0_set_12
	.end_data_region
                                        ## -- End function
	.comm	_layer_state,4,2                ## @layer_state
	.comm	_MODS_SHIFT_MASK,4,2            ## @MODS_SHIFT_MASK
	.comm	_USB_LED_CAPS_LOCK,4,2          ## @USB_LED_CAPS_LOCK
	.comm	_MODS_CTRL_MASK,4,2             ## @MODS_CTRL_MASK
	.comm	_MODS_GUI_MASK,4,2              ## @MODS_GUI_MASK
	.comm	_MODS_ALT_MASK,4,2              ## @MODS_ALT_MASK
.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	x19, x0
	bl	_host_keyboard_leds
	mov	x21, x0
	bl	_get_oneshot_mods
	mov	x20, x0
Lloh0:
	adrp	x8, _layer_state@GOTPAGE
Lloh1:
	ldr	x8, [x8, _layer_state@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_biton32
	mov	x22, x0
	bl	_ergodox_board_led_off
	bl	_ergodox_right_led_1_off
	bl	_ergodox_right_led_2_off
	bl	_ergodox_right_led_3_off
	sub	w8, w22, #128
	cmp	w8, #5
	b.hi	LBB0_14
; %bb.1:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh5:
	adrp	x8, _MODS_SHIFT_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MODS_SHIFT_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w19
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x9, _USB_LED_CAPS_LOCK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _USB_LED_CAPS_LOCK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	and	w9, w9, w21
	and	w8, w8, w20
	orr	w8, w9, w8
	cbz	w8, LBB0_5
LBB0_4:
	bl	_ergodox_right_led_1_on
	mov	w0, #25
	bl	_ergodox_right_led_1_set
LBB0_5:
Lloh11:
	adrp	x8, _MODS_CTRL_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MODS_CTRL_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x8]
	orr	w10, w19, w20
Lloh14:
	adrp	x8, _MODS_GUI_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MODS_GUI_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w10
	cset	w8, eq
	and	w9, w9, w10
	cbnz	w9, LBB0_7
; %bb.6:
	tbz	w8, #0, LBB0_8
	b	LBB0_13
LBB0_7:
	cbz	w8, LBB0_11
LBB0_8:
	mov	w21, #10
	b	LBB0_12
LBB0_9:
	bl	_ergodox_right_led_1_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_1_set
LBB0_10:
	bl	_ergodox_right_led_2_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_2_set
LBB0_11:
	mov	w21, #50
LBB0_12:
	bl	_ergodox_right_led_2_on
	mov	x0, x21
	bl	_ergodox_right_led_2_set
LBB0_13:
Lloh17:
	adrp	x8, _MODS_ALT_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MODS_ALT_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	orr	w9, w19, w20
	tst	w8, w9
	b.ne	LBB0_15
LBB0_14:
	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_15:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_layer_state,4,2                ; @layer_state
	.comm	_MODS_SHIFT_MASK,4,2            ; @MODS_SHIFT_MASK
	.comm	_USB_LED_CAPS_LOCK,4,2          ; @USB_LED_CAPS_LOCK
	.comm	_MODS_CTRL_MASK,4,2             ; @MODS_CTRL_MASK
	.comm	_MODS_GUI_MASK,4,2              ; @MODS_GUI_MASK
	.comm	_MODS_ALT_MASK,4,2              ; @MODS_ALT_MASK
.subsections_via_symbols
