	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rwebinput_process_keyboard_events
_rwebinput_process_keyboard_events:     ## @rwebinput_process_keyboard_events
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_EMSCRIPTEN_EVENT_KEYDOWN@GOTPCREL(%rip), %rax
	movq	(%rsi), %rcx
	movq	8(%rsi), %rdi
	xorl	%r12d, %r12d
	cmpq	(%rax), %rcx
	sete	%r14b
	callq	_utf8len
	xorl	%r15d, %r15d
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	%rax, -56(%rbp)
	leaq	-56(%rbp), %rdi
	callq	_utf8_walk
	movl	%eax, %r15d
LBB0_2:
	cmpq	$0, 48(%rbx)
	movl	$0, %eax
	je	LBB0_4
## %bb.3:
	movq	_RETROKMOD_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	cmpq	$0, 40(%rbx)
	movl	$0, %r13d
	je	LBB0_6
## %bb.5:
	movq	_RETROKMOD_ALT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_6:
	cmpq	$0, 32(%rbx)
	movl	$0, %ecx
	je	LBB0_8
## %bb.7:
	movq	_RETROKMOD_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_8:
	orl	%eax, %r13d
	cmpq	$0, 24(%rbx)
	movl	$0, %eax
	je	LBB0_10
## %bb.9:
	movq	_RETROKMOD_META@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	orl	%eax, %ecx
	orl	%ecx, %r13d
	movb	%r14b, %r12b
	movq	16(%rbx), %rbx
	movq	%rbx, %rdi
	movl	$8, %esi
	callq	_strnlen
	xorl	%edi, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_encoding_crc32
	movsbl	%al, %edi
	callq	_input_keymaps_translate_keysym_to_rk
	movl	%eax, %ebx
	movq	_RETROK_BACKSPACE@GOTPCREL(%rip), %rcx
	movb	$8, %al
	cmpl	(%rcx), %ebx
	je	LBB0_14
## %bb.11:
	movq	_RETROK_RETURN@GOTPCREL(%rip), %rcx
	movb	$10, %al
	cmpl	(%rcx), %ebx
	je	LBB0_14
## %bb.12:
	movq	_RETROK_KP_ENTER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	je	LBB0_14
## %bb.13:
	movq	_RETROK_TAB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movzbl	%r15b, %ecx
	movl	$9, %eax
	cmovnel	%ecx, %eax
LBB0_14:
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movsbl	%al, %edx
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%r13d, %ecx
	callq	_input_keyboard_event
	movq	_RETROK_LAST@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jae	LBB0_16
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	%ebx, %ecx
	movl	%r12d, (%rax,%rcx,4)
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMSCRIPTEN_EVENT_KEYDOWN,8,3   ## @EMSCRIPTEN_EVENT_KEYDOWN
	.comm	_RETROKMOD_CTRL,4,2             ## @RETROKMOD_CTRL
	.comm	_RETROKMOD_ALT,4,2              ## @RETROKMOD_ALT
	.comm	_RETROKMOD_SHIFT,4,2            ## @RETROKMOD_SHIFT
	.comm	_RETROKMOD_META,4,2             ## @RETROKMOD_META
	.comm	_RETROK_BACKSPACE,4,2           ## @RETROK_BACKSPACE
	.comm	_RETROK_RETURN,4,2              ## @RETROK_RETURN
	.comm	_RETROK_KP_ENTER,4,2            ## @RETROK_KP_ENTER
	.comm	_RETROK_TAB,4,2                 ## @RETROK_TAB
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ## @RETRO_DEVICE_KEYBOARD
	.comm	_RETROK_LAST,4,2                ## @RETROK_LAST
	.no_dead_strip	_rwebinput_process_keyboard_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rwebinput_process_keyboard_events
