	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function UI_SPLevelMenu_SetMenuArena
_UI_SPLevelMenu_SetMenuArena:           ## @UI_SPLevelMenu_SetMenuArena
	.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	%rdx, %r12
	movl	%esi, %r14d
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_QPATH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_Info_ValueForKey
	movq	%r13, %rdi
	movq	%rax, %rsi
	movl	%ebx, %edx
	callq	_Q_strncpyz
	movq	_levelMenuInfo@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movslq	%r15d, %rbx
	movq	(%rax,%rbx,8), %rdi
	movq	%r13, %rsi
	movl	$8, %edx
	callq	_Q_strncpyz
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_Q_strupr
	leaq	(,%rbx,4), %rdx
	movq	8(%r12), %rsi
	addq	%rdx, %rsi
	addq	32(%r12), %rdx
	movl	%r14d, %edi
	callq	_UI_GetBestScore
	movq	8(%r12), %rax
	cmpl	$9, (%rax,%rbx,4)
	jl	LBB0_2
## %bb.1:
	movl	$8, (%rax,%rbx,4)
LBB0_2:
	movq	24(%r12), %rax
	movl	(%rax,%rbx,4), %r14d
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	callq	_va
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_strcpy
	movq	24(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_trap_R_RegisterShaderNoMip
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	24(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movq	_ART_MAP_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcpy
LBB0_4:
	movq	16(%r12), %rax
	shlq	$4, %rbx
	movq	$0, 8(%rax,%rbx)
	movq	_selectedArenaSet@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_currentSet@GOTPCREL(%rip), %rsi
	movq	_QMF_GRAYED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpq	(%rsi), %rdx
	jle	LBB0_6
## %bb.5:
	orl	(%rax,%rbx), %ecx
	jmp	LBB0_7
LBB0_6:
	notl	%ecx
	andl	(%rax,%rbx), %ecx
LBB0_7:
	movl	%ecx, (%rax,%rbx)
	movq	_QMF_INACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%ecx, %edx
	movl	%edx, (%rax,%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_QPATH,4,2                  ## @MAX_QPATH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"map"

	.comm	_levelMenuInfo,40,3             ## @levelMenuInfo
L_.str.1:                               ## @.str.1
	.asciz	"levelshots/%s.tga"

	.comm	_ART_MAP_UNKNOWN,4,2            ## @ART_MAP_UNKNOWN
	.comm	_selectedArenaSet,8,3           ## @selectedArenaSet
	.comm	_currentSet,8,3                 ## @currentSet
	.comm	_QMF_GRAYED,4,2                 ## @QMF_GRAYED
	.comm	_QMF_INACTIVE,4,2               ## @QMF_INACTIVE
	.no_dead_strip	_UI_SPLevelMenu_SetMenuArena
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function UI_SPLevelMenu_SetMenuArena
_UI_SPLevelMenu_SetMenuArena:           ; @UI_SPLevelMenu_SetMenuArena
	.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, #16
	mov	x20, x1
	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, #-72]
Lloh3:
	adrp	x8, _MAX_QPATH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_QPATH@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	mov	x9, x22
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x22, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x2
	bl	_Info_ValueForKey
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_Q_strncpyz
Lloh10:
	adrp	x23, _levelMenuInfo@GOTPAGE
Lloh11:
	ldr	x23, [x23, _levelMenuInfo@GOTPAGEOFF]
	ldr	x8, [x23]
	sxtw	x22, w21
	sbfiz	x25, x21, #3, #32
	ldr	x0, [x8, x25]
	mov	w24, #8
	mov	x1, x19
	mov	w2, #8
	bl	_Q_strncpyz
	ldr	x8, [x23]
	ldr	x0, [x8, x25]
	bl	_Q_strupr
	ldr	x8, [x23, #8]
	sbfiz	x21, x21, #2, #32
	add	x1, x8, x21
	ldr	x8, [x23, #32]
	add	x2, x8, x21
	mov	x0, x20
	bl	_UI_GetBestScore
	ldr	x8, [x23, #8]
	ldr	w9, [x8, x21]
	cmp	w9, #9
	b.lt	LBB0_2
; %bb.1:
	str	w24, [x8, x22, lsl #2]
LBB0_2:
	ldr	x8, [x23, #24]
	lsl	x21, x22, #2
	ldr	w20, [x8, x21]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_va
	mov	x1, x0
	mov	x0, x20
	bl	_strcpy
	ldr	x8, [x23, #24]
	ldr	w0, [x8, x21]
	bl	_trap_R_RegisterShaderNoMip
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x23, #24]
	ldr	w0, [x8, x22, lsl #2]
Lloh14:
	adrp	x8, _ART_MAP_UNKNOWN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ART_MAP_UNKNOWN@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_strcpy
LBB0_4:
	ldr	x8, [x23, #16]
	add	x9, x8, x22, lsl #4
	str	xzr, [x9, #8]
Lloh17:
	adrp	x9, _selectedArenaSet@GOTPAGE
Lloh18:
	ldr	x9, [x9, _selectedArenaSet@GOTPAGEOFF]
Lloh19:
	ldr	x11, [x9]
Lloh20:
	adrp	x9, _currentSet@GOTPAGE
Lloh21:
	ldr	x9, [x9, _currentSet@GOTPAGEOFF]
Lloh22:
	ldr	x12, [x9]
Lloh23:
	adrp	x9, _QMF_GRAYED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _QMF_GRAYED@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x9]
	lsl	x9, x22, #4
	cmp	x11, x12
	b.le	LBB0_6
; %bb.5:
	ldr	w11, [x8, x9]
	orr	w10, w11, w10
	b	LBB0_7
LBB0_6:
	ldr	w11, [x8, x9]
	bic	w10, w11, w10
LBB0_7:
	str	w10, [x8, x9]
Lloh26:
	adrp	x11, _QMF_INACTIVE@GOTPAGE
Lloh27:
	ldr	x11, [x11, _QMF_INACTIVE@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x11]
	bic	w10, w10, w11
	str	w10, [x8, x9]
	ldur	x8, [x29, #-72]
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_9
; %bb.8:
	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_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_QPATH,4,2                  ; @MAX_QPATH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"map"

	.comm	_levelMenuInfo,40,3             ; @levelMenuInfo
l_.str.1:                               ; @.str.1
	.asciz	"levelshots/%s.tga"

	.comm	_ART_MAP_UNKNOWN,4,2            ; @ART_MAP_UNKNOWN
	.comm	_selectedArenaSet,8,3           ; @selectedArenaSet
	.comm	_currentSet,8,3                 ; @currentSet
	.comm	_QMF_GRAYED,4,2                 ; @QMF_GRAYED
	.comm	_QMF_INACTIVE,4,2               ; @QMF_INACTIVE
	.no_dead_strip	_UI_SPLevelMenu_SetMenuArena
.subsections_via_symbols
