	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function UI_LoadDemos
_UI_LoadDemos:                          ## @UI_LoadDemos
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_NAMEBUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	leaq	L_.str(%rip), %rdi
	callq	_trap_Cvar_VariableValue
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_trap_Cvar_VariableValue
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	callq	_trap_Cvar_VariableValue
LBB0_2:
	xorl	%r13d, %r13d
	cmpl	%eax, %ebx
	cmovel	%r13d, %ebx
	movq	_DEMOEXT@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	L_.str.3(%rip), %rdx
	leaq	-80(%rbp), %r14
	movq	%r14, %rdi
	movl	$32, %esi
	movl	%eax, %r8d
	callq	_Com_sprintf
	movq	%r15, %rdi
	callq	_ARRAY_LEN
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_trap_FS_GetFileList
	movq	_uiInfo@GOTPCREL(%rip), %r14
	movq	_MAX_DEMOS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	%ecx, (%r14)
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.3:
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_strlen
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_String_Alloc
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%r13,4)
	movslq	%r12d, %rax
	addq	%rax, %rbx
	incq	%rbx
	incq	%r13
	movslq	(%r14), %rcx
	cmpq	%rcx, %r13
	jl	LBB0_4
## %bb.5:
	movl	-84(%rbp), %ebx                 ## 4-byte Reload
	movq	_DEMOEXT@GOTPCREL(%rip), %r12
	movq	_MAX_DEMOS@GOTPCREL(%rip), %rdx
LBB0_6:
	testl	%ebx, %ebx
	jle	LBB0_11
## %bb.7:
	cmpl	(%rdx), %ecx
	jge	LBB0_11
## %bb.8:
	movl	(%r12), %ecx
	movq	%rdx, %r12
	leaq	L_.str.3(%rip), %rdx
	leaq	-80(%rbp), %rdi
	movl	$32, %esi
	movl	%ebx, %r8d
	callq	_Com_sprintf
	movq	%r15, %rdi
	callq	_ARRAY_LEN
	leaq	L_.str.4(%rip), %rdi
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_trap_FS_GetFileList
	addl	(%r14), %eax
	movl	(%r12), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, (%r14)
	cmpl	%eax, %r13d
	jge	LBB0_11
## %bb.9:
	movslq	%r13d, %rbx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_strlen
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_String_Alloc
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movslq	%r12d, %rax
	addq	%rax, %r15
	incq	%r15
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_10
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NAMEBUFSIZE,4,2                ## @NAMEBUFSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"com_legacyprotocol"

L_.str.1:                               ## @.str.1
	.asciz	"com_protocol"

L_.str.2:                               ## @.str.2
	.asciz	"protocol"

L_.str.3:                               ## @.str.3
	.asciz	".%s%d"

	.comm	_DEMOEXT,4,2                    ## @DEMOEXT
L_.str.4:                               ## @.str.4
	.asciz	"demos"

	.comm	_uiInfo,16,3                    ## @uiInfo
	.comm	_MAX_DEMOS,4,2                  ## @MAX_DEMOS
	.no_dead_strip	_UI_LoadDemos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function UI_LoadDemos
_UI_LoadDemos:                          ; @UI_LoadDemos
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #48
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _NAMEBUFSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAMEBUFSIZE@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
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_trap_Cvar_VariableValue
	mov	x20, x0
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_trap_Cvar_VariableValue
	mov	x4, x0
	cbnz	w0, LBB0_2
; %bb.1:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_trap_Cvar_VariableValue
	mov	x4, x0
LBB0_2:
	cmp	w20, w4
	csel	w20, wzr, w20, eq
Lloh14:
	adrp	x24, _DEMOEXT@GOTPAGE
Lloh15:
	ldr	x24, [x24, _DEMOEXT@GOTPAGEOFF]
	ldr	w3, [x24]
Lloh16:
	adrp	x2, l_.str.3@PAGE
Lloh17:
	add	x2, x2, l_.str.3@PAGEOFF
	sub	x0, x29, #104
	mov	w1, #32
	bl	_Com_sprintf
	mov	x0, x19
	bl	_ARRAY_LEN
	mov	x3, x0
Lloh18:
	adrp	x0, l_.str.4@PAGE
Lloh19:
	add	x0, x0, l_.str.4@PAGEOFF
	sub	x1, x29, #104
	mov	x2, x19
	bl	_trap_FS_GetFileList
Lloh20:
	adrp	x23, _uiInfo@GOTPAGE
Lloh21:
	ldr	x23, [x23, _uiInfo@GOTPAGEOFF]
Lloh22:
	adrp	x25, _MAX_DEMOS@GOTPAGE
Lloh23:
	ldr	x25, [x25, _MAX_DEMOS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w0, w8
	csel	w8, w0, w8, lt
	str	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x26, #0
	mov	x21, x19
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_strlen
	mov	x22, x0
	mov	x0, x21
	bl	_String_Alloc
	ldr	x8, [x23, #8]
	str	w0, [x8, x26, lsl #2]
	add	w8, w22, #1
	add	x21, x21, w8, sxtw
	add	x26, x26, #1
	ldrsw	x8, [x23]
	cmp	x26, x8
	b.lt	LBB0_4
; %bb.5:
	cmp	w20, #1
	b.ge	LBB0_7
	b	LBB0_11
LBB0_6:
	mov	w26, #0
	cmp	w20, #1
	b.lt	LBB0_11
LBB0_7:
	ldr	w9, [x25]
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.8:
	ldr	w3, [x24]
Lloh24:
	adrp	x2, l_.str.3@PAGE
Lloh25:
	add	x2, x2, l_.str.3@PAGEOFF
	sub	x0, x29, #104
	mov	w1, #32
	mov	x4, x20
	bl	_Com_sprintf
	mov	x0, x19
	bl	_ARRAY_LEN
	mov	x3, x0
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	sub	x1, x29, #104
	mov	x2, x19
	bl	_trap_FS_GetFileList
	ldr	w8, [x23]
	ldr	w9, [x25]
	add	w8, w8, w0
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x23]
	cmp	w26, w8
	b.ge	LBB0_11
; %bb.9:
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	sxtw	x21, w26
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_strlen
	mov	x20, x0
	mov	x0, x19
	bl	_String_Alloc
	ldr	x8, [x23, #8]
	str	w0, [x8, x21, lsl #2]
	add	w8, w20, #1
	add	x19, x19, w8, sxtw
	add	x21, x21, #1
	ldrsw	x8, [x23]
	cmp	x21, x8
	b.lt	LBB0_10
LBB0_11:
	ldur	x8, [x29, #-72]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_NAMEBUFSIZE,4,2                ; @NAMEBUFSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"com_legacyprotocol"

l_.str.1:                               ; @.str.1
	.asciz	"com_protocol"

l_.str.2:                               ; @.str.2
	.asciz	"protocol"

l_.str.3:                               ; @.str.3
	.asciz	".%s%d"

	.comm	_DEMOEXT,4,2                    ; @DEMOEXT
l_.str.4:                               ; @.str.4
	.asciz	"demos"

	.comm	_uiInfo,16,3                    ; @uiInfo
	.comm	_MAX_DEMOS,4,2                  ; @MAX_DEMOS
	.no_dead_strip	_UI_LoadDemos
.subsections_via_symbols
