LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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
leaq 0xf701(%rip), %rdx      # 0x53542
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x43f34
movq %rax, %rbx
movss 0x1592c(%rip), %xmm0    # 0x59790
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
xorl %r15d, %r15d
leaq 0xf6ce(%rip), %r14      # 0x53542
movss %xmm0, 0x4(%rsp)
xorl %r12d, %r12d
movss %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x19410
movaps %xmm0, %xmm1
movss 0x4(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x43ea3
movq %rbx, %r12
movss %xmm1, 0x4(%rsp)
jmp 0x43ebc
movss (%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x43eb7
movq %rbx, %r15
movss %xmm1, (%rsp)
jmp 0x43ebc
movss %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
incl %r13d
movss (%rsp), %xmm0
testq %rax, %rax
jne 0x43e7d
leal 0x1(%r13), %eax
leal 0x2(%r13), %ebx
xorl %r14d, %r14d
cmpl $0x2, %eax
cmovbq %r14, %r12
cmovbq %r14, %r15
cmovael %r13d, %ebx
callq 0x19a10
cltd
idivl %ebx
movl %edx, %ebp
leaq 0xf63b(%rip), %rbx      # 0x53542
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
movq %rax, %r14
cmpq %r12, %rax
sete %al
cmpq %r15, %r14
sete %cl
orb %al, %cl
movzbl %cl, %eax
addl %ebp, %eax
subl $0x1, %eax
movl %eax, %ebp
jae 0x43f07
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
leaq 0xf5ec(%rip), %rdx      # 0x53542
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x43fcb
movq %rax, %r14
xorps %xmm0, %xmm0
xorl %ebx, %ebx
leaq 0xf5cc(%rip), %r15      # 0x53542
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
callq 0x19410
movss 0xc(%rsp), %xmm1
ucomiss %xmm1, %xmm0
cmovaq %r14, %rbx
maxss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdx
callq 0x19430
movq %rax, %r14
movss 0xc(%rsp), %xmm0
testq %rax, %rax
jne 0x43f76
testq %rbx, %rbx
je 0x43fcb
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xf570(%rip), %rdx      # 0x53542
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x19430
// File: /workspace/github_c_makefile_star2_O3/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 0x10fad(%rip), %rax     # 0x54faf
leaq 0x10fb6(%rip), %rbx     # 0x54fbf
cmoveq %rax, %rbx
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
testq %rax, %rax
je 0x4407f
movq %rax, %r15
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movss %xmm0, 0xc(%rsp)
movq %r15, %rdi
callq 0x19410
movss 0xc(%rsp), %xmm1
ucomiss %xmm1, %xmm0
cmovaq %r15, %r14
maxss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movq %r15, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
movq %rax, %r15
movss 0xc(%rsp), %xmm0
testq %rax, %rax
jne 0x4402a
testq %r14, %r14
je 0x4407f
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 0x19430
// File: /workspace/github_c_makefile_star2_O3/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 0x24573(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0x9, %eax
jb 0x440ba
callq 0x18f00
jmp 0x440bf
callq 0x18110
movq %rax, %rbx
testq %rax, %rax
je 0x440fc
movq %rbx, %rdi
callq 0x19410
movss %xmm0, 0x4(%rsp)
movq %r14, %rdi
callq 0x192f0
testq %rax, %rax
je 0x440fe
movq %rax, %r14
movq %rax, %rdi
callq 0x19410
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
cmovbeq %r14, %rbx
jmp 0x440fe
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x58(%rdi), %rax
movq 0x24c06(%rip), %rcx     # 0x68d40
subq 0x408(%rcx), %rax
shrq $0x6, %rax
imull $0x4f4fc08d, %eax, %ebp # imm = 0x4F4FC08D
testl %ebp, %ebp
je 0x441bd
leaq 0x1401e(%rip), %rdx     # 0x58174
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x441bf
leaq 0xfdd5(%rip), %r12      # 0x53f45
movl $0x410, %r14d           # imm = 0x410
addq 0x24bc3(%rip), %r14     # 0x68d40
leaq 0x13ff0(%rip), %r15     # 0x58174
movq %rax, %rbx
movq 0x158(%rbx), %rsi
testq %rsi, %rsi
cmoveq %r12, %rsi
movq %r14, %rdi
callq 0x18690
testl %eax, %eax
jne 0x441a5
decl %ebp
je 0x441bf
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdx
callq 0x19430
movq %rax, %rbx
testq %rax, %rax
jne 0x44187
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x24a08(%rip), %rax     # 0x68da0
movl $0x0, 0x150(%rax)
movl $0x8, %ebx
leaq 0x11885(%rip), %r14     # 0x55c33
callq 0x19700
movq %r14, 0x138(%rax)
decl %ebx
jne 0x443ae
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x44460
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdi, %rbx
movq 0x2421a(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
leaq 0x13369(%rip), %rdi     # 0x5775a
callq *0x48(%rax)
movl $0x4, %r15d
movss 0xeb26(%rip), %xmm0     # 0x52f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x4, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
leaq 0x1334e(%rip), %r14     # 0x5776a
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x188e0
decl %r15d
jne 0x4441c
movss 0xc(%rbx), %xmm0
addss 0x1535b(%rip), %xmm0    # 0x59798
movss %xmm0, 0xc(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x18db0
movl $0x0, 0x27c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x240e2(%rip), %r13     # 0x68558
movq (%r13), %r15
movq 0x240af(%rip), %rax     # 0x68530
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movq 0x24910(%rip), %rcx     # 0x68da0
movl 0x150(%rcx), %edx
addl %edx, %eax
cltq
imulq $0x4a8, %rax, %r12      # imm = 0x4A8
leaq 0x4a8(%r15), %r14
addq %r12, %r14
leal 0x1(%rdx), %eax
leal 0x8(%rdx), %esi
testl %eax, %eax
cmovnsl %eax, %esi
andl $-0x8, %esi
negl %esi
leal (%rdx,%rsi), %eax
incl %eax
movl %eax, 0x150(%rcx)
movq 0x24133(%rip), %rbp     # 0x68600
callq *0x98(%rbp)
movq %r14, %rdi
callq *0x98(%rbp)
movl $0xa, %ecx
movq %r14, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x50(%rbx), %eax
movl %eax, 0x4f8(%r15,%r12)
movq %r14, %rax
subq (%r13), %rax
shrq $0x3, %rax
imull $0x8ce2cabd, %eax, %eax # imm = 0x8CE2CABD
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 0x23e5b(%rip), %rax     # 0x684b8
movq %rax, 0x6e0(%r15,%r12)
movl $0x1, 0x724(%r15,%r12)
movq %r14, %rdi
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x24142(%rip), %rax     # 0x687d8
cmpl $0x6, (%rax)
jne 0x446bf
movl $0x1, 0x118(%rbx)
xorl %eax, %eax
movl %eax, 0x108(%rbx)
orb $0x1, 0xc8(%rbx)
movl %eax, 0x254(%rbx)
jmp 0x44762
movq 0x247fa(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x446ee
jp 0x446ee
movq 0x24881(%rip), %rax     # 0x68f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x446ee
jnp 0x44764
cmpl $0x1, 0x118(%rbx)
je 0x446ff
movq %rbx, %rdi
callq 0x18d30
andb $-0x2, 0xc8(%rbx)
movq %rbx, %rdi
callq 0x18960
movq %rbx, %rdi
callq 0x18a20
movl $0x6, 0x50(%rbx)
movq 0x58(%rbx), %rax
movw $0xe20, 0x10(%rax)      # imm = 0xE20
movq 0x24672(%rip), %rcx     # 0x68da0
movss 0x4(%rcx), %xmm0
movss %xmm0, 0xf28(%rax)
movups 0x1515e(%rip), %xmm0    # 0x598a0
movups %xmm0, 0x2e0(%rax)
movups 0x15160(%rip), %xmm0    # 0x598b0
movups %xmm0, 0x2f0(%rax)
movq 0x58(%rbx), %rax
movb $0x0, 0x2ff(%rax)
popq %rbx
retq
movq 0x23e95(%rip), %rax     # 0x68600
leaq 0x15c19(%rip), %rdi     # 0x5a38b
popq %rbx
jmpq *0x150(%rax)
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %edi, %edi
movq %rbx, %rsi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
callq 0x19170
testq %rax, %rax
je 0x452bf
xorl %ebp, %ebp
movq 0x58(%rax), %rcx
movl 0x1100(%rcx), %ecx
cmpl $0x2, %ecx
je 0x452a2
cmpl $0x1, %ecx
jne 0x452a5
incl %ebp
jmp 0x452a5
incl %r14d
movq %rax, %rdi
movq %rbx, %rsi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
callq 0x19170
testq %rax, %rax
jne 0x4528a
cmpl %r14d, %ebp
jne 0x452d1
movq 0x23912(%rip), %rax     # 0x68bd8
movl (%rax), %eax
movq 0x23779(%rip), %rcx     # 0x68a48
cmpl (%rcx), %eax
setg %al
movzbl %al, %eax
incl %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x18de0
testl %eax, %eax
je 0x453ba
movl $0xc0, %r15d
movq 0x58(%rbx), %rdi
addq %r15, %rdi
leaq 0xd031(%rip), %rsi      # 0x52340
callq 0x18bb0
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19490
testl %eax, %eax
jne 0x45343
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19490
movq %r12, %r14
testl %eax, %eax
jne 0x45343
movq %rbx, %rdi
callq 0x18760
movq %rax, %r14
movq 0x2320e(%rip), %rax     # 0x68558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %ebp # imm = 0x8CE2CABD
movq 0x2329f(%rip), %rax     # 0x68600
movq 0x30(%rax), %r12
addl $0x51f, %ebp            # imm = 0x51F
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
leaq 0x15e32(%rip), %rdi     # 0x5b1ad
movq %r14, %rdx
xorl %eax, %eax
callq 0x19340
movl %ebp, %edi
movq %rax, %rsi
callq *%r12
addq 0x58(%rbx), %r15
leaq 0xcfa8(%rip), %rsi      # 0x52340
movq %r15, %rdi
movq %r14, %rdx
callq 0x18560
movq 0x58(%rbx), %rax
movl $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 0x19220
// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
jle 0x460bc
movl %esi, %ecx
xorl %edx, %edx
xorl %eax, %eax
movzbl (%rdi,%rdx), %esi
addl %esi, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x460ad
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: PrintPmove
void PrintPmove (pmove_t *pm)
{
	unsigned	c1, c2;

	c1 = CheckBlock (&pm->s, sizeof(pm->s));
	c2 = CheckBlock (&pm->cmd, sizeof(pm->cmd));
	Com_Printf ("sv %3i:%i %i\n", pm->cmd.impulse, c1, c2);
}

// Assembly:
pxor %xmm1, %xmm1
xorl %eax, %eax
pxor %xmm0, %xmm0
movd (%rdi,%rax), %xmm2
punpcklbw %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
punpcklwd %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
paddd %xmm2, %xmm0
addq $0x4, %rax
cmpq $0x1c, %rax
jne 0x460c9
pxor %xmm2, %xmm2
xorl %eax, %eax
pxor %xmm1, %xmm1
movd 0x1c(%rdi,%rax), %xmm3
punpcklbw %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3],xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
punpcklwd %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3]
paddd %xmm3, %xmm1
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x460ee
pshufd $0xee, %xmm0, %xmm2     # xmm2 = xmm0[2,3,2,3]
paddd %xmm0, %xmm2
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
paddd %xmm2, %xmm0
movd %xmm0, %edx
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %ecx
movzbl 0x2a(%rdi), %esi
leaq 0x1445b(%rip), %rdi     # 0x5a59c
xorl %eax, %eax
jmp 0x18f20
// File: /workspace/github_c_makefile_star2_O3/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 0x469db
cmpl $0x0, 0x1114(%rax)
je 0x46ad7
movq 0x2235e(%rip), %rax     # 0x68d40
cmpl $0x0, 0x610(%rax)
jle 0x46ad7
movl $0x500, %r13d           # imm = 0x500
movq 0x21b5c(%rip), %rbp     # 0x68558
movq 0x2233d(%rip), %r14     # 0x68d40
xorl %r12d, %r12d
movq (%rbp), %r15
cmpl $0x0, 0x8(%r15,%r13)
je 0x46abd
movq (%r15,%r13), %rdx
testq %rdx, %rdx
je 0x46abd
cmpl $0x0, 0x1100(%rdx)
js 0x46abd
movq 0x58(%rbx), %rax
movl 0x1110(%rax), %r8d
testl %r8d, %r8d
je 0x46a77
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jge 0x46a77
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %rdi
leaq 0x13b4e(%rip), %rsi     # 0x5a5aa
xorl %eax, %eax
callq 0x196f0
movl $0x2, %esi
movq %rbx, %rdi
movq %rsp, %rdx
callq 0x18da0
movq 0x58(%rbx), %rax
movl 0x1114(%rax), %r8d
testl %r8d, %r8d
je 0x46abd
movq (%r15,%r13), %rdx
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jle 0x46abd
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %r15
movq %r15, %rdi
leaq 0x13b2e(%rip), %rsi     # 0x5a5d4
xorl %eax, %eax
callq 0x196f0
movl $0x2, %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x18da0
movslq 0x610(%r14), %rax
incq %r12
addq $0x4a8, %r13            # imm = 0x4A8
cmpq %rax, %r12
jl 0x46a06
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %edi, %edi
movq %r14, %rsi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
callq 0x19170
movl $0x0, %ebp
testq %rax, %rax
je 0x470ec
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x58(%rax), %rcx
movl 0x1100(%rcx), %ecx
cmpl $0x2, %ecx
je 0x470d5
cmpl $0x1, %ecx
jne 0x470d7
incl %r15d
jmp 0x470d7
incl %ebp
movq %rax, %rdi
movq %r14, %rsi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
callq 0x19170
testq %rax, %rax
jne 0x470bc
cmpl $0x2, %ebx
je 0x470fb
movl %r15d, %ebp
cmpl $0x1, %ebx
je 0x470fb
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x21dad(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x4713f
jp 0x4713f
movq 0x21e34(%rip), %rcx     # 0x68f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x4713f
jnp 0x47253
movq 0x58(%rbx), %rcx
movl $0x1, 0xe24(%rcx)
movq 0x21c4c(%rip), %rdx     # 0x68da0
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 0x10256(%rip), %xmm1    # 0x573e0
cvttps2dq %xmm1, %xmm1
pshuflw $0xe8, %xmm1, %xmm1     # xmm1 = xmm1[0,2,2,3,4,5,6,7]
mulss 0xbd61(%rip), %xmm0     # 0x52efc
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)
xorl %edx, %edx
movl %edx, 0x58(%rcx)
movl %edx, 0x6c(%rcx)
andb $-0x2, 0x74(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0xf04(%rcx)
movq %rdx, 0xf14(%rcx)
movl %edx, 0x278(%rbx)
movl %edx, 0x40(%rbx)
movl %edx, 0x4c(%rbx)
movl %edx, 0x108(%rbx)
movq %rdx, 0x28(%rbx)
movl %edx, 0x30(%rbx)
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x47230
jp 0x47230
movq 0x21d3f(%rip), %rax     # 0x68f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x47230
jnp 0x4725c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18b10
movq 0x213bf(%rip), %rax     # 0x68600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
movq 0x58(%rbx), %rcx
jmp 0x4714d
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
xorl %ecx, %ecx
movq %rcx, 0xe28(%rax)
movq %rcx, 0xf74(%rax)
movl %ecx, 0xf80(%rax)
movl %ecx, 0xe34(%rax)
movq 0x20235(%rip), %rcx     # 0x68ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x48cb3
jp 0x48cb3
movq 0x202bc(%rip), %rcx     # 0x68f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x48cb3
jnp 0x48cc6
cmpl $0x0, 0xe24(%rax)
je 0x48cc8
movl $0x0, 0xe24(%rax)
popq %rbx
retq
movl $0x1, 0xe24(%rax)
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x18b10
movq 0x1f918(%rip), %rax     # 0x68600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
xorl %ecx, %ecx
movl %ecx, 0xe2c(%rax)
movq %rcx, 0xf74(%rax)
movl %ecx, 0xf80(%rax)
movq %rcx, 0xe24(%rax)
movq 0x2019b(%rip), %rcx     # 0x68ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x48d4d
jp 0x48d4d
movq 0x20222(%rip), %rcx     # 0x68f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x48d4d
jnp 0x48d60
cmpl $0x0, 0xe34(%rax)
je 0x48d62
movl $0x0, 0xe34(%rax)
popq %rbx
retq
movl $0x1, 0xe34(%rax)
movq %rbx, %rdi
callq 0x18270
movq 0x1f885(%rip), %rax     # 0x68600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/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 0x1f98e(%rip), %rax     # 0x68738
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x48dc5
jp 0x48dc5
leaq 0x11c5a(%rip), %rcx     # 0x5aa1d
jmp 0x48df6
ucomiss 0xa15c(%rip), %xmm0     # 0x52f28
jne 0x48dd9
jp 0x48dd9
leaq 0x11c4b(%rip), %rcx     # 0x5aa22
jmp 0x48df6
ucomiss 0xa68c(%rip), %xmm0     # 0x5346c
leaq 0x11c42(%rip), %rax     # 0x5aa29
leaq 0xd418(%rip), %rcx      # 0x56206
cmovneq %rax, %rcx
cmovpq %rax, %rcx
movq 0x1ffa3(%rip), %r8      # 0x68da0
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 0x1ff0e(%rip), %r9      # 0x68d40
leaq 0x200(%r9), %r15
addq $0x8, %r8
leaq 0x11beb(%rip), %rdx     # 0x5aa2f
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 0x18e10
addq $0x40, %rsp
movq 0x1f791(%rip), %rbx     # 0x68600
movl $0x4, %edi
callq *0xc8(%rbx)
movq %r14, %rdi
callq *0xe8(%rbx)
movq 0x8(%rsp), %rdi
movl $0x1, %esi
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_O3/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 0x20014(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x48ebe
jnp 0x48ec3
jmp 0x194d0
movq 0x58(%rdi), %rax
xorl %ecx, %ecx
movq %rcx, 0xe24(%rax)
movq %rcx, 0xf74(%rax)
movl %ecx, 0xf80(%rax)
movl %ecx, 0xe34(%rax)
cmpl %ecx, 0xe2c(%rax)
je 0x48f0b
movl 0x748(%rax), %ecx
movq 0x1fe48(%rip), %rdx     # 0x68d40
cmpl 0x400(%rdx), %ecx
jne 0x48f0b
movl $0x0, 0xe2c(%rax)
retq
movl $0x1, 0xe2c(%rax)
movl $0x0, 0x74c(%rax)
jmp 0x181a0
// File: /workspace/github_c_makefile_star2_O3/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 0x1ed6b(%rip), %r14     # 0x68530
movq (%r14), %rax
movss 0x20(%rax), %xmm0
ucomiss 0x9754(%rip), %xmm0     # 0x52f28
jb 0x49866
movq %rdi, %rbx
movq 0x1ed74(%rip), %r15     # 0x68558
movq (%r15), %rdi
movl $0x4a8, %r12d           # imm = 0x4A8
movl $0x2, %ebp
cmpl $0x0, 0x60(%rdi,%r12)
je 0x4984c
movq 0x58(%rdi,%r12), %rcx
cmpq %rbx, 0xf30(%rcx)
jne 0x4984c
addq %r12, %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 0x194c0
movq (%r15), %rdi
movq (%r14), %rax
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movss 0x20(%rax), %xmm1
addq $0x4a8, %r12            # imm = 0x4A8
incl %ebp
ucomiss %xmm0, %xmm1
jae 0x497f2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x49883
callq 0x197f0
movw $0x1, 0x9a(%rbx)
movw $0x0, 0x92(%rbx)
movq 0x1f504(%rip), %rax     # 0x68da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x498c0
jp 0x498c0
cmpl $0x0, 0xe24(%rbx)
jne 0x498c0
cmpl $0x0, 0xf80(%rbx)
je 0x4991c
movw $0x1, 0x92(%rbx)
movw $0x3, %ax
cmpl $0x0, 0xe28(%rbx)
je 0x498e6
cmpl $0x0, 0x308(%rbx)
jle 0x498e6
movw %ax, 0x92(%rbx)
movq 0xf30(%rbx), %rax
testq %rax, %rax
je 0x49911
cmpl $0x0, 0x60(%rax)
je 0x49911
movq 0x1ec59(%rip), %rcx     # 0x68558
subl (%rcx), %eax
shrl $0x3, %eax
imull $0xffffcabd, %eax, %eax # imm = 0xFFFFCABD
addl $0x51f, %eax            # imm = 0x51F
jmp 0x49913
xorl %eax, %eax
movw %ax, 0x98(%rbx)
popq %rbx
retq
movw $0x2, %ax
jmp 0x498cd
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x1f595(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4993d
jnp 0x4993e
retq
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x1f1ac(%rip), %r14     # 0x68af8
leaq 0x111e4(%rip), %r15     # 0x5ab37
callq 0x19700
movq %rax, (%r14,%rbx,8)
movq %r15, 0x138(%rax)
incq %rbx
cmpq $0x8, %rbx
jne 0x49953
movq 0x1f665(%rip), %rax     # 0x68fd8
movl $0x0, (%rax)
movq 0x1f460(%rip), %rax     # 0x68de0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1f44d(%rip), %rax     # 0x68de0
cmpl $0x0, (%rax)
je 0x49a37
pushq %r14
pushq %rbx
subq $0x18, %rsp
movss (%rdi), %xmm0
movq 0x1f62a(%rip), %rbx     # 0x68fd8
movslq (%rbx), %rax
movq 0x1f140(%rip), %r14     # 0x68af8
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 0x1f3c4(%rip), %rdx     # 0x68da0
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_O3/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 0x1f336(%rip), %rax     # 0x68de0
cmpl $0x0, (%rax)
je 0x49aec
movq 0x1f522(%rip), %rax     # 0x68fd8
movl (%rax), %ecx
movss 0x438(%rdi), %xmm0
movl $0xfffffff8, %esi       # imm = 0xFFFFFFF8
movq 0x1f02c(%rip), %rdx     # 0x68af8
movslq %ecx, %rax
movq (%rdx,%rax,8), %rax
ucomiss 0x144(%rax), %xmm0
jb 0x49aeb
incl %ecx
andl $0x7, %ecx
incl %esi
jne 0x49acc
movl %ecx, %eax
movq (%rdx,%rax,8), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: SV_CalcRoll
float SV_CalcRoll (vec3_t angles, vec3_t velocity)
{
	float	sign;
	float	side;
	float	value;
	
	side = DotProduct (velocity, right);
	sign = side < 0 ? -1 : 1;
	side = fabs(side);
	
	value = sv_rollangle->value;

	if (side < sv_rollspeed->value)
		side = side * value / sv_rollspeed->value;
	else
		side = value;
	
	return side*sign;
	
}

// Assembly:
movss 0x4(%rsi), %xmm0
mulss 0x4f533(%rip), %xmm0    # 0x9904c
movss (%rsi), %xmm1
mulss 0x4f523(%rip), %xmm1    # 0x99048
addss %xmm0, %xmm1
movss 0x8(%rsi), %xmm0
mulss 0x4f51a(%rip), %xmm0    # 0x99050
addss %xmm1, %xmm0
movaps 0x93ff(%rip), %xmm1     # 0x52f40
andps %xmm0, %xmm1
movq 0x1effd(%rip), %rax     # 0x68b48
movq (%rax), %rax
movss 0x20(%rax), %xmm2
movq 0x1f25e(%rip), %rax     # 0x68db8
movq (%rax), %rax
movss 0x20(%rax), %xmm3
movaps %xmm1, %xmm4
mulss %xmm2, %xmm4
divss %xmm3, %xmm4
cmpltss %xmm3, %xmm1
andps %xmm1, %xmm4
andnps %xmm2, %xmm1
orps %xmm4, %xmm1
movaps 0xc14e(%rip), %xmm2     # 0x55cd0
xorps %xmm1, %xmm2
xorps %xmm3, %xmm3
cmpltss %xmm3, %xmm0
movaps %xmm0, %xmm3
andnps %xmm1, %xmm3
andps %xmm2, %xmm0
orps %xmm3, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: SV_AddBlend
void SV_AddBlend (float r, float g, float b, float a, float *v_blend)
{
	float	a2, a3;

	if (a <= 0)
		return;
	a2 = v_blend[3] + (1-v_blend[3])*a;	// new total alpha
	a3 = v_blend[3]/a2;		// fraction of color from old

	v_blend[0] = v_blend[0]*a3 + r*(1-a3);
	v_blend[1] = v_blend[1]*a3 + g*(1-a3);
	v_blend[2] = v_blend[2]*a3 + b*(1-a3);
	v_blend[3] = a2;
}

// Assembly:
xorps %xmm4, %xmm4
ucomiss %xmm3, %xmm4
jae 0x4a59f
movss 0xc(%rdi), %xmm4
movss 0x89d6(%rip), %xmm5     # 0x52f28
movaps %xmm5, %xmm6
subss %xmm4, %xmm6
mulss %xmm3, %xmm6
addss %xmm4, %xmm6
divss %xmm6, %xmm4
subss %xmm4, %xmm5
movsd (%rdi), %xmm3
movaps %xmm5, %xmm7
unpcklps %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
mulps %xmm7, %xmm0
movaps %xmm4, %xmm1
unpcklps %xmm4, %xmm1            # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
mulps %xmm3, %xmm1
addps %xmm0, %xmm1
movlps %xmm1, (%rdi)
mulss 0x8(%rdi), %xmm4
mulss %xmm2, %xmm5
addss %xmm5, %xmm4
movss %xmm4, 0x8(%rdi)
movss %xmm6, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: G_SetClientEvent
void G_SetClientEvent (edict_t *ent)
{
	if (ent->s.event)
		return;

	if ( ent->groundentity && xyspeed > 225)
	{
		if ( (int)(current_client->bobtime+bobmove) != bobcycle )
			ent->s.event = EV_FOOTSTEP;
	}
}

// Assembly:
cmpl $0x0, 0x50(%rdi)
je 0x4b445
retq
cmpq $0x0, 0x2b8(%rdi)
je 0x4b444
movq 0x1daf2(%rip), %rax     # 0x68f48
movss (%rax), %xmm0
ucomiss 0xf7bb(%rip), %xmm0     # 0x5ac1c
jbe 0x4b444
movq 0x4dc1e(%rip), %rax     # 0x99088
movss 0xec8(%rax), %xmm0
movq 0x1d9cf(%rip), %rax     # 0x68e48
addss (%rax), %xmm0
cvttss2si %xmm0, %eax
movq 0x1d708(%rip), %rcx     # 0x68b90
cmpl %eax, (%rcx)
je 0x4b444
movl $0x2, 0x50(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: G_SetClientSound
void G_SetClientSound (edict_t *ent)
{
	char	*weap;

	if (ent->client->pers.game_helpchanged != game.helpchanged)
	{
		ent->client->pers.game_helpchanged = game.helpchanged;
		ent->client->pers.helpchanged = 1;
	}

	// help beep (no more than three times)
	if (ent->client->pers.helpchanged && ent->client->pers.helpchanged <= 3 && !(level.framenum&63) )
	{
		ent->client->pers.helpchanged++;
		gi.sound (ent, CHAN_VOICE, gi.soundindex ("misc/pc_up.wav"), 1, ATTN_STATIC, 0);
	}


	if (ent->client->pers.weapon)
		weap = ent->client->pers.weapon->classname;
	else
		weap = "";

	if (ent->waterlevel && (ent->watertype&(CONTENTS_LAVA|CONTENTS_SLIME)) )
		ent->s.sound = snd_fry;
	else if (strcmp(weap, "weapon_railgun") == 0)
		ent->s.sound = gi.soundindex("weapons/rg_hum.wav");
	else if (strcmp(weap, "weapon_bfg") == 0)
		ent->s.sound = gi.soundindex("weapons/bfg_hum.wav");
// SKWiD MOD
	else if (strcmp(weap, "weapon_plasma") == 0)
		ent->s.sound = gi.soundindex(PLASMA_SOUND_IDLE);
// END
	else if (ent->client->weapon_sound)
		ent->s.sound = ent->client->weapon_sound;
	else
		ent->s.sound = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %r15
movq 0x1d899(%rip), %rax     # 0x68d40
movl 0x400(%rax), %eax
cmpl %eax, 0x748(%r15)
jne 0x4b4bf
movl 0x74c(%r15), %eax
jmp 0x4b4d6
movl %eax, 0x748(%r15)
movl $0x1, 0x74c(%r15)
movl $0x1, %eax
testl %eax, %eax
sete %cl
cmpl $0x4, %eax
setge %dl
orb %cl, %dl
jne 0x4b533
movq 0x1d8b4(%rip), %rcx     # 0x68da0
testb $0x3f, (%rcx)
jne 0x4b533
incl %eax
movl %eax, 0x74c(%r15)
movq 0x1d0ff(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
leaq 0xd655(%rip), %rdi      # 0x58b61
callq *0x48(%rax)
movss 0x7a11(%rip), %xmm0     # 0x52f28
movss 0x79f1(%rip), %xmm1     # 0x52f10
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
callq *%r14
movq 0x58(%rbx), %r15
movq 0x730(%r15), %rax
testq %rax, %rax
je 0x4b544
movq (%rax), %r14
jmp 0x4b54b
leaq 0x89fa(%rip), %r14      # 0x53f45
cmpl $0x0, 0x30c(%rbx)
je 0x4b568
testb $0x18, 0x308(%rbx)
je 0x4b568
movq 0x1cf9c(%rip), %rax     # 0x68500
movl (%rax), %eax
jmp 0x4b5e6
leaq 0x7a58(%rip), %rsi      # 0x52fc7
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4b5b5
leaq 0x7a3a(%rip), %rsi      # 0x52fbc
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4b5c5
leaq 0xab76(%rip), %rsi      # 0x5610b
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4b5d5
movl 0xf20(%r15), %eax
testl %eax, %eax
jne 0x4b5e6
movl $0x0, 0x4c(%rbx)
jmp 0x4b5e9
movq 0x1d044(%rip), %rax     # 0x68600
leaq 0xb330(%rip), %rdi      # 0x568f3
jmp 0x4b5e3
movq 0x1d034(%rip), %rax     # 0x68600
leaq 0xb3f4(%rip), %rdi      # 0x569c7
jmp 0x4b5e3
movq 0x1d024(%rip), %rax     # 0x68600
leaq 0xf6d0(%rip), %rdi      # 0x5acb3
callq *0x48(%rax)
movl %eax, 0x4c(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: Client_Show_High_Scores
void Client_Show_High_Scores(edict_t *ent)
{
 char	string[5000];

	strcpy(string, "I am the big dawg");

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1390, %rsp           # imm = 0x1390
movq %rdi, %rbx
movups 0xeb6b(%rip), %xmm0     # 0x5accb
movq %rsp, %r14
movaps %xmm0, (%r14)
movw $0x67, 0x10(%r14)
movq 0x1c48b(%rip), %r15     # 0x68600
movl $0x4, %edi
callq *0xc8(%r15)
movq %r14, %rdi
callq *0xe8(%r15)
movq %rbx, %rdi
xorl %esi, %esi
callq *0xb8(%r15)
addq $0x1390, %rsp           # imm = 0x1390
popq %rbx
popq %r14
popq %r15
retq