	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_CheckEvents                 ## -- Begin function CG_CheckEvents
	.p2align	4, 0x90
_CG_CheckEvents:                        ## @CG_CheckEvents
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	_ET_EVENTS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jle	LBB0_6
## %bb.1:
	cmpl	$0, (%rbx)
	jne	LBB0_8
## %bb.2:
	movq	_EF_PLAYER_EVENT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 16(%rbx)
	je	LBB0_4
## %bb.3:
	movl	28(%rbx), %edx
	movl	%edx, 32(%rbx)
LBB0_4:
	movl	$1, (%rbx)
	subl	%ecx, %eax
	movl	%eax, 20(%rbx)
	jmp	LBB0_5
LBB0_6:
	movl	20(%rbx), %eax
	cmpl	(%rbx), %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, (%rbx)
	movq	_EV_EVENT_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%ecx, %eax
	je	LBB0_8
LBB0_5:
	leaq	24(%rbx), %rdi
	movq	_cg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	callq	_BG_EvaluateTrajectory
	movq	%rbx, %rdi
	callq	_CG_SetEntitySoundPosition
	movl	4(%rbx), %esi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_CG_EntityEvent                 ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ET_EVENTS,8,3                  ## @ET_EVENTS
	.comm	_EF_PLAYER_EVENT,4,2            ## @EF_PLAYER_EVENT
	.comm	_EV_EVENT_BITS,4,2              ## @EV_EVENT_BITS
	.comm	_cg,8,3                         ## @cg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_CheckEvents                 ; -- Begin function CG_CheckEvents
	.p2align	2
_CG_CheckEvents:                        ; @CG_CheckEvents
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _ET_EVENTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ET_EVENTS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_5
; %bb.1:
	ldr	w10, [x19]
	cbnz	w10, LBB0_8
; %bb.2:
	ldr	w10, [x19, #16]
Lloh3:
	adrp	x11, _EF_PLAYER_EVENT@GOTPAGE
Lloh4:
	ldr	x11, [x11, _EF_PLAYER_EVENT@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_4
; %bb.3:
	ldr	w10, [x19, #28]
	str	w10, [x19, #32]
LBB0_4:
	mov	w10, #1
	str	w10, [x19]
	sub	w8, w8, w9
	str	w8, [x19, #20]
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19, #20]
	ldr	w9, [x19]
	cmp	w8, w9
	b.eq	LBB0_8
; %bb.6:
	str	w8, [x19]
Lloh6:
	adrp	x9, _EV_EVENT_BITS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EV_EVENT_BITS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.eq	LBB0_8
LBB0_7:
	add	x0, x19, #24
Lloh9:
	adrp	x8, _cg@GOTPAGE
Lloh10:
	ldr	x8, [x8, _cg@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	bl	_BG_EvaluateTrajectory
	mov	x0, x19
	bl	_CG_SetEntitySoundPosition
	ldr	w1, [x19, #4]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_CG_EntityEvent
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ET_EVENTS,8,3                  ; @ET_EVENTS
	.comm	_EF_PLAYER_EVENT,4,2            ; @EF_PLAYER_EVENT
	.comm	_EV_EVENT_BITS,4,2              ; @EV_EVENT_BITS
	.comm	_cg,8,3                         ; @cg
.subsections_via_symbols
