LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: Drop_Rune_Think
void Drop_Rune_Think (edict_t *ent)
{
	ent->touch = Touch_Item;
	ent->owner = NULL;
	ent->think = Rune_Think;
	ent->nextthink = level.time + FRAMETIME;
}

// Assembly:
movq 0x49a82(%rip), %rax     # 0x69880
movq %rax, 0x220(%rdi)
movq $0x0, 0x110(%rdi)
movq 0x49e09(%rip), %rax     # 0x69c20
movq %rax, 0x210(%rdi)
movq 0x49f7b(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x3445e(%rip), %xmm0    # 0x54290
movss %xmm0, 0x200(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: tossruneset
static void tossruneset(edict_t *ent)
{
	ent->svflags &= ~SVF_NOCLIENT;
	ent->flags |= FL_RESPAWN;
	ent->spawnflags = DROPPED_ITEM;
	
	if (ent->model)
		gi.setmodel (ent, ent->model);
	else
		gi.setmodel (ent, ent->item->world_model);
	ent->movetype = MOVETYPE_TOSS;  
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andb $-0x2, 0xc8(%rdi)
orb $-0x80, 0x11f(%rdi)
movl $0x10000, 0x140(%rdi)   # imm = 0x10000
movq 0x120(%rdi), %rsi
movq 0x49587(%rip), %rax     # 0x69600
movq 0x58(%rax), %rax
testq %rsi, %rsi
jne 0x2008d
movq 0x330(%rbx), %rcx
movq 0x30(%rcx), %rsi
movq %rbx, %rdi
callq *%rax
movl $0x7, 0x118(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: DamageRuneHook
int DamageRuneHook(edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, int knockback, int dflags)
{
	if (attacker && attacker->client && attacker->client->rune)
	{
		if (attacker->client->rune->runetype == RUNE_DAMAGE)
		{
			//damage *=2; // Double damage
			damage *= 1.75f; //-bat
		}
	}
	
	return damage;
}

// Assembly:
movl %ecx, %eax
testq %rdx, %rdx
je 0x200d3
movq 0x58(%rdx), %rcx
testq %rcx, %rcx
je 0x200d3
movq 0xf68(%rcx), %rcx
testq %rcx, %rcx
je 0x200d3
cmpl $0x1, 0x478(%rcx)
jne 0x200d3
cvtsi2ss %eax, %xmm0
mulss 0x341dd(%rip), %xmm0    # 0x542ac
cvttss2si %xmm0, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: ResistRuneHook
int ResistRuneHook(edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, int knockback, int dflags)
{
	if (targ && targ->client && targ->client->rune)
	{
		if (targ->client->rune->runetype == RUNE_RESIST)
		{
			//damage /=2; // Half damage
			damage /= 1.75f; //-bat needs to offset damage rune.
			gi.sound(targ, CHAN_ITEM, gi.soundindex("ctf/resist.wav"), 1, ATTN_NORM, 0);
		}
	}
	
	return damage;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
testq %rdi, %rdi
je 0x20141
movq %rdi, %r14
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x20141
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x20141
cmpl $0x2, 0x478(%rax)
jne 0x20141
cvtsi2ss %ebx, %xmm0
divss 0x3419f(%rip), %xmm0    # 0x542ac
cvttss2si %xmm0, %ebx
movq 0x494e8(%rip), %rax     # 0x69600
movq 0x20(%rax), %r15
leaq 0x342cb(%rip), %rdi     # 0x543ee
callq *0x48(%rax)
movss 0x33dfa(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %r14, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x203d4
movq %rdi, %rbx
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x203d4
movq 0xf68(%rax), %rcx
testq %rcx, %rcx
je 0x203d4
cmpl $0x4, 0x478(%rcx)
jne 0x2037e
cmpl $0x0, 0xf70(%rax)
je 0x20367
movq 0x492c2(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x340cf(%rip), %rdi     # 0x54418
callq *0x48(%rax)
movss 0x33bd4(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
movq 0x58(%rbx), %rax
cmpl $0x0, 0x5c(%rax)
je 0x2037e
movq 0x730(%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x58(%rbx), %rax
movq 0xf68(%rax), %rcx
cmpl $0x1, 0x478(%rcx)
jne 0x203d4
cmpl $0x0, 0xf70(%rax)
je 0x203d4
movq 0x4925e(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x3407c(%rip), %rdi     # 0x54429
callq *0x48(%rax)
movss 0x33b70(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
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
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_findplayer
edict_t * ctf_findplayer(edict_t * ent_after, edict_t * ignore, int teamnum_wanted)
{
	edict_t * temp;

	if (ent_after == NULL)
		temp = g_edicts + 1;
	else
		temp = ent_after + 1;

	while ( (temp - (g_edicts + 1)) < game.maxclients)
	{
		if (ctf_validateplayer(temp, CTF_TEAM_IGNORETEAM) ) //make sure we're looking at something valid
		{
			if (temp != ignore) //null ignore would get caught by the outer loop
			{
				if (teamnum_wanted == CTF_TEAM_IGNORETEAM) //just want to find players
				{
					return temp;
				}
				else if (teamnum_wanted == CTF_TEAM_ANYTEAM) //want to find players on teams
				{
					if (temp->client->ctf.teamnum > CTF_TEAM_UNDEFINED) //CTF_TEAM_UNDEFINED or less are not real teams
						return temp;
				}
				else if (temp->client->ctf.teamnum == teamnum_wanted) //want player on specific team
				{
					return temp;
				}
			}
		}
		temp++;
	}
		
		
/*
	edict_t * temp;

	temp = G_Find (ent_after, FOFS(classname), "player");
	while ( temp != NULL )
	{
		if (ctf_validateplayer(temp, CTF_TEAM_IGNORETEAM) ) //make sure we're looking at something valid
		{
			if (temp != ignore) //null ignore would get caught by the outer loop
			{
				if (teamnum_wanted == CTF_TEAM_IGNORETEAM) //just want to find players
				{
					return temp;
				}
				else if (teamnum_wanted == CTF_TEAM_ANYTEAM) //want to find players on teams
				{
					if (temp->client->ctf.teamnum > CTF_TEAM_UNDEFINED) //CTF_TEAM_UNDEFINED or less are not real teams
						return temp;
				}
				else if (temp->client->ctf.teamnum == teamnum_wanted) //want player on specific team
				{
					return temp;
				}
			}
		}
		temp = G_Find (temp, FOFS(classname), "player");
	}
	*/

	return NULL; //didn't find anything to return before here.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r15
testq %rdi, %rdi
movq 0x49162(%rip), %rax     # 0x69558
movq (%rax), %rax
cmoveq %rax, %r15
movq 0x4993c(%rip), %rcx     # 0x69d40
movslq 0x610(%rcx), %r12
leaq 0x4a8(%r15), %rbx
movq %rbx, %rcx
subq %rax, %rcx
addq $-0x4a8, %rcx           # imm = 0xFB58
sarq $0x3, %rcx
movabsq $-0x20a4f089731d3543, %rdx # imm = 0xDF5B0F768CE2CABD
imulq %rdx, %rcx
cmpq %r12, %rcx
jge 0x204a4
movq %rsi, %r14
subq %rax, %r15
addq $0x4a8, %r15            # imm = 0x4A8
movl $0x4a8, %r13d           # imm = 0x4A8
movq %rbx, %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x18ce0
cmpq %r14, %rbx
je 0x20484
testl %eax, %eax
je 0x20484
cmpl $-0x5, %ebp
je 0x20477
cmpl $-0x4, %ebp
je 0x204a6
movq 0x58(%rbx), %rax
cmpl %ebp, 0x1100(%rax)
jne 0x20484
jmp 0x204a6
movq 0x58(%rbx), %rax
cmpl $0x0, 0x1100(%rax)
jg 0x204a6
addq %r13, %rbx
movq %r15, %rax
sarq $0x3, %rax
movabsq $-0x20a4f089731d3543, %rcx # imm = 0xDF5B0F768CE2CABD
imulq %rcx, %rax
addq %r13, %r15
cmpq %r12, %rax
jl 0x20449
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x204f3
movq 0x58(%rdi), %r14
testq %r14, %r14
je 0x204f3
cmpl $0x0, 0x60(%rdi)
je 0x204f3
cmpl $0x0, 0x304(%r14)
je 0x204f3
movl %esi, %ebx
movq 0x138(%rdi), %rdi
leaq 0x34ea9(%rip), %rsi     # 0x55393
callq 0x18b20
testl %eax, %eax
je 0x204fd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x499bc(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
movl $0x1, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2051b
jnp 0x204f5
cmpl $-0x4, %ebx
je 0x204f5
cmpl $-0x5, %ebx
jne 0x20535
movl 0x1100(%r14), %ecx
decl %ecx
cmpl $0x2, %ecx
jae 0x204f3
jmp 0x204f5
cmpl %ebx, 0x1100(%r14)
jne 0x204f3
jmp 0x204f5
// File: /workspace/github_c_makefile_star2_O1/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
movss (%rdi), %xmm0
subss (%rsi), %xmm0
leaq 0xc(%rsp), %rax
movss %xmm0, (%rax)
movss 0x4(%rdi), %xmm0
subss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rax)
movss 0x8(%rdi), %xmm0
subss 0x8(%rsi), %xmm0
movss %xmm0, 0x8(%rax)
movq %rax, %rdi
callq 0x192e0
xorl %eax, %eax
ucomiss 0x33eb8(%rip), %xmm0    # 0x5443c
setbe %al
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_flagathome
qboolean ctf_flagathome(edict_t * whichflag)
{
	if (whichflag && (strcmp(whichflag->classname, "flag") == 0))
		return ctf_flagatposition(whichflag->homeposition, whichflag->s.origin);
	else
		return false;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x205ff
movq %rdi, %rbx
movq 0x138(%rdi), %rdi
leaq 0x3b641(%rip), %rsi     # 0x5bbeb
callq 0x18b20
testl %eax, %eax
jne 0x205ff
movss 0x460(%rbx), %xmm0
subss 0x4(%rbx), %xmm0
leaq 0xc(%rsp), %rdi
movss %xmm0, (%rdi)
movss 0x464(%rbx), %xmm0
subss 0x8(%rbx), %xmm0
movss %xmm0, 0x4(%rdi)
movss 0x468(%rbx), %xmm0
subss 0xc(%rbx), %xmm0
movss %xmm0, 0x8(%rdi)
callq 0x192e0
xorl %ebp, %ebp
ucomiss 0x33e41(%rip), %xmm0    # 0x5443c
setbe %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3b292(%rip), %rdx     # 0x5bbeb
xorl %r13d, %r13d
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x209e4
movq %rax, %r14
xorl %r12d, %r12d
leaq 0x3b271(%rip), %r15     # 0x5bbeb
cmpq $0x0, 0x330(%r14)
je 0x209be
movl 0x47c(%r14), %eax
leal -0x3(%rax), %ecx
cmpl $-0x2, %ecx
jb 0x209be
cmpl %ebx, %eax
jne 0x209c6
movq %r14, %r13
testq %r12, %r12
je 0x209c9
movq 0x110(%r14), %rsi
movq %r14, %rdi
callq 0x19080
movq 0x110(%r12), %rsi
movq %r12, %rdi
callq 0x19080
movq %r14, %rdi
callq 0x19a60
movq %r12, %r13
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdx
callq 0x19430
movq %rax, %r14
movq %r13, %r12
testq %rax, %rax
jne 0x2097a
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x20d66
movq 0x460(%r14), %rax
movq %rax, 0x4(%r14)
movups 0x468(%r14), %xmm0
movups %xmm0, 0xc(%r14)
movq %r14, %rdi
callq 0x18580
testq %rbx, %rbx
je 0x20e27
andb $-0x2, 0x41(%rbx)
movq %rbx, %rdi
callq 0x18280
movl $0x0, 0x30(%rbx)
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x20e27
movq 0x48a62(%rip), %rcx     # 0x697f8
movq (%rcx), %rdx
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
testq %rdx, %rdx
je 0x20dc9
movq 0x330(%rdx), %rdx
subq 0x4908a(%rip), %rdx     # 0x69e40
sarq $0x3, %rdx
imulq %rcx, %rdx
movl $0x0, 0x318(%rax,%rdx)
movq 0x48a90(%rip), %rdx     # 0x69860
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x20df9
movq 0x330(%rdx), %rdx
subq 0x4905a(%rip), %rdx     # 0x69e40
sarq $0x3, %rdx
imulq %rcx, %rdx
movl $0x0, 0x318(%rax,%rdx)
testq %r14, %r14
je 0x20e1f
movq 0x330(%r14), %rdx
subq 0x49034(%rip), %rdx     # 0x69e40
sarq $0x3, %rdx
imulq %rcx, %rdx
movl $0x0, 0x318(%rax,%rdx)
movq %rbx, %rdi
callq 0x18280
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2103d
movl 0x38(%rbx), %eax
leal -0xac(%rax), %ecx
leal -0x9d(%rax), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
andl $-0x10, %edx
negl %edx
addl %edx, %eax
incl %eax
movl %eax, 0x38(%rbx)
movq 0x48d5c(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
movss 0x3323f(%rip), %xmm1    # 0x54290
addss %xmm0, %xmm1
movss %xmm1, 0x200(%rbx)
movss 0x4a0(%rbx), %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x2106f
jnp 0x21091
addss 0x3321d(%rip), %xmm1    # 0x54294
ucomiss %xmm1, %xmm0
jbe 0x21091
movq 0x110(%rbx), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
testl %eax, %eax
je 0x21099
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x48758(%rip), %rax     # 0x697f8
cmpq %rbx, (%rax)
je 0x210ba
movq 0x487b4(%rip), %rax     # 0x69860
cmpq %rbx, (%rax)
jne 0x210ea
leaq 0x334d7(%rip), %rdi     # 0x5458f
jmp 0x210c1
leaq 0x334bb(%rip), %rdi     # 0x5457c
movq 0x48538(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
callq *0x48(%rax)
movss 0x33379(%rip), %xmm0    # 0x54450
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x5, %esi
movl %eax, %edx
callq *%r14
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19080
// File: /workspace/github_c_makefile_star2_O1/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 0x48c00(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x212d6
jnp 0x21375
movq %rdi, %rbx
leaq 0x33232(%rip), %rdx     # 0x54512
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x21375
movq %rax, %r14
leaq 0xc(%rsp), %r15
leaq 0x3320e(%rip), %r12     # 0x54512
movss 0x4(%r14), %xmm0
subss 0x460(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x8(%r14), %xmm0
subss 0x464(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0xc(%r14), %xmm0
subss 0x468(%rbx), %xmm0
movss %xmm0, 0x14(%rsp)
movq %r15, %rdi
callq 0x192e0
movss 0x32bd4(%rip), %xmm1    # 0x53f24
ucomiss %xmm0, %xmm1
jb 0x2135d
movq %r14, %rdi
callq 0x19a60
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r12, %rdx
callq 0x19430
movq %rax, %r14
testq %rax, %rax
jne 0x21304
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x183a0
leaq 0xc(%rsp), %rsi
movq $0x41c00000, (%rsi)     # imm = 0x41C00000
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 0x18fa0
movq 0x48218(%rip), %rax     # 0x69600
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)
movq 0xc(%r12), %rax
movss 0x14(%r12), %xmm0
movq %rax, 0x4(%rbx)
movss %xmm0, 0xc(%rbx)
leaq 0x1c0(%rbx), %rsi
movss 0x32e6f(%rip), %xmm0    # 0x542a4
movq %r14, %rdi
callq 0x189d0
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_O1/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 0x48423(%rip), %rax     # 0x69880
movq %rax, 0x220(%rdi)
movq $0x0, 0x110(%rdi)
movq 0x4814a(%rip), %rax     # 0x695c0
movq %rax, 0x210(%rdi)
movq 0x4891c(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x32dff(%rip), %xmm0    # 0x54290
movss %xmm0, 0x200(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x47fd4(%rip), %rcx     # 0x69600
movq %rsi, %rdi
xorl %eax, %eax
callq *0x8(%rcx)
xorl %edi, %edi
xorl %esi, %esi
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
callq 0x19170
testq %rax, %rax
je 0x2166f
movq %rax, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x18da0
movq %r15, %rdi
xorl %esi, %esi
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
callq 0x19170
movq %rax, %r15
testq %rax, %rax
jne 0x2164a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2225b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %r14
testq %r14, %r14
je 0x22254
cmpq $0x0, 0x2b8(%rbx)
je 0x221d8
xorl %eax, %eax
movl %eax, 0xee0(%r14)
movl %eax, 0x1c8(%rbx)
movq 0x730(%r14), %rax
testq %rax, %rax
je 0x2220d
movq 0x50(%rax), %rdi
leaq 0x325d8(%rip), %rsi     # 0x547c7
callq 0x18b20
testl %eax, %eax
jne 0x2220d
cmpl $0x3, 0xe78(%r14)
jne 0x2220d
movl $0x0, 0xe78(%r14)
xorl %eax, %eax
movl %eax, 0xf40(%r14)
movl %eax, 0xf5c(%r14)
movq 0xf60(%r14), %rdi
testq %rdi, %rdi
je 0x22254
xorl %r14d, %r14d
movq %r14, 0x210(%rdi)
movl $0x0, 0x200(%rdi)
movq %r14, 0x480(%rdi)
callq 0x19a60
movq 0x58(%rbx), %rax
movq %r14, 0xf60(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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), %ecx
movl %ecx, %eax
addl $0x2d0, %eax            # imm = 0x2D0
cltq
imulq $-0x49f49f49, %rax, %rdx # imm = 0xB60B60B7
shrq $0x20, %rdx
addl %edx, %ecx
addl $0x2d0, %ecx            # imm = 0x2D0
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x8, %ecx
addl %edx, %ecx
imull $0x168, %ecx, %ecx      # imm = 0x168
subl %ecx, %eax
leal -0x152(%rax), %ecx
cmpl $0xfffffec4, %ecx       # imm = 0xFFFFFEC4
jae 0x222ac
leaq 0x31703(%rip), %rax     # 0x539ae
retq
cmpl $0x43, %eax
jge 0x222b9
leaq 0x37fdd(%rip), %rax     # 0x5a295
retq
cmpl $0x70, %eax
jge 0x222c6
leaq 0x35a87(%rip), %rax     # 0x57d4c
retq
cmpl $0x9d, %eax
jge 0x222d5
leaq 0x359a2(%rip), %rax     # 0x57c76
retq
cmpl $0xca, %eax
jge 0x222e4
leaq 0x3699c(%rip), %rax     # 0x58c7f
retq
cmpl $0xf7, %eax
jge 0x222f3
leaq 0x324e4(%rip), %rax     # 0x547d6
retq
cmpl $0x124, %eax            # imm = 0x124
leaq 0x367fc(%rip), %rcx     # 0x58afb
leaq 0x324d3(%rip), %rax     # 0x547d9
cmovlq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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), %ecx
movl %ecx, %eax
addl $0x2d0, %eax            # imm = 0x2D0
cltq
imulq $-0x49f49f49, %rax, %rdx # imm = 0xB60B60B7
shrq $0x20, %rdx
addl %edx, %ecx
addl $0x2d0, %ecx            # imm = 0x2D0
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x8, %ecx
addl %edx, %ecx
imull $0x168, %ecx, %ecx      # imm = 0x168
subl %ecx, %eax
leal -0x152(%rax), %ecx
cmpl $0xfffffec4, %ecx       # imm = 0xFFFFFEC4
jae 0x2235b
leaq 0x32482(%rip), %rax     # 0x547dc
retq
cmpl $0x43, %eax
jge 0x22368
leaq 0x3247b(%rip), %rax     # 0x547e2
retq
cmpl $0x70, %eax
jge 0x22375
leaq 0x3247d(%rip), %rax     # 0x547f1
retq
cmpl $0x9d, %eax
jge 0x22384
leaq 0x32469(%rip), %rax     # 0x547ec
retq
cmpl $0xca, %eax
jge 0x22393
leaq 0x32464(%rip), %rax     # 0x547f6
retq
cmpl $0xf7, %eax
jge 0x223a2
leaq 0x3245b(%rip), %rax     # 0x547fc
retq
cmpl $0x124, %eax            # imm = 0x124
leaq 0x32453(%rip), %rcx     # 0x54801
leaq 0x32451(%rip), %rax     # 0x54806
cmovlq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movq 0x58(%rdi), %rcx
movl $0x1, %ebx
testb $0x2, 0x1108(%rcx)
jne 0x225c8
movq 0x10e0(%rcx), %rax
testq %rax, %rax
jle 0x2259a
cmpq $0x32, 0x10d8(%rcx)
jg 0x2259a
movq 0x47824(%rip), %rdx     # 0x69da0
movss 0x4(%rdx), %xmm0
subss 0x10cc(%rcx), %xmm0
movss 0x31973(%rip), %xmm1    # 0x53f04
ucomiss %xmm0, %xmm1
jbe 0x22630
leaq 0x32288(%rip), %rdx     # 0x54829
movl $0x2, %esi
movq %r14, %rdi
callq 0x18da0
movq 0x477eb(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10cc(%rax)
xorl %ebx, %ebx
movq 0x58(%r14), %rax
movss 0x10d0(%rax), %xmm1
movq 0x477c5(%rip), %rcx     # 0x69da0
movss 0x4(%rcx), %xmm0
subss %xmm0, %xmm1
movss 0x31e70(%rip), %xmm2    # 0x5445c
ucomiss %xmm1, %xmm2
jbe 0x2261e
movq 0x10d8(%rax), %rcx
movq 0x10e0(%rax), %rdx
leaq 0x14(%rcx), %rsi
movq %rsi, 0x10d8(%rax)
cmpq $0xbd, %rdx
jg 0x2261e
addq $0x19, %rcx
movq %rcx, 0x10d8(%rax)
movss %xmm0, 0x10d0(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x59, %rax
jg 0x225c8
leaq 0x3221b(%rip), %rdx     # 0x54858
movl $0x2, %esi
movq %r14, %rdi
callq 0x18da0
jmp 0x225c8
// File: /workspace/github_c_makefile_star2_O1/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 0x46c55(%rip), %r14     # 0x69540
movq (%r14), %rax
movq 0x8(%rax), %rax
cmpb $0x0, (%rax)
je 0x229c3
xorl %edi, %edi
callq 0x18df0
leaq 0x158(%rsp), %rdi
movq %rax, (%rdi)
callq 0x18180
testq %rax, %rax
je 0x229c3
leaq 0x31f7e(%rip), %rdx     # 0x548a0
leaq 0x360(%rsp), %rbx
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdi
movq %rax, %rcx
callq 0x192d0
movq (%r14), %r15
movq 0x8(%r15), %rsi
leaq 0x160(%rsp), %r14
movq %r14, %rdi
callq 0x182a0
movq %r14, %rdi
callq 0x18680
movw $0x2f, 0x160(%rsp,%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19640
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0x18b20
testl %eax, %eax
je 0x229c3
movq 0x4741b(%rip), %rsi     # 0x69da0
movl $0x2b, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq 0x46c69(%rip), %rbx     # 0x69600
movq %rbx, %rdi
callq 0x19a10
leaq 0x31f05(%rip), %rdi     # 0x548ab
leaq 0x160(%rsp), %rsi
callq *0x128(%rbx)
leaq 0x31efb(%rip), %rsi     # 0x548b6
movq %rbx, %rdi
callq 0x19580
addq $0x560, %rsp            # imm = 0x560
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdi, %rcx
xorl %ebp, %ebp
testl %esi, %esi
setne %bpl
leaq 0x31ed6(%rip), %rdx     # 0x548c3
xorl %r14d, %r14d
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x18e10
movq 0x46bf7(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x150(%rax)
movq 0x47387(%rip), %rax     # 0x69da0
movq $0x0, 0xd0(%rax)
movl %r14d, 0xd8(%rax)
movl %r14d, 0xc8(%rax)
xorl %eax, %eax
callq 0x18f70
xorl %eax, %eax
callq 0x180d0
addl %ebp, %ebp
movq 0x46d8f(%rip), %rax     # 0x697d8
movl %ebp, (%rax)
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r15
movq %rdi, %r14
leaq 0x200(%rsp), %rdi
xorl %ebx, %ebx
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x18880
movq %rsp, %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x18880
testq %r15, %r15
je 0x22ff5
cmpq $0x0, 0x58(%r14)
je 0x22ff5
leaq 0x319bd(%rip), %rsi     # 0x54928
xorl %ebx, %ebx
movq %rsp, %rdx
leaq 0x200(%rsp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x18fe0
cmpl $0x2, %eax
jne 0x22ff5
movq 0x58(%r14), %rcx
xorl %eax, %eax
cmpl $0x1, 0x1100(%rcx)
setne %al
movl %eax, %edx
shll $0xc, %edx
movq 0x465d5(%rip), %rcx     # 0x69578
movq (%rcx,%rdx), %r14
testq %r14, %r14
je 0x22ff5
shll $0xc, %eax
leaq (%rax,%rcx), %r13
addq $0x10, %r13
leaq 0x200(%rsp), %r15
movq %rsp, %r12
movq -0x8(%r13), %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
jne 0x22fe1
movq %r14, %rdi
movq %r12, %rsi
callq 0x18b20
testl %eax, %eax
je 0x22ff0
movq (%r13), %r14
addq $0x10, %r13
testq %r14, %r14
jne 0x22fc2
jmp 0x22ff5
movl $0x1, %ebx
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x46547(%rip), %rax     # 0x69578
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0x23036
callq 0x19a20
cltd
idivl %ebp
movslq %edx, %rax
shlq $0x4, %rax
shll $0xc, %ebx
addq 0x4651d(%rip), %rbx     # 0x69578
movq (%rax,%rbx), %rdx
movq 0x8(%rax,%rbx), %rcx
leaq 0x4dfd5(%rip), %rbx     # 0x71040
leaq 0x318e8(%rip), %rsi     # 0x5495a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x19700
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x58(%rdi), %rcx
xorl %eax, %eax
cmpl $0x1, 0x1100(%rcx)
setne %al
movl %eax, %edx
shll $0xc, %edx
movq 0x464cb(%rip), %rcx     # 0x69578
movq (%rcx,%rdx), %rdx
testq %rdx, %rdx
je 0x23108
shll $0xc, %eax
leaq (%rax,%rcx), %r15
addq $0x10, %r15
leaq 0x4e978(%rip), %rbx     # 0x71a40
leaq 0x3188b(%rip), %r14     # 0x5495a
leaq 0x4e16a(%rip), %r13     # 0x71240
xorl %ebp, %ebp
xorl %r12d, %r12d
movq -0x8(%r15,%rbp,2), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x19700
movq %rbx, (%rbp,%r13)
incq %r12
movq (%r15,%rbp,2), %rdx
addq $0x1e, %rbx
addq $0x8, %rbp
testq %rdx, %rdx
jne 0x230db
jmp 0x2310b
xorl %r12d, %r12d
leaq 0x4e12e(%rip), %rax     # 0x71240
movq $0x0, (%rax,%r12,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x19530
movq 0x46043(%rip), %rax     # 0x697d8
movl $0x4, (%rax)
movl $0x12c, 0x290(%rbx)     # imm = 0x12C
movq 0x46594(%rip), %rax     # 0x69d40
movl $0x0, 0x624(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x46269(%rip), %rax     # 0x69aa0
movl %edi, (%rax)
testl %edi, %edi
movq 0x464ce(%rip), %rax     # 0x69d10
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
leaq 0x31221(%rip), %rcx     # 0x54a72
leaq 0x3120d(%rip), %rbx     # 0x54a65
cmoveq %rcx, %rbx
testl %eax, %eax
je 0x23874
xorl %eax, %eax
testl %edi, %edi
sete %al
movq 0x464d2(%rip), %rcx     # 0x69d40
movl %eax, 0x624(%rcx)
movq 0x464c5(%rip), %r14     # 0x69d40
cmpl $0x0, 0x610(%r14)
jle 0x238c9
movl $0x4a8, %r15d           # imm = 0x4A8
movq 0x45cc6(%rip), %r12     # 0x69558
movq 0x45d67(%rip), %r13     # 0x69600
xorl %ebp, %ebp
movq (%r12), %rdi
cmpl $0x0, 0x60(%rdi,%r15)
je 0x238b3
addq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq *0x18(%r13)
incq %rbp
movslq 0x610(%r14), %rax
addq $0x4a8, %r15            # imm = 0x4A8
cmpq %rax, %rbp
jl 0x2389b
movq 0x45d30(%rip), %rax     # 0x69600
movq 0x8(%rax), %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_O1/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 0x45a5a(%rip), %rax     # 0x697d8
movl $0x0, (%rax)
movq 0x4625d(%rip), %rax     # 0x69fe8
movq (%rax), %rcx
testq %rcx, %rcx
je 0x23dc4
movq 0x45696(%rip), %rdx     # 0x69430
movq %rdx, 0x210(%rcx)
movq 0x45ff8(%rip), %rdx     # 0x69da0
movss 0x4(%rdx), %xmm0
addss 0x30173(%rip), %xmm0    # 0x53f28
movss %xmm0, 0x200(%rcx)
movq $0x0, (%rax)
movq 0x45f45(%rip), %rax     # 0x69d10
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testl %eax, %eax
je 0x23de8
movq 0x45f62(%rip), %rax     # 0x69d40
movl $0x0, 0x624(%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x461c9(%rip), %rbx     # 0x69fe8
movq (%rbx), %rax
testq %rax, %rax
jne 0x23e2f
callq 0x19710
movq %rax, (%rbx)
movq 0x459a2(%rip), %rcx     # 0x697d8
cmpl $0x5, (%rcx)
jne 0x23e47
movl $0x10, 0x290(%rax)
jmp 0x23e62
movq 0x45a62(%rip), %rdx     # 0x698b0
movq (%rdx), %rdx
cvttss2si 0x20(%rdx), %edx
movl %edx, 0x290(%rax)
movl $0x2, (%rcx)
movq 0x45ea7(%rip), %rcx     # 0x69d10
movq (%rcx), %rcx
cvttss2si 0x20(%rcx), %ecx
testl %ecx, %ecx
je 0x23e86
movq 0x45ec4(%rip), %rcx     # 0x69d40
movl $0x1, 0x624(%rcx)
movq 0x46073(%rip), %rcx     # 0x69f00
movq %rcx, 0x210(%rax)
movq 0x45f05(%rip), %rcx     # 0x69da0
movss 0x4(%rcx), %xmm0
addss 0x30080(%rip), %xmm0    # 0x53f28
movss %xmm0, 0x200(%rax)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x19710
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 0x3092f(%rip), %rax     # 0x54c77
movq %rax, 0x138(%r15)
orl $0x102000, 0x40(%r15)   # imm = 0x102000
movl $0x20, 0x44(%r15)
movq 0x4529a(%rip), %rbx     # 0x69600
leaq 0x3090f(%rip), %rdi     # 0x54c7c
callq *0x40(%rbx)
movl %eax, 0x28(%r15)
leaq 0x30917(%rip), %rdi     # 0x54c92
callq *0x48(%rbx)
movl %eax, 0x4c(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x18870
movaps 0x30619(%rip), %xmm0    # 0x54c20
movups %xmm0, 0xcc(%rax)
movabsq $0x4140000041400000, %rcx # imm = 0x4140000041400000
movq %rcx, 0xdc(%rax)
movq %rax, %rdi
testl %ebp, %ebp
je 0x24630
movq %r14, %rdx
callq 0x193c0
jmp 0x2463b
movq %r15, %rsi
movq %r14, %rdx
callq 0x186f0
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_O1/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), %rax
cmpq %rsi, 0x730(%rax)
je 0x246fd
movq %rsi, %r14
movq 0x60(%rsi), %rdi
testq %rdi, %rdi
je 0x246ea
movq 0x44ec4(%rip), %rax     # 0x69548
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x246ea
jp 0x246ea
testb $0x2, 0x68(%r14)
jne 0x246ea
callq 0x189e0
movq %rax, %rcx
subq 0x45794(%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 0x2473f
cmpl 0x5c(%r14), %ecx
jge 0x246ea
movq 0x44f2b(%rip), %rcx     # 0x69600
movq 0x10(%rcx), %r9
movq 0x50(%rax), %rcx
movq 0x50(%r14), %r8
leaq 0x305f0(%rip), %rdx     # 0x54cd8
jmp 0x24759
movq 0x58(%rbx), %rax
movq %r14, 0xe50(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %ecx, %ecx
cmpl $0x0, 0xf3c(%rax)
sete %cl
movl %ecx, 0xf3c(%rax)
movq 0x44eea(%rip), %rax     # 0x69600
movq 0x10(%rax), %rcx
je 0x24725
leaq 0x30597(%rip), %rdx     # 0x54cba
jmp 0x2472c
leaq 0x3057f(%rip), %rdx     # 0x54cab
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
movq 0x44eba(%rip), %rcx     # 0x69600
movq 0x10(%rcx), %r9
movq 0x50(%rax), %rcx
movq 0x50(%r14), %r8
leaq 0x30570(%rip), %rdx     # 0x54cc9
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%r9