	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_key_lock               ## -- Begin function process_key_lock
	.p2align	4, 0x90
_process_key_lock:                      ## @process_key_lock
	.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, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %rdi
	callq	_translate_keycode
	movq	%rax, %r12
	movq	(%rbx), %rbx
	movq	%rax, %rdi
	callq	_IS_STANDARD_KEYCODE
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	movq	_KC_LOCK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	cmpq	%rcx, %r12
	je	LBB0_6
## %bb.3:
	movq	_watching@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_11
LBB0_4:
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movq	%r12, %rdi
	callq	_KEY_STATE
	xorl	%r15d, %r15d
	testq	%rax, %rax
	sete	%r15b
	jmp	LBB0_12
LBB0_11:
	movl	$1, %r15d
	jmp	LBB0_12
LBB0_6:
	cmpq	%rcx, %r12
	jne	LBB0_8
## %bb.7:
	movq	_watching@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	sete	%cl
	movl	%ecx, (%rax)
	xorl	%r15d, %r15d
	jmp	LBB0_12
LBB0_8:
	movq	%r12, %rdi
	callq	_IS_STANDARD_KEYCODE
	movl	$1, %r15d
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	_watching@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_13
## %bb.10:
	movl	$0, (%rax)
	movq	%r12, %rdi
	callq	_SET_KEY_STATE
	movq	%r12, (%r14)
	jmp	LBB0_12
LBB0_13:
	movq	%r12, %rdi
	callq	_KEY_STATE
	testq	%rax, %rax
	je	LBB0_12
## %bb.14:
	movq	%r12, %rdi
	callq	_UNSET_KEY_STATE
	xorl	%r15d, %r15d
LBB0_12:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KC_LOCK,8,3                    ## @KC_LOCK
	.comm	_watching,4,2                   ## @watching
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_key_lock               ; -- Begin function process_key_lock
	.p2align	2
_process_key_lock:                      ; @process_key_lock
	.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	x21, x1
	mov	x20, x0
	ldr	x0, [x0]
	bl	_translate_keycode
	mov	x19, x0
	ldr	x21, [x21]
	bl	_IS_STANDARD_KEYCODE
	cbz	x21, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _KC_LOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KC_LOCK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, #0
	ccmp	x19, x8, #4, eq
	b.ne	LBB0_6
; %bb.2:
	cmp	x19, x8
	b.ne	LBB0_9
; %bb.3:
	mov	w0, #0
Lloh3:
	adrp	x8, _watching@GOTPAGE
Lloh4:
	ldr	x8, [x8, _watching@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #0
	cset	w9, eq
	str	w9, [x8]
	b	LBB0_8
LBB0_4:
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_KEY_STATE
	cmp	x0, #0
	cset	w0, eq
	b	LBB0_8
LBB0_6:
Lloh5:
	adrp	x8, _watching@GOTPAGE
Lloh6:
	ldr	x8, [x8, _watching@GOTPAGEOFF]
Lloh7:
	str	wzr, [x8]
LBB0_7:
	mov	w0, #1
LBB0_8:
	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
LBB0_9:
	mov	x0, x19
	bl	_IS_STANDARD_KEYCODE
	cbz	x0, LBB0_7
; %bb.10:
Lloh8:
	adrp	x8, _watching@GOTPAGE
Lloh9:
	ldr	x8, [x8, _watching@GOTPAGEOFF]
	ldr	w9, [x8]
	cbz	w9, LBB0_12
; %bb.11:
	str	wzr, [x8]
	mov	x0, x19
	bl	_SET_KEY_STATE
	str	x19, [x20]
	b	LBB0_7
LBB0_12:
	mov	x0, x19
	bl	_KEY_STATE
	cbz	x0, LBB0_7
; %bb.13:
	mov	x0, x19
	bl	_UNSET_KEY_STATE
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_KC_LOCK,8,3                    ; @KC_LOCK
	.comm	_watching,4,2                   ; @watching
.subsections_via_symbols
