	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_setkeycode
_ir_setkeycode:                         ## @ir_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	callq	_input_get_drvdata
	movq	%rax, %r12
	movq	%rax, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	_INPUT_KEYMAP_BY_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.1:
	movl	4(%r15), %edx
	cmpl	(%r12), %edx
	jae	LBB0_2
LBB0_7:
	movl	8(%r15), %ecx
	movq	%r12, %rdi
	movq	%r12, %rsi
	callq	_ir_update_mapping
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_4:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_input_scancode_to_scalar
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	_ir_establish_scancode
	movl	%eax, %edx
	cmpl	(%r12), %eax
	jb	LBB0_7
## %bb.6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ## @INPUT_KEYMAP_BY_INDEX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ir_setkeycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_setkeycode
_ir_setkeycode:                         ; @ir_setkeycode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	bl	_input_get_drvdata
	mov	x22, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x21]
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_3
; %bb.1:
	ldr	w2, [x21, #4]
	ldr	w8, [x22]
	cmp	w2, w8
	b.hs	LBB0_6
LBB0_2:
	ldr	w3, [x21, #8]
	mov	x0, x22
	mov	x1, x22
	bl	_ir_update_mapping
	mov	w23, #0
	str	w0, [x20]
	b	LBB0_8
LBB0_3:
	add	x1, sp, #12
	mov	x0, x21
	bl	_input_scancode_to_scalar
	mov	x23, x0
	cbnz	w0, LBB0_8
; %bb.4:
	ldr	w2, [sp, #12]
	mov	x0, x22
	mov	x1, x22
	mov	w3, #1
	bl	_ir_establish_scancode
	mov	x2, x0
	ldr	w8, [x22]
	cmp	w0, w8
	b.lo	LBB0_2
; %bb.5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_INPUT_KEYMAP_BY_INDEX,4,2      ; @INPUT_KEYMAP_BY_INDEX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ir_setkeycode
.subsections_via_symbols
