	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Com_GetSystemEvent             ## -- Begin function Com_GetSystemEvent
	.p2align	4, 0x90
_Com_GetSystemEvent:                    ## @Com_GetSystemEvent
	.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	_eventHead@GOTPCREL(%rip), %r13
	movq	_eventTail@GOTPCREL(%rip), %r12
	movslq	(%r12), %rax
	cmpl	%eax, (%r13)
	jg	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_Sys_ConsoleInput
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %r14d
	movl	%r14d, %edi
	callq	_Z_Malloc
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_strcpy
	movq	_SE_CONSOLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	%r14d, %r8d
	movq	%r15, %r9
	callq	_Com_QueueEvent
LBB0_4:
	movslq	(%r12), %rax
	cmpl	%eax, (%r13)
	jle	LBB0_5
LBB0_1:
	leal	1(%rax), %ecx
	movl	%ecx, (%r12)
	movq	_eventQueue@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_MASK_QUEUED_EVENTS@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	andq	%rax, %rdx
	movl	(%rcx,%rdx,4), %eax
	jmp	LBB0_6
LBB0_5:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	xorl	%eax, %eax
	callq	_Sys_Milliseconds
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_eventHead,4,2                  ## @eventHead
	.comm	_eventTail,4,2                  ## @eventTail
	.comm	_eventQueue,8,3                 ## @eventQueue
	.comm	_MASK_QUEUED_EVENTS,4,2         ## @MASK_QUEUED_EVENTS
	.comm	_SE_CONSOLE,4,2                 ## @SE_CONSOLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Com_GetSystemEvent             ; -- Begin function Com_GetSystemEvent
	.p2align	2
_Com_GetSystemEvent:                    ; @Com_GetSystemEvent
	.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
Lloh0:
	adrp	x23, _eventHead@GOTPAGE
Lloh1:
	ldr	x23, [x23, _eventHead@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh2:
	adrp	x22, _eventTail@GOTPAGE
Lloh3:
	ldr	x22, [x22, _eventTail@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w9, w8
	b.gt	LBB0_4
; %bb.1:
	bl	_Sys_ConsoleInput
	cbz	x0, LBB0_3
; %bb.2:
	mov	x19, x0
	bl	_strlen
	add	w20, w0, #1
	mov	x0, x20
	bl	_Z_Malloc
	mov	x21, x0
	mov	x1, x19
	bl	_strcpy
Lloh4:
	adrp	x8, _SE_CONSOLE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SE_CONSOLE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #0
	mov	w2, #0
	mov	w3, #0
	mov	x4, x20
	mov	x5, x21
	bl	_Com_QueueEvent
LBB0_3:
	ldr	w9, [x23]
	ldr	w8, [x22]
	cmp	w9, w8
	b.le	LBB0_5
LBB0_4:
	add	w9, w8, #1
	str	w9, [x22]
Lloh7:
	adrp	x9, _eventQueue@GOTPAGE
Lloh8:
	ldr	x9, [x9, _eventQueue@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
Lloh10:
	adrp	x10, _MASK_QUEUED_EVENTS@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MASK_QUEUED_EVENTS@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	and	w8, w10, w8
	ldr	w0, [x9, w8, sxtw #2]
	b	LBB0_6
LBB0_5:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	bl	_Sys_Milliseconds
LBB0_6:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_eventHead,4,2                  ; @eventHead
	.comm	_eventTail,4,2                  ; @eventTail
	.comm	_eventQueue,8,3                 ; @eventQueue
	.comm	_MASK_QUEUED_EVENTS,4,2         ; @MASK_QUEUED_EVENTS
	.comm	_SE_CONSOLE,4,2                 ; @SE_CONSOLE
.subsections_via_symbols
