LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x45f68
movl $0xc0, %r15d
movq 0x58(%rbx), %rdi
addq %r15, %rdi
leaq 0xd483(%rip), %rsi      # 0x53340
callq 0x18bb0
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19490
testl %eax, %eax
jne 0x45ef1
movq %rbx, %rdi
movq %r12, %rsi
callq 0x19490
movq %r12, %r14
testl %eax, %eax
jne 0x45ef1
movq %rbx, %rdi
callq 0x18760
movq %rax, %r14
movq 0x23660(%rip), %rax     # 0x69558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %ebp # imm = 0x8CE2CABD
movq 0x236f1(%rip), %rax     # 0x69600
movq 0x30(%rax), %r12
addl $0x51f, %ebp            # imm = 0x51F
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
leaq 0x15f14(%rip), %rdi     # 0x5be3d
movq %r14, %rdx
xorl %eax, %eax
callq 0x19340
movl %ebp, %edi
movq %rax, %rsi
callq *%r12
addq 0x58(%rbx), %r15
leaq 0xd3fa(%rip), %rsi      # 0x53340
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_O1/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 0x46c76
movl %esi, %ecx
xorl %edx, %edx
xorl %eax, %eax
movzbl (%rdi,%rdx), %esi
addl %esi, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x46c67
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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:
xorl %eax, %eax
xorl %edx, %edx
movzbl (%rdi,%rax), %ecx
addl %ecx, %edx
incq %rax
cmpq $0x1c, %rax
jne 0x46c7d
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0x1c(%rdi,%rax), %esi
addl %esi, %ecx
incq %rax
cmpq $0x10, %rax
jne 0x46c90
movzbl 0x2a(%rdi), %esi
leaq 0x14631(%rip), %rdi     # 0x5b2dc
xorl %eax, %eax
jmp 0x18f20
// File: /workspace/github_c_makefile_star2_O1/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 0x475dc
cmpl $0x0, 0x1114(%rax)
je 0x476d8
movq 0x2275d(%rip), %rax     # 0x69d40
cmpl $0x0, 0x610(%rax)
jle 0x476d8
movl $0x500, %r13d           # imm = 0x500
movq 0x21f5b(%rip), %rbp     # 0x69558
movq 0x2273c(%rip), %r14     # 0x69d40
xorl %r12d, %r12d
movq (%rbp), %r15
cmpl $0x0, 0x8(%r15,%r13)
je 0x476be
movq (%r15,%r13), %rdx
testq %rdx, %rdx
je 0x476be
cmpl $0x0, 0x1100(%rdx)
js 0x476be
movq 0x58(%rbx), %rax
movl 0x1110(%rax), %r8d
testl %r8d, %r8d
je 0x47674
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jge 0x47674
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %rdi
leaq 0x13c8d(%rip), %rsi     # 0x5b2ea
xorl %eax, %eax
callq 0x19700
movl $0x2, %esi
movq %rbx, %rdi
movq %rsp, %rdx
callq 0x18da0
movq 0x58(%rbx), %rax
movl 0x1114(%rax), %r8d
testl %r8d, %r8d
je 0x476be
movq (%r15,%r13), %rdx
movl 0xb8(%rdx), %ecx
cmpl %r8d, %ecx
jle 0x476be
addq $0x2c0, %rdx            # imm = 0x2C0
movq %rsp, %r15
movq %r15, %rdi
leaq 0x13c6d(%rip), %rsi     # 0x5b314
xorl %eax, %eax
callq 0x19700
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 0x47607
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x47cd5
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x58(%rax), %rcx
movl 0x1100(%rcx), %ecx
cmpl $0x2, %ecx
je 0x47cbe
cmpl $0x1, %ecx
jne 0x47cc0
incl %r15d
jmp 0x47cc0
incl %ebp
movq %rax, %rdi
movq %r14, %rsi
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
callq 0x19170
testq %rax, %rax
jne 0x47ca5
cmpl $0x2, %ebx
je 0x47ce4
movl %r15d, %ebp
cmpl $0x1, %ebx
je 0x47ce4
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x221c1(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x47d27
jp 0x47d27
movq 0x22248(%rip), %rcx     # 0x69f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x47d27
jnp 0x47d35
movq 0x58(%rbx), %rcx
movl $0x1, 0xe24(%rcx)
movq 0x22064(%rip), %rcx     # 0x69da0
movss 0xdc(%rcx), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0xe0(%rcx), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0xe4(%rcx), %xmm0
movss %xmm0, 0xc(%rbx)
movss 0xc18d(%rip), %xmm0     # 0x53ef8
movss 0xdc(%rcx), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %edx
movq 0x58(%rbx), %rsi
movw %dx, 0x4(%rsi)
movss 0xe0(%rcx), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %edx
movw %dx, 0x6(%rsi)
mulss 0xe4(%rcx), %xmm0
cvttss2si %xmm0, %edx
movw %dx, 0x8(%rsi)
movss 0xe8(%rcx), %xmm0
movss %xmm0, 0x1c(%rsi)
movss 0xec(%rcx), %xmm0
movss %xmm0, 0x20(%rsi)
movss 0xf0(%rcx), %xmm0
movss %xmm0, 0x24(%rsi)
movl $0x4, (%rsi)
xorl %ecx, %ecx
movl %ecx, 0x58(%rsi)
movl %ecx, 0x6c(%rsi)
andb $-0x2, 0x74(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0xf04(%rsi)
movq %rcx, 0xf14(%rsi)
movl %ecx, 0x278(%rbx)
movl %ecx, 0x40(%rbx)
movl %ecx, 0x4c(%rbx)
movl %ecx, 0x108(%rbx)
movq %rcx, 0x28(%rbx)
movl %ecx, 0x30(%rbx)
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x47e2f
jp 0x47e2f
movq 0x22140(%rip), %rax     # 0x69f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x47e2f
jnp 0x47e52
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18b10
movq 0x217c0(%rip), %rax     # 0x69600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2063b(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x498ad
jp 0x498ad
movq 0x206c2(%rip), %rcx     # 0x69f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x498ad
jnp 0x498c0
cmpl $0x0, 0xe24(%rax)
je 0x498c2
movl $0x0, 0xe24(%rax)
popq %rbx
retq
movl $0x1, 0xe24(%rax)
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x18b10
movq 0x1fd1e(%rip), %rax     # 0x69600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/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 0x205a1(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x49947
jp 0x49947
movq 0x20628(%rip), %rcx     # 0x69f60
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
ucomiss %xmm0, %xmm1
jne 0x49947
jnp 0x4995a
cmpl $0x0, 0xe34(%rax)
je 0x4995c
movl $0x0, 0xe34(%rax)
popq %rbx
retq
movl $0x1, 0xe34(%rax)
movq %rbx, %rdi
callq 0x18270
movq 0x1fc8b(%rip), %rax     # 0x69600
movq 0xb8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/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 0x1fd94(%rip), %rax     # 0x69738
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x499bf
jp 0x499bf
leaq 0x11da0(%rip), %rcx     # 0x5b75d
jmp 0x499f0
ucomiss 0xa562(%rip), %xmm0     # 0x53f28
jne 0x499d3
jp 0x499d3
leaq 0x11d91(%rip), %rcx     # 0x5b762
jmp 0x499f0
ucomiss 0xaa7e(%rip), %xmm0     # 0x54458
leaq 0x11d88(%rip), %rax     # 0x5b769
leaq 0xd72a(%rip), %rcx      # 0x57112
cmovneq %rax, %rcx
cmovpq %rax, %rcx
movq 0x203a9(%rip), %r8      # 0x69da0
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 0x20314(%rip), %r9      # 0x69d40
leaq 0x200(%r9), %r15
addq $0x8, %r8
leaq 0x11d31(%rip), %rdx     # 0x5b76f
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 0x1fb97(%rip), %rbx     # 0x69600
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_O1/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 0x2041a(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x49ab8
jnp 0x49abd
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 0x49b05
movl 0x748(%rax), %ecx
movq 0x2024e(%rip), %rdx     # 0x69d40
cmpl 0x400(%rdx), %ecx
jne 0x49b05
movl $0x0, 0xe2c(%rax)
retq
movl $0x1, 0xe2c(%rax)
movl $0x0, 0x74c(%rax)
jmp 0x181a0
// File: /workspace/github_c_makefile_star2_O1/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 0x1f16a(%rip), %r14     # 0x69530
movq (%r14), %rax
movss 0x20(%rax), %xmm0
ucomiss 0x9b53(%rip), %xmm0     # 0x53f28
jb 0x4a465
movq %rdi, %rbx
movl $0x4a8, %r15d           # imm = 0x4A8
movl $0x2, %ebp
movq 0x1f168(%rip), %r12     # 0x69558
movq (%r12), %rdi
cmpl $0x0, 0x60(%rdi,%r15)
je 0x4a448
movq 0x58(%rdi,%r15), %rax
cmpq %rbx, 0xf30(%rax)
jne 0x4a448
addq %r15, %rdi
movq 0x58(%rbx), %rcx
movups 0x78(%rcx), %xmm0
movups 0x88(%rcx), %xmm1
movups 0x98(%rcx), %xmm2
movups 0xa8(%rcx), %xmm3
movups %xmm3, 0xa8(%rax)
movups %xmm2, 0x98(%rax)
movups %xmm1, 0x88(%rax)
movups %xmm0, 0x78(%rax)
callq 0x194c0
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movq (%r14), %rax
movss 0x20(%rax), %xmm1
addq $0x4a8, %r15            # imm = 0x4A8
incl %ebp
ucomiss %xmm0, %xmm1
jae 0x4a3f0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4a482
callq 0x19800
movw $0x1, 0x9a(%rbx)
movw $0x0, 0x92(%rbx)
movq 0x1f905(%rip), %rax     # 0x69da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4a4bf
jp 0x4a4bf
cmpl $0x0, 0xe24(%rbx)
jne 0x4a4bf
cmpl $0x0, 0xf80(%rbx)
je 0x4a4c8
movw $0x1, 0x92(%rbx)
cmpl $0x0, 0xe28(%rbx)
je 0x4a4e1
cmpl $0x0, 0x308(%rbx)
jle 0x4a4e1
orb $0x2, 0x92(%rbx)
movq 0xf30(%rbx), %rax
testq %rax, %rax
je 0x4a50c
cmpl $0x0, 0x60(%rax)
je 0x4a50c
movq 0x1f05e(%rip), %rcx     # 0x69558
subl (%rcx), %eax
shrl $0x3, %eax
imull $0xffffcabd, %eax, %eax # imm = 0xFFFFCABD
addl $0x51f, %eax            # imm = 0x51F
jmp 0x4a50e
xorl %eax, %eax
movw %ax, 0x98(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x1f9a1(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4a531
jnp 0x4a532
retq
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x1f5b8(%rip), %r14     # 0x69af8
leaq 0x11330(%rip), %r15     # 0x5b877
callq 0x19710
movq %rax, (%r14,%rbx,8)
movq %r15, 0x138(%rax)
incq %rbx
cmpq $0x8, %rbx
jne 0x4a547
movq 0x1fa71(%rip), %rax     # 0x69fd8
movl $0x0, (%rax)
movq 0x1f86c(%rip), %rax     # 0x69de0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1f859(%rip), %rax     # 0x69de0
cmpl $0x0, (%rax)
je 0x4a638
pushq %r14
pushq %rbx
subq $0x18, %rsp
movss (%rdi), %xmm0
movq 0x1fa36(%rip), %rbx     # 0x69fd8
movslq (%rbx), %rax
movq 0x1f54c(%rip), %r14     # 0x69af8
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 0x1f7d0(%rip), %rdx     # 0x69da0
movss 0x4(%rdx), %xmm0
movss %xmm0, 0x144(%rcx)
movss (%rdi), %xmm0
decl %eax
andl $0x7, %eax
movq (%r14,%rax,8), %rcx
subss 0x4(%rcx), %xmm0
leaq 0xc(%rsp), %rax
movss %xmm0, (%rax)
movss 0x4(%rdi), %xmm0
subss 0x8(%rcx), %xmm0
movss %xmm0, 0x4(%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_O1/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 0x1f735(%rip), %rax     # 0x69de0
cmpl $0x0, (%rax)
je 0x4a6ed
movq 0x1f921(%rip), %rax     # 0x69fd8
movl (%rax), %eax
movss 0x438(%rdi), %xmm0
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
movq 0x1f42b(%rip), %rcx     # 0x69af8
movslq %eax, %rsi
movq (%rcx,%rsi,8), %rsi
ucomiss 0x144(%rsi), %xmm0
jb 0x4a6e6
incl %eax
andl $0x7, %eax
incl %edx
jne 0x4a6cd
cltq
movq (%rcx,%rax,8), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4f933(%rip), %xmm0    # 0x9a04c
movss (%rsi), %xmm1
mulss 0x4f923(%rip), %xmm1    # 0x9a048
addss %xmm0, %xmm1
movss 0x8(%rsi), %xmm0
mulss 0x4f91a(%rip), %xmm0    # 0x9a050
addss %xmm1, %xmm0
movaps 0x97ff(%rip), %xmm1     # 0x53f40
andps %xmm0, %xmm1
movq 0x1f3fd(%rip), %rax     # 0x69b48
movq (%rax), %rax
movss 0x20(%rax), %xmm2
movq 0x1f65e(%rip), %rax     # 0x69db8
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 0xc48e(%rip), %xmm2     # 0x56c10
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_O1/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 0x4b200
movss 0xc(%rdi), %xmm4
movss 0x8d80(%rip), %xmm6     # 0x53f28
movaps %xmm6, %xmm5
subss %xmm4, %xmm5
mulss %xmm3, %xmm5
addss %xmm4, %xmm5
divss %xmm5, %xmm4
subss %xmm4, %xmm6
mulss %xmm6, %xmm0
movss (%rdi), %xmm3
mulss %xmm4, %xmm3
addss %xmm0, %xmm3
movss %xmm3, (%rdi)
mulss %xmm6, %xmm1
movss 0x4(%rdi), %xmm0
mulss %xmm4, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rdi)
mulss 0x8(%rdi), %xmm4
mulss %xmm2, %xmm6
addss %xmm6, %xmm4
movss %xmm4, 0x8(%rdi)
movss %xmm5, 0xc(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4c141
retq
cmpq $0x0, 0x2b8(%rdi)
je 0x4c140
movq 0x1ddf6(%rip), %rax     # 0x69f48
movss (%rax), %xmm0
ucomiss 0xf797(%rip), %xmm0     # 0x5b8f4
jbe 0x4c140
movq 0x4df22(%rip), %rax     # 0x9a088
movss 0xec8(%rax), %xmm0
movq 0x1dcd3(%rip), %rax     # 0x69e48
addss (%rax), %xmm0
cvttss2si %xmm0, %eax
movq 0x1da0c(%rip), %rcx     # 0x69b90
cmpl %eax, (%rcx)
je 0x4c140
movl $0x2, 0x50(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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), %rax
movq 0x1db9d(%rip), %rcx     # 0x69d40
movl 0x400(%rcx), %ecx
cmpl %ecx, 0x748(%rax)
je 0x4c1c1
movl %ecx, 0x748(%rax)
movl $0x1, 0x74c(%rax)
movl 0x74c(%rax), %ecx
testl %ecx, %ecx
sete %dl
cmpl $0x4, %ecx
setge %sil
orb %dl, %sil
jne 0x4c221
movq 0x1dbc1(%rip), %rdx     # 0x69da0
testb $0x3f, (%rdx)
jne 0x4c221
incl %ecx
movl %ecx, 0x74c(%rax)
movq 0x1d40d(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0xd74f(%rip), %rdi      # 0x5994d
callq *0x48(%rax)
movss 0x7d1f(%rip), %xmm0     # 0x53f28
movss 0x7cfb(%rip), %xmm1     # 0x53f0c
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 0x4c236
movq (%rax), %r14
jmp 0x4c23d
leaq 0x8cc8(%rip), %r14      # 0x54f05
cmpl $0x0, 0x30c(%rbx)
je 0x4c25a
testb $0x18, 0x308(%rbx)
je 0x4c25a
movq 0x1d2aa(%rip), %rax     # 0x69500
movl (%rax), %eax
jmp 0x4c2d8
leaq 0x7d66(%rip), %rsi      # 0x53fc7
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4c2a7
leaq 0x7d48(%rip), %rsi      # 0x53fbc
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4c2b7
leaq 0xad90(%rip), %rsi      # 0x57017
movq %r14, %rdi
callq 0x18b20
testl %eax, %eax
je 0x4c2c7
movl 0xf20(%r15), %eax
testl %eax, %eax
jne 0x4c2d8
movl $0x0, 0x4c(%rbx)
jmp 0x4c2db
movq 0x1d352(%rip), %rax     # 0x69600
leaq 0xb54a(%rip), %rdi      # 0x577ff
jmp 0x4c2d5
movq 0x1d342(%rip), %rax     # 0x69600
leaq 0xb60e(%rip), %rdi      # 0x578d3
jmp 0x4c2d5
movq 0x1d332(%rip), %rax     # 0x69600
leaq 0xf6ae(%rip), %rdi      # 0x5b983
callq *0x48(%rax)
movl %eax, 0x4c(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xeb2d(%rip), %xmm0     # 0x5b99b
movq %rsp, %r14
movaps %xmm0, (%r14)
movw $0x67, 0x10(%r14)
movq 0x1c77d(%rip), %r15     # 0x69600
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
nop
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Use_Weapon
void Use_Weapon (edict_t *ent, gitem_t *item)
{
	int			ammo_index;
	gitem_t		*ammo_item;
	char message[MAX_INFO_STRING];

	// see if we're already using it
	if (item == ent->client->pers.weapon)
		return;

	if (item->ammo && !g_select_empty->value && !(item->flags & IT_AMMO))
	{
		ammo_item = FindItem(item->ammo);
		ammo_index = ITEM_INDEX(ammo_item);

		if (!ent->client->pers.inventory[ammo_index])
		{
			sprintf(message, "No %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
			ctf_SafePrint(ent, PRINT_HIGH, message);
			return;
		}

		if (ent->client->pers.inventory[ammo_index] < item->quantity)
		{
			sprintf(message, "Not enough %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
			ctf_SafePrint(ent, PRINT_HIGH, message);
			return;
		}
	}

	// change to this weapon when down
	ent->client->newweapon = item;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x58(%rdi), %rax
cmpq %rsi, 0x730(%rax)
je 0x4d8cd
movq %rsi, %r14
movq %rdi, %rbx
movq 0x60(%rsi), %rdi
testq %rdi, %rdi
je 0x4d8c2
movq 0x1bce1(%rip), %rax     # 0x69548
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4d8c2
jp 0x4d8c2
testb $0x2, 0x68(%r14)
jne 0x4d8c2
callq 0x189e0
movq %rax, %rcx
subq 0x1c5b1(%rip), %rcx     # 0x69e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%rbx), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %ecx
testl %ecx, %ecx
je 0x4d8d8
cmpl 0x5c(%r14), %ecx
jge 0x4d8c2
movq 0x50(%rax), %rdx
movq 0x50(%r14), %rcx
leaq 0x7418(%rip), %rsi      # 0x54cd8
jmp 0x4d8e7
movq 0x58(%rbx), %rax
movq %r14, 0xe50(%rax)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movq 0x50(%rax), %rdx
movq 0x50(%r14), %rcx
leaq 0x73e2(%rip), %rsi      # 0x54cc9
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x19700
movl $0x2, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18da0
jmp 0x4d8cd
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Drop_Weapon
void Drop_Weapon (edict_t *ent, gitem_t *item)
{
	int		index;

	if ((int)(dmflags->value) & DF_WEAPONS_STAY)
		return;

	index = ITEM_INDEX(item);
	// see if we're already using it
	if ( ((item == ent->client->pers.weapon) || (item == ent->client->newweapon))&& (ent->client->pers.inventory[index] == 1) )
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Can't drop current weapon\n");
		return;
	}

	Drop_Item (ent, item);
	ent->client->pers.inventory[index]--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x1bd07(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x4, %al
jne 0x4d990
movq %rdi, %rbx
movq %rsi, %rax
subq 0x1c516(%rip), %rax     # 0x69e40
sarq $0x3, %rax
movabsq $-0xf0f0f0f0f0f0f0f, %r14 # imm = 0xF0F0F0F0F0F0F0F1
imulq %rax, %r14
movq 0x58(%rdi), %rax
cmpq %rsi, 0x730(%rax)
je 0x4d952
cmpq %rsi, 0xe50(%rax)
jne 0x4d97a
movslq %r14d, %rcx
cmpl $0x1, 0x318(%rax,%rcx,4)
jne 0x4d97a
leaq 0x95ce(%rip), %rdx      # 0x56f34
movl $0x2, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18da0
movq %rbx, %rdi
callq 0x18460
movq 0x58(%rbx), %rax
movslq %r14d, %rcx
decl 0x318(%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: P_ProjectSource
static void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
{
	vec3_t	_distance;

	VectorCopy (distance, _distance);
	if (client->pers.hand == LEFT_HANDED)
		_distance[1] *= -1;
	else if (client->pers.hand == CENTER_HANDED)
		_distance[1] = 0;
	G_ProjectSource (point, _distance, forward, right, result);
}

// Assembly:
subq $0x18, %rsp
movq %rsi, %rax
movss (%rdx), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x4(%rdx), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x8(%rdx), %xmm1
movss %xmm1, 0x14(%rsp)
movl 0x300(%rdi), %edx
cmpl $0x2, %edx
je 0x4de27
cmpl $0x1, %edx
jne 0x4de30
xorps 0x8deb(%rip), %xmm0     # 0x56c10
jmp 0x4de2a
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x18fa0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: weapon_grenadelauncher_fire
void weapon_grenadelauncher_fire (edict_t *ent)
{
	vec3_t	offset;
	vec3_t	forward, right;
	vec3_t	start;
	int		damage = 120;
	float	radius;

	radius = damage+40;
	if (is_quad)
		damage *= 4;

#ifdef WEAP_BALANCE_OK	

	if ((int)ctfflags->value & CTF_WEAP_BALANCE)
	{
		radius*=1.5;
		damage-=10;
	}
#endif


	VectorSet(offset, 8, 8, ent->viewheight-8);
	AngleVectors (ent->client->v_angle, forward, right, NULL);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -1;

	fire_grenade (ent, start, forward, damage, 600, 2.5, radius);

	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (ent-g_edicts);
	gi.WriteByte (MZ_GRENADE | is_silenced);
	gi.multicast (ent->s.origin, MULTICAST_PVS);

	ent->client->ps.gunframe++;

	PlayerNoise(ent, start, PNOISE_WEAPON);

	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
		ent->client->pers.inventory[ent->client->ammo_index]--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x4bf3b(%rip)     # 0x9a094
movl $0x78, %eax
movl $0x1e0, %ebp            # imm = 0x1E0
cmovel %eax, %ebp
movabsq $0x4100000041000000, %rax # imm = 0x4100000041000000
leaq 0x2c(%rsp), %r13
movq %rax, (%r13)
movl 0x278(%rdi), %eax
addl $-0x8, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%r13)
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x20(%rsp), %r12
leaq 0x14(%rsp), %r14
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x183a0
movq 0x58(%rbx), %rdi
leaq 0x4(%rbx), %r15
leaq 0x8(%rsp), %r9
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
movq %r9, %r13
callq 0x4dde7
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x7232(%rip), %xmm0     # 0x55410
movq %r12, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xbf800000, 0xe7c(%rax) # imm = 0xBF800000
movss 0xd8fc(%rip), %xmm0     # 0x5baf8
movss 0xd8f8(%rip), %xmm1     # 0x5bafc
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movl $0x258, %r8d            # imm = 0x258
callq 0x19350
movq 0x1b3df(%rip), %r14     # 0x69600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1b324(%rip), %rax     # 0x69558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4be46(%rip), %edi     # 0x9a098
shll $0x7, %edi
orl $0x8, %edi
callq *0xc8(%r14)
movq %r15, %rdi
movl $0x2, %esi
callq *0xb0(%r14)
movq 0x58(%rbx), %rax
incl 0x5c(%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x18ef0
movq 0x1b38c(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xd, %eax
jb 0x4e2ac
movq 0x58(%rbx), %rax
movslq 0xe38(%rax), %rcx
decl 0x318(%rax,%rcx,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Blaster_Fire
void Blaster_Fire (edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int effect)
{
	vec3_t	forward, right;
	vec3_t	start;
	vec3_t	offset;

	if (is_quad)
		damage *= 4;
	AngleVectors (ent->client->v_angle, forward, right, NULL);
	VectorSet(offset, 24, 8, ent->viewheight-8);
	VectorAdd (offset, g_offset, offset);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -1;

	fire_blaster (ent, start, forward, damage, 1000, effect, hyper);

	// send muzzle flash
	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (ent-g_edicts);
	if (hyper)
		gi.WriteByte (MZ_HYPERBLASTER | is_silenced);
	else
		gi.WriteByte (MZ_BLASTER | is_silenced);
	gi.multicast (ent->s.origin, MULTICAST_PVS);

	PlayerNoise(ent, start, PNOISE_WEAPON);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movq %rsi, %r12
leal (,%rdx,4), %r15d
cmpl $0x0, 0x4bb9a(%rip)     # 0x9a094
cmovel %edx, %r15d
movq %rdi, %rbx
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x3c(%rsp), %r14
leaq 0x30(%rsp), %rbp
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x183a0
movabsq $0x4100000041c00000, %rax # imm = 0x4100000041C00000
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movl 0x278(%rbx), %eax
addl $-0x8, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rdx)
movss (%r12), %xmm1
addss 0xd5b1(%rip), %xmm1     # 0x5bb04
movss %xmm1, (%rdx)
movss 0x4(%r12), %xmm1
addss 0x5992(%rip), %xmm1     # 0x53ef8
movss %xmm1, 0x4(%rdx)
addss 0x8(%r12), %xmm0
movss %xmm0, 0x8(%rdx)
movq 0x58(%rbx), %rdi
leaq 0x4(%rbx), %r13
leaq 0x24(%rsp), %r12
movq %r13, %rsi
movq %r14, %rcx
movq %rbp, %r8
movq %r12, %r9
callq 0x4dde7
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x6e6a(%rip), %xmm0     # 0x55410
movq %r14, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xbf800000, 0xe7c(%rax) # imm = 0xBF800000
movl 0x10(%rsp), %ebp
movl %ebp, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %r15d, %ecx
movl $0x3e8, %r8d            # imm = 0x3E8
movl 0x14(%rsp), %r9d
callq 0x189b0
movq 0x1b01a(%rip), %r14     # 0x69600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1af5f(%rip), %rax     # 0x69558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4ba81(%rip), %eax     # 0x9a098
shll $0x7, %eax
leal 0xe(%rax), %edi
testl %ebp, %ebp
cmovel %eax, %edi
callq *0xc8(%r14)
movq %r13, %rdi
movl $0x2, %esi
callq *0xb0(%r14)
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x18ef0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: weapon_fieldgun_fire
void weapon_fieldgun_fire (edict_t *ent)
{
	vec3_t		start;
	vec3_t		forward, right;
	vec3_t		offset;
	int			damage = 4;
	int			kick = 8;

	AngleVectors (ent->client->v_angle, forward, right, NULL);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -2;

	VectorSet(offset, 0, 8,  ent->viewheight-8);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	if (is_quad)
	{
		damage *= 4;
		kick *= 4;
	}

#ifdef WEAP_BALANCE_OK	
	if ((int)ctfflags->value & CTF_WEAP_BALANCE) //surt
		damage+=1; //slightly more damage, except with quad
#endif

	if (ent->client->buttons & BUTTON_ATTACK)
	{
		if (deathmatch->value)
			fire_fieldgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_DEATHMATCH_SHOTGUN_COUNT);
		else
			fire_fieldgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_SHOTGUN_COUNT);

		// send muzzle flash
		gi.WriteByte (svc_muzzleflash);
		gi.WriteShort (ent-g_edicts);
		gi.WriteByte (MZ_SHOTGUN | is_silenced);
		gi.multicast (ent->s.origin, MULTICAST_PVS);

		//ent->client->ps.gunframe++;
		//PlayerNoise(ent, start, PNOISE_WEAPON);

		//ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
	}
	else
	{
		ent->client->ps.gunframe++;
		ent->client->hooklength = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x18(%rsp), %r15
leaq 0x3c(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x183a0
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x5cf3(%rip), %xmm0     # 0x55410
movq %r15, %rdi
callq 0x189d0
movq 0x58(%rbx), %rdi
movl $0xc0000000, 0xe7c(%rdi) # imm = 0xC0000000
movabsq $0x4100000000000000, %rax # imm = 0x4100000000000000
leaq 0x30(%rsp), %rdx
movq %rax, (%rdx)
movl 0x278(%rbx), %eax
addl $-0x8, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rdx)
leaq 0x4(%rbx), %r14
leaq 0x24(%rsp), %r9
movq %r14, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x4dde7
movq 0x58(%rbx), %rax
testb $0x1, 0xe3c(%rax)
jne 0x4f78d
incl 0x5c(%rax)
movl $0x0, 0xf5c(%rax)
jmp 0x4f7f0
leaq 0x24(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x18f40
movq 0x19e5a(%rip), %r15     # 0x69600
movl $0x1, %edi
callq *0xc8(%r15)
movq 0x19d9f(%rip), %rax     # 0x69558
subq (%rax), %rbx
shrq $0x3, %rbx
imull $0x8ce2cabd, %ebx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r15)
movzbl 0x4a8c4(%rip), %edi     # 0x9a098
shll $0x7, %edi
orl $0x2, %edi
callq *0xc8(%r15)
movq %r14, %rdi
movl $0x2, %esi
callq *0xb0(%r15)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Draw_Hook
void Draw_Hook (edict_t *ent, vec3_t start, vec3_t end)
{
	vec3_t	dir, mins, maxs;
	vec3_t	offset;
	float		*v;

	v = tv(-15,-15,-15);
	_VectorCopy (v, mins);
	v = tv(15,15,15);
	_VectorCopy (v, maxs);

	VectorSubtract(end, start, dir);
	VectorSet(offset, 0, 0, 0);

	// Only display the grapple line if it isn't short
	if (VectorLength(dir) > 64)
	{
		gi.WriteByte (svc_temp_entity);
		gi.WriteByte (TE_GRAPPLE_CABLE);
		gi.WriteShort (ent - g_edicts);
		gi.WritePosition (start);
		gi.WritePosition (end);
		gi.WritePosition (offset);
		gi.multicast (ent->s.origin, MULTICAST_PVS);
	}	
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movss 0x3eca(%rip), %xmm0     # 0x54440
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x199e0
movss 0x3eae(%rip), %xmm0     # 0x54444
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq 0x199e0
movss (%r14), %xmm0
subss (%r15), %xmm0
leaq 0x2c(%rsp), %rdi
movss %xmm0, (%rdi)
movss 0x4(%r14), %xmm0
subss 0x4(%r15), %xmm0
movss %xmm0, 0x4(%rdi)
movss 0x8(%r14), %xmm0
subss 0x8(%r15), %xmm0
movss %xmm0, 0x8(%rdi)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x192e0
ucomiss 0x3918(%rip), %xmm0     # 0x53f18
jbe 0x50679
movq 0x18ff7(%rip), %r12     # 0x69600
movl $0x3, %edi
callq *0xc8(%r12)
movl $0x18, %edi
callq *0xc8(%r12)
movq 0x18f2e(%rip), %rax     # 0x69558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r12)
movq %r15, %rdi
callq *0xf0(%r12)
movq %r14, %rdi
callq *0xf0(%r12)
leaq 0x8(%rsp), %rdi
callq *0xf0(%r12)
addq $0x4, %rbx
movq %rbx, %rdi
movl $0x2, %esi
callq *0xb0(%r12)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Weapon_Hook
void Weapon_Hook (edict_t *ent)
{
	static int	pause_frames[]	= {14, 18, 26, 30, 0};
	static int	fire_frames[]	= {8, 9, 10, 11,0};

	//if (ent->client->weaponstate == WEAPON_READY)
	//		ent->client->hookstate = 0;
	
	if (ent->client->weaponstate == WEAPON_ACTIVATING)
	{
		// Speed up activation
		ent->client->ps.gunframe+=1;
	}

	if (ent->client->newweapon && ent->client->weaponstate != WEAPON_DROPPING)
	{
		ent->client->weaponstate = WEAPON_DROPPING;
		ent->client->ps.gunframe = 36; //FRAME_DEACTIVATE_FIRST;
		return;
	}
	
	if ( !((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK))
	{
		ctf_hook_abort(ent);
	}
	
	Weapon_Generic (ent, 9, 13, 34, 38, pause_frames, fire_frames, Weapon_Hook_Fire);

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
movl 0xe78(%rax), %ecx
cmpl $0x1, %ecx
jne 0x50a0a
incl 0x5c(%rax)
cmpl $0x2, %ecx
je 0x50a2c
cmpq $0x0, 0xe50(%rax)
je 0x50a2c
movl $0x2, 0xe78(%rax)
movl $0x24, 0x5c(%rax)
jmp 0x50a7e
movl 0xe3c(%rax), %ecx
orl 0xe44(%rax), %ecx
testb $0x1, %cl
jne 0x50a45
movq %rbx, %rdi
callq 0x18630
movq 0x1901c(%rip), %rax     # 0x69a68
leaq 0x1e58d(%rip), %r10     # 0x6efe0
leaq 0x1e566(%rip), %r9      # 0x6efc0
movq %rbx, %rdi
movl $0x9, %esi
movl $0xd, %edx
movl $0x22, %ecx
movl $0x26, %r8d
pushq %rax
pushq %r10
callq 0x18450
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: PerpendicularVector
void PerpendicularVector( vec3_t dst, const vec3_t src )
{
	int	pos;
	int i;
	float minelem = 1.0F;
	vec3_t tempvec;

	/*
	** find the smallest magnitude axially aligned vector
	*/
	for ( pos = 0, i = 0; i < 3; i++ )
	{
		if ( fabs( src[i] ) < minelem )
		{
			pos = i;
			minelem = fabs( src[i] );
		}
	}
	tempvec[0] = tempvec[1] = tempvec[2] = 0.0F;
	tempvec[pos] = 1.0F;

	/*
	** project the point onto the plane defined by src
	*/
	ProjectPointOnPlane( dst, tempvec, src );

	/*
	** normalize the result
	*/
	VectorNormalize( dst );
}

// Assembly:
xorl %eax, %eax
movss 0x2ff3(%rip), %xmm1     # 0x53f28
movaps 0x3004(%rip), %xmm0     # 0x53f40
xorl %ecx, %ecx
movss (%rsi,%rax,4), %xmm2
andps %xmm0, %xmm2
ucomiss %xmm2, %xmm1
cmoval %eax, %ecx
minss %xmm1, %xmm2
incq %rax
movaps %xmm2, %xmm1
cmpq $0x3, %rax
jne 0x50f3e
movl $0x0, -0x4(%rsp)
movq $0x0, -0xc(%rsp)
movslq %ecx, %rax
movl $0x3f800000, -0xc(%rsp,%rax,4) # imm = 0x3F800000
movss (%rsi), %xmm1
movss 0x4(%rsi), %xmm0
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rsi), %xmm2
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0x2f7d(%rip), %xmm3     # 0x53f28
divss %xmm4, %xmm3
movss -0xc(%rsp), %xmm4
movss -0x8(%rsp), %xmm5
movaps %xmm0, %xmm6
mulss %xmm5, %xmm6
movaps %xmm1, %xmm7
mulss %xmm4, %xmm7
addss %xmm6, %xmm7
movss -0x4(%rsp), %xmm6
movaps %xmm2, %xmm8
mulss %xmm6, %xmm8
addss %xmm7, %xmm8
mulss %xmm3, %xmm1
mulss %xmm3, %xmm0
xorps 0x5c1f(%rip), %xmm8     # 0x56c10
mulss %xmm3, %xmm2
mulss %xmm3, %xmm8
mulss %xmm8, %xmm1
addss %xmm4, %xmm1
movss %xmm1, (%rdi)
mulss %xmm8, %xmm0
addss %xmm5, %xmm0
movss %xmm0, 0x4(%rdi)
mulss %xmm2, %xmm8
addss %xmm6, %xmm8
movss %xmm8, 0x8(%rdi)
jmp 0x18390