	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_establish_scancode
_ir_establish_scancode:                 ## @ir_establish_scancode
	.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
	movq	%rsi, %r14
	movl	(%rdi), %eax
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	movl	$0, %r12d
	sbbl	%r12d, %r12d
	orl	%eax, %r12d
	andl	%edx, %r12d
	movl	(%rsi), %eax
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	8(%r14), %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r12d, (%rdx,%rbx,8)
	je	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	jae	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_2
## %bb.5:
	movl	%eax, %ebx
LBB0_6:
	cmpl	%eax, 4(%r14)
	jne	LBB0_10
## %bb.7:
	movl	$-1, %r15d
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.8:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_ir_resize_table
	testq	%rax, %rax
	jne	LBB0_15
## %bb.9:
	movl	(%r14), %eax
LBB0_10:
	movl	%eax, %edx
	subl	%ebx, %edx
	jbe	LBB0_11
## %bb.12:
	movq	8(%r14), %rax
	movl	%ebx, %r15d
	leaq	(%rax,%r15,8), %rdi
	addq	$8, %rdi
	leaq	(%rax,%r15,8), %rsi
	shll	$2, %edx
	callq	_memmove
	movl	(%r14), %eax
	jmp	LBB0_13
LBB0_11:
	movl	%ebx, %r15d
LBB0_13:
	movq	8(%r14), %rcx
	movl	%r12d, (%rcx,%r15,8)
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 4(%rcx,%r15,8)
	incl	%eax
	movl	%eax, (%r14)
LBB0_14:
	movl	%ebx, %r15d
LBB0_15:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.no_dead_strip	_ir_establish_scancode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_establish_scancode
_ir_establish_scancode:                 ; @ir_establish_scancode
	.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
	mov	x20, x1
	ldr	w8, [x0]
	cmp	w8, #0
	csinv	w8, w8, wzr, ne
	and	w21, w8, w2
	ldr	w8, [x1]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, #0
	ldr	x9, [x20, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	cmp	w10, w21
	b.eq	LBB0_16
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	b.hs	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x19, x19, #1
	add	x9, x9, #8
	cmp	x8, x19
	b.ne	LBB0_2
; %bb.5:
	mov	x19, x8
	b	LBB0_7
LBB0_6:
	mov	w19, #0
LBB0_7:
	ldr	w9, [x20, #4]
	cmp	w9, w8
	b.ne	LBB0_12
; %bb.8:
	cbz	w3, LBB0_10
; %bb.9:
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_ir_resize_table
	cbz	x0, LBB0_11
LBB0_10:
	mov	w19, #-1
	b	LBB0_16
LBB0_11:
	ldr	w8, [x20]
LBB0_12:
	subs	w9, w8, w19
	b.ls	LBB0_14
; %bb.13:
	ldr	x8, [x20, #8]
	add	w10, w19, #1
	add	x0, x8, w10, uxtw #3
	mov	w22, w19
	add	x1, x8, w19, uxtw #3
	lsl	w2, w9, #2
	bl	_memmove
	ldr	w8, [x20]
	b	LBB0_15
LBB0_14:
	mov	w22, w19
LBB0_15:
	ldr	x9, [x20, #8]
	add	x9, x9, x22, lsl #3
	str	w21, [x9]
Lloh3:
	adrp	x10, _KEY_RESERVED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _KEY_RESERVED@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	str	w10, [x9, #4]
	add	w8, w8, #1
	str	w8, [x20]
LBB0_16:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.no_dead_strip	_ir_establish_scancode
.subsections_via_symbols
