LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: FindItem
gitem_t	*FindItem (char *pickup_name)
{
	int		i;
	gitem_t	*it;

	it = itemlist;
	for (i=0 ; i<game.num_items ; i++, it++)
	{
		if (!it->pickup_name)
			continue;
		if (!Q_stricmp(it->pickup_name, pickup_name))
			return it;
	}

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x39c85(%rip), %r15     # 0x66d40
movl 0x61c(%r15), %eax
movq 0x39d77(%rip), %rbx     # 0x66e40
xorl %ebp, %ebp
cmpl %eax, %ebp
jge 0x2d0f6
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x2d0eb
movq %r14, %rsi
callq 0x186d0
testl %eax, %eax
je 0x2d0f8
movl 0x61c(%r15), %eax
incl %ebp
addq $0x88, %rbx
jmp 0x2d0cb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: DoRespawn
void DoRespawn(edict_t* ent)
{
	if (!ent)
		return;

	if (ent->team)
	{
		edict_t* master;
		unsigned count;
		unsigned choice;

		master = ent->teammaster;
		if (master == NULL)
			return;

		count = 0;
		for (ent = master; ent; ent = ent->chain)
			count++;

		choice = count ? (rand() % count) : 0;

		count = 0;
		for (ent = master; count < choice; ent = ent->chain)
			count++;
	}

	if (ent)
	{
		ent->svflags &= ~SVF_NOCLIENT;
		ent->solid = SOLID_TRIGGER;
		gi.linkentity(ent);

		// send an effect
		ent->s.event = EV_ITEM_RESPAWN;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x2d189
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x168(%rdi)
je 0x2d160
movq 0x2d0(%rbx), %rbx
testq %rbx, %rbx
je 0x2d183
xorl %ebp, %ebp
movq %rbx, %rax
testq %rax, %rax
je 0x2d13c
incl %ebp
movq 0x298(%rax), %rax
jmp 0x2d12c
testl %ebp, %ebp
je 0x2d14b
callq 0x19bf0
xorl %edx, %edx
divl %ebp
jmp 0x2d156
xorl %edx, %edx
jmp 0x2d156
movq 0x298(%rbx), %rbx
subl $0x1, %edx
jae 0x2d14f
testq %rbx, %rbx
je 0x2d183
andb $-0x2, 0xc8(%rbx)
pushq $0x1
popq %rbp
movl %ebp, 0x108(%rbx)
movq 0x39489(%rip), %rax     # 0x66600
movq %rbx, %rdi
callq *0x90(%rax)
movl %ebp, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SetRespawn
void SetRespawn (edict_t *ent, float delay)
{
	ent->flags |= FL_RESPAWN;
	ent->svflags |= SVF_NOCLIENT;
	ent->solid = SOLID_NOT;
	ent->nextthink = level.time + delay;
	ent->think = DoRespawn;
	gi.linkentity (ent);
}

// Assembly:
orb $-0x80, 0x11f(%rdi)
orb $0x1, 0xc8(%rdi)
andl $0x0, 0x108(%rdi)
movq 0x39bfa(%rip), %rax     # 0x66da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rdi)
movq 0x39b96(%rip), %rax     # 0x66d50
movq %rax, 0x210(%rdi)
movq 0x39438(%rip), %rax     # 0x66600
jmpq *0x90(%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Powerup
qboolean Pickup_Powerup (edict_t *ent, edict_t *other)
{
	int		quantity;

	quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
	if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
		return false;

	if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
		return false;

	other->client->pers.inventory[ITEM_INDEX(ent->item)]++;

	if (deathmatch->value)
	{
		if (!(ent->spawnflags & DROPPED_ITEM) )
			SetRespawn (ent, ent->item->quantity);
		if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM)))
		{
			if ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))
				quad_drop_timeout_hack = (ent->nextthink - level.time) / FRAMETIME;
			ent->item->use (other, ent->item);
		}
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rsi), %rcx
movq 0x330(%rdi), %rsi
movq %rsi, %rax
subq 0x39c53(%rip), %rax     # 0x66e40
movl $0x88, %edi
cqto
idivq %rdi
movl 0x318(%rcx,%rax,4), %edx
movq 0x39533(%rip), %rdi     # 0x66738
movq (%rdi), %rdi
movss 0x20(%rdi), %xmm0
xorl %ebp, %ebp
ucomiss 0x21d12(%rip), %xmm0    # 0x4ef28
jne 0x2d223
jp 0x2d223
cmpl $0x1, %edx
jg 0x2d312
ucomiss 0x22242(%rip), %xmm0    # 0x4f46c
jb 0x2d234
testl %edx, %edx
jg 0x2d312
movq 0x39d25(%rip), %rdi     # 0x66f60
movq (%rdi), %rdi
movss 0x20(%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x2d24d
jnp 0x2d25b
testb $0x8, 0x68(%rsi)
je 0x2d25b
testl %edx, %edx
jg 0x2d312
incl %edx
movl %edx, 0x318(%rcx,%rax,4)
movq 0x39c55(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
pushq $0x1
popq %rbp
ucomiss %xmm0, %xmm1
jne 0x2d281
jnp 0x2d312
testb $0x1, 0x142(%r14)
jne 0x2d29f
cvtsi2ssl 0x5c(%rsi), %xmm0
movq %r14, %rdi
callq 0x196d0
movq 0x330(%r14), %rsi
movq 0x39372(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %ecx
movq 0x10(%rsi), %rax
testb $0x10, %cl
jne 0x2d2cc
cmpq 0x396ba(%rip), %rax     # 0x66978
jne 0x2d312
testb $0x2, 0x142(%r14)
jne 0x2d2d5
jmp 0x2d312
cmpq 0x396a5(%rip), %rax     # 0x66978
jne 0x2d30d
movq 0x3969c(%rip), %rax     # 0x66978
testb $0x2, 0x142(%r14)
je 0x2d30d
movss 0x200(%r14), %xmm0
movq 0x39aaa(%rip), %rcx     # 0x66da0
subss 0x4(%rcx), %xmm0
divss 0x21f8d(%rip), %xmm0    # 0x4f290
cvttss2si %xmm0, %ecx
movl %ecx, 0x43933(%rip)     # 0x70c40
movq %rbx, %rdi
callq *%rax
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_Quad
void Use_Quad (edict_t *ent, gitem_t *item)
{
	int		timeout;

	ent->client->pers.inventory[ITEM_INDEX(item)]--;
	ValidateSelectedItem (ent);

	if (quad_drop_timeout_hack)
	{
		timeout = quad_drop_timeout_hack;
		quad_drop_timeout_hack = 0;
	}
	else
	{
		timeout = 300;
	}

	if (ent->client->quad_framenum > level.framenum)
		ent->client->quad_framenum += timeout;
	else
		ent->client->quad_framenum = level.framenum + timeout;

	gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
subq 0x39b12(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
decl 0x318(%rcx,%rax,4)
callq 0x182a0
movl 0x438f6(%rip), %eax     # 0x70c40
testl %eax, %eax
je 0x2d357
andl $0x0, 0x438eb(%rip)     # 0x70c40
jmp 0x2d35c
movl $0x12c, %eax            # imm = 0x12C
movq 0x58(%rbx), %rcx
movq 0x39a39(%rip), %rdx     # 0x66da0
movl (%rdx), %edx
cvtsi2ss %edx, %xmm0
addl %eax, %edx
cvtsi2ss %edx, %xmm1
movss 0xf04(%rcx), %xmm2
cvtsi2ss %eax, %xmm3
addss %xmm2, %xmm3
cmpltss %xmm2, %xmm0
andps %xmm0, %xmm3
andnps %xmm1, %xmm0
orps %xmm3, %xmm0
movss %xmm0, 0xf04(%rcx)
movq 0x39260(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x24c2b(%rip), %rdi     # 0x51fd6
callq *0x48(%rax)
pushq $0x3
popq %rsi
movss 0x21b6f(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Adrenaline
qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
{
	if (!deathmatch->value)
		other->max_health += 1;

	if (other->health < other->max_health)
		other->health = other->max_health;

	if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
		SetRespawn (ent, ent->item->quantity);

	return true;
}

// Assembly:
movq 0x398b0(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movl 0x258(%rsi), %eax
jne 0x2d630
jp 0x2d630
incl %eax
movl %eax, 0x258(%rsi)
cmpl %eax, 0x254(%rsi)
jge 0x2d63e
movl %eax, 0x254(%rsi)
ucomiss %xmm1, %xmm0
jne 0x2d645
jnp 0x2d668
movl $0x10000, %eax          # imm = 0x10000
andl 0x140(%rdi), %eax
jne 0x2d668
pushq %rax
movq 0x330(%rdi), %rax
cvtsi2ssl 0x5c(%rax), %xmm0
callq 0x196d0
addq $0x8, %rsp
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_AncientHead
qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
{
	other->max_health += 2;

	if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
		SetRespawn (ent, ent->item->quantity);

	return true;
}

// Assembly:
addl $0x2, 0x258(%rsi)
testb $0x1, 0x142(%rdi)
jne 0x2d6ab
movq 0x3983d(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2d695
jnp 0x2d6ab
pushq %rax
movq 0x330(%rdi), %rax
cvtsi2ssl 0x5c(%rax), %xmm0
callq 0x196d0
addq $0x8, %rsp
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Bandolier
qboolean Pickup_Bandolier (edict_t *ent, edict_t *other)
{
	gitem_t	*item;
	int		index;

	if (other->client->pers.max_bullets < 250)
		other->client->pers.max_bullets = 250;
	if (other->client->pers.max_shells < 150)
		other->client->pers.max_shells = 150;
	if (other->client->pers.max_cells < 250)
		other->client->pers.max_cells = 250;
	if (other->client->pers.max_slugs < 75)
		other->client->pers.max_slugs = 75;

	item = FindItem("Bullets");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
			other->client->pers.inventory[index] = other->client->pers.max_bullets;
	}

	item = FindItem("Shells");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_shells)
			other->client->pers.inventory[index] = other->client->pers.max_shells;
	}

	if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
		SetRespawn (ent, ent->item->quantity);

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rsi), %rax
cmpl $0xf9, 0x718(%rax)
jg 0x2d6d3
movl $0xfa, 0x718(%rax)
cmpl $0x95, 0x71c(%rax)
jg 0x2d6e9
movl $0x96, 0x71c(%rax)
cmpl $0xf9, 0x728(%rax)
jg 0x2d6ff
movl $0xfa, 0x728(%rax)
cmpl $0x4a, 0x72c(%rax)
jg 0x2d712
movl $0x4b, 0x72c(%rax)
leaq 0x24897(%rip), %rdi     # 0x51fb0
callq 0x18a80
testq %rax, %rax
je 0x2d760
movq %rax, %rcx
subq 0x39713(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x718(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x24851(%rip), %rdi     # 0x51fb8
callq 0x18a80
testq %rax, %rax
je 0x2d7ae
movq %rax, %rcx
subq 0x396c5(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x71c(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
testb $0x1, 0x142(%rbx)
jne 0x2d7e4
movq 0x39702(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2d7d0
jnp 0x2d7e4
movq 0x330(%rbx), %rax
cvtsi2ssl 0x5c(%rax), %xmm0
movq %rbx, %rdi
callq 0x196d0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_Breather
void Use_Breather (edict_t *ent, gitem_t *item)
{
	ent->client->pers.inventory[ITEM_INDEX(item)]--;
	ValidateSelectedItem (ent);

	if (ent->client->breather_framenum > level.framenum)
		ent->client->breather_framenum += 300;
	else
		ent->client->breather_framenum = level.framenum + 300;

//	gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
subq 0x393a1(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
decl 0x318(%rcx,%rax,4)
callq 0x182a0
movq 0x58(%rbx), %rax
movq 0x392e0(%rip), %rcx     # 0x66da0
movl (%rcx), %ecx
cvtsi2ss %ecx, %xmm0
addl $0x12c, %ecx            # imm = 0x12C
cvtsi2ss %ecx, %xmm1
movss 0xf0c(%rax), %xmm2
cmpltss %xmm2, %xmm0
addss 0x244b7(%rip), %xmm2    # 0x51f9c
andps %xmm0, %xmm2
andnps %xmm1, %xmm0
orps %xmm2, %xmm0
movss %xmm0, 0xf0c(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_Envirosuit
void Use_Envirosuit (edict_t *ent, gitem_t *item)
{
	ent->client->pers.inventory[ITEM_INDEX(item)]--;
	ValidateSelectedItem (ent);

	if (ent->client->enviro_framenum > level.framenum)
		ent->client->enviro_framenum += 300;
	else
		ent->client->enviro_framenum = level.framenum + 300;

//	gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
subq 0x39336(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
decl 0x318(%rcx,%rax,4)
callq 0x182a0
movq 0x58(%rbx), %rax
movq 0x39275(%rip), %rcx     # 0x66da0
movl (%rcx), %ecx
cvtsi2ss %ecx, %xmm0
addl $0x12c, %ecx            # imm = 0x12C
cvtsi2ss %ecx, %xmm1
movss 0xf10(%rax), %xmm2
cmpltss %xmm2, %xmm0
addss 0x2444c(%rip), %xmm2    # 0x51f9c
andps %xmm0, %xmm2
andnps %xmm1, %xmm0
orps %xmm2, %xmm0
movss %xmm0, 0xf10(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_Invulnerability
void	Use_Invulnerability (edict_t *ent, gitem_t *item)
{
	ent->client->pers.inventory[ITEM_INDEX(item)]--;
	ValidateSelectedItem (ent);

	if (ent->client->invincible_framenum > level.framenum)
		ent->client->invincible_framenum += 300;
	else
		ent->client->invincible_framenum = level.framenum + 300;

	gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
subq 0x392c8(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
decl 0x318(%rcx,%rax,4)
callq 0x182a0
movq 0x58(%rbx), %rax
movss 0xf08(%rax), %xmm0
movq 0x391ff(%rip), %rcx     # 0x66da0
movl (%rcx), %ecx
cvtsi2ss %ecx, %xmm1
addl $0x12c, %ecx            # imm = 0x12C
cvtsi2ss %ecx, %xmm2
cmpltss %xmm0, %xmm1
addss 0x243de(%rip), %xmm0    # 0x51f9c
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
movss %xmm1, 0xf08(%rax)
movq 0x38a2a(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x24406(%rip), %rdi     # 0x51fe7
callq *0x48(%rax)
pushq $0x3
popq %rsi
movss 0x21339(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_Silencer
void	Use_Silencer (edict_t *ent, gitem_t *item)
{
	ent->client->pers.inventory[ITEM_INDEX(item)]--;
	ValidateSelectedItem (ent);
	ent->client->silencer_shots += 30;

//	gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rcx
subq 0x39228(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
decl 0x318(%rcx,%rax,4)
callq 0x182a0
movq 0x58(%rbx), %rax
addl $0x1e, 0xf1c(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Key
qboolean Pickup_Key (edict_t *ent, edict_t *other)
{
	if (coop->value)
	{
		if (strcmp(ent->classname, "key_power_cube") == 0)
		{
			if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00)>> 8))
				return false;
			other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
			other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8);
		}
		else
		{
			if (other->client->pers.inventory[ITEM_INDEX(ent->item)])
				return false;
			other->client->pers.inventory[ITEM_INDEX(ent->item)] = 1;
		}
		return true;
	}
	other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x39314(%rip), %rax     # 0x66f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2dc5e
jnp 0x2dca8
movq 0x138(%rbx), %rdi
leaq 0x2438d(%rip), %rsi     # 0x51ff9
callq 0x18bc0
movq 0x58(%r14), %rcx
testl %eax, %eax
je 0x2dcd0
movq 0x330(%rbx), %rax
subq 0x391b9(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
cmpl $0x0, 0x318(%rcx,%rax,4)
jne 0x2dcde
movl $0x1, 0x318(%rcx,%rax,4)
jmp 0x2dccb
movq 0x58(%r14), %rcx
movq 0x330(%rbx), %rax
subq 0x39186(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
incl 0x318(%rcx,%rax,4)
pushq $0x1
popq %rax
jmp 0x2dce0
movb 0x740(%rcx), %al
testb %al, 0x141(%rbx)
je 0x2dce8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x330(%rbx), %rax
subq 0x3914a(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
incl 0x318(%rcx,%rax,4)
movzbl 0x141(%rbx), %eax
orl %eax, 0x740(%rcx)
jmp 0x2dccb
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Ammo
qboolean Pickup_Ammo (edict_t *ent, edict_t *other)
{
	int			oldcount;
	int			count;
	qboolean	weapon;

	weapon = (ent->item->flags & IT_WEAPON);
	if ( (weapon) && ( (int)dmflags->value & DF_INFINITE_AMMO ) )
		count = 1000;
	else if (ent->count)
		count = ent->count;
	else
		count = ent->item->quantity;

	oldcount = other->client->pers.inventory[ITEM_INDEX(ent->item)];

	if (!Add_Ammo (other, ent->item, count))
		return false;

	if (weapon && !oldcount)
	{
		if (other->client->pers.weapon != ent->item && ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) )
			other->client->newweapon = ent->item;
	}

	if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)) && (deathmatch->value))
		SetRespawn (ent, 30);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x330(%rdi), %rsi
movl 0x68(%rsi), %ebp
testb $0x1, %bpl
je 0x2dda6
movq 0x38885(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
btl $0xd, %eax
jb 0x2ddb3
movl 0x290(%rbx), %ecx
testl %ecx, %ecx
jne 0x2ddb3
movl 0x5c(%rsi), %ecx
movq 0x58(%r14), %rdi
movq %rsi, %rax
subq 0x3907f(%rip), %rax     # 0x66e40
movl $0x88, %r8d
cqto
idivq %r8
movl 0x318(%rdi,%rax,4), %r15d
movq %r14, %rdi
movl %ecx, %edx
callq 0x193b0
testl %eax, %eax
je 0x2de7b
testb $0x1, %bpl
je 0x2de44
testl %r15d, %r15d
jne 0x2de44
movq 0x58(%r14), %rax
movq 0x730(%rax), %r15
movq 0x330(%rbx), %rcx
cmpq %rcx, %r15
je 0x2de44
movq 0x390b1(%rip), %rdx     # 0x66ec0
movq (%rdx), %rdx
movss 0x20(%rdx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2de21
jnp 0x2de3d
leaq 0x2822e(%rip), %rdi     # 0x56056
callq 0x18a80
cmpq %rax, %r15
jne 0x2de44
movq 0x330(%rbx), %rcx
movq 0x58(%r14), %rax
movq %rcx, 0xe50(%rax)
pushq $0x1
popq %rbp
testb $0x3, 0x142(%rbx)
jne 0x2de7d
movq 0x39069(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2de69
jnp 0x2de7d
movss 0x21423(%rip), %xmm0    # 0x4f294
movq %rbx, %rdi
callq 0x196d0
jmp 0x2de7d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Drop_Ammo
void Drop_Ammo (edict_t *ent, gitem_t *item)
{
	edict_t	*dropped;
	int		index;

	index = ITEM_INDEX(item);
	dropped = Drop_Item (ent, item);
	if (ent->client->pers.inventory[index] >= item->quantity)
		dropped->count = item->quantity;
	else
		dropped->count = ent->client->pers.inventory[index];

	if (ent->client->pers.weapon && 
		ent->client->pers.weapon->tag == AMMO_GRENADES &&
		item->tag == AMMO_GRENADES &&
		ent->client->pers.inventory[index] - dropped->count <= 0) {
		gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
		G_FreeEdict(dropped);
		return;
	}

	ent->client->pers.inventory[index] -= dropped->count;
	ValidateSelectedItem (ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rax
subq 0x38fa1(%rip), %rax     # 0x66e40
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %r15
callq 0x18490
movq 0x58(%rbx), %rcx
movslq %r15d, %rdx
movl 0x318(%rcx,%rdx,4), %edi
movl 0x5c(%r14), %esi
cmpl %esi, %edi
cmovll %edi, %esi
movq %rax, %r15
movl %esi, 0x290(%rax)
movq 0x730(%rcx), %rax
testq %rax, %rax
je 0x2def3
cmpl $0x3, 0x78(%rax)
jne 0x2def3
cmpl $0x3, 0x78(%r14)
jne 0x2def3
cmpl %esi, 0x318(%rcx,%rdx,4)
jle 0x2df07
subl %esi, 0x318(%rcx,%rdx,4)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x182a0
movq 0x386f2(%rip), %rcx     # 0x66600
leaq 0x240f3(%rip), %rdx     # 0x52008
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x10(%rcx)
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: MegaHealth_think
void MegaHealth_think (edict_t *self)
{
	//surt regen rune problem with this
	if (self->owner)
	{
		if (self->owner->client && self->owner->client->rune &&
			self->owner->client->rune->runetype == RUNE_REGEN)
		{
			if (self->owner->health > self->owner->max_health + 25)
			{
				self->nextthink = level.time + 2;
				self->owner->health -= 1;
				return;
			}
		}
			
		//this was the old standard case
		else if (self->owner->health > self->owner->max_health)
		{
			self->nextthink = level.time + 1;
			self->owner->health -= 1;
			return;
		}
	}

	if (!(self->spawnflags & DROPPED_ITEM) && (deathmatch->value))
		SetRespawn (self, 20);
	else
		G_FreeEdict (self);
}

// Assembly:
movq 0x110(%rdi), %rax
testq %rax, %rax
je 0x2dfb3
movq 0x58(%rax), %rcx
testq %rcx, %rcx
je 0x2df80
movq 0xf68(%rcx), %rcx
testq %rcx, %rcx
je 0x2df80
cmpl $0x8, 0x478(%rcx)
jne 0x2df80
movl 0x254(%rax), %ecx
movl 0x258(%rax), %edx
addl $0x19, %edx
cmpl %edx, %ecx
jle 0x2dfb3
movq 0x38e2f(%rip), %rdx     # 0x66da0
movss 0x4(%rdx), %xmm0
addss 0x214ee(%rip), %xmm0    # 0x4f46c
jmp 0x2dfa2
movl 0x254(%rax), %ecx
cmpl 0x258(%rax), %ecx
jle 0x2dfb3
movq 0x38e0b(%rip), %rdx     # 0x66da0
movss 0x4(%rdx), %xmm0
addss 0x20f86(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rdi)
decl %ecx
movl %ecx, 0x254(%rax)
retq
testb $0x1, 0x142(%rdi)
jne 0x19c50
movq 0x38ef9(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2dfd9
jnp 0x2dfe6
movss 0x21c5f(%rip), %xmm0    # 0x4fc40
jmp 0x196d0
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Health
qboolean Pickup_Health (edict_t *ent, edict_t *other)
{
	if (!(ent->style & HEALTH_IGNORE_MAX))
		if (other->health >= other->max_health)
			return false;

	other->health += ent->count;

	if (!(ent->style & HEALTH_IGNORE_MAX))
	{
		if (other->health > other->max_health)
			other->health = other->max_health;
	}



#ifdef WEAP_BALANCE_OK	
	//surt take care of overboard health
	if ((int)ctfflags->value & CTF_WEAP_BALANCE)
	{
		if (other->health > (2 * other->max_health) )
			other->health = (2 * other->max_health);
	}
	//end surt code
#endif

	if (ent->style & HEALTH_TIMED)
	{
		ent->think = MegaHealth_think;
		ent->nextthink = level.time + 5;
		ent->owner = other;
		ent->flags |= FL_RESPAWN;
		ent->svflags |= SVF_NOCLIENT;
		ent->solid = SOLID_NOT;
	}
	else
	{
		if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
			SetRespawn (ent, 30);
	}

	return true;
}

// Assembly:
pushq %rbx
movl 0x32c(%rdi), %eax
movl 0x254(%rsi), %ecx
testb $0x1, %al
jne 0x2e01d
xorl %ebx, %ebx
cmpl 0x258(%rsi), %ecx
jge 0x2e0aa
addl 0x290(%rdi), %ecx
movl 0x258(%rsi), %edx
cmpl %edx, %ecx
cmovgel %edx, %ecx
jmp 0x2e023
addl 0x290(%rdi), %ecx
movl %ecx, 0x254(%rsi)
testb $0x2, %al
jne 0x2e061
pushq $0x1
popq %rbx
testb $0x1, 0x142(%rdi)
jne 0x2e0aa
movq 0x38e80(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2e052
jnp 0x2e0aa
movss 0x2123a(%rip), %xmm0    # 0x4f294
callq 0x196d0
jmp 0x2e0aa
movq 0x38898(%rip), %rax     # 0x66900
movq %rax, 0x210(%rdi)
movq 0x38d2a(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x20e81(%rip), %xmm0    # 0x4ef04
movss %xmm0, 0x200(%rdi)
movq %rsi, 0x110(%rdi)
orb $-0x80, 0x11f(%rdi)
orb $0x1, 0xc8(%rdi)
andl $0x0, 0x108(%rdi)
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: ArmorIndex
int ArmorIndex (edict_t *ent)
{
	if (!ent->client)
		return 0;

	if (ent->client->pers.inventory[jacket_armor_index] > 0)
		return jacket_armor_index;

	if (ent->client->pers.inventory[combat_armor_index] > 0)
		return combat_armor_index;

	if (ent->client->pers.inventory[body_armor_index] > 0)
		return body_armor_index;

	return 0;
}

// Assembly:
movq 0x58(%rdi), %rcx
testq %rcx, %rcx
je 0x2e0c9
movslq 0x42b86(%rip), %rax     # 0x70c44
cmpl $0x0, 0x318(%rcx,%rax,4)
jle 0x2e0cc
retq
xorl %eax, %eax
retq
movslq 0x42b75(%rip), %rax     # 0x70c48
cmpl $0x0, 0x318(%rcx,%rax,4)
jg 0x2e0c8
movslq 0x42b68(%rip), %rdx     # 0x70c4c
xorl %eax, %eax
cmpl $0x0, 0x318(%rcx,%rdx,4)
cmovgl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: PowerArmorType
int PowerArmorType (edict_t *ent)
{
	if (!ent->client)
		return POWER_ARMOR_NONE;

	if (!(ent->flags & FL_POWER_ARMOR))
		return POWER_ARMOR_NONE;

	if (ent->client->pers.inventory[power_shield_index] > 0)
		return POWER_ARMOR_SHIELD;

	if (ent->client->pers.inventory[power_screen_index] > 0)
		return POWER_ARMOR_SCREEN;

	return POWER_ARMOR_NONE;
}

// Assembly:
movq 0x58(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x2e2ad
testb $0x10, 0x11d(%rdi)
je 0x2e2ad
movslq 0x429c5(%rip), %rax     # 0x70c50
cmpl $0x0, 0x318(%rcx,%rax,4)
jle 0x2e299
pushq $0x2
popq %rax
retq
movslq 0x429b4(%rip), %rdx     # 0x70c54
xorl %eax, %eax
cmpl $0x0, 0x318(%rcx,%rdx,4)
setg %al
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Use_PowerArmor
void Use_PowerArmor (edict_t *ent, gitem_t *item)
{
	int		index;

	if (ent->flags & FL_POWER_ARMOR)
	{
		ent->flags &= ~FL_POWER_ARMOR;
		gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
	}
	else
	{
		index = ITEM_INDEX(FindItem("cells"));
		if (!ent->client->pers.inventory[index])
		{
			ctf_SafePrint(ent, PRINT_HIGH, "No cells for power armor.\n");
			return;
		}
		ent->flags |= FL_POWER_ARMOR;
		gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);	//FIXME powering up sound
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
btl $0xc, %eax
jb 0x2e309
leaq 0x2480f(%rip), %rdi     # 0x52ad7
callq 0x18a80
subq 0x38b6c(%rip), %rax     # 0x66e40
movl $0x88, %ecx
cqto
idivq %rcx
movq 0x58(%rbx), %rcx
cltq
cmpl $0x0, 0x318(%rcx,%rax,4)
je 0x2e34a
orb $0x10, 0x11d(%rbx)
movq 0x38304(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x23f75(%rip), %rdi     # 0x5227c
jmp 0x2e326
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
movl %eax, 0x11c(%rbx)
movq 0x382e5(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
leaq 0x210c8(%rip), %rdi     # 0x4f3ee
callq *0x48(%rax)
movss 0x20bf7(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
leaq 0x23cd2(%rip), %rdx     # 0x52023
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18ec0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SP_flag
void SP_flag (edict_t *self)
{
	if ( !deathmatch->value )
	{
		G_FreeEdict (self);
		return;
	}

	//self->model = "models/items/mega_h/tris.md2";
	self->droptime = 0;
	self->entprops = 0;
	self->count = 0;
	self->flagteam = 0; // Not set yet
	SpawnItem (self, FindItemByClassname ("flag"));
	self->think = ctf_flagwave;
	self->nextthink = level.time + 1;
	gi.soundindex ("items/m_health.wav");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x38675(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2e85d
jnp 0x2e8c6
andq $0x0, 0x4a0(%rbx)
andl $0x0, 0x290(%rbx)
andl $0x0, 0x47c(%rbx)
leaq 0x28681(%rip), %rdi     # 0x56efb
callq 0x18180
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18fe0
movq 0x37d2f(%rip), %rax     # 0x665c0
movq %rax, 0x210(%rbx)
movq 0x38501(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x2067c(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rbx)
movq 0x37d45(%rip), %rax     # 0x66600
leaq 0x2479d(%rip), %rdi     # 0x5305f
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_PowerArmor
qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other)
{
	int		quantity;

	quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];

	other->client->pers.inventory[ITEM_INDEX(ent->item)]++;

	if (deathmatch->value)
	{
		if (!(ent->spawnflags & DROPPED_ITEM) )
			SetRespawn (ent, ent->item->quantity);
		// auto-use for DM only if we didn't already have one
		if (!quantity)
			ent->item->use (other, ent->item);
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rsi), %rsi
movq 0x330(%rdi), %rcx
movq %rcx, %rax
subq 0x38172(%rip), %rax     # 0x66e40
movl $0x88, %edi
cqto
idivq %rdi
movl 0x318(%rsi,%rax,4), %r15d
leal 0x1(%r15), %edx
movl %edx, 0x318(%rsi,%rax,4)
movq 0x381ce(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2ed04
jnp 0x2ed2d
testb $0x1, 0x142(%r14)
jne 0x2ed1b
cvtsi2ssl 0x5c(%rcx), %xmm0
movq %r14, %rdi
callq 0x196d0
testl %r15d, %r15d
jne 0x2ed2d
movq 0x330(%r14), %rsi
movq %rbx, %rdi
callq *0x10(%rsi)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: drop_make_touchable
static void drop_make_touchable (edict_t *ent)
{
	ent->touch = Touch_Item;
	if (deathmatch->value)
	{
		ent->nextthink = level.time + 29;
		ent->think = G_FreeEdict;
	}
}

// Assembly:
movq 0x37ae6(%rip), %rax     # 0x66880
movq %rax, 0x220(%rdi)
movq 0x38118(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2edba
jnp 0x2ede4
movq 0x37fdf(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x231de(%rip), %xmm0    # 0x51fac
movss %xmm0, 0x200(%rdi)
movq 0x37653(%rip), %rax     # 0x66430
movq %rax, 0x210(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SP_item_health
void SP_item_health (edict_t *self)
{
	if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
	{
		G_FreeEdict (self);
		return;
	}

	self->model = "models/items/healing/medium/tris.md2";
	self->count = 10;
	SpawnItem (self, FindItem ("Health"));
	gi.soundindex ("items/n_health.wav");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x37c70(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f262
jnp 0x2f275
movq 0x373af(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x2f2b6
leaq 0x23f0a(%rip), %rax     # 0x53186
movq %rax, 0x120(%rbx)
movl $0xa, 0x290(%rbx)
leaq 0x1fd21(%rip), %rdi     # 0x4efb5
callq 0x18a80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18fe0
movq 0x37355(%rip), %rax     # 0x66600
leaq 0x22d9f(%rip), %rdi     # 0x52051
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SP_item_health_small
void SP_item_health_small (edict_t *self)
{
	if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
	{
		G_FreeEdict (self);
		return;
	}

	self->model = "models/items/healing/stimpack/tris.md2";
	self->count = 2;
	SpawnItem (self, FindItem ("Health"));
	self->style = HEALTH_IGNORE_MAX;
	gi.soundindex ("items/s_health.wav");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x37bf6(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f2dc
jnp 0x2f2ef
movq 0x37335(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x2f33a
leaq 0x23eb5(%rip), %rax     # 0x531ab
movq %rax, 0x120(%rbx)
movl $0x2, 0x290(%rbx)
leaq 0x1fca7(%rip), %rdi     # 0x4efb5
callq 0x18a80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18fe0
movl $0x1, 0x32c(%rbx)
movq 0x372d1(%rip), %rax     # 0x66600
leaq 0x22d08(%rip), %rdi     # 0x5203e
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SP_item_health_large
void SP_item_health_large (edict_t *self)
{
	if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
	{
		G_FreeEdict (self);
		return;
	}

	self->model = "models/items/healing/large/tris.md2";
	self->count = 25;
	SpawnItem (self, FindItem ("Health"));
	gi.soundindex ("items/l_health.wav");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x37b72(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f360
jnp 0x2f373
movq 0x372b1(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x2f3b4
leaq 0x23e58(%rip), %rax     # 0x531d2
movq %rax, 0x120(%rbx)
movl $0x19, 0x290(%rbx)
leaq 0x1fc23(%rip), %rdi     # 0x4efb5
callq 0x18a80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18fe0
movq 0x37257(%rip), %rax     # 0x66600
leaq 0x22cb4(%rip), %rdi     # 0x52064
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SP_item_health_mega
void SP_item_health_mega (edict_t *self)
{
	if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
	{
		G_FreeEdict (self);
		return;
	}

	self->model = "models/items/mega_h/tris.md2";
	self->count = 100;
	SpawnItem (self, FindItem ("Health"));
	gi.soundindex ("items/m_health.wav");
	self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x37af8(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f3da
jnp 0x2f3ed
movq 0x37237(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x2f439
leaq 0x23e02(%rip), %rax     # 0x531f6
movq %rax, 0x120(%rbx)
movl $0x64, 0x290(%rbx)
leaq 0x1fba9(%rip), %rdi     # 0x4efb5
callq 0x18a80
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18fe0
movq 0x371dd(%rip), %rax     # 0x66600
leaq 0x23c35(%rip), %rdi     # 0x5305f
callq *0x48(%rax)
movl $0x3, 0x32c(%rbx)
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x19c50
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: SetItemNames
void SetItemNames (void)
{
	int		i;
	gitem_t	*it;

	for (i=0 ; i<game.num_items ; i++)
	{
		it = &itemlist[i];
		gi.configstring (CS_ITEMS+i, it->pickup_name);
	}

	jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor"));
	combat_armor_index = ITEM_INDEX(FindItem("Combat Armor"));
	body_armor_index   = ITEM_INDEX(FindItem("Body Armor"));
	power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
	power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x379dc(%rip), %rbx     # 0x66e40
leaq 0x50(%rbx), %r14
xorl %r15d, %r15d
movq 0x378ce(%rip), %r12     # 0x66d40
movq 0x37187(%rip), %r13     # 0x66600
movslq 0x61c(%r12), %rax
cmpq %rax, %r15
jge 0x2f4a0
movq (%r14), %rsi
leal 0x420(%r15), %edi
callq *0x30(%r13)
incq %r15
addq $0x88, %r14
jmp 0x2f479
leaq 0x1ff66(%rip), %rdi     # 0x4f40d
callq 0x18a80
subq %rbx, %rax
movl $0x88, %r14d
cqto
idivq %r14
movl %eax, 0x41784(%rip)     # 0x70c44
leaq 0x211c7(%rip), %rdi     # 0x5068e
callq 0x18a80
subq %rbx, %rax
cqto
idivq %r14
movl %eax, 0x4176e(%rip)     # 0x70c48
leaq 0x211ba(%rip), %rdi     # 0x5069b
callq 0x18a80
subq %rbx, %rax
cqto
idivq %r14
movl %eax, 0x41758(%rip)     # 0x70c4c
leaq 0x22d33(%rip), %rdi     # 0x5222e
callq 0x18a80
subq %rbx, %rax
cqto
idivq %r14
movl %eax, 0x41746(%rip)     # 0x70c54
leaq 0x21191(%rip), %rdi     # 0x506a6
callq 0x18a80
subq %rbx, %rax
cqto
idivq %r14
movl %eax, 0x41728(%rip)     # 0x70c50
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: ShutdownGame
void ShutdownGame (void)
{
	gi.dprintf ("==== ShutdownGame ====\n");

	sl_GameEnd( &gi, level );	// StdLog - Mark Davies

	gi.FreeTags (TAG_LEVEL);
	gi.FreeTags (TAG_GAME);

#ifdef _WIN32
	OutputDebugString("ShutdownGame() was called.\n");
	OutputDebugString("Dump objects since startup.\n");
	_CrtMemDumpAllObjectsSince(&startup1);
	OutputDebugString("Memory stats since startup.\n");
	_CrtMemDumpStatistics(&startup1);
	_CrtDumpMemoryLeaks();
#endif

}

// Assembly:
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
movq 0x370bd(%rip), %rbx     # 0x66600
leaq 0x23cce(%rip), %rdi     # 0x53218
xorl %eax, %eax
callq *0x8(%rbx)
movq 0x3784a(%rip), %rsi     # 0x66da0
pushq $0x2b
popq %rcx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
callq 0x19be0
movl $0x2fe, %edi            # imm = 0x2FE
callq *0x118(%rbx)
movl $0x2fd, %edi            # imm = 0x2FD
movq %rbx, %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbx
jmpq *0x118(%rax)
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: GetGameAPI
q_exported game_export_t *GetGameAPI (game_import_t *import)
{
	gi = *import;

	globals.apiversion = GAME_API_VERSION;
	globals.Init = InitGame;
	globals.Shutdown = ShutdownGame;
	globals.SpawnEntities = SpawnEntities;

	globals.WriteGame = WriteGame;
	globals.ReadGame = ReadGame;
	globals.WriteLevel = WriteLevel;
	globals.ReadLevel = ReadLevel;

	globals.ClientThink = ClientThink;
	globals.ClientConnect = ClientConnect;
	globals.ClientUserinfoChanged = ClientUserinfoChanged;
	globals.ClientDisconnect = ClientDisconnect;
	globals.ClientBegin = ClientBegin;
	globals.ClientCommand = ClientCommand;

	globals.RunFrame = G_RunFrame;

	globals.ServerCommand = ServerCommand;

	globals.edict_size = sizeof(edict_t);

	return &globals;
}

// Assembly:
pushq %rax
movq %rdi, %rsi
movq 0x3706d(%rip), %rdi     # 0x66600
movl $0x160, %edx            # imm = 0x160
callq 0x18d60
movq 0x37564(%rip), %rax     # 0x66b08
movl $0x3, (%rax)
movq 0x370d7(%rip), %rcx     # 0x66688
movq %rcx, 0x8(%rax)
movq 0x3780c(%rip), %rcx     # 0x66dc8
movq %rcx, 0x10(%rax)
movq 0x36ee9(%rip), %rcx     # 0x664b0
movq %rcx, 0x18(%rax)
movq 0x3757e(%rip), %rcx     # 0x66b50
movq %rcx, 0x20(%rax)
movq 0x36fb3(%rip), %rcx     # 0x66590
movq %rcx, 0x28(%rax)
movq 0x37140(%rip), %rcx     # 0x66728
movq %rcx, 0x30(%rax)
movq 0x378c5(%rip), %rcx     # 0x66eb8
movq %rcx, 0x38(%rax)
movq 0x371d2(%rip), %rcx     # 0x667d0
movq %rcx, 0x68(%rax)
movq 0x3778f(%rip), %rcx     # 0x66d98
movq %rcx, 0x40(%rax)
movq 0x3715c(%rip), %rcx     # 0x66770
movq %rcx, 0x50(%rax)
movq 0x36e79(%rip), %rcx     # 0x66498
movq %rcx, 0x58(%rax)
movq 0x373a6(%rip), %rcx     # 0x669d0
movq %rcx, 0x48(%rax)
movq 0x372f3(%rip), %rcx     # 0x66928
movq %rcx, 0x60(%rax)
movq 0x37078(%rip), %rcx     # 0x666b8
movq %rcx, 0x70(%rax)
movq 0x37445(%rip), %rcx     # 0x66a90
movq %rcx, 0x78(%rax)
movl $0x4a8, 0x88(%rax)      # imm = 0x4A8
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: ClientEndServerFrames
void ClientEndServerFrames (void)
{
	int		i;
	edict_t	*ent;

	// calc the player views now that all pushing
	// and damage has been added
	for (i=0 ; i<maxclients->value ; i++)
	{
		ent = g_edicts + 1 + i;
		if (!ent->inuse || !ent->client)
			continue;
		ClientEndServerFrame (ent);
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x36b98(%rip), %rbx     # 0x66530
movq (%rbx), %rax
movl $0x4a8, %r14d           # imm = 0x4A8
xorl %ebp, %ebp
movq 0x36bae(%rip), %r15     # 0x66558
cvtsi2ss %ebp, %xmm0
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2f9e1
movq (%r15), %rdi
cmpl $0x0, 0x60(%rdi,%r14)
je 0x2f9d6
cmpq $0x0, 0x58(%rdi,%r14)
je 0x2f9d6
addq %r14, %rdi
callq 0x18ba0
movq (%rbx), %rax
addq $0x4a8, %r14            # imm = 0x4A8
incl %ebp
jmp 0x2f9aa
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: CreateTargetChangeLevel
edict_t *CreateTargetChangeLevel(char *map)
{
	edict_t *ent;

	ent = G_Spawn ();
	ent->classname = "target_changelevel";
	Com_sprintf(level.nextmap, sizeof(level.nextmap), "%s", map);
	ent->map = level.nextmap;
	return ent;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x198d0
movq %rax, %r14
leaq 0x1fb7f(%rip), %rax     # 0x4f582
movq %rax, 0x138(%r14)
movl $0x88, %r15d
addq 0x37389(%rip), %r15     # 0x66da0
leaq 0x1ef8f(%rip), %rdx     # 0x4e9ad
pushq $0x40
popq %rsi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x18f30
movq %r15, 0x270(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: Randomize_Map_List
void Randomize_Map_List(int Num_Of_Maps)
{
	int i;
	int Rand_Num;

	if (Num_Of_Maps > MAX_MAPS)
		Num_Of_Maps = MAX_MAPS;

	for (i = 0; i < MAX_MAPS; i++)
		Maps_Picked[i] = 0;

	for (i = 1; i < Num_Of_Maps; i++)
	{
		Rand_Num = rand() % (Num_Of_Maps - 2);
		while (Maps_Picked[Rand_Num])
		{
			Rand_Num++;
			if (Rand_Num == Num_Of_Maps)
				Rand_Num = 0;
		}

		Maps_Picked[Rand_Num] = i;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %eax, %eax
movq 0x373e9(%rip), %rbx     # 0x66e38
cmpq $0x12c, %rax            # imm = 0x12C
je 0x2fa61
andw $0x0, (%rbx,%rax,2)
incq %rax
jmp 0x2fa4f
movl $0x12c, %r14d           # imm = 0x12C
cmpl %r14d, %edi
cmovll %edi, %r14d
leal -0x2(%r14), %ebp
pushq $0x1
popq %r15
xorl %r12d, %r12d
cmpl %r14d, %r15d
jge 0x2faa5
callq 0x19bf0
cltd
idivl %ebp
movslq %edx, %rax
cmpw $0x0, (%rbx,%rax,2)
je 0x2fa9b
incl %edx
cmpl %r14d, %edx
cmovel %r12d, %edx
jmp 0x2fa86
movw %r15w, (%rbx,%rax,2)
incl %r15d
jmp 0x2fa79
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: getRandomMapByPlayerCount
MapInfo *getRandomMapByPlayerCount(int count) {
	MapInfo *criteriaList = NULL;
	MapInfo *clPtr = NULL;
	int mapCounter = 0;
	int randNum;

	for(int i = 0; maplist[i].mapname; i++) {
		if (maplist[i].minplayers > count || maplist[i].maxplayers < count) {
			gi.dprintf("Excluding %s due to min/max playercount\n", maplist[i].mapname);
			continue;
		}
		if (!criteriaList) {
			criteriaList = clPtr = &maplist[i];			
		} else {
			clPtr->next = &maplist[i];
			clPtr = clPtr->next;
			clPtr->next = NULL;
		}
		mapCounter++;
	}

	//QW// Added. This should never happen.
	if (!clPtr || !criteriaList) {
		gi.error("%s line %i: NULL pointer error.", __func__, __LINE__);
		abort(); // Shut up compiler.
	}

	clPtr->next = criteriaList;
	srand(time(0));
	randNum = rand() % (mapCounter - 2);
	for(int i = 0; i < randNum; i++) 
		clPtr = clPtr->next;	
	return clPtr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
movq 0x36d06(%rip), %r13     # 0x667c8
leaq 0x23767(%rip), %r14     # 0x53230
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%r13), %rsi
testq %rsi, %rsi
je 0x2fb1a
cmpl %ebp, 0x8(%r13)
jg 0x2fae6
cmpl %ebp, 0xc(%r13)
jge 0x2faf7
movq %r14, %rdi
xorl %eax, %eax
movq 0x36b0e(%rip), %rcx     # 0x66600
callq *0x8(%rcx)
jmp 0x2fb14
movq %r13, %rax
testq %r12, %r12
je 0x2fb0b
movq %r13, 0x10(%rbx)
andq $0x0, 0x10(%r13)
movq %r12, %rax
incl %r15d
movq %r13, %rbx
movq %rax, %r12
addq $0x18, %r13
jmp 0x2fad1
testq %rbx, %rbx
je 0x2fb6a
testq %r12, %r12
je 0x2fb6a
movq %r12, 0x10(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x18f10
movl %eax, %edi
callq 0x18a90
callq 0x19bf0
addl $-0x2, %r15d
cltd
idivl %r15d
testl %edx, %edx
cmovgl %edx, %r14d
subl $0x1, %r14d
jb 0x2fb58
movq 0x10(%rbx), %rbx
jmp 0x2fb4c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x236e8(%rip), %rdi     # 0x53259
leaq 0x23701(%rip), %rsi     # 0x53279
movl $0x138, %edx            # imm = 0x138
xorl %eax, %eax
movq 0x36a7a(%rip), %rcx     # 0x66600
callq *0x38(%rcx)
callq 0x181b0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: playerCount
int playerCount() {
        edict_t * player = NULL;
        unsigned int num_players = 0;

        player = ctf_findplayer(NULL, NULL, CTF_TEAM_IGNORETEAM);
        while (player)
        {
                num_players++;
                player = ctf_findplayer(player, NULL, CTF_TEAM_IGNORETEAM);
        }
        return (num_players);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $-0x4
popq %rbp
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0x192e0
testq %rax, %rax
je 0x2fbad
incl %ebx
movq %rax, %rdi
jmp 0x2fb98
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: Check_Made_Table
void Check_Made_Table(edict_t *cl_ent)
{
long score;
int index = 0;
int i;

   	score = stats_get(cl_ent, STATS_SCORE);

	if(score <= Highscore_Table[MAX_HIGHSCORE_ENTRIES - 1].Score)
		return;


	for(i = 0; i < MAX_HIGHSCORE_ENTRIES; i++)
	{
		if(score > Highscore_Table[i].Score)
		{
			index = i;
			break;
		}
	}

	for(i = MAX_HIGHSCORE_ENTRIES - 1; i > index; i--)
	{
		Highscore_Table[i].Score = Highscore_Table[i - 1].Score;
		strcpy(Highscore_Table[i].Player, Highscore_Table[i-1].Player);
	}


	Highscore_Table[index].Score = score;
	strcpy(Highscore_Table[i].Player, cl_ent->client->pers.netname);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x3
popq %rsi
callq 0x18030
movq 0x36e99(%rip), %r12     # 0x66aa8
cmpq 0x110(%r12), %rax
jle 0x2fc37
movq %rax, %r14
leaq 0x20(%r12), %rcx
xorl %eax, %eax
cmpq $0x7, %rax
je 0x2fc46
cmpq (%rcx), %r14
jg 0x2fc48
incq %rax
addq $0x28, %rcx
jmp 0x2fc23
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movl $0xc8, %r15d
addq 0x36e53(%rip), %r15     # 0x66aa8
movl %eax, %r13d
pushq $0x6
popq %rbp
cmpq %r13, %rbp
jbe 0x2fc7d
decq %rbp
movq 0x20(%r15), %rax
leaq 0x28(%r15), %rdi
movq %rax, 0x48(%r15)
movq %r15, %rsi
callq 0x182c0
addq $-0x28, %r15
jmp 0x2fc5b
imulq $0x28, %r13, %rax
movq %r14, 0x20(%r12,%rax)
addq $0x28, %r15
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x182c0