// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa00, %rsp            # imm = 0xA00
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x10c8(%rax), %eax
movq 0x67fbc(%rip), %rcx     # 0x82da0
cmpl (%rcx), %eax
jne 0x1adf9
movb $0x0, %al
callq 0x18160
cmpl $0x0, %eax
jne 0x1adf9
jmp 0x1b081
movq 0x67fa0(%rip), %rax     # 0x82da0
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x10c8(%rax)
movl $0x4, %edi
movq 0x677e4(%rip), %rax     # 0x82600
callq *0xc8(%rax)
leaq -0x9e0(%rbp), %rdi
leaq 0x55003(%rip), %rsi     # 0x6fe33
callq 0x182c0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xf84(%rax)
jne 0x1ae71
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xf90, %rax            # imm = 0xF90
movq %rax, -0x9f0(%rbp)
movl $0x12, -0x9f4(%rbp)
movl $0x20, -0x9f8(%rbp)
jmp 0x1aedf
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq 0xf84(%rax), %rcx
movq 0x67c41(%rip), %rax     # 0x82ac8
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x9f0(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq 0xf84(%rax), %rcx
movq 0x67c1a(%rip), %rax     # 0x82ac8
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x9f4(%rbp)
cmpl $0x12, -0x9f4(%rbp)
jge 0x1aed3
movl $0x28, -0x9f8(%rbp)
jmp 0x1aedd
movl $0x20, -0x9f8(%rbp)
jmp 0x1aedf
jmp 0x1aee1
movq -0x9f0(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq 0xf88(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1af0e
jmp 0x1af36
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xf88(%rax), %eax
addl $0x1, %eax
cltd
idivl -0x9f4(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl %edx, 0xf88(%rax)
jmp 0x1aee1
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xf88(%rax), %eax
movl %eax, -0x9fc(%rbp)
movl $0x0, -0x9e4(%rbp)
movl -0x9e4(%rbp), %eax
cmpl -0x9f4(%rbp), %eax
jge 0x1b051
movq -0x9f0(%rbp), %rax
movslq -0x9e4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x1af86
jmp 0x1b03d
movl -0x9e4(%rbp), %eax
cmpl -0x9fc(%rbp), %eax
jne 0x1afe0
leaq -0x210(%rbp), %rdi
movl -0x9f8(%rbp), %r8d
movl -0x9e4(%rbp), %eax
shll $0x3, %eax
addl %eax, %r8d
movq -0x9f0(%rbp), %rax
movslq -0x9e4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %r9
movl $0x200, %esi            # imm = 0x200
leaq 0x54e7c(%rip), %rdx     # 0x6fe4e
movl $0x37, %ecx
movb $0x0, %al
callq 0x18f90
jmp 0x1b02a
leaq -0x210(%rbp), %rdi
movl -0x9f8(%rbp), %r8d
movl -0x9e4(%rbp), %eax
shll $0x3, %eax
addl %eax, %r8d
movq -0x9f0(%rbp), %rax
movslq -0x9e4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %r9
movl $0x200, %esi            # imm = 0x200
leaq 0x54e4a(%rip), %rdx     # 0x6fe68
movl $0x37, %ecx
movb $0x0, %al
callq 0x18f90
leaq -0x9e0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x19880
movl -0x9e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9e4(%rbp)
jmp 0x1af54
movq 0x675a8(%rip), %rax     # 0x82600
movq 0xe8(%rax), %rax
leaq -0x9e0(%rbp), %rdi
callq *%rax
movq 0x67591(%rip), %rax     # 0x82600
movq 0xb8(%rax), %rax
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq *%rax
addq $0xa00, %rsp            # imm = 0xA00
popq %rbp
retq
nopw (%rax,%rax)