// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
callq 0x18de0
movq 0x58(%rbx), %rcx
testl %eax, %eax
je 0x19d40
movl 0x10c0(%rcx), %r15d
leal (%r15,%r15,4), %eax
leal (%rax,%rax,2), %r13d
movq %rbx, %rdi
callq 0x18710
movq %rax, %r14
testl %r15d, %r15d
jle 0x19c9f
leal -0xf(%r13), %eax
cltq
cmpq $0x0, (%r14,%rax,8)
jne 0x19c94
movq 0x58(%rbx), %rcx
movl $0x0, 0x10c0(%rcx)
xorl %r13d, %r13d
incq %rax
movslq %r13d, %rcx
cmpq %rcx, %rax
jl 0x19c7c
movq 0x58(%rbx), %rax
xorl %r15d, %r15d
movq 0x4e953(%rip), %r12     # 0x68600
movq 0xf90(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x19cd2
callq *0x110(%r12)
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xf90(%rax,%r15)
addq $0x10, %r15
cmpq $0x120, %r15            # imm = 0x120
jne 0x19cad
movq 0x58(%rbx), %rax
movq $0x0, 0xf84(%rax)
cmpl $0x1, 0x1100(%rax)
movq 0xf90(%rax), %rdi
jne 0x19d56
testq %rdi, %rdi
je 0x19d0b
callq *0x110(%r12)
leaq 0x38633(%rip), %rdi     # 0x52345
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4ea77(%rip), %rax     # 0x687a0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
leaq 0x384a7(%rip), %r15     # 0x521e5
jmp 0x19d96
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0xf84(%rcx)
jmp 0x19e3f
testq %rdi, %rdi
je 0x19d63
callq *0x110(%r12)
leaq 0x385eb(%rip), %rdi     # 0x52355
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4ea1f(%rip), %rax     # 0x687a0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
leaq 0x3844e(%rip), %r15     # 0x521e4
testq %rdi, %rdi
je 0x19da3
callq *0x110(%r12)
movq %r15, %rdi
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xfa0(%rcx)
movq $0x0, 0xfa8(%rcx)
movslq %r13d, %rax
movq (%r14,%rax,8), %rdx
testq %rdx, %rdx
je 0x19e06
leaq (%r14,%rax,8), %r13
movl $0x1, %r15d
movq 0x4ec32(%rip), %r14     # 0x68a10
movq %r15, %rbp
incq %r15
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rcx
callq 0x18370
movq (%r13,%rbp,8), %rdx
testq %rdx, %rdx
je 0x19e02
cmpl $0x10, %r15d
jb 0x19dde
movq 0x58(%rbx), %rcx
movq 0x10a0(%rcx), %rdi
testq %rdi, %rdi
je 0x19e1a
callq *0x110(%r12)
leaq 0x38545(%rip), %rdi     # 0x52366
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0x10a0(%rcx)
movq 0x4eba0(%rip), %rax     # 0x689d8
movq %rax, 0x10a8(%rcx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x196b0