// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: Menu_Draw
void Menu_Draw (edict_t *ent)
{
	char line[MAX_INFO_STRING], string[2000];
	int i;
	menuitem *menu;
	int size, ystart;

	int selected;

	// Keep from updating the menu more than once per frame
	// Paril: unless we're paused, in which case...
	if (ent->client->menumovetime == level.framenum && !GamePaused())
		return;

	ent->client->menumovetime = level.framenum;

	gi.WriteByte (svc_layout);
	strcpy(string, "xv 32 yv 8 picn inventory ");

	if (ent->client->menu == MENU_LOCAL) // Special case
	{
		menu = ent->client->localmenu;
		size = 18;
		ystart = 32; // Start one line up from static menu
	}
	else // Static menu
	{
		menu = menulist[ent->client->menu].menu;
		size = menulist[ent->client->menu].size;
		if (size < 18)
			ystart = 40; // Start one line down from local menu
		else
			ystart = 32;
	}

	// Validate our highlighed selection
	while (!menu[ent->client->menuselect].func)
		ent->client->menuselect = (ent->client->menuselect + 1) % size;
	selected = ent->client->menuselect;

	for (i=0 ; i<size ; i++)
	{
		if (!menu[i].text)
			continue;
		if (i == selected)
		{
			Com_sprintf(line, sizeof(line),
				"xv %i yv %i string \"\x0d%s\" ",
				55, ystart + (i * 8), menu[i].text );
		}
		else
		{
			Com_sprintf(line, sizeof(line),
				"xv %i yv %i string2 \" %s\" ",
				55, ystart + (i * 8), menu[i].text );
		}
		strcat(string, line);
	}

	gi.WriteString (string);
	// Paril
	gi.unicast (ent, true);
	// Paril
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9e8, %rsp            # imm = 0x9E8
movq %rdi, %r14
movq 0x58(%rdi), %rax
movl 0x10c8(%rax), %eax
movq 0x4f06f(%rip), %rbx     # 0x69da0
cmpl (%rbx), %eax
jne 0x1ad44
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x1ae82
movl (%rbx), %eax
movq 0x58(%r14), %rcx
movl %eax, 0x10c8(%rcx)
movq 0x4e8a9(%rip), %rax     # 0x69600
movl $0x4, %edi
callq *0xc8(%rax)
movups 0x390e5(%rip), %xmm0    # 0x53e4e
movups %xmm0, 0x1b(%rsp)
movups 0x390ce(%rip), %xmm0    # 0x53e43
movaps %xmm0, 0x10(%rsp)
movq 0x58(%r14), %rcx
movslq 0xf84(%rcx), %rax
testq %rax, %rax
je 0x1adaf
shlq $0x4, %rax
movq 0x4ed33(%rip), %rdx     # 0x69ac8
movq (%rdx,%rax), %r13
movl 0x8(%rdx,%rax), %esi
xorl %eax, %eax
cmpl $0x12, %esi
setl %al
leaq 0x20(,%rax,8), %rbp
jmp 0x1adc0
leaq 0xf90(%rcx), %r13
movl $0x20, %ebp
movl $0x12, %esi
movslq 0xf88(%rcx), %rdx
movq %rdx, %rax
shlq $0x4, %rax
cmpq $0x0, 0x8(%r13,%rax)
movq %r14, 0x8(%rsp)
jne 0x1adf7
incl %edx
movl %edx, %eax
cltd
idivl %esi
movslq %edx, %rax
shlq $0x4, %rax
cmpq $0x0, 0x8(%r13,%rax)
je 0x1addb
movl %edx, 0xf88(%rcx)
testl %esi, %esi
jle 0x1ae60
movl %edx, %r12d
movl %esi, %ebx
shlq $0x3, %r12
shlq $0x3, %rbx
leaq 0x7e0(%rsp), %r14
xorl %r15d, %r15d
movq (%r13,%r15,2), %r9
testq %r9, %r9
je 0x1ae57
leal (%r15,%rbp), %r8d
cmpq %r15, %r12
leaq 0x3904d(%rip), %rdx     # 0x53e78
leaq 0x3902c(%rip), %rax     # 0x53e5e
cmoveq %rax, %rdx
movq %r14, %rdi
movl $0x200, %esi            # imm = 0x200
movl $0x37, %ecx
xorl %eax, %eax
callq 0x18e10
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x19640
addq $0x8, %r15
cmpq %r15, %rbx
jne 0x1ae13
leaq 0x10(%rsp), %rdi
movq 0x4e794(%rip), %rbx     # 0x69600
callq *0xe8(%rbx)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq *0xb8(%rbx)
addq $0x9e8, %rsp            # imm = 0x9E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq