	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kb_key_callback                ## -- Begin function kb_key_callback
	.p2align	4, 0x90
_kb_key_callback:                       ## @kb_key_callback
	.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	%rdi, %r15
	xorl	%r14d, %r14d
	cmpq	$0, (%rdi)
	setg	%r14b
	movl	24(%rdi), %edi
	callq	_input_keymaps_translate_keysym_to_rk
	movq	_RETROK_LAST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jae	LBB0_2
## %bb.1:
	movq	_keyboardState@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %edx
	movl	%r14d, (%rcx,%rdx,4)
LBB0_2:
	movl	8(%r15), %edx
	movq	_KBD_WIIU_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%edx, %esi
	je	LBB0_4
## %bb.3:
	movq	_RETROKMOD_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_4:
	movq	_KBD_WIIU_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%edx, %ecx
	je	LBB0_6
## %bb.5:
	movq	_RETROKMOD_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_6:
	movq	_KBD_WIIU_ALT@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	andl	%edx, %edi
	je	LBB0_8
## %bb.7:
	movq	_RETROKMOD_ALT@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
LBB0_8:
	movq	_KBD_WIIU_NUM_LOCK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	andl	%edx, %ebx
	je	LBB0_10
## %bb.9:
	movq	_RETROKMOD_NUMLOCK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
LBB0_10:
	orl	%ebx, %edi
	orl	%esi, %ecx
	movq	_KBD_WIIU_CAPS_LOCK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%edx, %esi
	je	LBB0_12
## %bb.11:
	movq	_RETROKMOD_CAPSLOCK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
LBB0_12:
	orl	%edi, %ecx
	movq	_KBD_WIIU_SCROLL_LOCK@GOTPCREL(%rip), %rdi
	andl	(%rdi), %edx
	je	LBB0_14
## %bb.13:
	movq	_RETROKMOD_SCROLLOCK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_14:
	orl	%edx, %esi
	orl	%esi, %ecx
	movsbl	16(%r15), %edx
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movl	%r14d, %edi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_keyboard_event           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RETROK_LAST,4,2                ## @RETROK_LAST
	.comm	_keyboardState,8,3              ## @keyboardState
	.comm	_KBD_WIIU_SHIFT,4,2             ## @KBD_WIIU_SHIFT
	.comm	_RETROKMOD_SHIFT,4,2            ## @RETROKMOD_SHIFT
	.comm	_KBD_WIIU_CTRL,4,2              ## @KBD_WIIU_CTRL
	.comm	_RETROKMOD_CTRL,4,2             ## @RETROKMOD_CTRL
	.comm	_KBD_WIIU_ALT,4,2               ## @KBD_WIIU_ALT
	.comm	_RETROKMOD_ALT,4,2              ## @RETROKMOD_ALT
	.comm	_KBD_WIIU_NUM_LOCK,4,2          ## @KBD_WIIU_NUM_LOCK
	.comm	_RETROKMOD_NUMLOCK,4,2          ## @RETROKMOD_NUMLOCK
	.comm	_KBD_WIIU_CAPS_LOCK,4,2         ## @KBD_WIIU_CAPS_LOCK
	.comm	_RETROKMOD_CAPSLOCK,4,2         ## @RETROKMOD_CAPSLOCK
	.comm	_KBD_WIIU_SCROLL_LOCK,4,2       ## @KBD_WIIU_SCROLL_LOCK
	.comm	_RETROKMOD_SCROLLOCK,4,2        ## @RETROKMOD_SCROLLOCK
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ## @RETRO_DEVICE_KEYBOARD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kb_key_callback                ; -- Begin function kb_key_callback
	.p2align	2
