	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_KeyEvent                    ## -- Begin function CG_KeyEvent
	.p2align	4, 0x90
_CG_KeyEvent:                           ## @CG_KeyEvent
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.1:
	movq	_cg@GOTPCREL(%rip), %rax
	movq	8(%rax), %rcx
	movq	_PM_NORMAL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_9
## %bb.2:
	movl	%edi, %ebx
	movq	_PM_SPECTATOR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	movq	(%rax), %rax
	movq	_qfalse@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_9:
	movq	_CGAME_EVENT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CG_EventHandling
	xorl	%edi, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_trap_Key_SetCatcher            ## TAILCALL
LBB0_4:
	movq	_cgs@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	movl	%ebx, %edi
	callq	_Display_HandleKey
	cmpq	$0, 8(%r14)
	je	LBB0_6
## %bb.5:
	movq	$0, 8(%r14)
	jmp	LBB0_8
LBB0_6:
	movq	_K_MOUSE2@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_8
## %bb.7:
	movl	(%r14), %esi
	movl	4(%r14), %edi
	callq	_Display_CaptureItem
	movq	%rax, 8(%r14)
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cg,16,3                        ## @cg
	.comm	_PM_NORMAL,8,3                  ## @PM_NORMAL
	.comm	_PM_SPECTATOR,8,3               ## @PM_SPECTATOR
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_CGAME_EVENT_NONE,4,2           ## @CGAME_EVENT_NONE
	.comm	_cgs,16,3                       ## @cgs
	.comm	_K_MOUSE2,4,2                   ## @K_MOUSE2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_KeyEvent                    ; -- Begin function CG_KeyEvent
	.p2align	2
_CG_KeyEvent:                           ; @CG_KeyEvent
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x1, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _cg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cg@GOTPAGEOFF]
	ldr	x9, [x8, #8]
Lloh2:
	adrp	x10, _PM_NORMAL@GOTPAGE
Lloh3:
	ldr	x10, [x10, _PM_NORMAL@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_4
; %bb.2:
	mov	x19, x0
Lloh5:
	adrp	x10, _PM_SPECTATOR@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PM_SPECTATOR@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _qfalse@GOTPAGE
Lloh9:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _CGAME_EVENT_NONE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CGAME_EVENT_NONE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_CG_EventHandling
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_trap_Key_SetCatcher
LBB0_5:
Lloh14:
	adrp	x20, _cgs@GOTPAGE
Lloh15:
	ldr	x20, [x20, _cgs@GOTPAGEOFF]
	ldp	w3, w2, [x20]
	mov	x0, x19
	bl	_Display_HandleKey
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.6:
	str	xzr, [x20, #8]
	b	LBB0_9
LBB0_7:
Lloh16:
	adrp	x8, _K_MOUSE2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _K_MOUSE2@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_9
; %bb.8:
	ldp	w1, w0, [x20]
	bl	_Display_CaptureItem
	str	x0, [x20, #8]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_cg,16,3                        ; @cg
	.comm	_PM_NORMAL,8,3                  ; @PM_NORMAL
	.comm	_PM_SPECTATOR,8,3               ; @PM_SPECTATOR
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_CGAME_EVENT_NONE,4,2           ; @CGAME_EVENT_NONE
	.comm	_cgs,16,3                       ; @cgs
	.comm	_K_MOUSE2,4,2                   ; @K_MOUSE2
.subsections_via_symbols
