	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_handle_xkb                     ## -- Begin function handle_xkb
	.p2align	4, 0x90
_handle_xkb:                            ## @handle_xkb
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r12d
	movq	$0, -56(%rbp)
	movq	_xkb_state@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-1, %r13d
	testl	%edi, %edi
	je	LBB0_24
## %bb.1:
	movl	%esi, %ebx
	leal	8(%r12), %r14d
	movq	_XKB_KEY_UP@GOTPCREL(%rip), %r15
	testl	%esi, %esi
	je	LBB0_2
## %bb.3:
	cmpl	$2, %ebx
	jne	LBB0_5
## %bb.4:
	movq	_XKB_KEY_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %esi
	callq	_xkb_state_update_key
	movq	_xkb_state@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %esi
	callq	_xkb_state_key_get_syms
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_7
LBB0_2:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_8
LBB0_5:
	leaq	-56(%rbp), %rdx
	movl	%r14d, %esi
	callq	_xkb_state_key_get_syms
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_25
## %bb.6:
	movq	_xkb_state@GOTPCREL(%rip), %r15
LBB0_7:
	movl	(%r15), %edi
	movq	_XKB_KEY_DOWN@GOTPCREL(%rip), %r15
	jmp	LBB0_8
LBB0_25:
	movq	_xkb_state@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_8:
	movl	(%r15), %edx
	movl	%r14d, %esi
	callq	_xkb_state_update_key
	cmpq	$0, -56(%rbp)
	je	LBB0_24
## %bb.9:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	_MOD_MAP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	xorl	%ebx, %ebx
	movq	_mod_map_idx@GOTPCREL(%rip), %r14
	movq	_XKB_MOD_INVALID@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	(%r13,%rbx,4), %eax
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	orl	%eax, %r15d
	movq	_MOD_MAP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_18
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rcx
	movq	(%rcx,%rbx,4), %rsi
	cmpq	(%r12), %rsi
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_mod_map_bit@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_xkb_state@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%edx, %edx
	movq	_XKB_STATE_MODS_EFFECTIVE@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	setg	%dl
	callq	_xkb_state_mod_index_is_active
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_10:
	xorl	%r15d, %r15d
LBB0_18:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_input_keymaps_translate_keysym_to_rk
	movl	%eax, %r14d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.20:
	movq	-56(%rbp), %rax
	movl	(%rax), %edi
	callq	_xkb_keysym_to_utf32
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	movl	%r15d, %ecx
	callq	_input_keyboard_event
	xorl	%r13d, %r13d
	cmpl	$1, %ebx
	je	LBB0_24
## %bb.21:
	movl	%ebx, %r14d
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	_RETROK_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %rax
	movl	(%rax,%r13,4), %edi
	callq	_xkb_keysym_to_utf32
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	movl	%r15d, %ecx
	callq	_input_keyboard_event
	incq	%r13
	cmpq	%r13, %r14
	jne	LBB0_22
## %bb.23:
	xorl	%r13d, %r13d
	jmp	LBB0_24
LBB0_19:
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r13d, %r13d
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_input_keyboard_event
LBB0_24:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_xkb_state,4,2                  ## @xkb_state
	.comm	_XKB_KEY_UP,4,2                 ## @XKB_KEY_UP
	.comm	_XKB_KEY_DOWN,4,2               ## @XKB_KEY_DOWN
	.comm	_MOD_MAP_SIZE,4,2               ## @MOD_MAP_SIZE
	.comm	_mod_map_idx,8,3                ## @mod_map_idx
	.comm	_mod_map_bit,8,3                ## @mod_map_bit
	.comm	_XKB_MOD_INVALID,8,3            ## @XKB_MOD_INVALID
	.comm	_XKB_STATE_MODS_EFFECTIVE,8,3   ## @XKB_STATE_MODS_EFFECTIVE
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ## @RETRO_DEVICE_KEYBOARD
	.comm	_RETROK_UNKNOWN,4,2             ## @RETROK_UNKNOWN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_handle_xkb                     ; -- Begin function handle_xkb
	.p2align	2
_handle_xkb:                            ; @handle_xkb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x21, _xkb_state@GOTPAGE
Lloh1:
	ldr	x21, [x21, _xkb_state@GOTPAGEOFF]
	ldr	w0, [x21]
	cbz	w0, LBB0_17
; %bb.1:
	mov	x19, x1
	add	w22, w20, #8
Lloh2:
	adrp	x8, _XKB_KEY_UP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XKB_KEY_UP@GOTPAGEOFF]
	cbz	w1, LBB0_4
; %bb.2:
	cmp	w19, #2
	b.ne	LBB0_5
; %bb.3:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_xkb_state_update_key
	ldr	w0, [x21]
	add	x2, sp, #8
	mov	x1, x22
	bl	_xkb_state_key_get_syms
	mov	x23, x0
	b	LBB0_6
LBB0_4:
	mov	x23, x19
	b	LBB0_8