_kb_key_callback:                       ; @kb_key_callback
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w20, gt
	ldr	w0, [x0, #24]
	bl	_input_keymaps_translate_keysym_to_rk
	mov	x1, x0
Lloh0:
	adrp	x8, _RETROK_LAST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETROK_LAST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _keyboardState@GOTPAGE
Lloh4:
	ldr	x8, [x8, _keyboardState@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	w20, [x8, w1, uxtw #2]
LBB0_2:
	ldr	w8, [x19, #8]
Lloh6:
	adrp	x9, _KBD_WIIU_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KBD_WIIU_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _RETROKMOD_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _RETROKMOD_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w9, wzr, w10, eq
Lloh12:
	adrp	x10, _KBD_WIIU_CTRL@GOTPAGE
Lloh13:
	ldr	x10, [x10, _KBD_WIIU_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _RETROKMOD_CTRL@GOTPAGE
Lloh16:
	ldr	x11, [x11, _RETROKMOD_CTRL@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w10, w9
Lloh18:
	adrp	x10, _KBD_WIIU_ALT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _KBD_WIIU_ALT@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
Lloh21:
	adrp	x11, _RETROKMOD_ALT@GOTPAGE
Lloh22:
	ldr	x11, [x11, _RETROKMOD_ALT@GOTPAGEOFF]
Lloh23:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
Lloh24:
	adrp	x10, _KBD_WIIU_NUM_LOCK@GOTPAGE
Lloh25:
	ldr	x10, [x10, _KBD_WIIU_NUM_LOCK@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
Lloh27:
	adrp	x11, _RETROKMOD_NUMLOCK@GOTPAGE
Lloh28:
	ldr	x11, [x11, _RETROKMOD_NUMLOCK@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
Lloh30:
	adrp	x10, _KBD_WIIU_CAPS_LOCK@GOTPAGE
Lloh31:
	ldr	x10, [x10, _KBD_WIIU_CAPS_LOCK@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
Lloh33:
	adrp	x11, _RETROKMOD_CAPSLOCK@GOTPAGE
Lloh34:
	ldr	x11, [x11, _RETROKMOD_CAPSLOCK@GOTPAGEOFF]
Lloh35:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
Lloh36:
	adrp	x10, _KBD_WIIU_SCROLL_LOCK@GOTPAGE
Lloh37:
	ldr	x10, [x10, _KBD_WIIU_SCROLL_LOCK@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
Lloh39:
	adrp	x11, _RETROKMOD_SCROLLOCK@GOTPAGE
Lloh40:
	ldr	x11, [x11, _RETROKMOD_SCROLLOCK@GOTPAGEOFF]
Lloh41:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w3, w9, w8
	ldrsb	w2, [x19, #16]
Lloh42:
	adrp	x8, _RETRO_DEVICE_KEYBOARD@GOTPAGE
Lloh43:
	ldr	x8, [x8, _RETRO_DEVICE_KEYBOARD@GOTPAGEOFF]
Lloh44:
	ldr	w4, [x8]
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_input_keyboard_event
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RETROK_LAST,4,2                ; @RETROK_LAST
	.comm	_keyboardState,8,3              ; @keyboardState
	.comm	_KBD_WIIU_SHIFT,4,2             ; @KBD_WIIU_SHIFT
	.comm	_RETROKMOD_SHIFT,4,2            ; @RETROKMOD_SHIFT
	.comm	_KBD_WIIU_CTRL,4,2              ; @KBD_WIIU_CTRL
	.comm	_RETROKMOD_CTRL,4,2             ; @RETROKMOD_CTRL
	.comm	_KBD_WIIU_ALT,4,2               ; @KBD_WIIU_ALT
	.comm	_RETROKMOD_ALT,4,2              ; @RETROKMOD_ALT
	.comm	_KBD_WIIU_NUM_LOCK,4,2          ; @KBD_WIIU_NUM_LOCK
	.comm	_RETROKMOD_NUMLOCK,4,2          ; @RETROKMOD_NUMLOCK
	.comm	_KBD_WIIU_CAPS_LOCK,4,2         ; @KBD_WIIU_CAPS_LOCK
	.comm	_RETROKMOD_CAPSLOCK,4,2         ; @RETROKMOD_CAPSLOCK
	.comm	_KBD_WIIU_SCROLL_LOCK,4,2       ; @KBD_WIIU_SCROLL_LOCK
	.comm	_RETROKMOD_SCROLLOCK,4,2        ; @RETROKMOD_SCROLLOCK
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ; @RETRO_DEVICE_KEYBOARD
.subsections_via_symbols
