	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CL_ParseDownload               ## -- Begin function CL_ParseDownload
	.p2align	4, 0x90
_CL_ParseDownload:                      ## @CL_ParseDownload
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_MAX_MSGLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%rbx, %rdi
	callq	_MSG_ReadShort
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_MSG_ReadLong
	movq	_clc@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_Cvar_SetValue
	cmpq	$0, (%r15)
	js	LBB0_2
LBB0_4:
	movq	%rbx, %rdi
	callq	_MSG_ReadShort
	movl	%eax, %r15d
	testl	%eax, %eax
	jle	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_MSG_ReadData
LBB0_6:
	movq	_clc@GOTPCREL(%rip), %rbx
	movl	8(%rbx), %esi
	cmpl	%r12d, %esi
	jne	LBB0_7
## %bb.8:
	movq	40(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_9
LBB0_13:
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.14:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_FS_Write
LBB0_15:
	movl	8(%rbx), %esi
	leaq	L_.str.5(%rip), %rdi
	callq	_va
	movq	%rax, %rdi
	callq	_CL_AddReliableCommand
	incl	8(%rbx)
	movslq	%r15d, %rsi
	addq	16(%rbx), %rsi
	movq	%rsi, 16(%rbx)
	leaq	L_.str.6(%rip), %rdi
	callq	_Cvar_SetValue
	testl	%r15d, %r15d
	jne	LBB0_20
## %bb.16:
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	callq	_FS_FCloseFile
	movq	$0, 40(%rbx)
	movq	24(%rbx), %rsi
	movq	32(%rbx), %rdi
	callq	_FS_SV_Rename
LBB0_18:
	movq	24(%rbx), %rax
	movq	$0, (%rax)
	movq	32(%rbx), %rax
	movq	$0, (%rax)
	leaq	L_.str.7(%rip), %rdi
	leaq	L_.str.8(%rip), %rsi
	callq	_Cvar_Set
	xorl	%eax, %eax
	callq	_CL_WritePacket
	xorl	%eax, %eax
	callq	_CL_WritePacket
	jmp	LBB0_19
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %edx
	callq	_Com_DPrintf
	jmp	LBB0_20
LBB0_9:
	movq	32(%rbx), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_10
## %bb.11:
	callq	_FS_SV_FOpenFileWrite
	movq	%rax, %rdx
	movq	%rax, 40(%rbx)
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	32(%rbx), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_Com_Printf
	leaq	L_.str.3(%rip), %rdi
	callq	_CL_AddReliableCommand
LBB0_19:
	xorl	%eax, %eax
	callq	_CL_NextDownload
	jmp	LBB0_20
LBB0_2:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_MSG_ReadString
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_22
## %bb.3:
	movl	%r14d, %edi
	movl	%eax, %esi
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Com_Error                      ## TAILCALL
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_Com_Printf
	leaq	L_.str.3(%rip), %rdi
	callq	_CL_AddReliableCommand
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_MSGLEN,4,2                 ## @MAX_MSGLEN
	.comm	_clc,48,3                       ## @clc
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cl_downloadSize"

	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
L_.str.1:                               ## @.str.1
	.asciz	"CL_ParseDownload: Expected block %d, got %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Server sending download, but no download was requested\n"

L_.str.3:                               ## @.str.3
	.asciz	"stopdl"

L_.str.4:                               ## @.str.4
	.asciz	"Could not create %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"nextdl %d"

L_.str.6:                               ## @.str.6
	.asciz	"cl_downloadCount"

L_.str.7:                               ## @.str.7
	.asciz	"cl_downloadName"

L_.str.8:                               ## @.str.8
	.space	1

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CL_ParseDownload               ; -- Begin function CL_ParseDownload
	.p2align	2
_CL_ParseDownload:                      ; @CL_ParseDownload
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAX_MSGLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_MSGLEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	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, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	bl	_MSG_ReadShort
	mov	x22, x0
Lloh8:
	adrp	x23, _clc@GOTPAGE
Lloh9:
	ldr	x23, [x23, _clc@GOTPAGEOFF]
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_MSG_ReadLong
	mov	x1, x0
	str	x0, [x23]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Cvar_SetValue
	ldr	x8, [x23]
	tbnz	x8, #63, LBB0_17
LBB0_2:
	mov	x0, x21
	bl	_MSG_ReadShort
	mov	x20, x0
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_MSG_ReadData
LBB0_4:
	ldr	w1, [x23, #8]
	cmp	w1, w22
	b.ne	LBB0_12
; %bb.5:
	ldr	x2, [x23, #40]
	cbz	x2, LBB0_13
LBB0_6:
	cbz	w20, LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_FS_Write
LBB0_8:
	ldr	w1, [x23, #8]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_va
	bl	_CL_AddReliableCommand
	ldr	w8, [x23, #8]
	add	w8, w8, #1
	str	w8, [x23, #8]
	ldr	x8, [x23, #16]
	add	x1, x8, w20, sxtw
	str	x1, [x23, #16]
Lloh14:
	adrp	x0, l_.str.6@PAGE
Lloh15:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_Cvar_SetValue
	cbnz	w20, LBB0_20
; %bb.9:
	ldr	x0, [x23, #40]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_FS_FCloseFile
	str	xzr, [x23, #40]
	ldp	x1, x0, [x23, #24]
	bl	_FS_SV_Rename
LBB0_11:
	ldp	x8, x9, [x23, #24]
	str	xzr, [x8]
	str	xzr, [x9]
Lloh16:
	adrp	x0, l_.str.7@PAGE
Lloh17:
	add	x0, x0, l_.str.7@PAGEOFF
Lloh18:
	adrp	x1, l_.str.8@PAGE
Lloh19:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_Cvar_Set
	bl	_CL_WritePacket
	bl	_CL_WritePacket
	b	LBB0_16
LBB0_12:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_Com_DPrintf
	b	LBB0_20
LBB0_13:
	ldr	x0, [x23, #32]
	ldr	x8, [x0]
	cbz	x8, LBB0_19
; %bb.14:
	bl	_FS_SV_FOpenFileWrite
	mov	x2, x0
	str	x0, [x23, #40]
	cbnz	x0, LBB0_6
; %bb.15:
	ldr	x8, [x23, #32]
	str	x8, [sp, #-16]!
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Com_Printf
	add	sp, sp, #16
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_CL_AddReliableCommand
LBB0_16:
	bl	_CL_NextDownload
	b	LBB0_20
LBB0_17:
Lloh26:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh28:
	ldr	w19, [x8]
	mov	x0, x21
	bl	_MSG_ReadString
	ldur	x8, [x29, #-56]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.18:
	mov	x1, x0
	mov	x0, x19
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_Com_Error
LBB0_19:
Lloh32:
	adrp	x0, l_.str.2@PAGE
Lloh33:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Com_Printf
Lloh34:
	adrp	x0, l_.str.3@PAGE
Lloh35:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_CL_AddReliableCommand
LBB0_20:
	ldur	x8, [x29, #-56]
Lloh36:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh37:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MSGLEN,4,2                 ; @MAX_MSGLEN
	.comm	_clc,48,3                       ; @clc
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cl_downloadSize"

	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
l_.str.1:                               ; @.str.1
	.asciz	"CL_ParseDownload: Expected block %d, got %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Server sending download, but no download was requested\n"

l_.str.3:                               ; @.str.3
	.asciz	"stopdl"

l_.str.4:                               ; @.str.4
	.asciz	"Could not create %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"nextdl %d"

l_.str.6:                               ; @.str.6
	.asciz	"cl_downloadCount"

l_.str.7:                               ; @.str.7
	.asciz	"cl_downloadName"

l_.str.8:                               ; @.str.8
	.space	1

.subsections_via_symbols
