	.file	"extr_ui_splevel.c_UI_SPLevelMenu.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"training"
.LC1:
	.string	"num"
.LC2:
	.string	"final"
	.text
	.p2align 4
	.globl	UI_SPLevelMenu
	.type	UI_SPLevelMenu, @function
UI_SPLevelMenu:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	lea	rdi, .LC0[rip]
	mov	DWORD PTR trainingTier[rip], -1
	call	UI_GetSpecialArenaInfo@PLT
	test	rax, rax
	je	.L2
	mov	rdi, rax
	mov	eax, DWORD PTR trainingTier[rip]
	lea	rsi, .LC1[rip]
	mov	DWORD PTR minTier[rip], eax
	call	Info_ValueForKey@PLT
	mov	edi, eax
	call	atoi@PLT
	mov	ebx, eax
.L3:
	xor	eax, eax
	call	UI_GetNumSPTiers@PLT
	lea	rdi, .LC2[rip]
	mov	DWORD PTR finalTier[rip], eax
	call	UI_GetSpecialArenaInfo@PLT
	test	rax, rax
	mov	eax, DWORD PTR finalTier[rip]
	je	.L4
.L10:
	mov	DWORD PTR maxTier[rip], eax
	xor	eax, eax
	call	UI_GetCurrentGame@PLT
	cmp	eax, -1
	je	.L12
.L6:
	cmp	eax, ebx
	je	.L13
	cdq
	idiv	DWORD PTR ARENAS_PER_TIER[rip]
	mov	DWORD PTR currentSet[rip], eax
	mov	DWORD PTR currentGame[rip], edx
.L8:
	xor	eax, eax
	call	UI_SPLevelMenu_Init@PLT
	lea	rdi, levelMenuInfo[rip+4]
	call	UI_PushMenu@PLT
	lea	rsi, levelMenuInfo[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	lea	rdi, 4[rsi]
	jmp	Menu_SetCursorToItem@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	DWORD PTR minTier[rip], 0
	mov	ebx, -2
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	mov	DWORD PTR currentSet[rip], -1
	mov	DWORD PTR currentGame[rip], 0
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edx, DWORD PTR minTier[rip]
	sub	eax, 1
	cmp	eax, edx
	cmovl	eax, edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	xor	eax, eax
	call	UI_GetNumSPArenas@PLT
	xor	edx, edx
	mov	ecx, DWORD PTR finalTier[rip]
	cmp	DWORD PTR maxTier[rip], ecx
	setne	dl
	sub	eax, edx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	UI_SPLevelMenu, .-UI_SPLevelMenu
	.comm	trainingTier,4,4
	.comm	minTier,4,4
	.comm	maxTier,4,4
	.comm	levelMenuInfo,8,8
	.comm	finalTier,4,4
	.comm	currentSet,4,4
	.comm	currentGame,4,4
	.comm	ARENAS_PER_TIER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ui_splevel.c_UI_SPLevelMenu.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"training\000"
	.align	2
.LC1:
	.ascii	"num\000"
	.align	2
.LC2:
	.ascii	"final\000"
	.global	__aeabi_idivmod
	.text
	.align	2
	.global	UI_SPLevelMenu
	.syntax unified
	.arm
	.fpu softvfp
	.type	UI_SPLevelMenu, %function
UI_SPLevelMenu:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mvn	r3, #0
	push	{r4, r5, r6, lr}
	ldr	r4, .L13
	ldr	r0, .L13+4
	str	r3, [r4]
	bl	UI_GetSpecialArenaInfo
	subs	r3, r0, #0
	beq	.L2
	ldr	r3, [r4]
	ldr	r6, .L13+8
	ldr	r1, .L13+12
	str	r3, [r6]
	bl	Info_ValueForKey
	bl	atoi
	mov	r5, r0
.L3:
	bl	UI_GetNumSPTiers
	mov	r3, r0
	ldr	r4, .L13+16
	ldr	r0, .L13+20
	str	r3, [r4]
	bl	UI_GetSpecialArenaInfo
	cmp	r0, #0
	beq	.L4
	ldr	r3, [r4]
	ldr	r6, .L13+24
	str	r3, [r6]
	bl	UI_GetCurrentGame
	cmn	r0, #1
	beq	.L11
.L6:
	cmp	r0, r5
	beq	.L12
	ldr	r3, .L13+28
	ldr	r1, [r3]
	bl	__aeabi_idivmod
	ldr	r2, .L13+32
	ldr	r3, .L13+36
	str	r0, [r2]
	str	r1, [r3]
.L8:
	bl	UI_SPLevelMenu_Init
	ldr	r0, .L13+40
	bl	UI_PushMenu
	pop	{r4, r5, r6, lr}
	ldr	r1, .L13+44
	add	r0, r1, #4
	b	Menu_SetCursorToItem
.L2:
	ldr	r6, .L13+8
	mvn	r5, #1
	str	r3, [r6]
	b	.L3
.L12:
	mvn	r0, #0
	mov	r2, #0
	ldr	r1, .L13+32
	ldr	r3, .L13+36
	str	r0, [r1]
	str	r2, [r3]
	b	.L8
.L4:
	ldr	r2, [r4]
	ldr	r3, [r6]
	sub	r2, r2, #1
	cmp	r3, r2
	movlt	r3, r2
	ldr	r6, .L13+24
	str	r3, [r6]
	bl	UI_GetCurrentGame
	cmn	r0, #1
	bne	.L6
.L11:
	bl	UI_GetNumSPArenas
	ldr	r2, [r6]
	ldr	r3, [r4]
	cmp	r2, r3
	subne	r0, r0, #1
	b	.L6
.L14:
	.align	2
.L13:
	.word	trainingTier
	.word	.LC0
	.word	minTier
	.word	.LC1
	.word	finalTier
	.word	.LC2
	.word	maxTier
	.word	ARENAS_PER_TIER
	.word	currentSet
	.word	currentGame
	.word	levelMenuInfo+4
	.word	levelMenuInfo
	.size	UI_SPLevelMenu, .-UI_SPLevelMenu
	.comm	trainingTier,4,4
	.comm	minTier,4,4
	.comm	maxTier,4,4
	.comm	levelMenuInfo,8,4
	.comm	finalTier,4,4
	.comm	currentSet,4,4
	.comm	currentGame,4,4
	.comm	ARENAS_PER_TIER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
