	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_setkeytable
_ir_setkeytable:                        ## @ir_setkeytable
	.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
	movq	%rdi, %r12
	movl	20(%rsi), %edx
	movl	(%rsi), %r8d
	movl	16(%rsi), %ecx
	movq	%rdi, %rsi
	callq	_ir_create_table
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_1
## %bb.2:
	cmpl	$0, (%r14)
	je	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	4(%rax,%rbx,8), %edx
	movq	%r12, %rdi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	callq	_ir_establish_scancode
	cmpl	4(%r12), %eax
	jae	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r14), %rcx
	movl	(%rcx,%rbx,8), %ecx
	movq	%r12, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_ir_update_mapping
	incq	%rbx
	movl	(%r14), %eax
	cmpq	%rax, %rbx
	jb	LBB0_4
	jmp	LBB0_7
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.9:
	negl	%r15d
	movq	%r12, %rdi
	callq	_ir_free_table
	jmp	LBB0_1
LBB0_7:
	xorl	%r15d, %r15d
LBB0_1:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ir_setkeytable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_setkeytable
_ir_setkeytable:                        ; @ir_setkeytable
	.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
	mov	x19, x0
	ldp	w3, w2, [x1, #16]
	ldr	w4, [x1]
	mov	x1, x0
	bl	_ir_create_table
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w8, [x20]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x21, #0
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x21
	ldr	w2, [x8, #4]
	mov	x0, x19
	mov	x1, x19
	mov	w3, #0
	bl	_ir_establish_scancode
	ldr	w8, [x19, #4]
	cmp	w0, w8
	b.hs	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x2, x0
	ldr	x8, [x20, #8]
	ldr	w3, [x8, x21]
	mov	x0, x19
	mov	x1, x19
	bl	_ir_update_mapping
	add	x22, x22, #1
	ldr	w8, [x20]
	add	x21, x21, #8
	cmp	x22, x8
	b.lo	LBB0_3
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.6:
	neg	w21, w8
	mov	x0, x19
	bl	_ir_free_table
	b	LBB0_8
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x21
	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	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ir_setkeytable
.subsections_via_symbols
