// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: Skin_Menu
void Skin_Menu (edict_t *ent)
{
	int i, j, start;
	char **skinlist;

	if (!SkinListInUse())
	{
		Skin_Old_Menu(ent);
		return;
	}

	// Calculate our page
	start = 15*ent->client->menupage;


	skinlist = SkinGetList(ent);

	// Find if last page was the last
	if (start > 14)
	{
		for (i=start-15;i < start; i++)
		{
			if (!skinlist[i]) // Last entry
			{
				start = 0;			// Go to first page
				ent->client->menupage = 0;
			}
		}
	}

	Menu_Free(ent);
	ent->client->menu = MENU_LOCAL;
	ent->client->menuselect = 0;

	if (ent->client->ctf.teamnum == CTF_TEAM_RED)
	{
		Menu_Set(ent, 0, "LMCTF Red Skins", Main_Menu);
		Menu_Set(ent, 1, "---------------", NULL);
	}
	else
	{
		Menu_Set(ent, 0, "LMCTF Blue Skins", Main_Menu);
		Menu_Set(ent, 1, "----------------", NULL);
	}

	for (i=start, j=2; skinlist[i] && j < 17; i++,j++)
	{
		Menu_Set(ent, j, skinlist[i], SetSkin);
	}

	Menu_Set(ent, 17, "<next page>", Skin_Menu);

	Menu_Draw (ent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, %al
callq 0x18f60
cmpl $0x0, %eax
jne 0x19f16
movq -0x8(%rbp), %rdi
callq 0x18a70
jmp 0x1a0b3
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
imull $0xf, 0x10c0(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18780
movq %rax, -0x20(%rbp)
cmpl $0xe, -0x14(%rbp)
jle 0x19f83
movl -0x14(%rbp), %eax
subl $0xf, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x19f81
movq -0x20(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x19f74
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0x10c0(%rax)
jmp 0x19f76
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x19f44
jmp 0x19f83
movq -0x8(%rbp), %rdi
callq 0x18a00
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0xf84(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0xf88(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x1, 0x1100(%rax)
jne 0x19ff5
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x55367(%rip), %rdx     # 0x6f335
movq 0x687cb(%rip), %rcx     # 0x827a0
callq 0x183b0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x551eb(%rip), %rdx     # 0x6f1d5
xorl %eax, %eax
movl %eax, %ecx
callq 0x183b0
jmp 0x1a027
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x55343(%rip), %rdx     # 0x6f345
movq 0x68797(%rip), %rcx     # 0x827a0
callq 0x183b0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x551b6(%rip), %rdx     # 0x6f1d4
xorl %eax, %eax
movl %eax, %ecx
callq 0x183b0
movl -0x14(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x2, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movslq -0xc(%rbp), %rdx
xorl %eax, %eax
cmpq $0x0, (%rcx,%rdx,8)
movb %al, -0x21(%rbp)
je 0x1a052
cmpl $0x11, -0x10(%rbp)
setl %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x1a05b
jmp 0x1a08e
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x6899b(%rip), %rcx     # 0x82a10
callq 0x183b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1a034
movq -0x8(%rbp), %rdi
movl $0x11, %esi
leaq 0x552b8(%rip), %rdx     # 0x6f356
movq 0x68933(%rip), %rcx     # 0x829d8
callq 0x183b0
movq -0x8(%rbp), %rdi
callq 0x19900
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)