LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: RuneWeaponThinkHook
void RuneWeaponThinkHook (edict_t *ent)
{
	if (ent && ent->client && ent->client->rune)
	{
		if (ent->client->rune->runetype == RUNE_HASTE)
		{
			if (ent->client->isfiring)
				gi.sound(ent, CHAN_ITEM, gi.soundindex("player/lava1.wav"), 1, ATTN_NORM, 0);
			
			if (ent->client->ps.gunframe)
				ent->client->pers.weapon->weaponthink (ent);
		}
		if (ent->client->rune->runetype == RUNE_DAMAGE)
		{
			if (ent->client->isfiring)
				gi.sound(ent, CHAN_ITEM, gi.soundindex("ctf/strength.wav"), 1, ATTN_NORM, 0);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1eaa9
movq %rdi, %rbx
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x1eaa9
movq 0xf68(%rax), %rcx
testq %rcx, %rcx
je 0x1eaa9
cmpl $0x4, 0x478(%rcx)
jne 0x1ea59
cmpl $0x0, 0xf70(%rax)
je 0x1ea42
movq 0x47be9(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x30a06(%rip), %rdi     # 0x4f428
callq *0x48(%rax)
pushq $0x3
popq %rsi
movss 0x304f8(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
movq 0x58(%rbx), %rax
cmpl $0x0, 0x5c(%rax)
je 0x1ea59
movq 0x730(%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x58(%rbx), %rax
movq 0xf68(%rax), %rcx
cmpl $0x1, 0x478(%rcx)
jne 0x1eaa9
cmpl $0x0, 0xf70(%rax)
je 0x1eaa9
movq 0x47b87(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x309b5(%rip), %rdi     # 0x4f439
callq *0x48(%rax)
pushq $0x3
popq %rsi
movss 0x30496(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_validateplayer
qboolean ctf_validateplayer(edict_t * ent, int teamnum_wanted)
{
	if (ent)
	{
		if (ent->client && ent->inuse && ent->client->pers.connected && (strcmp(ent->classname,"player") == 0) )
		{
			if (!deathmatch->value) //surt, trying to catch stuff that breaks in single player
			{
				return true;
			}
			if (teamnum_wanted == CTF_TEAM_IGNORETEAM) //we don't care about team
			{
				return true; //this object was a player, regardless of team
			}
			else if (teamnum_wanted == CTF_TEAM_ANYTEAM)
			{
				if (ent->client->ctf.teamnum > CTF_TEAM_UNDEFINED && ent->client->ctf.teamnum < CTF_TEAM_LIMIT )
					return true; //this was a player, on some defined team
			}
			else if (teamnum_wanted == ent->client->ctf.teamnum) //we matched the desired team
			{
				return true; //this was a player that matched the right team number
			}
		}
	}
	return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1eba4
movq 0x58(%rdi), %r14
testq %r14, %r14
je 0x1eba4
cmpl $0x0, 0x60(%rdi)
je 0x1eba4
cmpl $0x0, 0x304(%r14)
je 0x1eba4
movl %esi, %ebx
movq 0x138(%rdi), %rdi
leaq 0x317f4(%rip), %rsi     # 0x5038f
callq 0x18bc0
testl %eax, %eax
je 0x1ebae
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x4830b(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
pushq $0x1
popq %rax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1ebca
jnp 0x1eba6
cmpl $-0x4, %ebx
je 0x1eba6
cmpl $-0x5, %ebx
jne 0x1ebe4
movl 0x1100(%r14), %ecx
decl %ecx
cmpl $0x2, %ecx
jae 0x1eba4
jmp 0x1eba6
cmpl %ebx, 0x1100(%r14)
jne 0x1eba4
jmp 0x1eba6
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_flagatposition
qboolean ctf_flagatposition(vec3_t a, vec3_t b)
{
	vec3_t dir;
	vec_t dist;
	qboolean result = true;

	VectorSubtract (a, b, dir);
	dist = VectorLength(dir);
	if (dist > 32)
		result = false;
	return result;
}

// Assembly:
subq $0x18, %rsp
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
subps %xmm1, %xmm0
leaq 0x8(%rsp), %rax
movlps %xmm0, (%rax)
movss 0x8(%rdi), %xmm0
subss 0x8(%rsi), %xmm0
movss %xmm0, 0x8(%rax)
movq %rax, %rdi
callq 0x19460
xorl %eax, %eax
ucomiss 0x30826(%rip), %xmm0    # 0x4f44c
setbe %al
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_flagsearch
edict_t * ctf_flagsearch(int whichteam)
{
	edict_t* current_flag = NULL;
	edict_t* valid_flag = NULL;
	current_flag = G_Find(current_flag, FOFS(classname), "flag");
	while (current_flag)
	{
		//is this the flag we're looking for?
		//we already know it is classname flag, what else is required?
		if (!current_flag->item) //how did this happen?
			G_FreeEdict(current_flag);
		else if (current_flag->flagteam >= CTF_TEAM_LIMIT ||
					current_flag->flagteam <= CTF_TEAM_UNDEFINED)
		{
			G_FreeEdict(current_flag); //what the heck is this?
		}
		else if (current_flag->flagteam == whichteam)
		{
			if (valid_flag != NULL) //uh oh, multiple flags
			{
				ctf_resetflagandplayer(current_flag, current_flag->owner);
				ctf_resetflagandplayer(valid_flag, valid_flag->owner);
				G_FreeEdict(current_flag); //we'll keep the first one we find
			}
			else
			{
				valid_flag = current_flag;
			}
		}

		current_flag = G_Find(current_flag, FOFS(classname), "flag");
	}

	return valid_flag; //either a flag matching the one we want, or null
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
leaq 0x37f4d(%rip), %r14     # 0x56efb
xorl %r15d, %r15d
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
movq %rax, %r12
testq %r12, %r12
je 0x1f031
cmpq $0x0, 0x330(%r12)
je 0x1f00e
movl 0x47c(%r12), %eax
leal -0x3(%rax), %ecx
cmpl $-0x2, %ecx
jb 0x1f00e
cmpl %ebx, %eax
jne 0x1f016
movq %r12, %r13
testq %r15, %r15
je 0x1f019
movq 0x110(%r12), %rsi
movq %r12, %rdi
callq 0x191d0
movq 0x110(%r15), %rsi
movq %r15, %rdi
callq 0x191d0
movq %r12, %rdi
callq 0x19c50
movq %r15, %r13
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
movq %rax, %r12
movq %r13, %r15
jmp 0x1efc3
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_resetflagandplayer
qboolean ctf_resetflagandplayer(edict_t * whichflag, edict_t * whichplayer)
{

	if (whichflag)
	{
		VectorCopy (whichflag->homeposition, whichflag->s.origin);
		VectorCopy (whichflag->homeangles, whichflag->s.angles);	
		ctf_ResetFlagProps(whichflag);
		// Change the object's position back to it's home position
	}
	if (whichplayer)
	{
		whichplayer->s.effects &= ~EF_COLOR_SHELL;  // Turn off flag carrying affect
		ValidateSelectedItem(whichplayer);
		whichplayer->s.modelindex3 = 0; // Remove model from player
		if (whichplayer->client)
		{
			if (redflag)
				whichplayer->client->pers.inventory[ITEM_INDEX(redflag->item)] = 0;
			if (blueflag)
				whichplayer->client->pers.inventory[ITEM_INDEX(blueflag->item)] = 0;
			if (whichflag)
				whichplayer->client->pers.inventory[ITEM_INDEX(whichflag->item)] = 0;
			ValidateSelectedItem (whichplayer);
		}
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0x1f39e
movups 0x460(%r14), %xmm0
movups %xmm0, 0x4(%r14)
movsd 0x470(%r14), %xmm0
movsd %xmm0, 0x14(%r14)
movq %r14, %rdi
callq 0x185c0
testq %rbx, %rbx
je 0x1f44f
andb $-0x2, 0x41(%rbx)
movq %rbx, %rdi
callq 0x182a0
andl $0x0, 0x30(%rbx)
movq 0x58(%rbx), %rcx
testq %rcx, %rcx
je 0x1f44f
movq 0x4742d(%rip), %rax     # 0x667f8
movq (%rax), %rax
testq %rax, %rax
je 0x1f3f3
movq 0x330(%rax), %rax
subq 0x47a5f(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
andl $0x0, 0x318(%rcx,%rax,4)
movq 0x47466(%rip), %rax     # 0x66860
movq (%rax), %rax
testq %rax, %rax
je 0x1f422
movq 0x330(%rax), %rax
subq 0x47a30(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
andl $0x0, 0x318(%rcx,%rax,4)
testq %r14, %r14
je 0x1f447
movq 0x330(%r14), %rax
subq 0x47a0b(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
andl $0x0, 0x318(%rcx,%rax,4)
movq %rbx, %rdi
callq 0x182a0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_flagwave
void ctf_flagwave (edict_t *ent) //flag animation
{
	if (ent->solid != SOLID_NOT)
		ent->s.frame = 173 + (((ent->s.frame - 173) + 1) % 16);
	ent->nextthink = level.time + FRAMETIME;

	if ( (ent->droptime) && (level.time > ent->droptime + 30) )
	{
		if (!ctf_validateplayer(ent->owner,CTF_TEAM_ANYTEAM))
		{
			if (ent == redflag)
				gi.sound(ent, CHAN_CTF, gi.soundindex("ctf/r_returned.wav"), 0.8f, ATTN_NONE, 0);	
			else if (ent == blueflag)
				gi.sound(ent, CHAN_CTF, gi.soundindex("ctf/b_returned.wav"), 0.8f, ATTN_NONE, 0);	
			ctf_resetflagandplayer(ent, NULL);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x108(%rdi)
je 0x1f651
movl $0xffffff54, %eax       # imm = 0xFFFFFF54
addl 0x38(%rbx), %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
addl $0xad, %edx
movl %edx, 0x38(%rbx)
movq 0x47748(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movss 0x2fc2b(%rip), %xmm1    # 0x4f290
addss %xmm0, %xmm1
movss %xmm1, 0x200(%rbx)
movss 0x4a0(%rbx), %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x1f683
jnp 0x1f6a3
addss 0x2fc09(%rip), %xmm1    # 0x4f294
ucomiss %xmm1, %xmm0
jbe 0x1f6a3
movq 0x110(%rbx), %rdi
pushq $-0x5
popq %rsi
callq 0x18de0
testl %eax, %eax
je 0x1f6ab
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x47146(%rip), %rax     # 0x667f8
cmpq %rbx, (%rax)
je 0x1f6cc
movq 0x471a2(%rip), %rax     # 0x66860
cmpq %rbx, (%rax)
jne 0x1f6fa
leaq 0x2fef5(%rip), %rdi     # 0x4f5bf
jmp 0x1f6d3
leaq 0x2fed9(%rip), %rdi     # 0x4f5ac
movq 0x46f26(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
callq *0x48(%rax)
pushq $0x5
popq %rsi
movss 0x2fd74(%rip), %xmm0    # 0x4f460
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
callq *%r14
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x191d0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_deletespawnpointsnearflag
void ctf_deletespawnpointsnearflag (edict_t *flag)
{
	edict_t *spot;
	float	dist;		  // CTF CODE -- LM JORM
	vec3_t	v;			  // CTF CODE -- LM JORM


	spot = NULL;
	if (deathmatch->value)
	{
                // MJD This should have parentheses, given that you DO want
		// to do an asignment and not a ==
		spot = G_Find (spot, FOFS(classname), "info_player_deathmatch");
		while(spot)
		{
			VectorSubtract (spot->s.origin, flag->homeposition, v);
			dist = VectorLength (v);
			if (dist <= 256)			
			{
				G_FreeEdict (spot);
			}
			spot = G_Find (spot, FOFS(classname), "info_player_deathmatch");
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x4764c(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1f88a
jnp 0x1f90e
movq %rdi, %rbx
leaq 0x2fcae(%rip), %r14     # 0x4f542
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
movq %rax, %r12
leaq 0x8(%rsp), %r15
testq %r12, %r12
je 0x1f90e
movsd 0x4(%r12), %xmm0
movsd 0x460(%rbx), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, 0x8(%rsp)
movss 0xc(%r12), %xmm0
subss 0x468(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
movq %r15, %rdi
callq 0x19460
movss 0x2f638(%rip), %xmm1    # 0x4ef24
ucomiss %xmm0, %xmm1
jb 0x1f8f9
movq %r12, %rdi
callq 0x19c50
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x195e0
movq %rax, %r12
jmp 0x1f8ab
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_TossEnt
void ctf_TossEnt(edict_t * startent, edict_t * tossent)
{
	trace_t		tr;
	vec3_t		forward,right,offset;

	AngleVectors (startent->client->v_angle, forward, right, NULL);
	VectorSet(offset, 24, 0, -16);
	G_ProjectSource (startent->s.origin, offset, forward, right, tossent->s.origin);
	tr = gi.trace (startent->s.origin, tossent->mins, tossent->maxs,
		tossent->s.origin, startent, CONTENTS_SOLID);
	VectorCopy (tr.endpos, tossent->s.origin);

	VectorScale(forward, 200, tossent->velocity);
	tossent->velocity[2] = 300;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%r15), %rdi
leaq 0x24(%rsp), %r14
leaq 0x18(%rsp), %r12
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x183d0
movss 0x2fb0e(%rip), %xmm0    # 0x4f464
leaq 0x8(%rsp), %rsi
movlps %xmm0, (%rsi)
movl $0xc1800000, 0x8(%rsi)  # imm = 0xC1800000
leaq 0x4(%r15), %r13
leaq 0x4(%rbx), %rbp
movq %r13, %rdi
movq %r14, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0x190d0
movq 0x46c7b(%rip), %rax     # 0x66600
leaq 0xcc(%rbx), %rdx
leaq 0xd8(%rbx), %rcx
movl $0x1, (%rsp)
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %r8
movq %r15, %r9
callq *0x60(%rax)
movss 0x14(%r12), %xmm0
movsd 0xc(%r12), %xmm1
movsd %xmm1, 0x4(%rbx)
movss %xmm0, 0xc(%rbx)
leaq 0x1c0(%rbx), %rsi
movss 0x2f8cf(%rip), %xmm0    # 0x4f2a4
movq %r14, %rdi
callq 0x18a70
movl $0x43960000, 0x1c8(%rbx) # imm = 0x43960000
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: Drop_Flag_Think
void Drop_Flag_Think (edict_t *ent)
{
	ent->touch = Touch_Item;
	ent->owner = NULL;
	ent->think = ctf_flagwave;
	ent->nextthink = level.time + FRAMETIME;
}

// Assembly:
movq 0x46e83(%rip), %rax     # 0x66880
movq %rax, 0x220(%rdi)
andq $0x0, 0x110(%rdi)
movq 0x46bad(%rip), %rax     # 0x665c0
movq %rax, 0x210(%rdi)
movq 0x4737f(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x2f862(%rip), %xmm0    # 0x4f290
movss %xmm0, 0x200(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_BSafePrint
void ctf_BSafePrint(long print_priority, char * buf)
{
	edict_t *ent = NULL;
//	int i;

//	for (i=0 ; i<game.maxclients ; i++)
//	{
//		ent = g_edicts + 1 + i;
//		ctf_SafePrint(ent, print_priority, buf);
//	}

	gi.dprintf(buf);
	
	ent = ctf_findplayer(ent, NULL, CTF_TEAM_IGNORETEAM);
	while (ent)
	{
		ctf_SafePrint(ent, print_priority, buf); 
		ent = ctf_findplayer(ent, NULL, CTF_TEAM_IGNORETEAM);
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x46a3f(%rip), %rcx     # 0x66600
movq %rsi, %rdi
xorl %eax, %eax
callq *0x8(%rcx)
pushq $-0x4
popq %rbp
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0x192e0
movq %rax, %r15
testq %rax, %rax
je 0x1fbf2
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x18ec0
movq %r15, %rdi
jmp 0x1fbce
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_hook_abort
void ctf_hook_abort(edict_t *ent)
{
	if (ent && ent->client)
	{
//		ent->client->fall_time = 0;
//		ent->client->fall_value = 0;
//		ent->client->bobtime = 0.0625;
//		ent->pain_debounce_time = 0;
//		ent->client->ps.pmove.velocity[2] = 0;
//		if (ent->velocity[2] < 0)
//			ent->velocity[2] = (ent->velocity[2] * -1) /10;
		//surt, none of the above is responsible for the problem with
		//the bouncing view.

		// If we are on the ground, don't take falling damage
		if (ent->groundentity)
		{
			ent->client->oldvelocity[2] = 0;
			ent->velocity[2] = 0;
		}

		if (ent->client->pers.weapon &&
			!strcmp (ent->client->pers.weapon->pickup_name, "Grappling Hook"))
		{
			// Only stop firing grapple
			if (ent->client->weaponstate == WEAPON_FIRING)
				ent->client->weaponstate = WEAPON_READY;
		}
		ent->client->hookstate = 0; //Surt: this used to be ==, obviously broken
		ent->client->hooklength = 0;
		if (ent->client->hook)
		{
			ent->client->hook->think = NULL;
			ent->client->hook->nextthink = 0;
			ent->client->hook->hook_target = NULL;
			G_FreeEdict (ent->client->hook);
			ent->client->hook = NULL;
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x2072b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %r14
testq %r14, %r14
je 0x20724
cmpq $0x0, 0x2b8(%rbx)
je 0x206ae
andl $0x0, 0xee0(%r14)
andl $0x0, 0x1c8(%rbx)
movq 0x730(%r14), %rax
testq %rax, %rax
je 0x206e0
movq 0x50(%rax), %rdi
leaq 0x2f132(%rip), %rsi     # 0x4f7f7
callq 0x18bc0
testl %eax, %eax
jne 0x206e0
cmpl $0x3, 0xe78(%r14)
jne 0x206e0
andl $0x0, 0xe78(%r14)
andl $0x0, 0xf40(%r14)
andl $0x0, 0xf5c(%r14)
movq 0xf60(%r14), %rdi
testq %rdi, %rdi
je 0x20724
andq $0x0, 0x210(%rdi)
andl $0x0, 0x200(%rdi)
andq $0x0, 0x480(%rdi)
callq 0x19c50
movq 0x58(%rbx), %rax
andq $0x0, 0xf60(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_facing
char *
ctf_facing(edict_t *ent)
{
	int angle;
	
	angle = (int)ent->client->v_angle[1];

	// Turn the angle positive
	angle = (angle + 720) % 360;

	if (angle < 22 || angle >= 338)
		return "s";
	else if (angle < 67)
		return "se";
	else if (angle < 112)
		return "e";
	else if (angle < 157)
		return "ne";
	else if (angle < 202)
		return "n";
	else if (angle < 247)
		return "nw";
	else if (angle < 292)
		return "w";
	else // MJD - Requires a default state. Logic removed
	     // MJD - Would a (int)(angle/67) and case statment
	     // MJD - work better?
		return "sw";
}

// Assembly:
movq 0x58(%rdi), %rax
cvttss2si 0xec0(%rax), %eax
addl $0x2d0, %eax            # imm = 0x2D0
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
leal -0x152(%rdx), %eax
cmpl $0xfffffec4, %eax       # imm = 0xFFFFFEC4
jae 0x2075a
leaq 0x2e255(%rip), %rax     # 0x4e9ae
retq
cmpl $0x43, %edx
jae 0x20767
leaq 0x34d1f(%rip), %rax     # 0x55485
retq
cmpl $0x70, %edx
jae 0x20774
leaq 0x326ad(%rip), %rax     # 0x52e20
retq
cmpl $0x9d, %edx
jae 0x20784
leaq 0x325c7(%rip), %rax     # 0x52d4a
retq
cmpl $0xca, %edx
jae 0x20794
leaq 0x336e0(%rip), %rax     # 0x53e73
retq
cmpl $0xf7, %edx
jae 0x207a4
leaq 0x2f063(%rip), %rax     # 0x4f806
retq
cmpl $0x124, %edx            # imm = 0x124
leaq 0x3353e(%rip), %rcx     # 0x53cef
leaq 0x2f051(%rip), %rax     # 0x4f809
cmovbq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_faceNorth
char *
ctf_faceNorth(edict_t *ent)
{
	int angle;
	
	angle = (int)ent->client->v_angle[1];

	// Turn the angle positive
	angle = (angle + 720) % 360;

	if (angle < 22 || angle >= 338)
		return "south";
	else if (angle < 67)
		return "southwest";
	else if (angle < 112)
		return "west";
	else if (angle < 157)
		return "northwest";
	else if (angle < 202)
		return "north";
	else if (angle < 247)
		return "northeast";
	else if (angle < 292)
		return "east";
	else // MJD See Previous Error - Requires Default
		return "southeast";
}

// Assembly:
movq 0x58(%rdi), %rax
cvttss2si 0xec0(%rax), %eax
addl $0x2d0, %eax            # imm = 0x2D0
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
leal -0x152(%rdx), %eax
cmpl $0xfffffec4, %eax       # imm = 0xFFFFFEC4
jae 0x207eb
leaq 0x2f022(%rip), %rax     # 0x4f80c
retq
cmpl $0x43, %edx
jae 0x207f8
leaq 0x2f01b(%rip), %rax     # 0x4f812
retq
cmpl $0x70, %edx
jae 0x20805
leaq 0x2f01d(%rip), %rax     # 0x4f821
retq
cmpl $0x9d, %edx
jae 0x20815
leaq 0x2f008(%rip), %rax     # 0x4f81c
retq
cmpl $0xca, %edx
jae 0x20825
leaq 0x2f002(%rip), %rax     # 0x4f826
retq
cmpl $0xf7, %edx
jae 0x20835
leaq 0x2eff8(%rip), %rax     # 0x4f82c
retq
cmpl $0x124, %edx            # imm = 0x124
leaq 0x2efef(%rip), %rcx     # 0x4f831
leaq 0x2efed(%rip), %rax     # 0x4f836
cmovbq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_SpamCheck
qboolean ctf_SpamCheck(edict_t *ent)
{
	qboolean result = false;

	if (ent->client->ctf.extra_flags & CTF_EXTRAFLAGS_REFEREE)
		result = true;

	else if (	(ent->client->spam_band_count <= 0) || //no bandwidth available
					(ent->client->spam_freq_count > CTF_SPAM_FREQ_MAX_ALLOWED) || //no frequency available
					(level.time - ent->client->spam_lock_time < CTF_SPAM_LOCKOUT_TIME)    ) //already in penalty box
	{
		ctf_SafePrint(ent, PRINT_HIGH, "That action has been blocked by spam control.\n");
		ent->client->spam_lock_time = level.time; //you triggered spam lock
	}
	else
	{
		result = true;
		
		//here we have a player who has done too many long says, or some such
		if (ent->client->spam_band_count < CTF_SPAM_BAND_WARN_LEVEL)
		{
			ctf_SafePrint(ent, PRINT_HIGH, "Warning: Approaching spam bandwidth limits.\n");
		}
		
	}

	//here we have a player who has done a few actions in a short time
	if (ent->client->spam_freq_time - level.time < CTF_SPAM_FREQ_EXTRA_PENALTY_TIME)
	{
		ent->client->spam_freq_count += CTF_SPAM_FREQ_EXTRA_PENALTY;
		if (ent->client->spam_band_count < CTF_SPAM_FREQ_BAND_EXTRA_PENALTY_LEVEL) //compound penalty for bandwidth
			ent->client->spam_freq_count += CTF_SPAM_FREQ_BAND_EXTRA_PENALTY;
	}


	ent->client->spam_freq_time = level.time; //see test of this above

/*	gi.dprintf("Time: %f Freq-Time: %f Freq-Count: %ld Lock-Time: %f Band: %ld", 
		level.time,
		ent->client->spam_freq_time,
		ent->client->spam_freq_count,
		ent->client->spam_lock_time,
		ent->client->spam_band_count
		); */

	return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x58(%rdi), %rax
pushq $0x1
popq %rbx
testb $0x2, 0x1108(%rax)
jne 0x20a1b
movq %rdi, %r14
movq 0x10e0(%rax), %rcx
testq %rcx, %rcx
jle 0x209ef
cmpq $0x32, 0x10d8(%rax)
jg 0x209ef
movq 0x463cf(%rip), %rdx     # 0x66da0
movss 0x4(%rdx), %xmm0
subss 0x10cc(%rax), %xmm0
movss 0x2e51e(%rip), %xmm1    # 0x4ef04
ucomiss %xmm0, %xmm1
jbe 0x20a7f
leaq 0x2ee63(%rip), %rdx     # 0x4f859
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x18ec0
movq 0x46398(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10cc(%rax)
xorl %ebx, %ebx
movss 0x10d0(%rax), %xmm1
movq 0x46376(%rip), %rcx     # 0x66da0
movss 0x4(%rcx), %xmm0
subss %xmm0, %xmm1
movss 0x2ea35(%rip), %xmm2    # 0x4f470
ucomiss %xmm1, %xmm2
jbe 0x20a6d
movq 0x10d8(%rax), %rcx
movq 0x10e0(%rax), %rdx
leaq 0x14(%rcx), %rsi
movq %rsi, 0x10d8(%rax)
cmpq $0xbd, %rdx
jg 0x20a6d
addq $0x19, %rcx
movq %rcx, 0x10d8(%rax)
movss %xmm0, 0x10d0(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x59, %rcx
ja 0x20a1b
leaq 0x2edfc(%rip), %rdx     # 0x4f888
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x18ec0
movq 0x58(%r14), %rax
jmp 0x20a1b
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_SetLogName
void ctf_SetLogName()
{
	//surt automated logfile renaming here
	if ( strcmp(logrename->string, "") != 0)
	{
		time_t t;
		struct tm  *ptm;
		qboolean lognamechange = false;
		
		/* Get the time */
		t = time(NULL);
		
//		sl_CloseLogFile();
		
		ptm = localtime( &t );
		if( NULL != ptm )
		{
			char timestring[MAX_INFO_STRING];
			char stdlogstring[MAX_INFO_STRING];
			
			strftime( &timestring[0],
				(sizeof(timestring)/sizeof(timestring[0]))-1,
				"%d%b%Y.log",
				ptm );
			strcpy(stdlogstring, logrename->string);
			strcat(stdlogstring, "/");
			strcat(stdlogstring, timestring);
			if (strcmp(logrename->string, stdlogstring) != 0)
				lognamechange = true;
			if (lognamechange == true)
			{
				sl_GameEnd( &gi, level); //closes the previous logfile
				gi.cvar_set("stdlogname", stdlogstring); //set the new name
				sl_Logging( &gi, GAMEVERSION );	// StdLog - Surt, print the standard header
			}
		}
	}


	//surt end of automated logfile renaming
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x560, %rsp            # imm = 0x560
movq 0x45818(%rip), %r14     # 0x66540
movq (%r14), %rax
movq 0x8(%rax), %rax
cmpb $0x0, (%rax)
je 0x20e00
xorl %edi, %edi
callq 0x18f10
leaq 0x158(%rsp), %rdi
movq %rax, (%rdi)
callq 0x181a0
testq %rax, %rax
je 0x20e00
leaq 0x2eb71(%rip), %rdx     # 0x4f8d0
leaq 0x360(%rsp), %rbx
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdi
movq %rax, %rcx
callq 0x19450
movq (%r14), %rax
movq 0x8(%rax), %r14
leaq 0x160(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x182c0
movq %r15, %rdi
callq 0x186c0
movw $0x2f, 0x160(%rsp,%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x19800
movq %r14, %rdi
movq %r15, %rsi
callq 0x18bc0
testl %eax, %eax
je 0x20e00
movq 0x45fdc(%rip), %rsi     # 0x66da0
pushq $0x2b
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq 0x4582c(%rip), %rbx     # 0x66600
movq %rbx, %rdi
callq 0x19be0
leaq 0x2eaf8(%rip), %rdi     # 0x4f8db
leaq 0x160(%rsp), %rsi
callq *0x128(%rbx)
leaq 0x2eaee(%rip), %rsi     # 0x4f8e6
movq %rbx, %rdi
callq 0x19740
addq $0x560, %rsp            # imm = 0x560
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_ChangeMap
void ctf_ChangeMap(char *mapname, qboolean startmatch)
{
	extern int matchstate;
    char command[MAX_INFO_STRING];
    Com_sprintf (command, sizeof(command), "gamemap \"%s\"\n", mapname);
    gi.AddCommandString (command);
    level.changemap = NULL;
    level.exitintermission = 0;
    level.intermissiontime = 0;
    stats_cleanup(); // STATS - LM_Hati
    KillMatch();
    if (startmatch) {
		matchstate = MATCH_COUNTDOWN;
    } else {
		matchstate = MATCH_NONE;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rcx
xorl %ebp, %ebp
testl %esi, %esi
setne %bpl
leaq 0x2eacb(%rip), %rdx     # 0x4f8f3
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x18f30
movq 0x457bf(%rip), %rax     # 0x66600
movq %rbx, %rdi
callq *0x150(%rax)
movq 0x45f4f(%rip), %rax     # 0x66da0
andq $0x0, 0xd0(%rax)
andl $0x0, 0xd8(%rax)
andl $0x0, 0xc8(%rax)
xorl %eax, %eax
callq 0x19090
xorl %eax, %eax
callq 0x180d0
addl %ebp, %ebp
movq 0x4595a(%rip), %rax     # 0x667d8
movl %ebp, (%rax)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_skins.c
// Function: SkinValid
qboolean
SkinValid(edict_t *ent, char *input)
{
	int teamnum, i;
	qboolean	valid = false;
	char	skin[MAX_INFO_STRING] = { 0 };
	char	model[MAX_INFO_STRING] = { 0 };

	if (!ent->client)
		return false;

	if (!input)
		return false;

	// Parse our input skin and model
	if (sscanf(input, "%[^/]/%s", model, skin) != 2)
		return false; // Doesn't contain skin and model

	if (ent->client->ctf.teamnum == CTF_TEAM_RED)
		teamnum = SKIN_RED;
	else 
		teamnum = SKIN_BLUE;

	i = 0;
	while(skinlist[teamnum][i][SKIN_MODELNAME])
	{
		if (!strcmp(skinlist[teamnum][i][SKIN_SKINNAME], skin) &&
			!strcmp(skinlist[teamnum][i][SKIN_MODELNAME], model))
		{
			valid = true;
			break;
		}
		i++;
	}
	return valid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %r15
movq %rdi, %r14
leaq 0x200(%rsp), %rdi
xorl %ebx, %ebx
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x188e0
movq %rsp, %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x188e0
testq %r15, %r15
je 0x2133e
cmpq $0x0, 0x58(%r14)
je 0x2133e
leaq 0x2e696(%rip), %rsi     # 0x4f958
xorl %ebx, %ebx
movq %rsp, %rdx
leaq 0x200(%rsp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x19110
cmpl $0x2, %eax
jne 0x2133e
movq 0x58(%r14), %rax
xorl %ecx, %ecx
cmpl $0x1, 0x1100(%rax)
setne %cl
shll $0xc, %ecx
movq 0x45280(%rip), %rax     # 0x66578
leaq (%rcx,%rax), %r13
addq $0x8, %r13
leaq 0x200(%rsp), %r14
movq %rsp, %r15
pushq $0x1
popq %rbp
movq -0x8(%r13), %r12
testq %r12, %r12
je 0x2133e
movq (%r13), %rdi
movq %r14, %rsi
callq 0x18bc0
testl %eax, %eax
jne 0x21336
movq %r12, %rdi
movq %r15, %rsi
callq 0x18bc0
testl %eax, %eax
je 0x2133c
addq $0x10, %r13
jmp 0x2130e
movl %ebp, %ebx
movl %ebx, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_skins.c
// Function: SkinRandom
char *SkinRandom(edict_t *ent)
{
	int teamnum,i;
	static	char skin[MAX_INFO_STRING]; // Returned and used as a temp

	if (ent->client->ctf.teamnum == CTF_TEAM_RED)
		teamnum = SKIN_RED;
	else 
		teamnum = SKIN_BLUE;

	i = 0;
	while (skinlist[teamnum][i][SKIN_MODELNAME])
	{
		i++;
	}

	i = rand() % i;

	sprintf(skin, "%s/%s", skinlist[teamnum][i][SKIN_MODELNAME],
		skinlist[teamnum][i][SKIN_SKINNAME]);

	return skin;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x58(%rdi), %rax
xorl %ebx, %ebx
cmpl $0x1, 0x1100(%rax)
setne %bl
movl %ebx, %eax
shll $0xc, %eax
addq 0x451fd(%rip), %rax     # 0x66578
pushq $-0x1
popq %rbp
incl %ebp
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0x2137e
callq 0x19bf0
cltd
idivl %ebp
movslq %edx, %rax
shlq $0x4, %rax
shll $0xc, %ebx
addq 0x451d5(%rip), %rbx     # 0x66578
movq (%rax,%rbx), %rdx
movq 0x8(%rax,%rbx), %rcx
leaq 0x4cd8d(%rip), %rbx     # 0x6e140
leaq 0x2e5d0(%rip), %rsi     # 0x4f98a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x198c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_skins.c
// Function: SkinGetList
char **SkinGetList(edict_t *ent)
{
	int teamnum, i;
	static	char *skins[SKIN_MAXSKINS]; // Returned and used as a temp
	static  char storage[SKIN_MAXSKINS][30];
	
	if (ent->client->ctf.teamnum == CTF_TEAM_RED)
		teamnum = SKIN_RED;
	else 
		teamnum = SKIN_BLUE;

	i = 0;
	while (skinlist[teamnum][i][SKIN_MODELNAME])
	{
		sprintf(storage[i], "%s/%s", skinlist[teamnum][i][SKIN_MODELNAME],
			skinlist[teamnum][i][SKIN_SKINNAME]);
		skins[i] = storage[i];		
		i++;
	}
	skins[i] = NULL;

	return skins;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x58(%rdi), %rax
xorl %ecx, %ecx
cmpl $0x1, 0x1100(%rax)
setne %cl
shll $0xc, %ecx
movq 0x45187(%rip), %rax     # 0x66578
leaq (%rcx,%rax), %r12
addq $0x8, %r12
leaq 0x4d740(%rip), %rbx     # 0x6eb40
leaq 0x2e583(%rip), %r15     # 0x4f98a
leaq 0x4cf32(%rip), %r14     # 0x6e340
xorl %r13d, %r13d
movq -0x8(%r12,%r13,2), %rdx
testq %rdx, %rdx
je 0x2143b
movq (%r12,%r13,2), %rcx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x198c0
movq %rbx, (%r13,%r14)
addq $0x8, %r13
addq $0x1e, %rbx
jmp 0x21411
andq $0x0, (%r13,%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_tourney.c
// Function: Match_End
void Match_End(edict_t *ent)
{
    Victory();

    matchstate = MATCH_OVER;
    ent->count = 300; // five minutes
    game.teamslocked = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x196e0
movq 0x44dd5(%rip), %rax     # 0x667d8
movl $0x4, (%rax)
movl $0x12c, 0x290(%rbx)     # imm = 0x12C
movq 0x45326(%rip), %rax     # 0x66d40
andl $0x0, 0x624(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_tourney.c
// Function: SetPause
void SetPause(qboolean state)
{
    edict_t *ent;
    char *message;
    int i;

    match_pause = state;

    if (state) {
    	if ((int)autolock->value) {
    		game.teamslocked = false;
    	}
        message = "Game Paused\n";
    } else {
    	if ((int)autolock->value) {
    		game.teamslocked = true;
    	}
        message = "Game Unpaused\n";
    }

    for (i=0 ; i<game.maxclients ; i++) {  // Go through everyone
        ent = g_edicts + 1 + i;            // Select the client entity from the list of ents.
        if (!ent->inuse) {                 // Not in game yet is what I think this means.
            continue;
        }
        gi.centerprintf(ent, message);
    }
    gi.dprintf(message);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x44fff(%rip), %rax     # 0x66aa0
movl %edi, (%rax)
testl %edi, %edi
movq 0x45264(%rip), %rax     # 0x66d10
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
leaq 0x2dfe7(%rip), %rcx     # 0x4faa2
leaq 0x2dfd3(%rip), %rbx     # 0x4fa95
cmoveq %rcx, %rbx
testl %eax, %eax
je 0x21ade
xorl %eax, %eax
testl %edi, %edi
sete %al
movq 0x45268(%rip), %rcx     # 0x66d40
movl %eax, 0x624(%rcx)
movq 0x4525b(%rip), %r14     # 0x66d40
movl 0x610(%r14), %eax
movl $0x4a8, %r15d           # imm = 0x4A8
movq 0x44a5f(%rip), %r13     # 0x66558
movq 0x44b00(%rip), %r12     # 0x66600
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x21b36
movq (%r13), %rdi
cmpl $0x0, 0x60(%rdi,%r15)
je 0x21b2a
addq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq *0x18(%r12)
movl 0x610(%r14), %eax
incq %rbp
addq $0x4a8, %r15            # imm = 0x4A8
jmp 0x21b02
movq 0x8(%r12), %rcx
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_tourney.c
// Function: KillMatch
void KillMatch()
{
    matchstate = MATCH_NONE;

    if (tourneyclock) {
        tourneyclock->think = G_FreeEdict;
        tourneyclock->nextthink = level.time + 1;
        tourneyclock = NULL;
    }

    if ((int)autolock->value) {
    	game.teamslocked = false;
    }
}

// Assembly:
movq 0x44841(%rip), %rax     # 0x667d8
andl $0x0, (%rax)
movq 0x45047(%rip), %rax     # 0x66fe8
movq (%rax), %rcx
testq %rcx, %rcx
je 0x21fd7
movq 0x44480(%rip), %rdx     # 0x66430
movq %rdx, 0x210(%rcx)
movq 0x44de2(%rip), %rdx     # 0x66da0
movss 0x4(%rdx), %xmm0
addss 0x2cf5d(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rcx)
andq $0x0, (%rax)
movq 0x44d32(%rip), %rax     # 0x66d10
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testl %eax, %eax
je 0x21ff8
movq 0x44d4f(%rip), %rax     # 0x66d40
andl $0x0, 0x624(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_tourney.c
// Function: SpawnTourneyClock
void SpawnTourneyClock ()
{
    edict_t    *ent;

    if (!tourneyclock) {
        ent = G_Spawn();
        tourneyclock = ent;
    } else {
        ent = tourneyclock;
    }

    if (matchstate == MATCH_RAILGUN_COUNTDOWN) {
        ent->count = 16;
    } else {
        ent->count = (int)countdown_time->value;
        matchstate = MATCH_COUNTDOWN;
    }

    // game is about to start, lock teams if necessary
    if ((int)autolock->value) {
    	game.teamslocked = true;
    }

    ent->think = Tourney_Think;
    ent->nextthink = level.time + 1;
}

// Assembly:
pushq %rbx
movq 0x44fbb(%rip), %rbx     # 0x66fe8
movq (%rbx), %rax
testq %rax, %rax
jne 0x2203d
callq 0x198d0
movq %rax, (%rbx)
movq 0x44794(%rip), %rdx     # 0x667d8
cmpl $0x5, (%rdx)
jne 0x2204e
pushq $0x10
popq %rcx
jmp 0x22063
movq 0x4485b(%rip), %rcx     # 0x668b0
movq (%rcx), %rcx
cvttss2si 0x20(%rcx), %ecx
movl $0x2, (%rdx)
movl %ecx, 0x290(%rax)
movq 0x44ca0(%rip), %rcx     # 0x66d10
movq (%rcx), %rcx
cvttss2si 0x20(%rcx), %ecx
testl %ecx, %ecx
je 0x2208d
movq 0x44cbd(%rip), %rcx     # 0x66d40
movl $0x1, 0x624(%rcx)
movq 0x44e6c(%rip), %rcx     # 0x66f00
movq %rcx, 0x210(%rax)
movq 0x44cfe(%rip), %rcx     # 0x66da0
movss 0x4(%rcx), %xmm0
addss 0x2ce79(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rax)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/plasma.c
// Function: Spawn_Goop
edict_t *
Spawn_Goop
(edict_t *ent, vec3_t start) {
	edict_t *goop = G_Spawn();

	goop->owner=	ent;
	goop->clipmask=	MASK_SHOT;
	goop->solid=	SOLID_BBOX;
	goop->svflags=	SVF_DEADMONSTER;
	
	VectorCopy (start, goop->s.origin);
	goop->classname= "goop";

	//goop->s.effects|=	EF_BLUEHYPERBLASTER | EF_ANIM_ALLFAST;
	//bat to get rid of the blue flag effect
	goop->s.effects|=	EF_IONRIPPER | EF_ANIM_ALLFAST;
	goop->s.renderfx= 	RF_TRANSLUCENT;
	goop->s.modelindex=	gi.modelindex(PLASMA_SPRITE_FLY);
	goop->s.sound= 		gi.soundindex(PLASMA_SOUND_FLYBY);

	return goop;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x198d0
movq %rax, %r15
movq %r14, 0x110(%rax)
movabsq $0x600000300000002, %rax # imm = 0x600000300000002
movq %rax, 0x108(%r15)
movl $0x2, 0xc8(%r15)
movss (%rbx), %xmm0
movss %xmm0, 0x4(%r15)
movss 0x4(%rbx), %xmm0
movss %xmm0, 0x8(%r15)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0xc(%r15)
leaq 0x2d799(%rip), %rax     # 0x4fcb7
movq %rax, 0x138(%r15)
orl $0x102000, 0x40(%r15)   # imm = 0x102000
movl $0x20, 0x44(%r15)
movq 0x440c4(%rip), %rbx     # 0x66600
leaq 0x2d779(%rip), %rdi     # 0x4fcbc
callq *0x40(%rbx)
movl %eax, 0x28(%r15)
leaq 0x2d781(%rip), %rdi     # 0x4fcd2
callq *0x48(%rbx)
movl %eax, 0x4c(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/plasma.c
// Function: fire_plasma
void
fire_plasma
(edict_t *ent, vec3_t start, vec3_t dir, int reflect) {
	edict_t *goop= Spawn_Goop(ent, start);

	// give it some thickness for the bounce
	VectorSet (goop->mins, -12,-12,-12);
	VectorSet (goop->maxs, 12,12,12);

	if(reflect)
	{
		fire_plasma_reflect (goop,start,dir);
		//bat
		ent->client->pers.inventory[ent->client->ammo_index] -= (PLASMA_CELLS_PER_SHOT -1);
	}
	else
	{
		fire_plasma_spread (goop,start,dir);
		//bat
		ent->client->pers.inventory[ent->client->ammo_index] -= (PLASMA_CELLS_PER_SHOT - 1);
	}


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x188d0
movaps 0x2d474(%rip), %xmm0    # 0x4fc50
movups %xmm0, 0xcc(%rax)
movsd 0x2d475(%rip), %xmm0    # 0x4fc60
movsd %xmm0, 0xdc(%rax)
movq %rax, %rdi
testl %ebp, %ebp
je 0x22804
movq %r14, %rdx
callq 0x19560
jmp 0x2280f
movq %r15, %rsi
movq %r14, %rdx
callq 0x18740
movq 0x58(%rbx), %rax
movslq 0xe38(%rax), %rcx
addl $-0x9, 0x318(%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/plasma.c
// Function: Use_PLASMA
void
Use_PLASMA
(edict_t *ent, gitem_t *item)
{
	int		ammo_index;
	gitem_t		*ammo_item;
///////// FIXME /////////
	// if we're already using it, switch modes
	if(item == ent->client->pers.weapon) {
		// see if you have the other weapon
			// if yes, switch
			// else return
// simple hack for demo
		ent->client->plasma_mode = (!ent->client->plasma_mode);

		if(ent->client->plasma_mode)
			gi.cprintf(ent, PRINT_HIGH, "bounce plasma\n");
		else
			gi.cprintf(ent, PRINT_HIGH, "spread plasma\n");

		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])
		{
			gi.cprintf (ent, PRINT_HIGH, "No %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
			return;
		}

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdx
cmpq %rsi, 0x730(%rdx)
je 0x228cc
movq %rsi, %r14
movq 0x60(%rsi), %rdi
testq %rdi, %rdi
je 0x228bd
movq 0x43cf0(%rip), %rax     # 0x66548
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x228bd
jp 0x228bd
testb $0x2, 0x68(%r14)
jne 0x228bd
callq 0x18a80
movq %rax, %rcx
subq 0x445c0(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%rbx), %rdx
cltq
movl 0x318(%rdx,%rax,4), %eax
testl %eax, %eax
je 0x2290c
cmpl 0x5c(%r14), %eax
jge 0x228bd
movq 0x43d58(%rip), %rax     # 0x66600
movq 0x10(%rax), %r9
movq 0x50(%rcx), %rcx
movq 0x50(%r14), %r8
leaq 0x2d45d(%rip), %rdx     # 0x4fd18
jmp 0x22926
movq %r14, 0xe50(%rdx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
cmpl $0x0, 0xf3c(%rdx)
sete %al
movl %eax, 0xf3c(%rdx)
movq 0x43d1b(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
je 0x228f4
leaq 0x2d408(%rip), %rdx     # 0x4fcfa
jmp 0x228fb
leaq 0x2d3f0(%rip), %rdx     # 0x4fceb
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
movq 0x43ced(%rip), %rax     # 0x66600
movq 0x10(%rax), %r9
movq 0x50(%rcx), %rcx
movq 0x50(%r14), %r8
leaq 0x2d3e3(%rip), %rdx     # 0x4fd09
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%r9
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_chase.c
// Function: ChaseNext
void ChaseNext(edict_t *ent)
{
int i;
edict_t *e;
int Chase_Team; //-bat

	if(!ent->client->chase_target)
		return;

	Chase_Team = ent->client->ctf.teamnum;

	i = ent->client->chase_target - g_edicts;
	do 
	{
		i++;
		if (i > maxclients->value)
			i = 1;
		e = g_edicts + i;
		if(!e->inuse)
			continue;

		//bat
		if(((Chase_Team == CTF_TEAM_OBSERVER_RED) && (e->client->ctf.teamnum != CTF_TEAM_RED))
			|| ((Chase_Team == CTF_TEAM_OBSERVER_BLUE) && (e->client->ctf.teamnum != CTF_TEAM_BLUE)))
			continue;


		if (!e->client->resp.spectator)
			break;
	} while (e != ent->client->chase_target);

	ent->client->chase_target = e;
	ent->client->update_chase = true;
}

// Assembly:
movq 0x58(%rdi), %rcx
movq 0xf30(%rcx), %rsi
testq %rsi, %rsi
je 0x2300c
movl 0x1100(%rcx), %edi
movq 0x435e6(%rip), %rax     # 0x66558
movq (%rax), %r8
movq %rsi, %rax
subq %r8, %rax
movl $0x4a8, %r9d            # imm = 0x4A8
cqto
idivq %r9
movq 0x435a3(%rip), %rdx     # 0x66530
movq (%rdx), %rdx
movss 0x20(%rdx), %xmm0
pushq $0x1
popq %rdx
movl %eax, %r9d
incl %r9d
cvtsi2ss %r9d, %xmm1
ucomiss %xmm0, %xmm1
movl %edx, %eax
ja 0x22fad
movl %r9d, %eax
movslq %eax, %r9
imulq $0x4a8, %r9, %r10       # imm = 0x4A8
leaq (%r8,%r10), %r9
cmpl $0x0, 0x60(%r8,%r10)
je 0x22ff6
movq 0x58(%r9), %r10
cmpl $-0x2, %edi
je 0x22fec
cmpl $-0x3, %edi
jne 0x22fdb
cmpl $0x1, 0x1100(%r10)
jne 0x22ff6
cmpq %rsi, %r9
je 0x22ffb
cmpl $0x0, 0xe04(%r10)
jne 0x22f98
jmp 0x22ffb
cmpl $0x2, 0x1100(%r10)
je 0x22fdb
cmpq %rsi, %r9
jne 0x22f98
movq %r9, 0xf30(%rcx)
movl $0x1, 0xf38(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_chase.c
// Function: ChasePrev
void ChasePrev(edict_t *ent)
{
int i;
edict_t *e;
int Chase_Team; //-bat
int Team_Observe_OK;

	if(!ent->client->chase_target)
		return;

	Chase_Team = ent->client->ctf.teamnum;

	if(Chase_Team == CTF_TEAM_OBSERVER_RED || Chase_Team == CTF_TEAM_OBSERVER_BLUE)
		Team_Observe_OK = false;
	else
		Team_Observe_OK = true;

	i = ent->client->chase_target - g_edicts;
	do 
	{
		i--;
		if(i < 1)
			i = maxclients->value;
		e = g_edicts + i;
		if(!e->inuse)
			continue;

		//bat
		if(((Chase_Team == CTF_TEAM_OBSERVER_RED) && (e->client->ctf.teamnum != CTF_TEAM_RED))
			|| ((Chase_Team == CTF_TEAM_OBSERVER_BLUE) && (e->client->ctf.teamnum != CTF_TEAM_BLUE)))
			continue;

		if(!e->client->resp.spectator)
		{
			Team_Observe_OK = true;
			break;
		}
	} while (e != ent->client->chase_target);

	if(Team_Observe_OK)
	{
		ent->client->chase_target = e;
		ent->client->update_chase = true;
	}
}

// Assembly:
movq 0x58(%rdi), %rcx
movq 0xf30(%rcx), %rsi
testq %rsi, %rsi
je 0x230be
movl 0x1100(%rcx), %edi
leal 0x3(%rdi), %r8d
movq 0x43526(%rip), %rax     # 0x66558
movq (%rax), %r9
movq %rsi, %rax
subq %r9, %rax
movl $0x4a8, %r10d           # imm = 0x4A8
cqto
idivq %r10
movq 0x434e3(%rip), %rdx     # 0x66530
movq (%rdx), %rdx
cmpl $0x1, %eax
jg 0x2305c
cvttss2si 0x20(%rdx), %eax
jmp 0x2305e
decl %eax
movslq %eax, %r10
imulq $0x4a8, %r10, %r11      # imm = 0x4A8
leaq (%r9,%r11), %r10
cmpl $0x0, 0x60(%r9,%r11)
je 0x230a2
movq 0x58(%r10), %r11
cmpl $-0x2, %edi
je 0x2308e
cmpl $-0x3, %edi
jne 0x23098
cmpl $0x1, 0x1100(%r11)
je 0x23098
jmp 0x230a2
cmpl $0x2, 0x1100(%r11)
jne 0x230a2
cmpl $0x0, 0xe04(%r11)
je 0x230ad
cmpq %rsi, %r10
jne 0x23050
cmpl $0x2, %r8d
jb 0x230be
movq %r10, 0xf30(%rcx)
movl $0x1, 0xf38(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_chase.c
// Function: GetChaseTarget
void GetChaseTarget(edict_t *ent)
{
int i;
edict_t *other;
int Chase_Team; //-bat

	Chase_Team = ent->client->ctf.teamnum;

	for(i = 1; i <= maxclients->value; i++) 
	{
		//other is the guy we are chasing
		other = g_edicts + i;

		//-bat
		if(((Chase_Team == CTF_TEAM_OBSERVER_RED) && (other->client->ctf.teamnum != CTF_TEAM_RED))
			|| ((Chase_Team == CTF_TEAM_OBSERVER_BLUE) && (other->client->ctf.teamnum != CTF_TEAM_BLUE)))
			continue;

		if(other->inuse && !other->client->resp.spectator) 
		{
			ent->client->chase_target = other;
			ent->client->update_chase = true;
			UpdateChaseCam(ent);
			return;
		}
	}

	gi.centerprintf(ent, "No other players to chase.");
}

// Assembly:
movq 0x58(%rdi), %rax
movl 0x1100(%rax), %ecx
movq 0x43416(%rip), %rdx     # 0x66530
movq (%rdx), %rdx
movss 0x20(%rdx), %xmm0
movq 0x4342f(%rip), %rsi     # 0x66558
movl $0x4a8, %edx            # imm = 0x4A8
addq (%rsi), %rdx
pushq $0x1
popq %rsi
cvtsi2ss %esi, %xmm1
ucomiss %xmm1, %xmm0
jb 0x23184
cmpl $-0x2, %ecx
je 0x23157
cmpl $-0x3, %ecx
jne 0x23165
movq 0x58(%rdx), %r8
cmpl $0x1, 0x1100(%r8)
je 0x23165
jmp 0x23179
movq 0x58(%rdx), %r8
cmpl $0x2, 0x1100(%r8)
jne 0x23179
cmpl $0x0, 0x60(%rdx)
je 0x23179
movq 0x58(%rdx), %r8
cmpl $0x0, 0xe04(%r8)
je 0x2319a
addq $0x4a8, %rdx            # imm = 0x4A8
incl %esi
jmp 0x23134
movq 0x43475(%rip), %rax     # 0x66600
movq 0x18(%rax), %rcx
leaq 0x2cc05(%rip), %rsi     # 0x4fd9b
xorl %eax, %eax
jmpq *%rcx
movq %rdx, 0xf30(%rax)
movl $0x1, 0xf38(%rax)
jmp 0x19ba0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: stats_log_reset
void stats_log_reset()
{
	stats_player_s * p_current_player;

	p_current_player = p_start_player;
	while (p_current_player != NULL)
	{
		p_start_player = p_start_player->pNext;
		gi.TagFree(p_current_player);
		p_current_player = p_start_player;
	}

	stats_log_init();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x43771(%rip), %rbx     # 0x66938
movq 0x43432(%rip), %r14     # 0x66600
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x231e9
movq 0x280(%rdi), %rax
movq %rax, (%rbx)
callq *0x110(%r14)
jmp 0x231ce
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: stats_find_dropped_player
stats_player_s* stats_find_dropped_player(char* name)
{
	stats_player_s *p_current_player = p_start_player;
	
	while (p_current_player != NULL)
	{
		if ((strcmp(p_current_player->info.name, name) == 0) &&
			p_current_player->dropped)
			break;
		else
			p_current_player = p_current_player->pNext;
	}

	return p_current_player;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x43739(%rip), %rbx     # 0x66938
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x23225
leaq 0x4(%rbx), %rdi
movq %r14, %rsi
callq 0x18bc0
testl %eax, %eax
jne 0x2321c
cmpl $0x0, (%rbx)
jne 0x23225
addq $0x280, %rbx            # imm = 0x280
jmp 0x231ff
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: stats_new_player
stats_player_s* stats_new_player(char* name)
{
	stats_player_s* p_player;
	
	p_player = (stats_player_s *) gi.TagMalloc(sizeof(stats_player_s), TAG_GAME);
	if (!p_player) {
		gi.error(ERR_FATAL, "LMCTF: allocation failed in %s", __func__);
		return NULL;
	}

	stats_init_player(p_player);
	p_player->dropped = false;
	p_player->info.teamnum = CTF_TEAM_UNDEFINED;
	strcpy(p_player->info.name, name);

	//attach the player to the front of the list
	p_player->pNext = p_start_player;
	p_start_player = p_player;

	return p_player;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x433aa(%rip), %r15     # 0x66600
movl $0x288, %edi            # imm = 0x288
movl $0x2fd, %esi            # imm = 0x2FD
callq *0x108(%r15)
movq %rax, %rbx
testq %rax, %rax
je 0x232a6
movq %rbx, %rdi
callq 0x19150
andl $0x0, (%rbx)
movq %rbx, %rdi
addq $0x4, %rdi
andl $0x0, 0x204(%rbx)
movq %r14, %rsi
callq 0x182c0
movq 0x436a1(%rip), %rax     # 0x66938
movq (%rax), %rcx
movq %rcx, 0x280(%rbx)
movq %rbx, (%rax)
jmp 0x232bc
leaq 0x2cb09(%rip), %rsi     # 0x4fdb6
leaq 0x2cb21(%rip), %rdx     # 0x4fdd5
xorl %edi, %edi
xorl %eax, %eax
callq *0x38(%r15)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq