LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: Ref_Match_Maplist_Menu
void Ref_Match_Maplist_Menu (edict_t *ent)
{
	Menu_Free(ent);
	ent->client->menu = MENU_LOCAL;
	ent->client->menuselect = 0;

	Menu_Set(ent, 0, "Match Maplist <min> <max>", Ref_Main_Menu);
	Menu_Set(ent, 1, "-------------", NULL);
	SetMapsForMenu(ent);
	Menu_Set(ent, 17, "<next page>", Ref_Match_Maplist_Menu);

	Menu_Draw (ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
xorl %r15d, %r15d
movq 0x4ac60(%rip), %r14     # 0x68600
movq 0xf90(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x1d9c4
callq *0x110(%r14)
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xf90(%rax,%r15)
addq $0x10, %r15
cmpq $0x120, %r15            # imm = 0x120
jne 0x1d9a0
movq 0x58(%rbx), %rax
movq $0x0, 0xf84(%rax)
movq 0xf90(%rax), %rdi
testq %rdi, %rdi
je 0x1d9f3
callq *0x110(%r14)
leaq 0x35308(%rip), %rdi     # 0x52d02
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4b0df(%rip), %rax     # 0x68af0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
testq %rdi, %rdi
je 0x1da2b
callq *0x110(%r14)
leaq 0x347b5(%rip), %rdi     # 0x521e7
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xfa0(%rcx)
movq $0x0, 0xfa8(%rcx)
movq %rbx, %rdi
callq 0x19800
movq 0x58(%rbx), %rax
movq 0x10a0(%rax), %rdi
testq %rdi, %rdi
je 0x1da6c
callq *0x110(%r14)
leaq 0x348f3(%rip), %rdi     # 0x52366
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0x10a0(%rcx)
movq 0x4b416(%rip), %rax     # 0x68ea0
movq %rax, 0x10a8(%rcx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x196b0
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: Ref_Map_Maplist_Menu
void Ref_Map_Maplist_Menu (edict_t *ent)
{
	Menu_Free(ent);
	ent->client->menu = MENU_LOCAL;
	ent->client->menuselect = 0;

	Menu_Set(ent, 0, "Maplist <min> <max>", Ref_Main_Menu);
	Menu_Set(ent, 1, "-------------", NULL);
	SetMapsForMenu(ent);
	Menu_Set(ent, 17, "<next page>", Ref_Map_Maplist_Menu);

	Menu_Draw (ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
xorl %r15d, %r15d
movq 0x4aaed(%rip), %r14     # 0x68600
movq 0xf90(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x1db37
callq *0x110(%r14)
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xf90(%rax,%r15)
addq $0x10, %r15
cmpq $0x120, %r15            # imm = 0x120
jne 0x1db13
movq 0x58(%rbx), %rax
movq $0x0, 0xf84(%rax)
movq 0xf90(%rax), %rdi
testq %rdi, %rdi
je 0x1db66
callq *0x110(%r14)
leaq 0x3519b(%rip), %rdi     # 0x52d08
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq 0x4af6c(%rip), %rax     # 0x68af0
movq %rax, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
testq %rdi, %rdi
je 0x1db9e
callq *0x110(%r14)
leaq 0x34642(%rip), %rdi     # 0x521e7
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xfa0(%rcx)
movq $0x0, 0xfa8(%rcx)
movq %rbx, %rdi
callq 0x19800
movq 0x58(%rbx), %rax
movq 0x10a0(%rax), %rdi
testq %rdi, %rdi
je 0x1dbdf
callq *0x110(%r14)
leaq 0x34780(%rip), %rdi     # 0x52366
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0x10a0(%rcx)
movq 0x4af13(%rip), %rax     # 0x68b10
movq %rax, 0x10a8(%rcx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x196b0
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: SetMapsForMenu
void SetMapsForMenu( edict_t *ent)
{
	char text[MAX_INFO_STRING];
	int start;

	SetupShortList();

	MapInfo *slPtr = shortList;

	// Calculate our page
	start = 15*ent->client->menupage;

	slPtr = shortList;
	int mapCtr = 0;
	while (slPtr) {
		mapCtr++;
		slPtr = slPtr->next;
	}

	// Find if last page was the last
	if (start > 14)
	{
		if (start + 15 >= mapCtr)
		{
			start = 0;
			ent->client->menupage = 0;
		}
	}

	slPtr = shortList;
	for (int ct = 0; ct < start; ct++)
		slPtr = slPtr->next;


	for (int endCtr = 2; endCtr < 18 && slPtr; endCtr++) {
		sprintf(text, "%s %d %d", slPtr->mapname, slPtr->minplayers, slPtr->maxplayers);
		Menu_Set(ent, endCtr, text, SetMap);
		slPtr = slPtr->next;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
callq 0x193e0
movq 0x58(%rbx), %rax
movl 0x10c0(%rax), %ecx
leal (%rcx,%rcx,4), %edx
movq 0x4b292(%rip), %rsi     # 0x68ed0
movq (%rsi), %r13
xorl %esi, %esi
testq %r13, %r13
je 0x1dc56
movq %r13, %rdi
incl %esi
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
jne 0x1dc4b
leal (%rdx,%rdx,2), %edx
testl %ecx, %ecx
jle 0x1dc70
leal 0xf(%rdx), %edi
cmpl %esi, %edi
jl 0x1dc70
movl $0x0, 0x10c0(%rax)
jmp 0x1dc7c
testl %ecx, %ecx
jle 0x1dc7c
movq 0x10(%r13), %r13
decl %edx
jne 0x1dc74
testq %r13, %r13
je 0x1dcd0
movl $0x2, %ebp
leaq 0x3508f(%rip), %r14     # 0x52d1c
movq %rsp, %r15
movq 0x4a9e1(%rip), %r12     # 0x68678
movq (%r13), %rdx
movl 0x8(%r13), %ecx
movl 0xc(%r13), %r8d
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x196f0
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x18370
cmpl $0x10, %ebp
ja 0x1dcd0
movq 0x10(%r13), %r13
incl %ebp
testq %r13, %r13
jne 0x1dc97
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: SetupShortList
void SetupShortList()
{
	if (shortList)
	{
		return;
	}
        MapInfo *slPtr = NULL;
        for(int ctr = 0; maplist[ctr].mapname; ctr++) {
                char *thisMap = maplist[ctr].mapname;
                for(int lmNdx = 0; maplmlist[lmNdx]; lmNdx++) {
                        if (!strcmp(maplmlist[lmNdx], thisMap)) {
                                goto end;
                        }
                }
                if (!slPtr) {
                        shortList = slPtr = &maplist[ctr];
			slPtr->next = NULL;
                } else {
                        slPtr->next = &maplist[ctr];
                        slPtr = slPtr->next;
                        slPtr->next = NULL;
                }
                end:
                        continue;
        }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x4b1dc(%rip), %rax     # 0x68ed0
cmpq $0x0, (%rax)
jne 0x1dd95
movq 0x4aac3(%rip), %rax     # 0x687c8
movq (%rax), %rbx
testq %rbx, %rbx
je 0x1dd95
movq 0x4a770(%rip), %rax     # 0x68488
movq (%rax), %r13
xorl %ebp, %ebp
addq $0x8, %rax
movq %rax, (%rsp)
movq 0x4aa9c(%rip), %r14     # 0x687c8
xorl %r15d, %r15d
testq %r13, %r13
je 0x1dd54
movq (%rsp), %r12
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18b20
testl %eax, %eax
je 0x1dd74
movq (%r12), %rdi
addq $0x8, %r12
testq %rdi, %rdi
jne 0x1dd3b
testq %r15, %r15
jne 0x1dd62
movq 0x4b170(%rip), %r15     # 0x68ed0
jmp 0x1dd66
addq $0x10, %r15
movq %r14, (%r15)
movq $0x0, 0x10(%r14)
movq %r14, %r15
incq %rbp
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x4aa3f(%rip), %rcx     # 0x687c8
leaq (%rcx,%rax,8), %r14
movq (%r14), %rbx
testq %rbx, %rbx
jne 0x1dd2f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: MapMenu
void MapMenu(edict_t *ent, char *maplist[], char *msg)
{
	char text[MAX_INFO_STRING];
        char title[MAX_INFO_STRING];
	int i;

	Menu_Free(ent);
	ent->client->menu = MENU_LOCAL;
	ent->client->menuselect = 0;

	sprintf(title, "%s", msg);

	Menu_Set(ent, 0, title, ent->client->prevmenu);
	Menu_Set(ent, 1, "-----------", NULL);
	for (i=2; i < 18; i++)
	{
		if (maplist[i])
		{
			sprintf(text, "%s", maplist[i]);
			Menu_Set(ent, i, text, SetMap);
		}
	}

	Menu_Draw (ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rdi), %rax
xorl %r13d, %r13d
movq 0x4a835(%rip), %r12     # 0x68600
movq 0xf90(%rax,%r13), %rdi
testq %rdi, %rdi
je 0x1ddf0
callq *0x110(%r12)
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xf90(%rax,%r13)
addq $0x10, %r13
cmpq $0x120, %r13            # imm = 0x120
jne 0x1ddcb
movq 0x58(%rbx), %r13
movq $0x0, 0xf84(%r13)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x182a0
movq 0xf90(%r13), %rdi
movq 0x10b8(%r13), %r15
testq %rdi, %rdi
je 0x1de32
callq *0x110(%r12)
movq %rsp, %rdi
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xf90(%rcx)
movq %r15, 0xf98(%rcx)
movq 0xfa0(%rcx), %rdi
testq %rdi, %rdi
je 0x1de60
callq *0x110(%r12)
leaq 0x34382(%rip), %rdi     # 0x521e9
callq 0x18100
movq 0x58(%rbx), %rcx
movq %rax, 0xfa0(%rcx)
movq $0x0, 0xfa8(%rcx)
movl $0x2, %r15d
leaq 0x200(%rsp), %r12
movq 0x4a7e1(%rip), %r13     # 0x68678
movq (%r14,%r15,8), %rsi
testq %rsi, %rsi
je 0x1deb9
movq %r12, %rdi
callq 0x182a0
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x18370
incq %r15
cmpq $0x12, %r15
jne 0x1de97
movq %rbx, %rdi
callq 0x196b0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_menu.c
// Function: SelectKick
void SelectKick(edict_t* ent)
{
	int i; //initialize j or you read off into memory
	unsigned long id;
	char kickcommand[MAX_INFO_STRING];

	i = ent->client->menuselect;
	if (sscanf(ent->client->localmenu[i].text, "%lu", &id))
	{
		Com_sprintf(kickcommand, sizeof kickcommand, "\nctfkick %lu\n", id);
		ForceCommand(ent, kickcommand);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
movq 0x58(%rdi), %rax
movslq 0xf88(%rax), %rcx
shlq $0x4, %rcx
movq 0xf90(%rax,%rcx), %rdi
leaq 0x34eb9(%rip), %rsi     # 0x52dbf
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x18fe0
testl %eax, %eax
je 0x1df41
movq 0x8(%rsp), %rcx
leaq 0x34ea1(%rip), %rdx     # 0x52dc3
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x18e10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18c40
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_armor
void replace_armor(edict_t *person, char *temp)
{
	gitem_t *item;
	int test, power_armor_type;
	char fill[1024];
	qboolean	hasArmor = false; // MJD Unitialized.  It needs to be


	strcpy(temp, ""); //this will get replaced

	power_armor_type = PowerArmorType(person);

	if (power_armor_type)
	{
		test = person->client->pers.inventory[ITEM_INDEX(FindItem ("cells"))];
		if (test)
		{
			hasArmor = true;
			sprintf(temp, "%i cells of ", test);
			if (power_armor_type == POWER_ARMOR_SCREEN)
				strcat(temp, "power screen ");
			else
				strcat(temp, "power shield ");
		}
	}

	test = ArmorIndex(person);
	if (test)
	{
		item = GetItemByIndex (test);
		if (item)
		{
			hasArmor = true;
			if (strlen(temp) > 1)
				strcat(temp, "and ");
			sprintf(fill, "%i of %s", 
				person->client->pers.inventory[test], item->pickup_name);
			strcat(temp, fill);
		}
	}
	
	if (!hasArmor)
		strcat (temp, "no armor");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rsi)
callq 0x18ab0
movb $0x1, %r12b
testl %eax, %eax
je 0x1ec20
movl %eax, %ebp
movq 0x58(%r14), %r15
leaq 0x37f5a(%rip), %rdi     # 0x56af7
callq 0x189e0
subq 0x4a297(%rip), %rax     # 0x68e40
sarq $0x3, %rax
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rax, %rcx
movl 0x318(%r15,%rcx), %edx
testl %edx, %edx
je 0x1ec20
leaq 0x3457b(%rip), %rsi     # 0x53149
movq %rbx, %rdi
xorl %eax, %eax
callq 0x196f0
movq %rbx, %rdi
callq 0x18680
addq %rbx, %rax
cmpl $0x1, %ebp
jne 0x1ec02
movabsq $0x206e6565726373, %rcx # imm = 0x206E6565726373
movq %rcx, 0x6(%rax)
movabsq $0x6373207265776f70, %rcx # imm = 0x6373207265776F70
jmp 0x1ec1a
movabsq $0x20646c65696873, %rcx # imm = 0x20646C65696873
movq %rcx, 0x6(%rax)
movabsq $0x6873207265776f70, %rcx # imm = 0x6873207265776F70
movq %rcx, (%rax)
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x18750
testl %eax, %eax
je 0x1ec92
movl %eax, %ebp
movl %eax, %edi
callq 0x18c30
testq %rax, %rax
je 0x1ec92
movq %rax, %r15
movq %rbx, %rdi
callq 0x18680
cmpq $0x2, %rax
jb 0x1ec5f
movq %rbx, %rdi
callq 0x18680
movl $0x20646e61, (%rbx,%rax) # imm = 0x20646E61
movb $0x0, 0x4(%rbx,%rax)
movq 0x58(%r14), %rax
movslq %ebp, %rcx
movl 0x318(%rax,%rcx,4), %edx
movq 0x50(%r15), %rcx
leaq 0x344fa(%rip), %rsi     # 0x53172
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x196f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19640
jmp 0x1ecb2
testb %r12b, %r12b
je 0x1ecb2
movq %rbx, %rdi
callq 0x18680
movabsq $0x726f6d7261206f6e, %rcx # imm = 0x726F6D7261206F6E
movq %rcx, (%rbx,%rax)
movb $0x0, 0x8(%rbx,%rax)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_health
void replace_health(edict_t *person, char *temp)
{
	edict_t *cur = NULL;
	int sum = 0;
	char str[10] = "";

	strcpy(temp,"");

	if (person->health <= 0)
		strcpy(temp, "dead");
	else
	{
		sprintf(temp, "%i health", person->health);
		while ((cur = findradius(cur, person->s.origin, 256)) != NULL)
		{
			if (!strcmp(cur->classname, "item_health_small") ||
			!strcmp(cur->classname, "item_health_large") ||
			!strcmp(cur->classname, "item_health") ||
			!strcmp(cur->classname, "item_health_mega") )
				sum += cur->count;
		}

		if (person->health < person->max_health)
		{
			strcat(temp," with ");
			if (!sum)
				strcat(temp,"none ");
			else
			{
				sprintf(str, "%i ", sum);
				strcat(temp, str);
			}
			strcat(temp, "nearby");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rax
movw $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, (%rsi)
movl 0x254(%rdi), %edx
testl %edx, %edx
jle 0x1ee15
movq %rdi, %rbx
leaq 0x3448b(%rip), %rsi     # 0x53189
xorl %r14d, %r14d
movq %rax, 0x18(%rsp)
movq %rax, %rdi
xorl %eax, %eax
callq 0x196f0
movq %rbx, 0x20(%rsp)
leaq 0x4(%rbx), %r12
movss 0x34203(%rip), %xmm0    # 0x52f24
xorl %edi, %edi
movq %r12, %rsi
callq 0x19870
testq %rax, %rax
je 0x1edb5
movq %rax, %r13
xorl %r14d, %r14d
leaq 0x34452(%rip), %rbp     # 0x53193
leaq 0x3445d(%rip), %r15     # 0x531a5
movq 0x138(%r13), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x18b20
testl %eax, %eax
je 0x1ed93
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
je 0x1ed93
movq %rbx, %rdi
leaq 0x34440(%rip), %rsi     # 0x531b7
callq 0x18b20
testl %eax, %eax
je 0x1ed93
movq %rbx, %rdi
leaq 0x34215(%rip), %rsi     # 0x52f9f
callq 0x18b20
testl %eax, %eax
jne 0x1ed9a
addl 0x290(%r13), %r14d
movq %r13, %rdi
movq %r12, %rsi
movss 0x3417c(%rip), %xmm0    # 0x52f24
callq 0x19870
movq %rax, %r13
testq %rax, %rax
jne 0x1ed48
movq 0x20(%rsp), %rcx
movl 0x254(%rcx), %eax
cmpl 0x258(%rcx), %eax
jge 0x1ee52
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x18680
movl $0x74697720, (%r15,%rax) # imm = 0x74697720
movl $0x206874, 0x3(%r15,%rax) # imm = 0x206874
testl %r14d, %r14d
je 0x1ee21
leaq 0x3b993(%rip), %rsi     # 0x5a789
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x196f0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x19640
jmp 0x1ee39
movb $0x0, 0x4(%rax)
movl $0x64616564, (%rax)     # imm = 0x64616564
jmp 0x1ee52
movq %r15, %rdi
callq 0x18680
movl $0x656e6f6e, (%r15,%rax) # imm = 0x656E6F6E
movw $0x20, 0x4(%r15,%rax)
movq %r15, %rdi
callq 0x18680
movl $0x7261656e, (%r15,%rax) # imm = 0x7261656E
movl $0x796272, 0x3(%r15,%rax) # imm = 0x796272
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_artifact
void replace_artifact(edict_t *person, char *temp)
{
	if (person->client->rune)
	{
		if (person->client->rune->item)
		{
			strcpy(temp,person->client->rune->item->pickup_name);
		}
		else
		{
			strcpy(temp, "an unnamed artifact of power");
		}
	}
	else
	{
		strcpy(temp, "no artifact");
	}
}

// Assembly:
movq 0x58(%rdi), %rax
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x1ee8c
movq 0x330(%rax), %rax
testq %rax, %rax
je 0x1eea1
movq 0x50(%rax), %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x182a0
movabsq $0x6669747261206f6e, %rax # imm = 0x6669747261206F6E
movq %rax, (%rsi)
movl $0x746361, 0x8(%rsi)    # imm = 0x746361
retq
movups 0x3433c(%rip), %xmm0    # 0x531e4
movups %xmm0, 0xd(%rsi)
movups 0x34324(%rip), %xmm0    # 0x531d7
movups %xmm0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_team
void replace_team(edict_t *person, char *temp)
{
	if (person->client->ctf.teamnum == CTF_TEAM_RED)
		strcpy(temp, "red team");
	else if (person->client->ctf.teamnum == CTF_TEAM_BLUE)
		strcpy(temp, "blue team");
	else
		strcpy(temp, "unassigned team");
}

// Assembly:
movq 0x58(%rdi), %rax
movl 0x1100(%rax), %eax
cmpl $0x2, %eax
je 0x1ef10
cmpl $0x1, %eax
jne 0x1ef24
movabsq $0x6d61657420646572, %rax # imm = 0x6D61657420646572
movq %rax, (%rsi)
movb $0x0, 0x8(%rsi)
retq
movabsq $0x6165742065756c62, %rax # imm = 0x6165742065756C62
movq %rax, (%rsi)
movw $0x6d, 0x8(%rsi)
retq
movups 0x342f2(%rip), %xmm0    # 0x5321d
movups %xmm0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_flaginfo
void replace_flaginfo(edict_t *person, char *temp)
{
	int flagcount=CTF_TEAM_UNDEFINED+1;										   
	edict_t *whichflag = NULL;

	if (!ctf_validateplayer(person, CTF_TEAM_IGNORETEAM))
		return;// only works for valid players

	strcpy(temp,"");
	while (flagcount < CTF_TEAM_LIMIT)
	{
		if (flagcount == person->client->ctf.teamnum)
			strcat(temp, "Your ");
		else
			strcat(temp, "The enemy ");
		ctf_teamstring(temp, flagcount, CTF_TEAM_MATCHING);
		strcat(temp, " flag ");
		whichflag = ctf_getteamflag(flagcount, CTF_TEAM_MATCHING);
		if (!whichflag)
			strcat(temp, "is missing.  ");
		else if (whichflag->owner)
		{
			strcat(temp,"is held by ");
			strcat(temp,whichflag->owner->client->pers.netname );
			strcat(temp,".  ");
		}
		else if (!ctf_flagathome(whichflag))
			strcat(temp, "is sitting around.  ");
		else
			strcat(temp, "is at home.  " );

		flagcount++;
	}
	strcat(temp,"\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x18ce0
testl %eax, %eax
je 0x1f0b6
movb $0x0, (%rbx)
movl $0x1, %ebp
movl $0x2c0, %r13d           # imm = 0x2C0
movabsq $0x6d656e6520656854, %r12 # imm = 0x6D656E6520656854
movq 0x58(%r14), %rax
movl 0x1100(%rax), %r15d
movq %rbx, %rdi
callq 0x18680
addq %rbx, %rax
cmpl %r15d, %ebp
jne 0x1ef93
movw $0x20, 0x4(%rax)
movl $0x72756f59, (%rax)     # imm = 0x72756F59
jmp 0x1ef9d
movq %r12, (%rax)
movl $0x20796d, 0x7(%rax)    # imm = 0x20796D
movq %rbx, %rdi
movl %ebp, %esi
movl $0xfffffff9, %edx       # imm = 0xFFFFFFF9
callq 0x181f0
movq %rbx, %rdi
callq 0x18680
movl $0x616c6620, (%rbx,%rax) # imm = 0x616C6620
movl $0x206761, 0x3(%rbx,%rax) # imm = 0x206761
movl %ebp, %edi
movl $0xfffffff9, %esi       # imm = 0xFFFFFFF9
callq 0x18d70
testq %rax, %rax
je 0x1f026
movq %rax, %r15
cmpq $0x0, 0x110(%rax)
je 0x1f04d
movq %rbx, %rdi
callq 0x18680
movabsq $0x20646c6568207369, %rcx # imm = 0x20646C6568207369
movq %rcx, (%rbx,%rax)
movl $0x207962, 0x8(%rbx,%rax) # imm = 0x207962
movq 0x110(%r15), %rax
movq 0x58(%rax), %rsi
addq %r13, %rsi
movq %rbx, %rdi
callq 0x19640
movq %rbx, %rdi
callq 0x18680
movl $0x20202e, (%rbx,%rax)  # imm = 0x20202E
jmp 0x1f09d
movq %rbx, %rdi
callq 0x18680
movabsq $0x697373696d207369, %rcx # imm = 0x697373696D207369
movq %rcx, (%rbx,%rax)
movabsq $0x20202e676e6973, %rcx # imm = 0x20202E676E6973
movq %rcx, 0x6(%rbx,%rax)
jmp 0x1f09d
movq %r15, %rdi
callq 0x19420
movl %eax, %r15d
movq %rbx, %rdi
callq 0x18680
addq %rbx, %rax
testl %r15d, %r15d
je 0x1f085
movabsq $0x20202e656d6f68, %rcx # imm = 0x20202E656D6F68
movq %rcx, 0x6(%rax)
movabsq $0x6f68207461207369, %rcx # imm = 0x6F68207461207369
movq %rcx, (%rax)
jmp 0x1f09d
movups 0x341cc(%rip), %xmm0    # 0x53258
movups %xmm0, (%rax)
movabsq $0x20202e646e756f, %rcx # imm = 0x20202E646E756F
movq %rcx, 0xd(%rax)
incl %ebp
cmpl $0x3, %ebp
jne 0x1ef6a
movq %rbx, %rdi
callq 0x18680
movw $0xa, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: visibility_test
qboolean visibility_test(edict_t *one, edict_t *two)
{
	trace_t	traceresult;
	
	//movetype push obs have bogus origins
	if (one->movetype == MOVETYPE_PUSH)
		return false; //pretend we can't see it
	if (two->movetype == MOVETYPE_PUSH)
		return false; //pretend we can't see it
	
	traceresult = gi.trace(one->s.origin, NULL, NULL, two->s.origin, one, MASK_SOLID);
	if (traceresult.fraction == 1.0)
		return true;
	return false;
}

// Assembly:
xorl %eax, %eax
cmpl $0x2, 0x118(%rdi)
je 0x1f1f8
movq %rsi, %r8
cmpl $0x2, 0x118(%rsi)
je 0x1f1f8
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r9
movq 0x49440(%rip), %rax     # 0x68600
leaq 0x4(%rdi), %rsi
addq $0x4, %r8
movl $0x3, (%rsp)
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq *0x60(%rax)
movss 0x33d42(%rip), %xmm0    # 0x52f28
cmpeqss 0x8(%rbx), %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: replace_visibleplayers
void replace_visibleplayers(edict_t *person, char *temp)
{
	edict_t *cur = NULL;
	qboolean more_than_one = false;	
	
	strcpy(temp,"");
	while ((cur = findradius(cur, person->s.origin, 2048)) != NULL)
	{
		if (cur->client)
		{
			if (cur->inuse && cur != person && visibility_test(person, cur) )
			{
				if (more_than_one)
					strcat(temp," and");
				strcat(temp, cur->client->pers.netname);
				more_than_one = true;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rsi)
leaq 0x4(%rdi), %r15
xorl %ebp, %ebp
movss 0x33d11(%rip), %xmm0    # 0x52f2c
xorl %edi, %edi
movq %r15, %rsi
callq 0x19870
testq %rax, %rax
je 0x1f29f
movq %rax, %r12
movl $0x2c0, %r13d           # imm = 0x2C0
cmpq $0x0, 0x58(%r12)
je 0x1f284
cmpq %r14, %r12
je 0x1f284
cmpl $0x0, 0x60(%r12)
je 0x1f284
movq %r14, %rdi
movq %r12, %rsi
callq 0x18400
testl %eax, %eax
je 0x1f284
testl %ebp, %ebp
je 0x1f26f
movq %rbx, %rdi
callq 0x18680
movl $0x646e6120, (%rbx,%rax) # imm = 0x646E6120
movb $0x0, 0x4(%rbx,%rax)
movq 0x58(%r12), %rsi
addq %r13, %rsi
movq %rbx, %rdi
callq 0x19640
movl $0x1, %ebp
movq %r12, %rdi
movq %r15, %rsi
movss 0x33c9a(%rip), %xmm0    # 0x52f2c
callq 0x19870
movq %rax, %r12
testq %rax, %rax
jne 0x1f233
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_replace.c
// Function: LowerCase
void LowerCase(char* src)
{
	size_t len;
	size_t i;

	len = strlen(src);
	for (i = 0; i < len; i++)
	{
		src[i] = tolower(src[i]);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x18680
testq %rax, %rax
je 0x1f2e2
movq %rax, %r14
xorl %r15d, %r15d
callq 0x19a20
movq (%rax), %rcx
movsbq (%rbx,%r15), %rdx
movb (%rcx,%rdx,4), %cl
movb %cl, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x1f2cb
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: SelectFarthestRuneSpawnPoint
edict_t *SelectFarthestRuneSpawnPoint (void)
{
	edict_t	*bestspot;
	float	bestdistance, bestrunedistance;
	edict_t	*spot;


	spot = NULL;
	bestspot = NULL;
	bestdistance = 0;
	spot = G_Find (spot, FOFS(classname), "item_health");
	while (spot)
	{
		bestrunedistance = RunesRangeFromSpot (spot);
		
		if (bestrunedistance > bestdistance)
		{
			bestspot = spot;
			bestdistance = bestrunedistance;
		}
		spot = G_Find (spot, FOFS(classname), "item_health");
	}

	if (bestspot)
	{
	    return bestspot;
	}

	spot = SelectRuneSpawnPoint();

	return spot;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x33b62(%rip), %rdx     # 0x531b7
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x1f6ca
movq %rax, %r14
xorps %xmm0, %xmm0
xorl %ebx, %ebx
leaq 0x33b42(%rip), %r15     # 0x531b7
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
callq 0x19840
movss 0xc(%rsp), %xmm1
ucomiss %xmm1, %xmm0
cmovaq %r14, %rbx
maxss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r15, %rdx
callq 0x19430
movq %rax, %r14
movss 0xc(%rsp), %xmm0
testq %rax, %rax
jne 0x1f675
testq %rbx, %rbx
je 0x1f6ca
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x183d0
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: Pickup_Rune
qboolean Pickup_Rune (edict_t *ent, edict_t *other)
{
	if (!other->client->rune) // don't already have rune
	{
		// Make sure it will respawn
		ent->flags |= FL_RESPAWN;
		ent->think = NULL;
		ent->nextthink = 0;

		other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
		ent->owner = other;
		other->client->rune = ent;
		ent->solid = SOLID_NOT;
		gi.linkentity (ent); //always pair with solid changes

		ent->svflags |= SVF_NOCLIENT;
		ent->movetype = MOVETYPE_NONE;  // Don't block doors
		gi.sound(ent, CHAN_ITEM, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
		return true;
	}

	ent->touch = Touch_Item;
	ent->think = Rune_Think;
	ent->nextthink = level.time + FRAMETIME;
	
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rsi), %rax
cmpq $0x0, 0xf68(%rax)
je 0x1fc78
movq 0x48c40(%rip), %rax     # 0x68880
movq %rax, 0x220(%rbx)
movq 0x48fd2(%rip), %rax     # 0x68c20
movq %rax, 0x210(%rbx)
movq 0x49144(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x33627(%rip), %xmm0    # 0x53290
movss %xmm0, 0x200(%rbx)
xorl %eax, %eax
jmp 0x1fd1a
orb $-0x80, 0x11f(%rbx)
movq $0x0, 0x210(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x200(%rbx)
movq 0x330(%rbx), %rcx
subq 0x491a0(%rip), %rcx     # 0x68e40
sarq $0x3, %rcx
movabsq $-0x3c3c3c3c3c3c3c3c, %rdx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rcx, %rdx
incl 0x318(%rax,%rdx)
movq %rsi, 0x110(%rbx)
movq %rbx, 0xf68(%rax)
movl %ebp, 0x108(%rbx)
movq 0x4892c(%rip), %r14     # 0x68600
movq %rbx, %rdi
callq *0x90(%r14)
orb $0x1, 0xc8(%rbx)
movl %ebp, 0x118(%rbx)
movq 0x20(%r14), %r15
leaq 0x365a6(%rip), %rdi     # 0x5629c
callq *0x48(%r14)
movss 0x33226(%rip), %xmm0    # 0x52f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x48b54(%rip), %rax     # 0x68880
movq %rax, 0x220(%rdi)
movq $0x0, 0x110(%rdi)
movq 0x48edb(%rip), %rax     # 0x68c20
movq %rax, 0x210(%rdi)
movq 0x4904d(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x33530(%rip), %xmm0    # 0x53290
movss %xmm0, 0x200(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x48659(%rip), %rax     # 0x68600
movq 0x58(%rax), %rax
testq %rsi, %rsi
jne 0x1ffbb
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_O3/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 0x20001
movq 0x58(%rdx), %rcx
testq %rcx, %rcx
je 0x20001
movq 0xf68(%rcx), %rcx
testq %rcx, %rcx
je 0x20001
cmpl $0x1, 0x478(%rcx)
jne 0x20001
cvtsi2ss %eax, %xmm0
mulss 0x332af(%rip), %xmm0    # 0x532ac
cvttss2si %xmm0, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2006f
movq %rdi, %r14
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x2006f
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x2006f
cmpl $0x2, 0x478(%rax)
jne 0x2006f
cvtsi2ss %ebx, %xmm0
divss 0x33271(%rip), %xmm0    # 0x532ac
cvttss2si %xmm0, %ebx
movq 0x485ba(%rip), %rax     # 0x68600
movq 0x20(%rax), %r15
leaq 0x333ad(%rip), %rdi     # 0x533fe
callq *0x48(%rax)
movss 0x32ecc(%rip), %xmm0    # 0x52f28
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_O3/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 0x202ee
movq %rdi, %rbx
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x202ee
movq 0xf68(%rax), %rcx
testq %rcx, %rcx
je 0x202ee
cmpl $0x4, 0x478(%rcx)
jne 0x2029c
cmpl $0x0, 0xf70(%rax)
je 0x20285
movq 0x483a8(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
leaq 0x331c5(%rip), %rdi     # 0x53428
callq *0x48(%rax)
movss 0x32cba(%rip), %xmm0    # 0x52f28
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 0x2029c
movq 0x730(%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x58(%rbx), %rax
movq 0xf68(%rax), %rcx
cmpl $0x1, 0x478(%rcx)
jne 0x202ee
cmpl $0x0, 0xf70(%rax)
je 0x202ee
movq 0x48344(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
leaq 0x33172(%rip), %rdi     # 0x53439
callq *0x48(%rax)
movss 0x32c56(%rip), %xmm0    # 0x52f28
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
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x48246(%rip), %rax     # 0x68558
movq (%rax), %rax
cmoveq %rax, %r15
movq 0x48a20(%rip), %rcx     # 0x68d40
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 0x203c0
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 0x203a0
testl %eax, %eax
je 0x203a0
cmpl $-0x5, %ebp
je 0x20393
cmpl $-0x4, %ebp
je 0x203c2
movq 0x58(%rbx), %rax
cmpl %ebp, 0x1100(%rax)
jne 0x203a0
jmp 0x203c2
movq 0x58(%rbx), %rax
cmpl $0x0, 0x1100(%rax)
jg 0x203c2
addq %r13, %rbx
movq %r15, %rax
sarq $0x3, %rax
movabsq $-0x20a4f089731d3543, %rcx # imm = 0xDF5B0F768CE2CABD
imulq %rcx, %rax
addq %r13, %r15
cmpq %r12, %rax
jl 0x20365
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_O3/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 0x2040f
movq 0x58(%rdi), %r14
testq %r14, %r14
je 0x2040f
cmpl $0x0, 0x60(%rdi)
je 0x2040f
cmpl $0x0, 0x304(%r14)
je 0x2040f
movl %esi, %ebx
movq 0x138(%rdi), %rdi
leaq 0x33f89(%rip), %rsi     # 0x5438f
callq 0x18b20
testl %eax, %eax
je 0x20419
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x48aa0(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
movl $0x1, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x20437
jnp 0x20411
cmpl $-0x4, %ebx
je 0x20411
cmpl $-0x5, %ebx
jne 0x20451
movl 0x1100(%r14), %ecx
decl %ecx
cmpl $0x2, %ecx
jae 0x2040f
jmp 0x20411
cmpl %ebx, 0x1100(%r14)
jne 0x2040f
jmp 0x20411
// File: /workspace/github_c_makefile_star2_O3/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 0x192e0
xorl %eax, %eax
ucomiss 0x32fb9(%rip), %xmm0    # 0x5344c
setbe %al
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x20502
movq %rdi, %r14
movq 0x138(%rdi), %rdi
leaq 0x3aa81(%rip), %rsi     # 0x5af3b
callq 0x18b20
testl %eax, %eax
jne 0x20502
movsd 0x460(%r14), %xmm0
movsd 0x4(%r14), %xmm1
subps %xmm1, %xmm0
leaq 0x8(%rsp), %rdi
movlps %xmm0, (%rdi)
movss 0x468(%r14), %xmm0
subss 0xc(%r14), %xmm0
movss %xmm0, 0x8(%rdi)
callq 0x192e0
xorl %ebx, %ebx
ucomiss 0x32f4d(%rip), %xmm0    # 0x5344c
setbe %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3a6da(%rip), %rdx     # 0x5af3b
xorl %r13d, %r13d
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x208ec
movq %rax, %r14
xorl %r12d, %r12d
leaq 0x3a6b9(%rip), %r15     # 0x5af3b
cmpq $0x0, 0x330(%r14)
je 0x208c6
movl 0x47c(%r14), %eax
leal -0x3(%rax), %ecx
cmpl $-0x2, %ecx
jb 0x208c6
cmpl %ebx, %eax
jne 0x208ce
movq %r14, %r13
testq %r12, %r12
je 0x208d1
movq 0x110(%r14), %rsi
movq %r14, %rdi
callq 0x19080
movq 0x110(%r12), %rsi
movq %r12, %rdi
callq 0x19080
movq %r14, %rdi
callq 0x19a50
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 0x20882
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x20c79
movups 0x460(%r14), %xmm0
movups %xmm0, 0x4(%r14)
movsd 0x470(%r14), %xmm0
movsd %xmm0, 0x14(%r14)
movq %r14, %rdi
callq 0x18580
testq %rbx, %rbx
je 0x20d3a
andb $-0x2, 0x41(%rbx)
movq %rbx, %rdi
callq 0x18280
movl $0x0, 0x30(%rbx)
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x20d3a
movq 0x47b4f(%rip), %rcx     # 0x687f8
movq (%rcx), %rdx
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
testq %rdx, %rdx
je 0x20cdc
movq 0x330(%rdx), %rdx
subq 0x48177(%rip), %rdx     # 0x68e40
sarq $0x3, %rdx
imulq %rcx, %rdx
movl $0x0, 0x318(%rax,%rdx)
movq 0x47b7d(%rip), %rdx     # 0x68860
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x20d0c
movq 0x330(%rdx), %rdx
subq 0x48147(%rip), %rdx     # 0x68e40
sarq $0x3, %rdx
imulq %rcx, %rdx
movl $0x0, 0x318(%rax,%rdx)
testq %r14, %r14
je 0x20d32
movq 0x330(%r14), %rdx
subq 0x48121(%rip), %rdx     # 0x68e40
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_O3/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 0x20f45
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 0x47e54(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movss 0x32337(%rip), %xmm1    # 0x53290
addss %xmm0, %xmm1
movss %xmm1, 0x200(%rbx)
movss 0x4a0(%rbx), %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x20f77
jnp 0x20f99
addss 0x32315(%rip), %xmm1    # 0x53294
ucomiss %xmm1, %xmm0
jbe 0x20f99
movq 0x110(%rbx), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
testl %eax, %eax
je 0x20fa1
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x47850(%rip), %rax     # 0x687f8
cmpq %rbx, (%rax)
je 0x20fc2
movq 0x478ac(%rip), %rax     # 0x68860
cmpq %rbx, (%rax)
jne 0x20ff2
leaq 0x325ff(%rip), %rdi     # 0x535bf
jmp 0x20fc9
leaq 0x325e3(%rip), %rdi     # 0x535ac
movq 0x47630(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
callq *0x48(%rax)
movss 0x32481(%rip), %xmm0    # 0x53460
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_O3/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 0x47d21(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x211b5
jnp 0x2123e
movq %rdi, %rbx
leaq 0x32383(%rip), %rdx     # 0x53542
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x2123e
movq %rax, %r14
leaq 0x8(%rsp), %r15
leaq 0x32363(%rip), %r12     # 0x53542
movsd 0x4(%r14), %xmm0
movsd 0x460(%rbx), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, 0x8(%rsp)
movss 0xc(%r14), %xmm0
subss 0x468(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
movq %r15, %rdi
callq 0x192e0
movss 0x31d0b(%rip), %xmm1    # 0x52f24
ucomiss %xmm0, %xmm1
jb 0x21226
movq %r14, %rdi
callq 0x19a50
movq %r14, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r12, %rdx
callq 0x19430
movq %rax, %r14
testq %rax, %rax
jne 0x211df
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movss 0x321de(%rip), %xmm0    # 0x53464
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 0x18fa0
movq 0x4734b(%rip), %rax     # 0x68600
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 0x31f9f(%rip), %xmm0    # 0x532a4
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_O3/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 0x47553(%rip), %rax     # 0x68880
movq %rax, 0x220(%rdi)
movq $0x0, 0x110(%rdi)
movq 0x4727a(%rip), %rax     # 0x685c0
movq %rax, 0x210(%rdi)
movq 0x47a4c(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x31f2f(%rip), %xmm0    # 0x53290
movss %xmm0, 0x200(%rdi)
retq