	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Com_QueueEvent                 ## -- Begin function Com_QueueEvent
	.p2align	4, 0x90
_Com_QueueEvent:                        ## @Com_QueueEvent
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edi, %r14d
	movq	_SE_MOUSE@GOTPCREL(%rip), %rdi
	movq	_eventHead@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movq	_eventTail@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpq	%rsi, (%rdi)
	jne	LBB0_1
## %bb.9:
	movl	%eax, %r11d
	cmpl	%ecx, %eax
	je	LBB0_2
## %bb.10:
	movq	_eventQueue@GOTPCREL(%rip), %rdi
	movq	(%rdi), %r10
	movq	_MAX_QUEUED_EVENTS@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	leal	(%rax,%rdi), %r11d
	decl	%r11d
	movq	_MASK_QUEUED_EVENTS@GOTPCREL(%rip), %rdi
	andl	(%rdi), %r11d
	movslq	%r11d, %rdi
	shlq	$5, %rdi
	movl	%ecx, %r11d
	cmpq	%rsi, (%r10,%rdi)
	jne	LBB0_2
## %bb.11:
	addl	%edx, 8(%r10,%rdi)
	addl	%r15d, 12(%r10,%rdi)
	jmp	LBB0_12
LBB0_1:
	movl	%ecx, %r11d
LBB0_2:
	movslq	%eax, %rcx
	movq	_eventQueue@GOTPCREL(%rip), %rdi
	movq	(%rdi), %r12
	movq	_MASK_QUEUED_EVENTS@GOTPCREL(%rip), %rdi
	movslq	(%rdi), %r13
	andq	%rcx, %r13
	movl	%eax, %ecx
	subl	%r11d, %ecx
	movq	_MAX_QUEUED_EVENTS@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %ecx
	jl	LBB0_6
## %bb.3:
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movq	%r9, %r15
	leaq	L_.str(%rip), %rdi
	callq	_Com_Printf
	movq	%r13, %rax
	shlq	$5, %rax
	movq	24(%r12,%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_Z_Free
LBB0_5:
	movq	_eventTail@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	(%rbx), %eax
	movq	%r15, %r9
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movl	-60(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
LBB0_6:
	incl	%eax
	movl	%eax, (%rbx)
	testl	%r14d, %r14d
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r14d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	callq	_Sys_Milliseconds
	movq	%rbx, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movl	%eax, %r14d
LBB0_8:
	shlq	$5, %r13
	movl	%r14d, 16(%r12,%r13)
	movq	%rsi, (%r12,%r13)
	movl	%edx, 8(%r12,%r13)
	movl	%r15d, 12(%r12,%r13)
	movl	%r8d, 20(%r12,%r13)
	movq	%r9, 24(%r12,%r13)
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SE_MOUSE,8,3                   ## @SE_MOUSE
	.comm	_eventHead,4,2                  ## @eventHead
	.comm	_eventTail,4,2                  ## @eventTail
	.comm	_eventQueue,8,3                 ## @eventQueue
	.comm	_MAX_QUEUED_EVENTS,4,2          ## @MAX_QUEUED_EVENTS
	.comm	_MASK_QUEUED_EVENTS,4,2         ## @MASK_QUEUED_EVENTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Com_QueueEvent: overflow\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Com_QueueEvent                 ; -- Begin function Com_QueueEvent
	.p2align	2
_Com_QueueEvent:                        ; @Com_QueueEvent
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x5
	mov	x22, x4
	mov	x19, x3
	mov	x20, x2
	mov	x23, x1
	mov	x24, x0
Lloh0:
	adrp	x8, _SE_MOUSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SE_MOUSE@GOTPAGEOFF]
Lloh2:
	adrp	x25, _eventHead@GOTPAGE
Lloh3:
	ldr	x25, [x25, _eventHead@GOTPAGEOFF]
Lloh4:
	ldr	x13, [x8]
	ldr	w8, [x25]
Lloh5:
	adrp	x26, _eventTail@GOTPAGE
Lloh6:
	ldr	x26, [x26, _eventTail@GOTPAGEOFF]
Lloh7:
	adrp	x10, _eventQueue@GOTPAGE
Lloh8:
	ldr	x10, [x10, _eventQueue@GOTPAGEOFF]
	ldr	w12, [x26]
Lloh9:
	adrp	x9, _MAX_QUEUED_EVENTS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MAX_QUEUED_EVENTS@GOTPAGEOFF]
Lloh11:
	adrp	x11, _MASK_QUEUED_EVENTS@GOTPAGE
Lloh12:
	ldr	x11, [x11, _MASK_QUEUED_EVENTS@GOTPAGEOFF]
	cmp	x13, x1
	b.ne	LBB0_4
; %bb.1:
	mov	x13, x8
	cmp	w8, w12
	b.eq	LBB0_5
; %bb.2:
	ldr	x14, [x10]
	ldr	w13, [x9]
	add	w13, w8, w13
	sub	w13, w13, #1
	ldr	w15, [x11]
	and	w15, w13, w15
	sbfiz	x13, x15, #5, #32
	ldr	x16, [x14, x13]
	mov	x13, x12
	cmp	x16, x23
	b.ne	LBB0_5
; %bb.3:
	sxtw	x8, w15
	add	x8, x14, x8, lsl #5
	ldp	w9, w10, [x8, #8]
	add	w9, w9, w20
	add	w10, w10, w19
	stp	w9, w10, [x8, #8]
	b	LBB0_12
LBB0_4:
	mov	x13, x12
LBB0_5:
	sxtw	x12, w8
	ldr	x27, [x10]
	ldrsw	x10, [x11]
	and	x28, x10, x12
	ldr	w9, [x9]
	sub	w10, w8, w13
	cmp	w10, w9
	b.lt	LBB0_9
; %bb.6:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Com_Printf
	add	x8, x27, x28, lsl #5
	ldr	x0, [x8, #24]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_Z_Free
LBB0_8:
	ldr	w8, [x26]
	add	w8, w8, #1
	str	w8, [x26]
	ldr	w8, [x25]
LBB0_9:
	add	w8, w8, #1
	str	w8, [x25]
	cbnz	w24, LBB0_11
; %bb.10:
	bl	_Sys_Milliseconds
	mov	x24, x0
LBB0_11:
	add	x8, x27, x28, lsl #5
	str	x23, [x8]
	stp	w20, w19, [x8, #8]
	stp	w24, w22, [x8, #16]
	str	x21, [x8, #24]
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SE_MOUSE,8,3                   ; @SE_MOUSE
	.comm	_eventHead,4,2                  ; @eventHead
	.comm	_eventTail,4,2                  ; @eventTail
	.comm	_eventQueue,8,3                 ; @eventQueue
	.comm	_MAX_QUEUED_EVENTS,4,2          ; @MAX_QUEUED_EVENTS
	.comm	_MASK_QUEUED_EVENTS,4,2         ; @MASK_QUEUED_EVENTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Com_QueueEvent: overflow\n"

.subsections_via_symbols
