// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: ClientShowID
int ClientShowID(edict_t *ent, char * buf)
{
	char	string[5000];
#ifdef OLDOBSERVERCODE
	char	string2[5000];
#endif
	char	*color;
	vec3_t	forward, right, start, mins, maxs, end;
	trace_t	tr;
	float	*v;
	edict_t *popup_ent;

	if (ent->client->showscores || ent->client->showhelp ||
		ent->client->showinventory || ent->client->showmod ||
		ent->client->showmenu
		|| ent->client->showsquadboard) // ADC
		return 0;

	// only update every second for each player
	// hopefuly this will distribute the load on the server
	// for the tracing needed for this function as well as
	// reduce the number of packets
	if (ent->client->last_popup_frame &&
		((level.framenum - ent->client->last_popup_frame + ent->client->ctf.original_enterframe) % 10))
		return 0;

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

	strcpy(string, "");

	// Always show who we are chasing.
#ifdef OLDOBSERVERCODE
	if (ent->client->camera_target)
	{
		ent->client->ctf.popup_ent = ent->client->camera_target;
		ent->client->awayframe = level.framenum;
		sprintf(string2, ":%d", stats_get(ent->client->camera_target, STATS_SCORE));
	}
	else
#endif
	{
		v = tv(-16,-16,-16);
		VectorCopy (v, mins);
		v = tv(16,16,16);
		VectorCopy (v, maxs);
		
		// Set out ending point to our starting point
		AngleVectors (ent->client->v_angle, forward, right, NULL);
		
		VectorScale(forward, 5000, forward);
		VectorCopy(ent->s.origin, start);
		start[2] += ent->viewheight-8;
		
		VectorAdd(start, forward, end);
		/*
		VectorSet(offset, 8, 0, ent->viewheight-8);
		G_ProjectSource (ent->s.origin, offset, forward, right, start);
		
		  VectorSet(offset, 10000, 0, 0);
		  G_ProjectSource (start, offset, forward, right, end);
		*/
		
		tr = gi.trace (start, mins, maxs, end, ent, MASK_SHOT);
		
		if (tr.ent && tr.ent->client)
		{
			ent->client->ctf.popup_ent = tr.ent;
			ent->client->awayframe = level.framenum;
		}
		else
		{
			ent->client->ctf.popup_ent = NULL;
		}
	}

	popup_ent = ent->client->ctf.popup_ent;
	if (popup_ent && popup_ent->client)
	{
		ent->client->showctfhud = true;
		color = "string2";

		if (buf != NULL)
			strcpy(buf, popup_ent->client->pers.netname); //surt, for autotext

		strcpy(string, popup_ent->client->pers.netname);
#ifdef OLDOBSERVERCODE
		if (ent->client->camera_target)
			strcat(string, string2);
#endif
		if (popup_ent->client->ctf.teamnum != ent->client->ctf.teamnum)
			color = "string";

		Com_sprintf(string, sizeof(string),
			"xl %i yb %i %s \""
			"%s",
			5,-42,
			color,
			string);
		strcat(string, "\" ");
	}
	else if (Match_Over())
	{
		ent->client->showctfhud = true;
		color = "string2";
		strcpy(string, "MATCH OVER!");

		Com_sprintf(string, sizeof(string),
			"xv 32 yv 8 picn matchover "
			"xl %i yb %i %s \""
			"%s",
			5,-42,
			color,
			string);
		strcat(string, "\" ");
	}
	else if (GamePaused())
	{
		ent->client->showctfhud = true;
		color = "string2";
		strcpy(string, "GAME PAUSED (NO MOVING)!");

		Com_sprintf(string, sizeof(string),
			"xv 32 yv 8 picn gamepaused "
			"xl %i yb %i %s \""
			"%s",
			5,-42,
			color,
			string);
		strcat(string, "\" ");
	}

	// show popup for 1 more second after looking away
	if (level.framenum > ent->client->awayframe + 10)
	{
		ent->client->showctfhud = false;
		ent->client->ctf.popup_ent = NULL;
	}

	if (strlen(string) > 0)
	{
		gi.WriteByte (svc_layout);
		gi.WriteString (string);
		gi.unicast (ent, false);
	}
	
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x14a0, %rsp           # imm = 0x14A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xe24(%rax)
jne 0x65589
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xe2c(%rax)
jne 0x65589
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xe28(%rax)
jne 0x65589
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xf74(%rax)
jne 0x65589
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xf80(%rax)
jne 0x65589
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xe34(%rax)
je 0x65595
movl $0x0, -0x4(%rbp)
jmp 0x65b1e
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x10fc(%rax)
je 0x655e4
movq 0x1d7f3(%rip), %rax     # 0x82da0
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
subl 0x10fc(%rcx), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
addl 0x9128(%rcx), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x655e4
movl $0x0, -0x4(%rbp)
jmp 0x65b1e
movq 0x1d7b5(%rip), %rax     # 0x82da0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x10fc(%rax)
leaq -0x13a0(%rbp), %rdi
leaq 0xb977(%rip), %rsi      # 0x70f80
callq 0x182c0
movss 0xae72(%rip), %xmm2     # 0x70488
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x19740
movq %rax, -0x1440(%rbp)
movq -0x1440(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x13d8(%rbp)
movq -0x1440(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x13d4(%rbp)
movq -0x1440(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x13d0(%rbp)
movss 0xeb8d(%rip), %xmm2     # 0x741f8
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x19740
movq %rax, -0x1440(%rbp)
movq -0x1440(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x13e4(%rbp)
movq -0x1440(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x13e0(%rbp)
movq -0x1440(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x13dc(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xebc, %rdi            # imm = 0xEBC
leaq -0x13b4(%rbp), %rsi
leaq -0x13c0(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x183e0
leaq -0x13b4(%rbp), %rdi
leaq -0x13b4(%rbp), %rsi
movss 0x12164(%rip), %xmm0    # 0x77858
callq 0x18a80
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x13cc(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x13c8(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0x13c4(%rbp)
movq -0x10(%rbp), %rax
movl 0x278(%rax), %eax
subl $0x8, %eax
cvtsi2ss %eax, %xmm0
addss -0x13c4(%rbp), %xmm0
movss %xmm0, -0x13c4(%rbp)
movss -0x13cc(%rbp), %xmm0
addss -0x13b4(%rbp), %xmm0
movss %xmm0, -0x13f0(%rbp)
movss -0x13c8(%rbp), %xmm0
addss -0x13b0(%rbp), %xmm0
movss %xmm0, -0x13ec(%rbp)
movss -0x13c4(%rbp), %xmm0
addss -0x13ac(%rbp), %xmm0
movss %xmm0, -0x13e8(%rbp)
movq 0x1ce64(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0x13cc(%rbp), %rsi
leaq -0x13d8(%rbp), %rdx
leaq -0x13e4(%rbp), %rcx
leaq -0x13f0(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0x1490(%rbp), %rdi
movl $0x6000003, (%rsp)      # imm = 0x6000003
callq *%rax
leaq -0x1438(%rbp), %rdi
leaq -0x1490(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
cmpq $0x0, -0x13f8(%rbp)
je 0x6582f
movq -0x13f8(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x6582f
movq -0x13f8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x9130(%rax)
movq 0x1d583(%rip), %rax     # 0x82da0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0xf7c(%rax)
jmp 0x65842
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0x9130(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x9130(%rax), %rax
movq %rax, -0x1448(%rbp)
cmpq $0x0, -0x1448(%rbp)
je 0x65964
movq -0x1448(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x65964
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0xf78(%rax)
leaq 0x11d75(%rip), %rax     # 0x77606
movq %rax, -0x13a8(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x658c1
movq -0x18(%rbp), %rdi
movq -0x1448(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
callq 0x182c0
leaq -0x13a0(%rbp), %rdi
movq -0x1448(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
callq 0x182c0
movq -0x1448(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x1100(%rcx), %eax
je 0x65915
leaq 0xd661(%rip), %rax      # 0x72f6f
movq %rax, -0x13a8(%rbp)
leaq -0x13a0(%rbp), %rdi
movq -0x13a8(%rbp), %r9
leaq -0x13a0(%rbp), %rax
movl $0x1388, %esi           # imm = 0x1388
leaq 0x120ff(%rip), %rdx     # 0x77a35
movl $0x5, %ecx
movl $0xffffffd6, %r8d       # imm = 0xFFFFFFD6
movq %rax, (%rsp)
movb $0x0, %al
callq 0x18f90
leaq -0x13a0(%rbp), %rdi
leaq 0x11a8a(%rip), %rsi     # 0x773e4
callq 0x19880
jmp 0x65a83
movb $0x0, %al
callq 0x18e50
cmpl $0x0, %eax
je 0x659f6
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0xf78(%rax)
leaq 0x11c79(%rip), %rax     # 0x77606
movq %rax, -0x13a8(%rbp)
leaq -0x13a0(%rbp), %rdi
leaq 0x12026(%rip), %rsi     # 0x779c8
callq 0x182c0
leaq -0x13a0(%rbp), %rdi
movq -0x13a8(%rbp), %r9
leaq -0x13a0(%rbp), %rax
movl $0x1388, %esi           # imm = 0x1388
leaq 0x1200c(%rip), %rdx     # 0x779d4
movl $0x5, %ecx
movl $0xffffffd6, %r8d       # imm = 0xFFFFFFD6
movq %rax, (%rsp)
movb $0x0, %al
callq 0x18f90
leaq -0x13a0(%rbp), %rdi
leaq 0x119f8(%rip), %rsi     # 0x773e4
callq 0x19880
jmp 0x65a81
movb $0x0, %al
callq 0x18160
cmpl $0x0, %eax
je 0x65a7f
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0xf78(%rax)
leaq 0x11beb(%rip), %rax     # 0x77606
movq %rax, -0x13a8(%rbp)
leaq -0x13a0(%rbp), %rdi
leaq 0x11fd1(%rip), %rsi     # 0x77a01
callq 0x182c0
leaq -0x13a0(%rbp), %rdi
movq -0x13a8(%rbp), %r9
leaq -0x13a0(%rbp), %rax
movl $0x1388, %esi           # imm = 0x1388
leaq 0x11fc4(%rip), %rdx     # 0x77a1a
movl $0x5, %ecx
movl $0xffffffd6, %r8d       # imm = 0xFFFFFFD6
movq %rax, (%rsp)
movb $0x0, %al
callq 0x18f90
leaq -0x13a0(%rbp), %rdi
leaq 0x1196a(%rip), %rsi     # 0x773e4
callq 0x19880
jmp 0x65a81
jmp 0x65a83
movq 0x1d316(%rip), %rax     # 0x82da0
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl 0xf7c(%rcx), %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
jle 0x65ac6
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0xf78(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0x9130(%rax)
leaq -0x13a0(%rbp), %rdi
callq 0x186e0
cmpq $0x0, %rax
jbe 0x65b17
movl $0x4, %edi
movq 0x1cb1c(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq 0x1cb0f(%rip), %rax     # 0x82600
movq 0xe8(%rax), %rax
leaq -0x13a0(%rbp), %rdi
callq *%rax
movq 0x1caf8(%rip), %rax     # 0x82600
movq 0xb8(%rax), %rax
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x14a0, %rsp           # imm = 0x14A0
popq %rbp
retq
nopw (%rax,%rax)