	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CL_ReadDemoMessage             ## -- Begin function CL_ReadDemoMessage
	.p2align	4, 0x90
_CL_ReadDemoMessage:                    ## @CL_ReadDemoMessage
	.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
	movq	%rsp, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_MSGLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	(,%rbx,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_clc@GOTPCREL(%rip), %r13
	movl	4(%r13), %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	leaq	-52(%rbp), %rdi
	movl	$4, %esi
	callq	_FS_Read
	cmpl	$4, %eax
	jne	LBB0_1
## %bb.3:
	movl	-52(%rbp), %edi
	callq	_LittleLong
	movq	%rax, 8(%r13)
	shll	$2, %ebx
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_MSG_Init
	movl	4(%r13), %edx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_FS_Read
	cmpl	$4, %eax
	jne	LBB0_1
## %bb.4:
	movl	-80(%rbp), %edi
	callq	_LittleLong
	movl	%eax, -80(%rbp)
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.5:
	cmpl	%eax, -76(%rbp)
	jge	LBB0_7
## %bb.6:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_Com_Error
	movl	-80(%rbp), %eax
LBB0_7:
	movq	-72(%rbp), %rdi
	movl	4(%r13), %edx
	movl	%eax, %esi
	callq	_FS_Read
	cmpl	-80(%rbp), %eax
	jne	LBB0_8
## %bb.9:
	movq	_cls@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	$0, -64(%rbp)
	leaq	-80(%rbp), %rdi
	callq	_CL_ParseServerMessage
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_Com_Printf
LBB0_1:
	xorl	%eax, %eax
	callq	_CL_DemoCompleted
LBB0_10:
	movq	%r12, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_MSGLEN,4,2                 ## @MAX_MSGLEN
	.comm	_clc,16,3                       ## @clc
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CL_ReadDemoMessage: demoMsglen > MAX_MSGLEN"

L_.str.1:                               ## @.str.1
	.asciz	"Demo file was truncated.\n"

	.comm	_cls,4,2                        ## @cls
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CL_ReadDemoMessage             ; -- Begin function CL_ReadDemoMessage
	.p2align	2
_CL_ReadDemoMessage:                    ; @CL_ReadDemoMessage
	.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
	sub	sp, sp, #48
	mov	x20, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _MAX_MSGLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_MSGLEN@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	lsl	x8, x22, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x19, x9, x8
	mov	sp, x19
Lloh8:
	adrp	x21, _clc@GOTPAGE
Lloh9:
	ldr	x21, [x21, _clc@GOTPAGEOFF]
	ldr	w2, [x21, #4]
	cbz	w2, LBB0_9
; %bb.1:
	sub	x0, x29, #68
	mov	w1, #4
	bl	_FS_Read
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.2:
	ldur	w0, [x29, #-68]
	bl	_LittleLong
	str	x0, [x21, #8]
	lsl	w2, w22, #2
	sub	x0, x29, #64
	mov	x1, x19
	bl	_MSG_Init
	ldr	w2, [x21, #4]
	sub	x0, x29, #64
	mov	w1, #4
	bl	_FS_Read
	cmp	w0, #4
	b.ne	LBB0_9
; %bb.3:
	ldur	w0, [x29, #-64]
	bl	_LittleLong
	mov	x1, x0
	stur	w1, [x29, #-64]
	cmn	w1, #1
	b.eq	LBB0_9
; %bb.4:
	ldur	w8, [x29, #-60]
	cmp	w8, w1
	b.ge	LBB0_6
; %bb.5:
Lloh10:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	ldur	w1, [x29, #-64]
LBB0_6:
	ldur	x0, [x29, #-56]
	ldr	w2, [x21, #4]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_FS_Read
	ldur	w8, [x29, #-64]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.7:
Lloh15:
	adrp	x8, _cls@GOTPAGE
Lloh16:
	ldr	x8, [x8, _cls@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21]
	stur	xzr, [x29, #-48]
	sub	x0, x29, #64
	bl	_CL_ParseServerMessage
	b	LBB0_10
LBB0_8:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Com_Printf
LBB0_9:
	bl	_CL_DemoCompleted
LBB0_10:
	mov	sp, x20
	ldur	x8, [x29, #-40]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	sub	sp, x29, #32
	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_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MSGLEN,4,2                 ; @MAX_MSGLEN
	.comm	_clc,16,3                       ; @clc
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CL_ReadDemoMessage: demoMsglen > MAX_MSGLEN"

l_.str.1:                               ; @.str.1
	.asciz	"Demo file was truncated.\n"

	.comm	_cls,4,2                        ; @cls
.subsections_via_symbols