_rwebinput_process_keyboard_events:     ; @rwebinput_process_keyboard_events
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _EMSCRIPTEN_EVENT_KEYDOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EMSCRIPTEN_EVENT_KEYDOWN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldp	x9, x0, [x1]
	cmp	x9, x8
	cset	w20, eq
	bl	_utf8len
	cmp	w0, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	str	x8, [sp, #8]
	add	x0, sp, #8
	bl	_utf8_walk
	mov	x21, x0
	b	LBB0_3
LBB0_2:
	mov	w21, #0
LBB0_3:
	ldp	x10, x8, [x22, #40]
Lloh3:
	adrp	x9, _RETROKMOD_CTRL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RETROKMOD_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w8, wzr, w9, eq
Lloh6:
	adrp	x9, _RETROKMOD_ALT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RETROKMOD_ALT@GOTPAGEOFF]
	ldr	x11, [x22, #32]
	cmp	x10, #0
Lloh8:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _RETROKMOD_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RETROKMOD_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	x11, #0
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _RETROKMOD_META@GOTPAGE
Lloh13:
	ldr	x9, [x9, _RETROKMOD_META@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	ldp	x23, x10, [x22, #16]
	cmp	x10, #0
	csel	w9, wzr, w9, eq
	orr	w22, w8, w9
	mov	w24, #8
	mov	x0, x23
	mov	w1, #8
	bl	_strnlen
	mov	x2, x0
	mov	w0, #0
	mov	x1, x23
	bl	_encoding_crc32
	bl	_input_keymaps_translate_keysym_to_rk
	mov	x23, x0
Lloh15:
	adrp	x8, _RETROK_BACKSPACE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RETROK_BACKSPACE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_7
; %bb.4:
Lloh18:
	adrp	x8, _RETROK_RETURN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RETROK_RETURN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	mov	w24, #10
	cmp	w23, w8
	b.eq	LBB0_7
; %bb.5:
Lloh21:
	adrp	x8, _RETROK_KP_ENTER@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RETROK_KP_ENTER@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w23, w8
	b.eq	LBB0_7
; %bb.6:
Lloh24:
	adrp	x8, _RETROK_TAB@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RETROK_TAB@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	mov	w9, #9
	cmp	w23, w8
	csel	w24, w9, w21, eq
LBB0_7:
Lloh27:
	adrp	x8, _RETRO_DEVICE_KEYBOARD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RETRO_DEVICE_KEYBOARD@GOTPAGEOFF]
Lloh29:
	ldr	w4, [x8]
	sxtb	w2, w24
	mov	x0, x20
	mov	x1, x23
	mov	x3, x22
	bl	_input_keyboard_event
Lloh30:
	adrp	x8, _RETROK_LAST@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RETROK_LAST@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w23, w8
	b.hs	LBB0_9
; %bb.8:
	ldr	x8, [x19]
	str	w20, [x8, w23, uxtw #2]
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_EMSCRIPTEN_EVENT_KEYDOWN,8,3   ; @EMSCRIPTEN_EVENT_KEYDOWN
	.comm	_RETROKMOD_CTRL,4,2             ; @RETROKMOD_CTRL
	.comm	_RETROKMOD_ALT,4,2              ; @RETROKMOD_ALT
	.comm	_RETROKMOD_SHIFT,4,2            ; @RETROKMOD_SHIFT
	.comm	_RETROKMOD_META,4,2             ; @RETROKMOD_META
	.comm	_RETROK_BACKSPACE,4,2           ; @RETROK_BACKSPACE
	.comm	_RETROK_RETURN,4,2              ; @RETROK_RETURN
	.comm	_RETROK_KP_ENTER,4,2            ; @RETROK_KP_ENTER
	.comm	_RETROK_TAB,4,2                 ; @RETROK_TAB
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ; @RETRO_DEVICE_KEYBOARD
	.comm	_RETROK_LAST,4,2                ; @RETROK_LAST
	.no_dead_strip	_rwebinput_process_keyboard_events
.subsections_via_symbols
