	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, (%rdi)
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %r12
	movl	4(%rdi), %ecx
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.3:
	movl	%edx, %r15d
	cmpl	$3, %ecx
	ja	LBB0_5
## %bb.4:
	shll	$3, %ecx
	movl	%r15d, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	testl	%eax, %eax
	je	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_5:
	movq	16(%r12), %rax
	movslq	%esi, %rcx
	movl	(%rax,%rcx,4), %r14d
	movl	%r15d, (%rax,%rcx,4)
	movl	8(%r12), %esi
	movl	%r14d, %edi
	callq	_clear_bit
	movl	8(%r12), %esi
	movl	%r15d, %edi
	callq	_set_bit
	cmpl	$0, (%r12)
	jle	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_input_fetch_keycode
	cmpl	%r14d, %eax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_8
	jmp	LBB0_10
LBB0_9:
	movl	8(%r12), %esi
	movl	%r14d, %edi
	callq	_set_bit
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.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:
	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
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x21, x2
	cmp	w8, #3
	lsl	w8, w8, #3
	asr	w8, w2, w8
	ccmp	w8, #0, #4, ls
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x19, #16]
	sbfiz	x9, x1, #2, #32
	ldr	w20, [x8, x9]
	str	w21, [x8, x9]
	ldr	w1, [x19, #8]
	mov	x0, x20
	bl	_clear_bit
	ldr	w1, [x19, #8]
	mov	x0, x21
	bl	_set_bit
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.4:
	mov	w21, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_input_fetch_keycode
	cmp	w0, w20
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lt	LBB0_5
	b	LBB0_9
LBB0_7:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	ldr	w1, [x19, #8]
	mov	x0, x20
	bl	_set_bit
LBB0_9:
	mov	w0, #0
LBB0_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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_input_default_setkeycode
.subsections_via_symbols
