// File: /workspace/github_c_makefile_star2_O1/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 0x19d50
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 0x19caf
leal -0xf(%r13), %eax
cltq
cmpq $0x0, (%r14,%rax,8)
jne 0x19ca4
movq 0x58(%rbx), %rcx
movl $0x0, 0x10c0(%rcx)
xorl %r13d, %r13d
incq %rax
movslq %r13d, %rcx
cmpq %rcx, %rax
jl 0x19c8c
xorl %r15d, %r15d
movq 0x4f947(%rip), %r12     # 0x69600
movq 0x58(%rbx), %rax
movq 0xf90(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x19ce2
callq *0x110(%r12)
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xf90(%rax,%r15)
addq $0x10, %r15
cmpq $0x120, %r15            # imm = 0x120
jne 0x19cb9
movq 0x58(%rbx), %rax
movq $0x0, 0xf84(%rax)
cmpl $0x1, 0x1100(%rax)
movq 0xf90(%rax), %rdi
jne 0x19d66
testq %rdi, %rdi
je 0x19d1b
callq *0x110(%r12)
leaq 0x39623(%rip), %rdi     # 0x53345
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4fa67(%rip), %rax     # 0x697a0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
leaq 0x39497(%rip), %r15     # 0x531e5
jmp 0x19da6
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0xf84(%rcx)
jmp 0x19e4f
testq %rdi, %rdi
je 0x19d73
callq *0x110(%r12)
leaq 0x395db(%rip), %rdi     # 0x53355
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4fa0f(%rip), %rax     # 0x697a0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
leaq 0x3943e(%rip), %r15     # 0x531e4
testq %rdi, %rdi
je 0x19db3
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 0x19e12
leaq (%r14,%rax,8), %r13
movl $0x1, %r15d
movq 0x4fc22(%rip), %r14     # 0x69a10
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 0x19e12
cmpl $0x10, %r15d
jb 0x19dee
movq 0x58(%rbx), %rax
movq 0x10a0(%rax), %rdi
testq %rdi, %rdi
je 0x19e2a
callq *0x110(%r12)
leaq 0x39535(%rip), %rdi     # 0x53366
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0x10a0(%rcx)
movq 0x4fb90(%rip), %rax     # 0x699d8
movq %rax, 0x10a8(%rcx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x196c0