	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function input_default_setkeycode
_input_default_setkeycode:              ## @input_default_setkeycode
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_INPUT_KEYMAP_BY_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_4
## %bb.3:
	movl	4(%r15), %eax
	movl	%eax, -36(%rbp)
	cmpl	4(%r12), %eax
	jae	LBB0_1
LBB0_7:
	movl	(%r12), %ecx
	cmpl	$3, %ecx
	ja	LBB0_9
## %bb.8:
	movl	8(%r15), %edx
	shll	$3, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edx
	testl	%edx, %edx
	jne	LBB0_1
LBB0_9:
	movq	16(%r12), %rcx
	movl	%eax, %eax
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r14)
	movl	8(%r15), %edx
	movl	%edx, (%rcx,%rax,4)
	movl	(%r14), %edi
	movl	8(%r12), %esi
	callq	___clear_bit
	movl	8(%r15), %edi
	movl	8(%r12), %esi
	callq	___set_bit
	cmpl	$0, 4(%r12)
	je	LBB0_14
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_input_fetch_keycode
	cmpl	(%r14), %eax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=1
	incl	%ebx
	cmpl	4(%r12), %ebx
	jb	LBB0_12
	jmp	LBB0_14
LBB0_4:
	leaq	-36(%rbp), %rsi
	movq	%r15, %rdi
	callq	_input_scancode_to_scalar
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movl	-36(%rbp), %eax
	cmpl	4(%r12), %eax
	jb	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	8(%r12), %esi
	movl	%eax, %edi
	callq	___set_bit
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ## @INPUT_KEYMAP_BY_INDEX
	.no_dead_strip	_input_default_setkeycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function input_default_setkeycode
_input_default_setkeycode:              ; @input_default_setkeycode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _INPUT_KEYMAP_BY_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INPUT_KEYMAP_BY_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.2:
	ldr	w8, [x21, #4]
	str	w8, [sp, #12]
LBB0_3:
	ldr	w9, [x19, #4]
	cmp	w8, w9
	b.hs	LBB0_6
; %bb.4:
	ldr	w9, [x19]
	cmp	w9, #3
	b.hi	LBB0_10
; %bb.5:
	ldr	w10, [x21, #8]
	lsl	w9, w9, #3
	asr	w9, w10, w9
	cbz	w9, LBB0_10
LBB0_6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	add	x1, sp, #12
	mov	x0, x21
	bl	_input_scancode_to_scalar
	cbnz	w0, LBB0_7
; %bb.9:
	ldr	w8, [sp, #12]
	b	LBB0_3
LBB0_10:
	ldr	x9, [x19, #16]
	mov	w8, w8
	lsl	x8, x8, #2
	ldr	w10, [x9, x8]
	str	w10, [x20]
	ldr	w10, [x21, #8]
	str	w10, [x9, x8]
	ldr	w0, [x20]
	ldr	w1, [x19, #8]
	bl	___clear_bit
	ldr	w0, [x21, #8]
	ldr	w1, [x19, #8]
	bl	___set_bit
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_15
; %bb.11:
	mov	w21, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_input_fetch_keycode
	ldr	w8, [x20]
	cmp	w0, w8
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19, #4]
	cmp	w21, w8
	b.lo	LBB0_12
	b	LBB0_15
LBB0_14:
	ldr	w1, [x19, #8]
	bl	___set_bit
LBB0_15:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ; @INPUT_KEYMAP_BY_INDEX
	.no_dead_strip	_input_default_setkeycode
.subsections_via_symbols