LBB0_5:
	add	x2, sp, #8
	mov	x1, x22
	bl	_xkb_state_key_get_syms
	mov	x23, x0
	cmp	w19, #0
	b.le	LBB0_7
LBB0_6:
	ldr	w0, [x21]
Lloh4:
	adrp	x8, _XKB_KEY_DOWN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _XKB_KEY_DOWN@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	ldr	w0, [x21]
Lloh6:
	adrp	x8, _XKB_KEY_UP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XKB_KEY_UP@GOTPAGEOFF]
LBB0_8:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_xkb_state_update_key
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_17
; %bb.9:
	stp	w23, w20, [sp]                  ; 8-byte Folded Spill
Lloh8:
	adrp	x24, _MOD_MAP_SIZE@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MOD_MAP_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	cbz	w8, LBB0_18
; %bb.10:
	mov	x25, #0
	mov	x26, #0
	mov	w22, #0
Lloh10:
	adrp	x27, _mod_map_idx@GOTPAGE
Lloh11:
	ldr	x27, [x27, _mod_map_idx@GOTPAGEOFF]
Lloh12:
	adrp	x28, _mod_map_bit@GOTPAGE
Lloh13:
	ldr	x28, [x28, _mod_map_bit@GOTPAGEOFF]
Lloh14:
	adrp	x21, _XKB_MOD_INVALID@GOTPAGE
Lloh15:
	ldr	x21, [x21, _XKB_MOD_INVALID@GOTPAGEOFF]
Lloh16:
	adrp	x20, _XKB_STATE_MODS_EFFECTIVE@GOTPAGE
Lloh17:
	ldr	x20, [x20, _XKB_STATE_MODS_EFFECTIVE@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x23, x25]
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	orr	w22, w8, w22
	ldr	w8, [x24]
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x26, x26, #1
	add	x25, x25, #4
	cmp	x26, w8, uxtw
	b.hs	LBB0_19
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x27]
	ldr	x1, [x9, x25]
	ldr	x9, [x21]
	cmp	x1, x9
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x23, [x28]
Lloh18:
	adrp	x8, _xkb_state@GOTPAGE
Lloh19:
	ldr	x8, [x8, _xkb_state@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w2, gt
	bl	_xkb_state_mod_index_is_active
	cbnz	x0, LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w8, #0
	b	LBB0_12
LBB0_17:
	mov	w0, #-1
	b	LBB0_25
LBB0_18:
	mov	w22, #0
LBB0_19:
	ldr	w0, [sp, #4]                    ; 4-byte Folded Reload
	bl	_input_keymaps_translate_keysym_to_rk
	mov	x20, x0
	ldr	w23, [sp]                       ; 4-byte Folded Reload
	cbz	w23, LBB0_23
; %bb.20:
	ldr	x8, [sp, #8]
	ldr	w0, [x8]
	bl	_xkb_keysym_to_utf32
	mov	x2, x0
Lloh21:
	adrp	x21, _RETRO_DEVICE_KEYBOARD@GOTPAGE
Lloh22:
	ldr	x21, [x21, _RETRO_DEVICE_KEYBOARD@GOTPAGEOFF]
	ldr	w4, [x21]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_input_keyboard_event
	cmp	w23, #1
	b.eq	LBB0_24
; %bb.21:
	mov	w23, w23
	mov	w24, #1
Lloh23:
	adrp	x25, _RETROK_UNKNOWN@GOTPAGE
Lloh24:
	ldr	x25, [x25, _RETROK_UNKNOWN@GOTPAGEOFF]
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x25]
	ldr	x8, [sp, #8]
	ldr	w0, [x8, x24, lsl #2]
	bl	_xkb_keysym_to_utf32
	mov	x2, x0
	ldr	w4, [x21]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_input_keyboard_event
	add	x24, x24, #1
	cmp	x23, x24
	b.ne	LBB0_22
	b	LBB0_24
LBB0_23:
Lloh25:
	adrp	x8, _RETRO_DEVICE_KEYBOARD@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RETRO_DEVICE_KEYBOARD@GOTPAGEOFF]
Lloh27:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x3, x22
	bl	_input_keyboard_event
LBB0_24:
	mov	w0, #0
LBB0_25:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_xkb_state,4,2                  ; @xkb_state
	.comm	_XKB_KEY_UP,4,2                 ; @XKB_KEY_UP
	.comm	_XKB_KEY_DOWN,4,2               ; @XKB_KEY_DOWN
	.comm	_MOD_MAP_SIZE,4,2               ; @MOD_MAP_SIZE
	.comm	_mod_map_idx,8,3                ; @mod_map_idx
	.comm	_mod_map_bit,8,3                ; @mod_map_bit
	.comm	_XKB_MOD_INVALID,8,3            ; @XKB_MOD_INVALID
	.comm	_XKB_STATE_MODS_EFFECTIVE,8,3   ; @XKB_STATE_MODS_EFFECTIVE
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ; @RETRO_DEVICE_KEYBOARD
	.comm	_RETROK_UNKNOWN,4,2             ; @RETROK_UNKNOWN
.subsections_via_symbols
