	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_UI_SPLevelMenu                 ## -- Begin function UI_SPLevelMenu
	.p2align	4, 0x90
_UI_SPLevelMenu:                        ## @UI_SPLevelMenu
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_trainingTier@GOTPCREL(%rip), %rbx
	movl	$-1, (%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_UI_GetSpecialArenaInfo
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %ecx
	movq	_minTier@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_Info_ValueForKey
	movl	%eax, %edi
	callq	_atoi
	movl	%eax, %r14d
	jmp	LBB0_3
LBB0_2:
	movq	_minTier@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$-2, %r14d
LBB0_3:
	xorl	%eax, %eax
	callq	_UI_GetNumSPTiers
	movq	_finalTier@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	leaq	L_.str.2(%rip), %rdi
	callq	_UI_GetSpecialArenaInfo
	movl	(%r15), %ecx
	leal	-1(%rcx), %edx
	movq	_minTier@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	cmpl	%esi, %ecx
	cmovlel	%esi, %edx
	testq	%rax, %rax
	cmovnel	%ecx, %edx
	movq	_maxTier@GOTPCREL(%rip), %rbx
	movl	%edx, (%rbx)
	xorl	%eax, %eax
	callq	_UI_GetCurrentGame
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	cmpl	%r14d, %eax
	jne	LBB0_7
LBB0_6:
	movq	_currentSet@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	xorl	%edx, %edx
	jmp	LBB0_8
LBB0_4:
	xorl	%eax, %eax
	callq	_UI_GetNumSPArenas
	movl	(%rbx), %ecx
	xorl	%edx, %edx
	cmpl	(%r15), %ecx
	setne	%dl
	subl	%edx, %eax
	cmpl	%r14d, %eax
	je	LBB0_6
LBB0_7:
	movq	_ARENAS_PER_TIER@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	_currentSet@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_8:
	movq	_currentGame@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	xorl	%eax, %eax
	callq	_UI_SPLevelMenu_Init
	movq	_levelMenuInfo@GOTPCREL(%rip), %r14
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_UI_PushMenu
	movq	%rbx, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Menu_SetCursorToItem           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_trainingTier,4,2               ## @trainingTier
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"training"

	.comm	_minTier,4,2                    ## @minTier
L_.str.1:                               ## @.str.1
	.asciz	"num"

	.comm	_finalTier,4,2                  ## @finalTier
L_.str.2:                               ## @.str.2
	.asciz	"final"

	.comm	_maxTier,4,2                    ## @maxTier
	.comm	_currentSet,4,2                 ## @currentSet
	.comm	_currentGame,4,2                ## @currentGame
	.comm	_ARENAS_PER_TIER,4,2            ## @ARENAS_PER_TIER
	.comm	_levelMenuInfo,8,2              ## @levelMenuInfo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_UI_SPLevelMenu                 ; -- Begin function UI_SPLevelMenu
	.p2align	2
_UI_SPLevelMenu:                        ; @UI_SPLevelMenu
	.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
Lloh0:
	adrp	x19, _trainingTier@GOTPAGE
Lloh1:
	ldr	x19, [x19, _trainingTier@GOTPAGEOFF]
	mov	w8, #-1
	str	w8, [x19]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_UI_GetSpecialArenaInfo
Lloh4:
	adrp	x20, _minTier@GOTPAGE
Lloh5:
	ldr	x20, [x20, _minTier@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	str	w8, [x20]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_Info_ValueForKey
	bl	_atoi
	mov	x19, x0
	b	LBB0_3
LBB0_2:
	str	wzr, [x20]
	mov	w19, #-2
LBB0_3:
	bl	_UI_GetNumSPTiers
Lloh8:
	adrp	x21, _finalTier@GOTPAGE
Lloh9:
	ldr	x21, [x21, _finalTier@GOTPAGEOFF]
	str	w0, [x21]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_UI_GetSpecialArenaInfo
	ldr	w8, [x21]
	sub	w9, w8, #1
	ldr	w10, [x20]
	cmp	w8, w10
	csel	w9, w9, w10, gt
	cmp	x0, #0
	csel	w8, w9, w8, eq
Lloh12:
	adrp	x20, _maxTier@GOTPAGE
Lloh13:
	ldr	x20, [x20, _maxTier@GOTPAGEOFF]
	str	w8, [x20]
	bl	_UI_GetCurrentGame
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.4:
	cmp	w0, w19
	b.ne	LBB0_7
LBB0_5:
	mov	w8, #0
Lloh14:
	adrp	x9, _currentSet@GOTPAGE
Lloh15:
	ldr	x9, [x9, _currentSet@GOTPAGEOFF]
	mov	w10, #-1
Lloh16:
	str	w10, [x9]
	b	LBB0_8
LBB0_6:
	bl	_UI_GetNumSPArenas
	ldr	w8, [x20]
	ldr	w9, [x21]
	cmp	w8, w9
	cset	w8, ne
	sub	w0, w0, w8
	cmp	w0, w19
	b.eq	LBB0_5
LBB0_7:
Lloh17:
	adrp	x8, _ARENAS_PER_TIER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ARENAS_PER_TIER@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	sdiv	w9, w0, w8
Lloh20:
	adrp	x10, _currentSet@GOTPAGE
Lloh21:
	ldr	x10, [x10, _currentSet@GOTPAGEOFF]
Lloh22:
	str	w9, [x10]
	msub	w8, w9, w8, w0
LBB0_8:
Lloh23:
	adrp	x9, _currentGame@GOTPAGE
Lloh24:
	ldr	x9, [x9, _currentGame@GOTPAGEOFF]
Lloh25:
	str	w8, [x9]
	bl	_UI_SPLevelMenu_Init
Lloh26:
	adrp	x19, _levelMenuInfo@GOTPAGE
Lloh27:
	ldr	x19, [x19, _levelMenuInfo@GOTPAGEOFF]
	add	x20, x19, #4
	mov	x0, x20
	bl	_UI_PushMenu
	mov	x0, x20
	mov	x1, x19
	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
	b	_Menu_SetCursorToItem
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_trainingTier,4,2               ; @trainingTier
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"training"

	.comm	_minTier,4,2                    ; @minTier
l_.str.1:                               ; @.str.1
	.asciz	"num"

	.comm	_finalTier,4,2                  ; @finalTier
l_.str.2:                               ; @.str.2
	.asciz	"final"

	.comm	_maxTier,4,2                    ; @maxTier
	.comm	_currentSet,4,2                 ; @currentSet
	.comm	_currentGame,4,2                ; @currentGame
	.comm	_ARENAS_PER_TIER,4,2            ; @ARENAS_PER_TIER
	.comm	_levelMenuInfo,8,2              ; @levelMenuInfo
.subsections_via_symbols
