LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SP_info_player_blue
void SP_info_player_blue(edict_t *self)
{
	vec3_t	end, angles;
	
	// If we have no facing for this spawn point...
	//  Turn it to face the flag
	if (!self->s.angles[1] && blueflag)
	{
		VectorSubtract(blueflag->s.origin, self->s.origin, end);
		vectoangles(end, angles);
		
		self->s.angles[1] = angles[1];
	}
	self->classname = "info_player_blue";
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
ucomiss 0x14(%rdi), %xmm0
setnp %al
sete %cl
andb %al, %cl
movq 0x27946(%rip), %rax     # 0x66860
movq (%rax), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3ef64
movsd 0x4(%rax), %xmm0
movsd 0x4(%rbx), %xmm1
subps %xmm1, %xmm0
movq %rsp, %rdi
movlps %xmm0, (%rdi)
movss 0xc(%rax), %xmm0
subss 0xc(%rbx), %xmm0
movss %xmm0, 0x8(%rdi)
leaq 0xc(%rsp), %r14
movq %r14, %rsi
callq 0x19240
movss 0x4(%r14), %xmm0
movss %xmm0, 0x14(%rbx)
leaq 0x12034(%rip), %rax     # 0x50f9f
movq %rax, 0x138(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: IsNeutral
qboolean IsNeutral (edict_t *ent)
{
	char		*info;

	if (!ent->client)
		return false;

	info = Info_ValueForKey (ent->client->pers.userinfo, "gender");
	if (info[0] != 'f' && info[0] != 'F' && info[0] != 'm' && info[0] != 'M')
		return true;
	return false;
}

// Assembly:
movq 0x58(%rdi), %rdi
xorl %eax, %eax
testq %rdi, %rdi
je 0x3eff2
pushq %rax
addq $0xc0, %rdi
leaq 0x16982(%rip), %rsi     # 0x5594a
callq 0x18c70
movzbl (%rax), %ecx
pushq $0x1
popq %rax
addl $-0x46, %ecx
cmpl $0x27, %ecx
leaq 0x8(%rsp), %rsp
ja 0x3eff2
movabsq $0x8100000081, %rdx     # imm = 0x8100000081
btq %rcx, %rdx
jae 0x3eff2
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: LookAtKiller
void LookAtKiller (edict_t *self, edict_t *inflictor, edict_t *attacker)
{
	vec3_t		dir;

	if (attacker && attacker != world && attacker != self)
	{
		VectorSubtract (attacker->s.origin, self->s.origin, dir);
	}
	else if (inflictor && inflictor != world && inflictor != self)
	{
		VectorSubtract (inflictor->s.origin, self->s.origin, dir);
	}
	else
	{
		self->client->killer_yaw = self->s.angles[YAW];
		return;
	}

	if (dir[0])
		self->client->killer_yaw = 180/M_PI*atan2(dir[1], dir[0]);
	else {
		self->client->killer_yaw = 0;
		if (dir[1] > 0)
			self->client->killer_yaw = 90;
		else if (dir[1] < 0)
			self->client->killer_yaw = -90;
	}
	if (self->client->killer_yaw < 0)
		self->client->killer_yaw += 360;
	

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x26e25(%rip), %rax     # 0x66558
movq (%rax), %rax
cmpq %rdi, %rdx
je 0x3f745
testq %rdx, %rdx
je 0x3f745
cmpq %rdx, %rax
jne 0x3f757
cmpq %rbx, %rsi
je 0x3f7c0
testq %rsi, %rsi
je 0x3f7c0
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x3f7c0
movss 0x4(%rdx), %xmm1
movss 0x8(%rdx), %xmm0
subss 0x4(%rbx), %xmm1
subss 0x8(%rbx), %xmm0
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x3f775
jnp 0x3f7a4
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
callq 0x19210
mulsd 0x1617e(%rip), %xmm0    # 0x55908
cvtsd2ss %xmm0, %xmm0
movq 0x58(%rbx), %rax
movss %xmm0, 0xe74(%rax)
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x3f7e5
jmp 0x3f7f5
movq 0x58(%rbx), %rax
andl $0x0, 0xe74(%rax)
ucomiss %xmm2, %xmm0
jbe 0x3f7cb
movl $0x42b40000, 0xe74(%rax) # imm = 0x42B40000
jmp 0x3f7f5
movss 0x14(%rbx), %xmm0
movq 0x58(%rbx), %rax
jmp 0x3f7ed
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x3f7f5
movl $0xc2b40000, 0xe74(%rax) # imm = 0xC2B40000
movss 0x15c23(%rip), %xmm0    # 0x55408
addss 0x10577(%rip), %xmm0    # 0x4fd64
movss %xmm0, 0xe74(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: InitClientPersistent
void InitClientPersistent (gclient_t *client)
{
	gitem_t		*item;

	memset (&client->pers, 0, sizeof(client->pers));
	
	// CTF CODE -- LM_JORM
	item = FindItem("Grappling Hook");
	client->pers.inventory[ITEM_INDEX(item)] = 1;
	// END CTF CODE -- LM_JORM
	
	
	item = FindItem("Blaster");
	client->pers.selected_item = ITEM_INDEX(item);
	client->pers.inventory[client->pers.selected_item] = 1;

	client->pers.weapon = item;

	client->pers.health			= 100;
	client->pers.max_health		= 100;

	client->pers.max_bullets	= 200;
	client->pers.max_shells		= 100;
	client->pers.max_rockets	= 50;
	client->pers.max_grenades	= 50;
	client->pers.max_cells		= 200;
	client->pers.max_slugs		= 50;

	client->pers.connected = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0xc0, %rdi
movl $0x698, %edx            # imm = 0x698
xorl %esi, %esi
callq 0x188e0
leaq 0xf53a(%rip), %rdi      # 0x4f7f7
callq 0x18a80
movq 0x26b77(%rip), %r14     # 0x66e40
subq %r14, %rax
movl $0x88, %r15d
cqto
idivq %r15
pushq $0x1
popq %rbp
movl %ebp, 0x318(%rbx,%rax,4)
leaq 0x1252f(%rip), %rdi     # 0x52817
callq 0x18a80
movq %rax, %rcx
subq %r14, %rax
cqto
idivq %r15
movl %eax, 0x314(%rbx)
cltq
movl %ebp, 0x318(%rbx,%rax,4)
movq %rcx, 0x730(%rbx)
movl $0x64, 0x30c(%rbx)
movaps 0x154a1(%rip), %xmm0    # 0x557c0
movups %xmm0, 0x718(%rbx)
movabsq $0x32000000c8, %rax     # imm = 0x32000000C8
movq %rax, 0x728(%rbx)
movabsq $0x6400000001, %rax     # imm = 0x6400000001
movq %rax, 0x304(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: InitClientResp
void InitClientResp (gclient_t *client)
{
	//surt
	//	  int teamnum, radio, extra_flags;
	//	  qboolean	goodskin;	// Flags that skin has been approved, no need to forcecommand
	//	  int 		pingalertfloor;
	//	  int 		pingalertceiling;
	//	  int 	compass;
	stats_player_s *playertemp;
	
	ctftemp = client->ctf;
	playertemp = client->p_stats_player;
	
	memset (&client->resp, 0, sizeof(client->resp));
	client->resp.enterframe = level.framenum;
	
	client->ctf = ctftemp;
	client->p_stats_player = playertemp;

	if ((int)ctfflags->value & CTF_TEAM_RESET)
	{
		//if (client->ctf.teamnum != CTF_TEAM_OBSERVER)
		//bat
		if (client->ctf.teamnum != CTF_TEAM_OBSERVER && 
			client->ctf.teamnum != CTF_TEAM_OBSERVER_RED &&
			client->ctf.teamnum != CTF_TEAM_OBSERVER_BLUE)
				client->ctf.teamnum = CTF_TEAM_UNDEFINED; // LM_JORM -- This will cause us to be on a new team
	}
	//surt above is allowed as a special case for now, otherwise only set teamnum
	//in ctf_SetEntTeam
	
	client->resp.coop_respawn = client->pers;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1100(%rdi), %r14
leaq 0x4ed3f(%rip), %rdi     # 0x8f0a8
movl $0x8038, %edx           # imm = 0x8038
movq %r14, %rsi
callq 0x18d60
leaq 0x758(%rbx), %r15
movl $0x6b0, %edx            # imm = 0x6B0
movq %r15, %rdi
xorl %esi, %esi
callq 0x188e0
movq 0x26a0d(%rip), %rax     # 0x66da0
movl (%rax), %eax
movl %eax, 0xdf0(%rbx)
movq 0x267b6(%rip), %rax     # 0x66b58
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x4, %al
je 0x403b8
cmpl $-0x4, (%r14)
ja 0x403b8
andl $0x0, (%r14)
addq $0xc0, %rbx
movl $0x698, %edx            # imm = 0x698
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x18d60
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SaveClientData
void SaveClientData (void)
{
	int		i;
	edict_t	*ent;

	for (i=0 ; i<game.maxclients ; i++)
	{
		ent = &g_edicts[1+i];
		if (!ent->inuse)
			continue;
		game.clients[i].pers.health = ent->health;
		game.clients[i].pers.max_health = ent->max_health;
		game.clients[i].pers.savedFlags = (ent->flags & (FL_GODMODE|FL_NOTARGET|FL_POWER_ARMOR));
		if (coop->value)
			game.clients[i].pers.score = ent->client->resp.score;
	}
}

// Assembly:
movq 0x26965(%rip), %rdx     # 0x66d40
movslq 0x610(%rdx), %rax
movq 0x2616f(%rip), %rsi     # 0x66558
movl $0x308, %ecx            # imm = 0x308
addq 0x408(%rdx), %rcx
movq 0x26b64(%rip), %rdi     # 0x66f60
movl $0x500, %edx            # imm = 0x500
addq (%rsi), %rdx
movq (%rdi), %rsi
xorl %edi, %edi
movl $0x1030, %r8d           # imm = 0x1030
xorps %xmm0, %xmm0
cmpq %rax, %rdi
jge 0x40465
cmpl $0x0, 0x8(%rdx)
je 0x40452
movq 0x1fc(%rdx), %r9
movq %r9, (%rcx)
movl 0xc4(%rdx), %r9d
andl %r8d, %r9d
movl %r9d, 0x8(%rcx)
movss 0x20(%rsi), %xmm1
ucomiss %xmm0, %xmm1
jne 0x40441
jnp 0x40452
movq (%rdx), %r9
movl 0xdf4(%r9), %r9d
movl %r9d, 0x43c(%rcx)
addq $0x9140, %rcx           # imm = 0x9140
addq $0x4a8, %rdx            # imm = 0x4A8
incq %rdi
jmp 0x40412
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: FetchClientEntData
void FetchClientEntData (edict_t *ent)
{
	ent->health = ent->client->pers.health;
	ent->max_health = ent->client->pers.max_health;
	ent->flags |= ent->client->pers.savedFlags;
	if (coop->value)
		ent->client->resp.score = ent->client->pers.score;
}

// Assembly:
movq 0x58(%rdi), %rax
movq 0x308(%rax), %rcx
movq %rcx, 0x254(%rdi)
movl 0x310(%rax), %ecx
orl %ecx, 0x11c(%rdi)
movq 0x26ad5(%rip), %rcx     # 0x66f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4049d
jnp 0x404a9
movl 0x744(%rax), %ecx
movl %ecx, 0xdf4(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: PlayersRangeFromSpot
float	PlayersRangeFromSpot (edict_t *spot)
{
	edict_t	*player;
	float	bestplayerdistance;
	vec3_t	v;
	int		n;
	float	playerdistance;


	bestplayerdistance = 9999999;

	for (n = 1; n <= maxclients->value; n++)
	{
		player = &g_edicts[n];

		if (!player->inuse)
			continue;

		if (player->health <= 0)
			continue;

		VectorSubtract (spot->s.origin, player->s.origin, v);
		playerdistance = VectorLength (v);

		if (playerdistance < bestplayerdistance)
			bestplayerdistance = playerdistance;
	}

	return bestplayerdistance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x2606e(%rip), %r15     # 0x66530
movq (%r15), %rax
movss 0xedbf(%rip), %xmm0     # 0x4f28c
movss %xmm0, 0x8(%rsp)
movl $0x4ac, %r12d           # imm = 0x4AC
pushq $0x1
popq %rbp
movq 0x26075(%rip), %r13     # 0x66558
leaq 0xc(%rsp), %r14
cvtsi2ss %ebp, %xmm0
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jb 0x4056c
movq (%r13), %rcx
cmpl $0x0, 0x5c(%rcx,%r12)
je 0x4055e
cmpl $0x0, 0x250(%rcx,%r12)
jle 0x4055e
movss 0x4(%rbx), %xmm0
subss (%rcx,%r12), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x8(%rbx), %xmm0
subss 0x4(%rcx,%r12), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0xc(%rbx), %xmm0
subss 0x8(%rcx,%r12), %xmm0
movss %xmm0, 0x14(%rsp)
movq %r14, %rdi
callq 0x19460
movss 0x8(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movq (%r15), %rax
jbe 0x4055e
movss %xmm0, 0x8(%rsp)
addq $0x4a8, %r12            # imm = 0x4A8
incl %ebp
jmp 0x404e8
movss 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectRandomDeathmatchSpawnPoint
edict_t *SelectRandomDeathmatchSpawnPoint (void)
{
	edict_t	*spot, *spot1, *spot2;
	int		count = 0;
	int		selection;
	float	range, range1, range2;

	spot = NULL;
	range1 = range2 = 99999;
	spot1 = spot2 = NULL;

	while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL)
	{
		count++;
		range = PlayersRangeFromSpot(spot);
		if (range < range1)
		{
			range1 = range;
			spot1 = spot;
		}
		else if (range < range2)
		{
			range2 = range;
			spot2 = spot;
		}
	}

	if (!count)
		return NULL;

	if (count <= 2)
	{
		spot1 = spot2 = NULL;
	}
	else
		count -= 2;

	selection = rand() % count;

	spot = NULL;
	do
	{
		spot = G_Find (spot, FOFS(classname), "info_player_deathmatch");
		if (spot == spot1 || spot == spot2)
			selection++;
	} while(selection--);

	return spot;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movss 0x151e4(%rip), %xmm0    # 0x55778
xorl %r15d, %r15d
leaq 0xefa4(%rip), %rbx      # 0x4f542
pushq $0x1
popq %r13
xorl %r12d, %r12d
xorl %ebp, %ebp
movss %xmm0, 0x4(%rsp)
movss %xmm0, (%rsp)
xorl %r14d, %r14d
negl %ebp
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x195e0
testq %rax, %rax
je 0x4060c
movq %rax, %r14
movq %rax, %rdi
callq 0x195c0
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
ja 0x405fa
decl %ebp
movss (%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x405b7
negl %ebp
movq %r14, %r12
movss %xmm0, (%rsp)
jmp 0x405b5
movl %r13d, %eax
subl %ebp, %eax
movq %r14, %r15
movl %eax, %ebp
movss %xmm0, 0x4(%rsp)
jmp 0x405b5
testl %ebp, %ebp
je 0x40667
pushq $-0x2
popq %rax
subl %ebp, %eax
negl %ebp
xorl %ebx, %ebx
cmpl $0x3, %ebp
cmovbq %rbx, %r15
cmovbq %rbx, %r12
cmovael %eax, %ebp
callq 0x19bf0
cltd
idivl %ebp
movl %edx, %ebp
leaq 0xef0a(%rip), %r14      # 0x4f542
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
movq %rax, %rbx
cmpq %r15, %rax
sete %al
cmpq %r12, %rbx
sete %cl
orb %al, %cl
movzbl %cl, %eax
addl %ebp, %eax
subl $0x1, %eax
movl %eax, %ebp
jae 0x40638
jmp 0x40669
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectFarthestDeathmatchSpawnPoint
edict_t *SelectFarthestDeathmatchSpawnPoint (void)
{
	edict_t	*bestspot;
	float	bestdistance, bestplayerdistance;
	edict_t	*spot;


	spot = NULL;
	bestspot = NULL;
	bestdistance = 0;
	while ((spot = G_Find (spot, FOFS(classname), "info_player_deathmatch")) != NULL)
	{
		bestplayerdistance = PlayersRangeFromSpot (spot);

		if (bestplayerdistance > bestdistance)
		{
			bestspot = spot;
			bestdistance = bestplayerdistance;
		}
	}

	if (bestspot)
	{
		return bestspot;
	}

	// if there is a player just spawned on each and every start spot
	// we have no choice to turn one into a telefrag meltdown
	spot = G_Find (NULL, FOFS(classname), "info_player_deathmatch");

	return spot;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
xorl %ebx, %ebx
leaq 0xeeac(%rip), %r14      # 0x4f542
xorl %r15d, %r15d
movq %r15, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
testq %rax, %rax
je 0x406d2
movq %rax, %r15
movq %rax, %rdi
callq 0x195c0
movss 0xc(%rsp), %xmm1
ucomiss %xmm1, %xmm0
cmovaq %r15, %rbx
maxss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
jmp 0x40699
testq %rbx, %rbx
je 0x406e4
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xee57(%rip), %rdx      # 0x4f542
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x195e0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectTeamSpawnPoint
edict_t *SelectTeamSpawnPoint (edict_t *ent)
{
	edict_t	*bestspot;
	float	bestdistance, bestplayerdistance;
	edict_t	*spot;
	char	*spawntype;
	
	if (ent->client->ctf.teamnum == CTF_TEAM_RED) // RED team
		spawntype = "info_player_red";
	else // BLUE team
		spawntype = "info_player_blue";
	
	spot = NULL;
	bestspot = NULL;
	bestdistance = 0;
	while ((spot = G_Find (spot, FOFS(classname), spawntype)) != NULL)
	{
		bestplayerdistance = PlayersRangeFromSpot (spot);
		
		if (bestplayerdistance > bestdistance)
		{
			bestspot = spot;
			bestdistance = bestplayerdistance;
		}
	}
	
	if (bestspot)
	{
		return bestspot;
	}
	
	// if there is a player just spawned on each and every start spot
	// we have no choice to turn one into a telefrag meltdown
	spot = G_Find (NULL, FOFS(classname), spawntype);
	
	return spot;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x58(%rdi), %rax
cmpl $0x1, 0x1100(%rax)
leaq 0x10874(%rip), %rax     # 0x50f8f
leaq 0x1087d(%rip), %rbx     # 0x50f9f
cmoveq %rax, %rbx
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %r15, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x195e0
testq %rax, %rax
je 0x4076e
movq %rax, %r15
movq %rax, %rdi
callq 0x195c0
movss 0xc(%rsp), %xmm1
ucomiss %xmm1, %xmm0
cmovaq %r15, %r14
maxss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
jmp 0x40735
testq %r14, %r14
je 0x40780
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x195e0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectAnySpawnPoint
edict_t *SelectAnySpawnPoint (edict_t *ent)
{
	float	distance1, distance2;
	edict_t	*spot1, *spot2;
	
	
	if ( (int)(dmflags->value) & DF_SPAWN_FARTHEST)
		spot1 = SelectFarthestDeathmatchSpawnPoint ();
	else
		spot1 = SelectRandomDeathmatchSpawnPoint ();
	
	if (!spot1)
		return NULL;
	
	distance1 = PlayersRangeFromSpot (spot1);
	
	
	spot2 = SelectTeamSpawnPoint(ent);
	if (!spot2) // Do we have any team spawn points?
		return spot1;
	distance2 = PlayersRangeFromSpot (spot2);
	
	if (distance1 > distance2) // Is deathmatch better than team?
		return spot1;
	else
		return spot2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x25e72(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0x9, %eax
jb 0x407bb
callq 0x19020
jmp 0x407c0
callq 0x18110
movq %rax, %rbx
testq %rax, %rax
je 0x407fd
movq %rbx, %rdi
callq 0x195c0
movss %xmm0, 0x4(%rsp)
movq %r14, %rdi
callq 0x19470
testq %rax, %rax
je 0x407ff
movq %rax, %r14
movq %rax, %rdi
callq 0x195c0
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
cmovbeq %r14, %rbx
jmp 0x407ff
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectCoopSpawnPoint
edict_t *SelectCoopSpawnPoint (edict_t *ent)
{
	int		index;
	edict_t	*spot = NULL;
	char	*target;

	index = ent->client - game.clients;

	// player 0 starts in normal player spawn point
	if (!index)
		return NULL;

	spot = NULL;

	// assume there are four coop spots at each spawnpoint
	while (1)
	{
		spot = G_Find (spot, FOFS(classname), "info_player_coop");
		if (!spot)
			return NULL;	// we didn't have enough...

		target = spot->targetname;
		if (!target)
			target = "";
		if ( Q_stricmp(game.spawnpoint, target) == 0 )
		{	// this is a coop spawn point for one of the clients here
			index--;
			if (!index)
				return spot;		// this is it
		}
	}


	return spot;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x58(%rdi), %rax
movq 0x26504(%rip), %rcx     # 0x66d40
subq 0x408(%rcx), %rax
movl $0x9140, %ecx           # imm = 0x9140
cqto
idivq %rcx
movq %rax, %rbx
testl %ebx, %ebx
je 0x408aa
leaq 0x138f9(%rip), %r14     # 0x54154
leaq 0xf6e3(%rip), %r13      # 0x4ff45
movl $0x410, %r15d           # imm = 0x410
addq 0x264d1(%rip), %r15     # 0x66d40
xorl %r12d, %r12d
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
testq %rax, %rax
je 0x408aa
movq %rax, %r12
movq 0x158(%rax), %rsi
testq %rsi, %rsi
cmoveq %r13, %rsi
movq %r15, %rdi
callq 0x186d0
testl %eax, %eax
jne 0x40872
decl %ebx
jne 0x40872
jmp 0x408ad
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: InitBodyQue
void InitBodyQue (void)
{
	int		i;
	edict_t	*ent;

	level.body_que = 0;
	for (i=0; i<BODY_QUEUE_SIZE ; i++)
	{
		ent = G_Spawn();
		ent->classname = "bodyque";
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x2633b(%rip), %rax     # 0x66da0
andl $0x0, 0x150(%rax)
pushq $0x8
popq %rbx
leaq 0x1119d(%rip), %r14     # 0x51c13
subl $0x1, %ebx
jb 0x40a89
callq 0x198d0
movq %r14, 0x138(%rax)
jmp 0x40a76
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: body_die
void body_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
	int	n;

	if (self->health < -40)
	{
		gi.sound (self, CHAN_BODY, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
		for (n= 0; n < 4; n++)
			ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
		self->s.origin[2] -= 48;
		ThrowClientHead (self, damage);
		self->takedamage = DAMAGE_NO;
	}
}

// Assembly:
cmpl $-0x29, 0x254(%rdi)
jg 0x40b27
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdi, %rbx
movq 0x25b4f(%rip), %rax     # 0x66600
movq 0x20(%rax), %r15
leaq 0x12c7e(%rip), %rdi     # 0x5373a
callq *0x48(%rax)
pushq $0x4
popq %r14
movss 0xe45d(%rip), %xmm0     # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %r14d, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
leaq 0x12c67(%rip), %r15     # 0x5374a
subl $0x1, %r14d
jb 0x40afa
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x18940
jmp 0x40ae3
movss 0xc(%rbx), %xmm0
addss 0x14c79(%rip), %xmm0    # 0x55780
movss %xmm0, 0xc(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x18ed0
andl $0x0, 0x27c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: CopyToBodyQue
void CopyToBodyQue (edict_t *ent)
{
	edict_t		*body;

	// grab a body que and cycle to the next one
	body = &g_edicts[(int)maxclients->value + level.body_que + 1];
	level.body_que = (level.body_que + 1) % BODY_QUEUE_SIZE;

	// FIXME: send an effect on the removed body

	gi.unlinkentity (ent);

	gi.unlinkentity (body);
	body->s = ent->s;
	body->s.number = body - g_edicts;

	body->svflags = ent->svflags;
	VectorCopy (ent->mins, body->mins);
	VectorCopy (ent->maxs, body->maxs);
	VectorCopy (ent->absmin, body->absmin);
	VectorCopy (ent->absmax, body->absmax);
	VectorCopy (ent->size, body->size);
	body->solid = ent->solid;
	body->clipmask = ent->clipmask;
	body->owner = ent->owner;
	body->movetype = ent->movetype;

	body->die = body_die;
	body->takedamage = DAMAGE_YES;

	gi.linkentity (body);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x25a1b(%rip), %r13     # 0x66558
movq (%r13), %r15
movq 0x259e8(%rip), %rax     # 0x66530
movq (%rax), %rax
cvttss2si 0x20(%rax), %ecx
movq 0x26249(%rip), %rsi     # 0x66da0
movl 0x150(%rsi), %eax
addl %eax, %ecx
movslq %ecx, %rcx
imulq $0x4a8, %rcx, %r12      # imm = 0x4A8
movl $0x4a8, %ebp            # imm = 0x4A8
leaq (%r15,%rbp), %r14
addq %r12, %r14
incl %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %edx, 0x150(%rsi)
movq 0x25a76(%rip), %rax     # 0x66600
callq *0x98(%rax)
movq %r14, %rdi
movq 0x25a66(%rip), %rax     # 0x66600
callq *0x98(%rax)
pushq $0x54
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
rep  movsb (%rsi), %es:(%rdi)
movq %r14, %rax
subq (%r13), %rax
cqto
idivq %rbp
movl %eax, 0x4a8(%r15,%r12)
movl 0xc8(%rbx), %eax
movl %eax, 0x570(%r15,%r12)
movss 0xcc(%rbx), %xmm0
movss %xmm0, 0x574(%r15,%r12)
movss 0xd0(%rbx), %xmm0
movss %xmm0, 0x578(%r15,%r12)
movss 0xd4(%rbx), %xmm0
movss %xmm0, 0x57c(%r15,%r12)
movss 0xd8(%rbx), %xmm0
movss %xmm0, 0x580(%r15,%r12)
movss 0xdc(%rbx), %xmm0
movss %xmm0, 0x584(%r15,%r12)
movss 0xe0(%rbx), %xmm0
movss %xmm0, 0x588(%r15,%r12)
movss 0xe4(%rbx), %xmm0
movss %xmm0, 0x58c(%r15,%r12)
movss 0xe8(%rbx), %xmm0
movss %xmm0, 0x590(%r15,%r12)
movss 0xec(%rbx), %xmm0
movss %xmm0, 0x594(%r15,%r12)
movss 0xf0(%rbx), %xmm0
movss %xmm0, 0x598(%r15,%r12)
movss 0xf4(%rbx), %xmm0
movss %xmm0, 0x59c(%r15,%r12)
movss 0xf8(%rbx), %xmm0
movss %xmm0, 0x5a0(%r15,%r12)
movss 0xfc(%rbx), %xmm0
movss %xmm0, 0x5a4(%r15,%r12)
movss 0x100(%rbx), %xmm0
movss %xmm0, 0x5a8(%r15,%r12)
movss 0x104(%rbx), %xmm0
movss %xmm0, 0x5ac(%r15,%r12)
movq 0x108(%rbx), %rax
movq %rax, 0x5b0(%r15,%r12)
movq 0x110(%rbx), %rax
movq %rax, 0x5b8(%r15,%r12)
movl 0x118(%rbx), %eax
movl %eax, 0x5c0(%r15,%r12)
movq 0x257aa(%rip), %rax     # 0x664b8
movq %rax, 0x6e0(%r15,%r12)
movl $0x1, 0x724(%r15,%r12)
movq %r14, %rdi
movq 0x258d4(%rip), %rax     # 0x66600
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: respawn
void respawn (edict_t *self)
{

	if(matchstate == MATCH_RAILGUN_INPLAY)
	{
		//Drop_All(self);
		self->movetype = MOVETYPE_NOCLIP;
		self->solid = SOLID_NOT;
		self->svflags |= SVF_NOCLIENT;
		self->health = 0;
		return;
	}

	if (deathmatch->value || coop->value)
	{
		// spectator's don't leave bodies
		if (self->movetype != MOVETYPE_NOCLIP)
			CopyToBodyQue (self);
		self->svflags &= ~SVF_NOCLIENT;
		Menu_Free (self); // free the menu rather than lose it during the memset
		PutClientInServer (self);
		// add a teleportation effect
		self->s.event = EV_PLAYER_TELEPORT;

		// hold in place briefly
		self->client->ps.pmove.pm_flags = PMF_TIME_TELEPORT;
		self->client->ps.pmove.pm_time = 14;

		//bat changed to avoid the overflows.
		self->client->respawn_time = level.time;
		//self->client->respawn_time = level.time + (0.2 * Respawn_Count);

		// Set the squadboard status to "respawned"...
		strncpy (self->client->pers.squadStatus, RESPAWNED_STATUS_STR, MAX_STATUS_LEN); // ADC
		self->client->pers.squadStatus[MAX_STATUS_LEN-1] = 0; // ADC

		return;
	}

	// restart the entire server
	gi.AddCommandString ("menu_loadgame\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x25a8d(%rip), %rax     # 0x667d8
cmpl $0x6, (%rax)
jne 0x40d74
movl $0x1, 0x118(%rbx)
andl $0x0, 0x108(%rbx)
orb $0x1, 0xc8(%rbx)
andl $0x0, 0x254(%rbx)
jmp 0x40e17
movq 0x26145(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x40da3
jp 0x40da3
movq 0x261cc(%rip), %rax     # 0x66f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x40da3
jnp 0x40e19
cmpl $0x1, 0x118(%rbx)
je 0x40db4
movq %rbx, %rdi
callq 0x18e30
andb $-0x2, 0xc8(%rbx)
movq %rbx, %rdi
callq 0x189e0
movq %rbx, %rdi
callq 0x18ac0
movl $0x6, 0x50(%rbx)
movq 0x58(%rbx), %rax
movw $0xe20, 0x10(%rax)      # imm = 0xE20
movq 0x25fbd(%rip), %rcx     # 0x66da0
movss 0x4(%rcx), %xmm0
movss %xmm0, 0xf28(%rax)
movups 0x14a99(%rip), %xmm0    # 0x55890
movups %xmm0, 0x2e0(%rax)
movups 0x14a9b(%rip), %xmm0    # 0x558a0
movups %xmm0, 0x2f0(%rax)
movq 0x58(%rbx), %rax
movb $0x0, 0x2ff(%rax)
popq %rbx
retq
movq 0x257e0(%rip), %rax     # 0x66600
leaq 0x15554(%rip), %rdi     # 0x5637b
popq %rbx
jmpq *0x150(%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: Team_To_Join
int Team_To_Join(edict_t *ent)
{
int	red, blue;
edict_t	*player;

	red = blue = 0;
	player = ctf_findplayer(NULL, ent, CTF_TEAM_ANYTEAM);
	while (player)
	{
		if (player->client->ctf.teamnum == CTF_TEAM_RED)
			red++;
		else if (player->client->ctf.teamnum == CTF_TEAM_BLUE)
			blue++;

		player = ctf_findplayer(player, ent, CTF_TEAM_ANYTEAM);
	}


	if(red == blue) // Even teams
	{
		if(redscore > bluescore)
			return(CTF_TEAM_BLUE);
		else 
			return(CTF_TEAM_RED);
	}
	else if(red > blue)
		return(CTF_TEAM_BLUE);
	else // if (blue > red)
		return(CTF_TEAM_RED);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $-0x5
popq %rbp
xorl %edi, %edi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x192e0
xorl %r15d, %r15d
testq %rax, %rax
je 0x418ef
movq 0x58(%rax), %rcx
movl 0x1100(%rcx), %ecx
cmpl $0x2, %ecx
je 0x418dd
cmpl $0x1, %ecx
jne 0x418e0
incl %r14d
jmp 0x418e0
incl %r15d
movq %rax, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x192e0
jmp 0x418bf
movq 0x252e2(%rip), %rax     # 0x66bd8
movl (%rax), %eax
movq 0x25149(%rip), %rcx     # 0x66a48
xorl %edx, %edx
cmpl (%rcx), %eax
setg %dl
xorl %eax, %eax
cmpl %r15d, %r14d
setg %al
cmovnel %eax, %edx
movzbl %dl, %eax
incl %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: ClientSetSkin
void ClientSetSkin(edict_t *ent, char *skin)
{
	char	*newskin, *s;
	int 	playernum;
	
	
	if (!SkinListInUse())
	{
		ClientOldSetSkin(ent, skin);
		return;
	}
	
	// get skin
	s = Info_ValueForKey (ent->client->pers.userinfo, "skin");
	
	if (!SkinValid(ent, skin))
	{
		if (SkinValid(ent, s))
			newskin = s;
		else
			newskin = SkinRandom(ent);
	}
	else
		newskin = skin;
	
	playernum = ent-g_edicts-1;
	
	// combine name and skin into a configstring
	gi.configstring (CS_PLAYERSKINS+playernum, va("%s\\%s", ent->client->pers.netname, newskin) );
	
	
	Info_SetValueForKey (ent->client->pers.userinfo, "skin", newskin);
	ent->client->ctf.goodskin = false; // We need to re-force our skin
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
callq 0x18f00
testl %eax, %eax
je 0x419fa
movl $0xc0, %r15d
movq 0x58(%rbx), %rdi
addq %r15, %rdi
leaq 0xc9ee(%rip), %rsi      # 0x4e340
callq 0x18c70
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19640
testl %eax, %eax
jne 0x41986
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19640
movq %r12, %r14
testl %eax, %eax
jne 0x41986
movq %rbx, %rdi
callq 0x187b0
movq %rax, %r14
movq 0x24bcb(%rip), %rcx     # 0x66558
movq %rbx, %rax
subq (%rcx), %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
movq 0x24c5c(%rip), %rcx     # 0x66600
movq 0x30(%rcx), %r12
leal 0x51f(%rax), %ebp
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
leaq 0x157af(%rip), %rdi     # 0x5716d
movq %r14, %rdx
xorl %eax, %eax
callq 0x194e0
movl %ebp, %edi
movq %rax, %rsi
callq *%r12
addq 0x58(%rbx), %r15
leaq 0xc965(%rip), %rsi      # 0x4e340
movq %r15, %rdi
movq %r14, %rdx
callq 0x185a0
movq 0x58(%rbx), %rax
andl $0x0, 0x110c(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x193a0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: CheckBlock
unsigned CheckBlock (void *b, int c)
{
	int	v,i;
	v = 0;
	for (i=0 ; i<c ; i++)
		v+= ((byte *)b)[i];
	return v;
}

// Assembly:
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
xorl %eax, %eax
cmpq %rcx, %rsi
je 0x42556
movzbl (%rdi,%rcx), %edx
addl %edx, %eax
incq %rcx
jmp 0x42546
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: PingAlert
void PingAlert (edict_t *ent)
{
	edict_t *other;
	int j;
	char message[MAX_INFO_STRING];
	
	// Check if they are turned off
	if (!ent->client->ctf.pingalertfloor && !ent->client->ctf.pingalertceiling)
		return;
	
	for (j = 1; j <= game.maxclients; j++)
	{
		other = &g_edicts[j];
		if (!other->inuse)
			continue;
		//bat
		//if (!other->client || other->client->ctf.teamnum == CTF_TEAM_OBSERVER)
		if (!other->client || other->client->ctf.teamnum <= CTF_TEAM_OBSERVER)
			continue;

		
		if (ent->client->ctf.pingalertfloor &&
			other->client->ping < ent->client->ctf.pingalertfloor)
		{
			sprintf(message, "PING ALERT: %s has a %d ping (below %d).\n",
				other->client->pers.netname, other->client->ping,
				ent->client->ctf.pingalertfloor);
			ctf_SafePrint(ent, PRINT_HIGH, message);
		}
		if (ent->client->ctf.pingalertceiling &&
			other->client->ping > ent->client->ctf.pingalertceiling)
		{
			sprintf(message, "PING ALERT: %s has a %d ping (above %d).\n",
				other->client->pers.netname, other->client->ping,
				ent->client->ctf.pingalertceiling);
			ctf_SafePrint(ent, PRINT_HIGH, message);
		}
		
	}
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
movq 0x58(%rdi), %rax
cmpl $0x0, 0x1110(%rax)
jne 0x42db3
cmpl $0x0, 0x1114(%rax)
je 0x42e9c
pushq $0x1
popq %rbp
movl $0x500, %r14d           # imm = 0x500
movq 0x23f7d(%rip), %r13     # 0x66d40
movq 0x2378e(%rip), %r12     # 0x66558
movslq 0x610(%r13), %rax
cmpq %rax, %rbp
jg 0x42e9c
movq (%r12), %r15
cmpl $0x0, 0x8(%r15,%r14)
je 0x42e8d
movq (%r15,%r14), %rdx
testq %rdx, %rdx
je 0x42e8d
cmpl $0x0, 0x1100(%rdx)
js 0x42e8d
movq 0x58(%rbx), %rax
movl 0x1110(%rax), %r8d
testl %r8d, %r8d
je 0x42e49
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jge 0x42e49
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %rdi
leaq 0x1376a(%rip), %rsi     # 0x5659a
xorl %eax, %eax
callq 0x198c0
movq %rbx, %rdi
pushq $0x2
popq %rsi
movq %rsp, %rdx
callq 0x18ec0
movq 0x58(%rbx), %rax
movl 0x1114(%rax), %r8d
testl %r8d, %r8d
je 0x42e8d
movq (%r15,%r14), %rdx
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jle 0x42e8d
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %r15
movq %r15, %rdi
leaq 0x1374c(%rip), %rsi     # 0x565c4
xorl %eax, %eax
callq 0x198c0
movq %rbx, %rdi
pushq $0x2
popq %rsi
movq %r15, %rdx
callq 0x18ec0
incq %rbp
addq $0x4a8, %r14            # imm = 0x4A8
jmp 0x42dca
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: Num_Of_Players
int Num_Of_Players(edict_t *ent, int Ctf_Team)
{
int red, blue;
edict_t		*player;

	player = ctf_findplayer(NULL, ent, CTF_TEAM_ANYTEAM);
	
	red = 0;
	blue = 0;

	while (player)
	{
		if(player->client->ctf.teamnum == CTF_TEAM_RED)
			red++;
		else if (player->client->ctf.teamnum == CTF_TEAM_BLUE)
			blue++;
		player = ctf_findplayer(player, ent, CTF_TEAM_ANYTEAM);
	}

	if(Ctf_Team == CTF_TEAM_BLUE)
		return(blue);
	else if(Ctf_Team == CTF_TEAM_RED)
		return(red);
	else
		return(0);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r12d, %r12d
pushq $-0x5
popq %r15
xorl %edi, %edi
movq %r14, %rsi
movl %r15d, %edx
callq 0x192e0
xorl %ebp, %ebp
testq %rax, %rax
je 0x4345c
movq 0x58(%rax), %rcx
movl 0x1100(%rcx), %ecx
cmpl $0x2, %ecx
je 0x4344a
cmpl $0x1, %ecx
jne 0x4344c
incl %r12d
jmp 0x4344c
incl %ebp
movq %rax, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x192e0
jmp 0x4342c
cmpl $0x2, %ebx
je 0x4346b
movl %r12d, %ebp
cmpl $0x1, %ebx
je 0x4346b
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: MoveClientToIntermission
void MoveClientToIntermission (edict_t *ent)
{
	
	if (deathmatch->value || coop->value)
		ent->client->showscores = true;
	VectorCopy (level.intermission_origin, ent->s.origin);
	ent->client->ps.pmove.origin[0] = level.intermission_origin[0]*8;
	ent->client->ps.pmove.origin[1] = level.intermission_origin[1]*8;
	ent->client->ps.pmove.origin[2] = level.intermission_origin[2]*8;
	VectorCopy (level.intermission_angle, ent->client->ps.viewangles);
	ent->client->ps.pmove.pm_type = PM_FREEZE;
	ent->client->ps.gunindex = 0;
	ent->client->ps.blend[3] = 0;
	ent->client->ps.rdflags &= ~RDF_UNDERWATER;

	// clean up powerup info
	ent->client->quad_framenum = 0;
	ent->client->invincible_framenum = 0;
	ent->client->breather_framenum = 0;
	ent->client->enviro_framenum = 0;
	ent->client->grenade_blew_up = false;
	ent->client->grenade_time = 0;

	ent->viewheight = 0;
	ent->s.modelindex = 0;
	ent->s.modelindex2 = 0;
	ent->s.modelindex3 = 0;
	ent->s.modelindex = 0;
	ent->s.effects = 0;
	ent->s.sound = 0;
	ent->solid = SOLID_NOT;

	// add the layout

	if (deathmatch->value || coop->value)
	{
		DeathmatchScoreboardMessage (ent, NULL);
		gi.unicast (ent, true);
	}

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x23a3d(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x434af
jp 0x434af
movq 0x23ac4(%rip), %rcx     # 0x66f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x434af
jnp 0x435c8
movq 0x58(%rbx), %rcx
movl $0x1, 0xe24(%rcx)
movq 0x238dc(%rip), %rdx     # 0x66da0
movss 0xdc(%rdx), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0xe0(%rdx), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0xe4(%rdx), %xmm0
movss %xmm0, 0xc(%rbx)
movsd 0xdc(%rdx), %xmm1
mulps 0xfec6(%rip), %xmm1     # 0x533c0
cvttps2dq %xmm1, %xmm1
pshuflw $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3,4,5,6,7]
mulss 0xb9ed(%rip), %xmm0     # 0x4eef8
cvttss2si %xmm0, %esi
movd %xmm1, 0x4(%rcx)
movw %si, 0x8(%rcx)
movss 0xe8(%rdx), %xmm0
movss %xmm0, 0x1c(%rcx)
movss 0xec(%rdx), %xmm0
movss %xmm0, 0x20(%rcx)
movss 0xf0(%rdx), %xmm0
movss %xmm0, 0x24(%rcx)
movl $0x4, (%rcx)
andl $0x0, 0x58(%rcx)
andl $0x0, 0x6c(%rcx)
andb $-0x2, 0x74(%rcx)
xorps %xmm0, %xmm0
andq $0x0, 0xf14(%rcx)
movups %xmm0, 0xf04(%rcx)
andl $0x0, 0x278(%rbx)
andl $0x0, 0x40(%rbx)
andl $0x0, 0x4c(%rbx)
andl $0x0, 0x108(%rbx)
andq $0x0, 0x28(%rbx)
andl $0x0, 0x30(%rbx)
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x435a7
jp 0x435a7
movq 0x239c8(%rip), %rax     # 0x66f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x435a7
jnp 0x435d1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18bb0
movq 0x23048(%rip), %rax     # 0x66600
movq 0xb8(%rax), %rax
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
jmpq *%rax
movq 0x58(%rbx), %rcx
jmp 0x434bd
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: Cmd_Score_f
void Cmd_Score_f (edict_t *ent)
{
	ent->client->showinventory = false;
	ent->client->showhelp = false;
    ent->client->showctfhud = false;
    ent->client->showmod = false;
    ent->client->showmenu = false;
	ent->client->showsquadboard = false; // ADC

	if (!deathmatch->value && !coop->value)
		return;

	if (ent->client->showscores)
	{
		ent->client->showscores = false;
		return;
	}

	ent->client->showscores = true;
	DeathmatchScoreboard (ent);
}

// Assembly:
movq 0x58(%rdi), %rax
andq $0x0, 0xe28(%rax)
andq $0x0, 0xf74(%rax)
andl $0x0, 0xf80(%rax)
andl $0x0, 0xe34(%rax)
movq 0x21f85(%rip), %rcx     # 0x66ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x44f63
jp 0x44f63
movq 0x2200c(%rip), %rcx     # 0x66f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x44f63
jnp 0x44f73
cmpl $0x0, 0xe24(%rax)
je 0x44f74
andl $0x0, 0xe24(%rax)
retq
movl $0x1, 0xe24(%rax)
jmp 0x19c10
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: Cmd_Squadboard_f
void Cmd_Squadboard_f (edict_t *ent)
{
	ent->client->showhelp = false;
	ent->client->showinventory = false;
	ent->client->showctfhud = false;
	ent->client->showmod = false;
	ent->client->showmenu = false;
	ent->client->showscores = false;

	if (!deathmatch->value && !coop->value)
		return;

	if (ent->client->showsquadboard)
	{
		ent->client->showsquadboard = false;
		return;
	}

	ent->client->showsquadboard = true;
	Squadboard (ent);
}

// Assembly:
movq 0x58(%rdi), %rax
andl $0x0, 0xe2c(%rax)
andq $0x0, 0xf74(%rax)
andl $0x0, 0xf80(%rax)
andq $0x0, 0xe24(%rax)
movq 0x21f14(%rip), %rcx     # 0x66ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x44fd4
jp 0x44fd4
movq 0x21f9b(%rip), %rcx     # 0x66f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x44fd4
jnp 0x44fe4
cmpl $0x0, 0xe34(%rax)
je 0x44fe5
andl $0x0, 0xe34(%rax)
retq
movl $0x1, 0xe34(%rax)
jmp 0x19720
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: HelpComputer
void HelpComputer (edict_t *ent)
{
	char	string[1024];
	char	*sk;

	if (skill->value == 0)
		sk = "easy";
	else if (skill->value == 1)
		sk = "medium";
	else if (skill->value == 2)
		sk = "hard";
	else
		sk = "hard+";

	// send the layout
	Com_sprintf (string, sizeof(string),
		"xv 32 yv 8 picn help "			// background
		"xv 202 yv 12 string2 \"%s\" "		// skill
		"xv 0 yv 24 cstring2 \"%s\" "		// level name
		"xv 0 yv 54 cstring2 \"%s\" "		// help 1
		"xv 0 yv 110 cstring2 \"%s\" "		// help 2
		"xv 50 yv 164 string2 \" kills     goals    secrets\" "
		"xv 50 yv 172 string2 \"%3i/%3i     %i/%i       %i/%i\" ", 
		sk,
		level.level_name,
		game.helpmessage1,
		game.helpmessage2,
		level.killed_monsters, level.total_monsters, 
		level.found_goals, level.total_goals,
		level.found_secrets, level.total_secrets);

	gi.WriteByte (svc_layout);
	gi.WriteString (string);
	gi.unicast (ent, true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, 0x8(%rsp)
movq 0x21727(%rip), %rax     # 0x66738
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4502c
jp 0x4502c
leaq 0x119e3(%rip), %rcx     # 0x56a0d
jmp 0x4505d
ucomiss 0x9ef5(%rip), %xmm0     # 0x4ef28
jne 0x45040
jp 0x45040
leaq 0x119d4(%rip), %rcx     # 0x56a12
jmp 0x4505d
ucomiss 0xa425(%rip), %xmm0     # 0x4f46c
leaq 0x119cb(%rip), %rax     # 0x56a19
leaq 0xd191(%rip), %rcx      # 0x521e6
cmovneq %rax, %rcx
cmovpq %rax, %rcx
movq 0x21d3c(%rip), %r8      # 0x66da0
movl 0x144(%r8), %r10d
movl 0x140(%r8), %r11d
movl 0x13c(%r8), %r12d
movl 0x138(%r8), %r13d
movl 0x130(%r8), %ebp
movl 0x134(%r8), %ebx
subq $0x8, %rsp
movq 0x21ca7(%rip), %r9      # 0x66d40
leaq 0x200(%r9), %r15
addq $0x8, %r8
leaq 0x11974(%rip), %rdx     # 0x56a1f
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
pushq %rbp
pushq %rbx
pushq %r13
pushq %r12
pushq %r11
pushq %r10
pushq %r15
callq 0x18f30
addq $0x40, %rsp
movq 0x2152a(%rip), %rbx     # 0x66600
pushq $0x4
popq %rdi
callq *0xc8(%rbx)
movq %r14, %rdi
callq *0xe8(%rbx)
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rdi
callq *0xb8(%rbx)
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: Cmd_Help_f
void Cmd_Help_f (edict_t *ent)
{
	// this is for backwards compatability
	if (deathmatch->value)
	{
		Cmd_Score_f (ent);
		return;
	}

	ent->client->showinventory = false;
	ent->client->showscores = false;
    ent->client->showctfhud = false;
    ent->client->showmod = false;
    ent->client->showmenu = false;
	ent->client->showsquadboard = false; // ADC

	if (ent->client->showhelp && (ent->client->pers.game_helpchanged == game.helpchanged))
	{
		ent->client->showhelp = false;
		return;
	}

	ent->client->showhelp = true;
	ent->client->pers.helpchanged = 0;
	HelpComputer (ent);
}

// Assembly:
movq 0x21db1(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x45121
jnp 0x45126
jmp 0x19680
movq 0x58(%rdi), %rax
andq $0x0, 0xe24(%rax)
andq $0x0, 0xf74(%rax)
andl $0x0, 0xf80(%rax)
andl $0x0, 0xe34(%rax)
xorl %ecx, %ecx
cmpl %ecx, 0xe2c(%rax)
je 0x4516f
movl 0x748(%rax), %ecx
movq 0x21be1(%rip), %rdx     # 0x66d40
cmpl 0x400(%rdx), %ecx
jne 0x4516f
andl $0x0, 0xe2c(%rax)
retq
movl $0x1, 0xe2c(%rax)
andl $0x0, 0x74c(%rax)
jmp 0x181c0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: G_CheckChaseStats
void G_CheckChaseStats (edict_t *ent)
{
	int i;
	gclient_t *cl;

	for (i = 1; i <= maxclients->value; i++) {
		cl = g_edicts[i].client;
		if (!g_edicts[i].inuse || cl->chase_target != ent)
			continue;
		memcpy(cl->ps.stats, ent->client->ps.stats, sizeof(cl->ps.stats));
		G_SetSpectatorStats(g_edicts + i);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20b34(%rip), %r14     # 0x66530
movq (%r14), %rax
movl $0x4a8, %r15d           # imm = 0x4A8
pushq $0x1
popq %rbp
movq 0x20b49(%rip), %r12     # 0x66558
cvtsi2ss %ebp, %xmm0
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jb 0x45a83
movq (%r12), %rdi
cmpl $0x0, 0x60(%rdi,%r15)
je 0x45a78
movq 0x58(%rdi,%r15), %rcx
cmpq %rbx, 0xf30(%rcx)
jne 0x45a78
addq %r15, %rdi
movq 0x58(%rbx), %rax
movups 0x78(%rax), %xmm0
movups 0x88(%rax), %xmm1
movups 0x98(%rax), %xmm2
movups 0xa8(%rax), %xmm3
movups %xmm3, 0xa8(%rcx)
movups %xmm2, 0x98(%rcx)
movups %xmm1, 0x88(%rcx)
movups %xmm0, 0x78(%rcx)
callq 0x19670
movq (%r14), %rax
addq $0x4a8, %r15            # imm = 0x4A8
incl %ebp
jmp 0x45a0f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: G_SetSpectatorStats
void G_SetSpectatorStats (edict_t *ent)
{
	gclient_t *cl = ent->client;

	if (!cl->chase_target)
		G_SetStats (ent);

	cl->ps.stats[STAT_SPECTATOR] = 1;

	// layouts are independant in spectator
	cl->ps.stats[STAT_LAYOUTS] = 0;
	//if (cl->pers.health <= 0 || level.intermissiontime || cl->showscores)
//	if (cl->pers.health <= 0 || level.intermissiontime || cl->showscores || cl->showmenu)
	
	//bat - I think that cl->pers.health is only supposed to be checked in deathmatch
	
	if(level.intermissiontime || cl->showscores || cl->showmenu)
		cl->ps.stats[STAT_LAYOUTS] |= 1;
	if (cl->showinventory && cl->pers.health > 0)
		cl->ps.stats[STAT_LAYOUTS] |= 2;

	if (cl->chase_target && cl->chase_target->inuse)
		cl->ps.stats[STAT_CHASE] = CS_PLAYERSKINS + 
			(cl->chase_target - g_edicts) - 1;
	else
		cl->ps.stats[STAT_CHASE] = 0;
}

// Assembly:
pushq %rbx
movq 0x58(%rdi), %rbx
cmpq $0x0, 0xf30(%rbx)
jne 0x45aa0
callq 0x199d0
movw $0x1, 0x9a(%rbx)
andw $0x0, 0x92(%rbx)
movq 0x212e8(%rip), %rax     # 0x66da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x45adc
jp 0x45adc
cmpl $0x0, 0xe24(%rbx)
jne 0x45adc
cmpl $0x0, 0xf80(%rbx)
je 0x45b3a
movw $0x1, 0x92(%rbx)
movw $0x3, %ax
cmpl $0x0, 0xe28(%rbx)
je 0x45b02
cmpl $0x0, 0x308(%rbx)
jle 0x45b02
movw %ax, 0x92(%rbx)
movq 0xf30(%rbx), %rax
testq %rax, %rax
je 0x45b2f
cmpl $0x0, 0x60(%rax)
je 0x45b2f
movq 0x20a3d(%rip), %rcx     # 0x66558
subq (%rcx), %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
addl $0x51f, %eax            # imm = 0x51F
jmp 0x45b31
xorl %eax, %eax
movw %ax, 0x98(%rbx)
popq %rbx
retq
movw $0x2, %ax
jmp 0x45ae9
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_trail.c
// Function: PlayerTrail_Init
void PlayerTrail_Init (void)
{
	int		n;

	if (deathmatch->value /* FIXME || coop */)
		return;

	for (n = 0; n < TRAIL_LENGTH; n++)
	{
		trail[n] = G_Spawn();
		trail[n]->classname = "player_trail";
	}

	trail_head = 0;
	trail_active = true;
}

// Assembly:
movq 0x21379(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x45b59
jnp 0x45b5a
retq
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x20f90(%rip), %r14     # 0x66af8
leaq 0x10fb8(%rip), %r15     # 0x56b27
cmpq $0x8, %rbx
je 0x45b8a
callq 0x198d0
movq %rax, (%r14,%rbx,8)
movq %r15, 0x138(%rax)
incq %rbx
jmp 0x45b6f
movq 0x21447(%rip), %rax     # 0x66fd8
andl $0x0, (%rax)
movq 0x21245(%rip), %rax     # 0x66de0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_trail.c
// Function: PlayerTrail_Add
void PlayerTrail_Add (vec3_t spot)
{
	vec3_t	temp;

	if (!trail_active)
		return;

	VectorCopy (spot, trail[trail_head]->s.origin);

	trail[trail_head]->timestamp = level.time;

	VectorSubtract (spot, trail[PREV(trail_head)]->s.origin, temp);
	trail[trail_head]->s.angles[1] = vectoyaw (temp);

	trail_head = NEXT(trail_head);
}

// Assembly:
movq 0x21232(%rip), %rax     # 0x66de0
cmpl $0x0, (%rax)
je 0x45c52
pushq %r14
pushq %rbx
subq $0x18, %rsp
movss (%rdi), %xmm0
movq 0x2140f(%rip), %rbx     # 0x66fd8
movslq (%rbx), %rax
movq 0x20f25(%rip), %r14     # 0x66af8
movq (%r14,%rax,8), %rcx
movss %xmm0, 0x4(%rcx)
movss 0x4(%rdi), %xmm0
movss %xmm0, 0x8(%rcx)
movss 0x8(%rdi), %xmm0
movss %xmm0, 0xc(%rcx)
movq 0x211a9(%rip), %rdx     # 0x66da0
movss 0x4(%rdx), %xmm0
movss %xmm0, 0x144(%rcx)
decl %eax
andl $0x7, %eax
movq (%r14,%rax,8), %rcx
movsd (%rdi), %xmm0
movsd 0x4(%rcx), %xmm1
subps %xmm1, %xmm0
leaq 0x8(%rsp), %rax
movlps %xmm0, (%rax)
movss 0x8(%rdi), %xmm0
subss 0xc(%rcx), %xmm0
movss %xmm0, 0x8(%rax)
movq %rax, %rdi
callq 0x18070
movslq (%rbx), %rax
movq (%r14,%rax,8), %rcx
movss %xmm0, 0x14(%rcx)
incl %eax
andl $0x7, %eax
movl %eax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_trail.c
// Function: PlayerTrail_PickNext
edict_t *PlayerTrail_PickNext (edict_t *self)
{
	int		marker;
	int		n;

	if (!trail_active)
		return NULL;

	for (marker = trail_head, n = TRAIL_LENGTH; n; n--)
	{
		if(trail[marker]->timestamp <= self->monsterinfo.trail_time)
			marker = NEXT(marker);
		else
			break;
	}

	return trail[marker];
}

// Assembly:
movq 0x21120(%rip), %rax     # 0x66de0
cmpl $0x0, (%rax)
je 0x45cfd
movq 0x2130c(%rip), %rax     # 0x66fd8
movl (%rax), %ecx
movss 0x438(%rdi), %xmm0
pushq $-0x8
popq %rdx
movq 0x20e18(%rip), %rsi     # 0x66af8
movslq %ecx, %rax
movq (%rsi,%rax,8), %rax
testl %edx, %edx
je 0x45cff
ucomiss 0x144(%rax), %xmm0
jb 0x45cff
incl %ecx
andl $0x7, %ecx
incl %edx
jmp 0x45ce0
xorl %eax, %eax
retq