LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: func_train_find
void func_train_find (edict_t *self)
{
	edict_t *ent;

	if (!self->target)
	{
		gi.dprintf ("train_find: no target\n");
		return;
	}
	ent = G_PickTarget (self->target);
	if (!ent)
	{
		gi.dprintf ("train_find: target %s not found\n", self->target);
		return;
	}
	self->target = ent->target;

	VectorSubtract (ent->s.origin, self->mins, self->s.origin);
	gi.linkentity (self);

	// if not triggered, start immediately
	if (!self->targetname)
		self->spawnflags |= TRAIN_START_ON;

	if (self->spawnflags & TRAIN_START_ON)
	{
		self->nextthink = level.time + FRAMETIME;
		self->think = train_next;
		self->activator = self;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x150(%rdi), %rdi
testq %rdi, %rdi
je 0x2f15b
callq 0x18350
testq %rax, %rax
je 0x2f172
movq 0x150(%rax), %rcx
movq %rcx, 0x150(%rbx)
movss 0x4(%rax), %xmm0
subss 0xcc(%rbx), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0x8(%rax), %xmm0
subss 0xd0(%rbx), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0xc(%rax), %xmm0
subss 0xd4(%rbx), %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x3a4fb(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x90(%rax)
cmpq $0x0, 0x158(%rbx)
jne 0x2f11f
orb $0x1, 0x140(%rbx)
testb $0x1, 0x140(%rbx)
je 0x2f159
movq 0x3ac71(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x25154(%rip), %xmm0    # 0x54290
movss %xmm0, 0x200(%rbx)
movq 0x3a79d(%rip), %rax     # 0x698e8
movq %rax, 0x210(%rbx)
movq %rbx, 0x2b0(%rbx)
popq %rbx
retq
movq 0x3a49e(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
leaq 0x27c0d(%rip), %rdi     # 0x56d7a
xorl %eax, %eax
popq %rbx
jmpq *%rcx
movq 0x3a487(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
movq 0x150(%rbx), %rsi
leaq 0x27c06(%rip), %rdi     # 0x56d91
xorl %eax, %eax
popq %rbx
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: SP_func_train
void SP_func_train (edict_t *self)
{
	self->movetype = MOVETYPE_PUSH;

	VectorClear (self->s.angles);
	self->blocked = train_blocked;
	if (self->spawnflags & TRAIN_BLOCK_STOPS)
		self->dmg = 0;
	else
	{
		if (!self->dmg)
			self->dmg = 100;
	}
	self->solid = SOLID_BSP;
	gi.setmodel (self, self->model);

	if (st.noise)
		self->moveinfo.sound_middle = gi.soundindex  (st.noise);

	if (!self->speed)
		self->speed = 100;

	self->moveinfo.speed = self->speed;
	self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed;

	self->use = train_use;

	gi.linkentity (self);

	if (self->target)
	{
		// start trains on the second frame, to make sure their targets have had
		// a chance to spawn
		self->nextthink = level.time + FRAMETIME;
		self->think = func_train_find;
	}
	else
	{
		gi.dprintf ("func_train without a target at %s\n", vtos(self->absmin));
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, 0x118(%rdi)
movl $0x0, 0x18(%rdi)
movq $0x0, 0x10(%rdi)
movq 0x3a9c6(%rip), %rax     # 0x69bc8
movq %rax, 0x218(%rdi)
xorl %eax, %eax
testb $0x4, 0x140(%rdi)
jne 0x2f222
cmpl $0x0, 0x280(%rbx)
jne 0x2f228
movl $0x64, %eax
movl %eax, 0x280(%rbx)
movl $0x3, 0x108(%rbx)
movq 0x3a3c7(%rip), %r14     # 0x69600
movq 0x120(%rbx), %rsi
movq %rbx, %rdi
callq *0x58(%r14)
movq 0x3a41a(%rip), %rax     # 0x69668
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0x2f261
callq *0x48(%r14)
movl %eax, 0x36c(%rbx)
movss 0x190(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f27d
jp 0x2f27d
movl $0x42c80000, 0x190(%rbx) # imm = 0x42C80000
movss 0x190(%rbx), %xmm0
movss %xmm0, 0x378(%rbx)
movss %xmm0, 0x37c(%rbx)
movss %xmm0, 0x374(%rbx)
movq 0x3a194(%rip), %rax     # 0x69438
movq %rax, 0x228(%rbx)
movq %rbx, %rdi
callq *0x90(%r14)
cmpq $0x0, 0x150(%rbx)
je 0x2f2f1
movq 0x3aada(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x24fbd(%rip), %xmm0    # 0x54290
movss %xmm0, 0x200(%rbx)
movq 0x3a85e(%rip), %rax     # 0x69b40
movq %rax, 0x210(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%r14), %r14
addq $0xe4, %rbx
movq %rbx, %rdi
callq 0x190a0
leaq 0x27aa7(%rip), %rdi     # 0x56db2
movq %rax, %rsi
xorl %eax, %eax
movq %r14, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: trigger_elevator_use
void trigger_elevator_use (edict_t *self, edict_t *other, edict_t *activator)
{
	edict_t *target;

	if (self->movetarget->nextthink)
	{
//		gi.dprintf("elevator busy\n");
		return;
	}

	if (!other->pathtarget)
	{
		gi.dprintf("elevator used with no pathtarget\n");
		return;
	}

	target = G_PickTarget (other->pathtarget);
	if (!target)
	{
		gi.dprintf("elevator used with bad pathtarget: %s\n", other->pathtarget);
		return;
	}

	self->movetarget->target_ent = target;
	train_resume (self->movetarget);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x1f0(%rdi), %rax
movss 0x200(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f339
jnp 0x2f341
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
movq %rdi, %r14
movq 0x170(%rsi), %rdi
testq %rdi, %rdi
je 0x2f377
callq 0x18350
testq %rax, %rax
je 0x2f394
movq 0x1f0(%r14), %rdi
movq %rax, 0x188(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x198b0
movq 0x3a282(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
leaq 0x27a4c(%rip), %rdi     # 0x56dd5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
movq 0x3a265(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
movq 0x170(%rbx), %rsi
leaq 0x27a4a(%rip), %rdi     # 0x56df7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: trigger_elevator_init
void trigger_elevator_init (edict_t *self)
{
	if (!self->target)
	{
		gi.dprintf("trigger_elevator has no target\n");
		return;
	}
	self->movetarget = G_PickTarget (self->target);
	if (!self->movetarget)
	{
		gi.dprintf("trigger_elevator unable to find target %s\n", self->target);
		return;
	}
	if (strcmp(self->movetarget->classname, "func_train") != 0)
	{
		gi.dprintf("trigger_elevator target %s is not a train\n", self->target);
		return;
	}

	self->use = trigger_elevator_use;
	self->svflags = SVF_NOCLIENT;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x150(%rdi), %rdi
testq %rdi, %rdi
je 0x2f40b
callq 0x18350
movq %rax, 0x1f0(%rbx)
testq %rax, %rax
je 0x2f422
movq 0x138(%rax), %rdi
leaq 0x27a82(%rip), %rsi     # 0x56e69
callq 0x18b20
testl %eax, %eax
je 0x2f440
movq 0x3a209(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
movq 0x150(%rbx), %rsi
leaq 0x27a6b(%rip), %rdi     # 0x56e74
jmp 0x2f43b
movq 0x3a1ee(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
leaq 0x27a01(%rip), %rdi     # 0x56e1e
xorl %eax, %eax
popq %rbx
jmpq *%rcx
movq 0x3a1d7(%rip), %rax     # 0x69600
movq 0x8(%rax), %rcx
movq 0x150(%rbx), %rsi
leaq 0x27a03(%rip), %rdi     # 0x56e3e
xorl %eax, %eax
popq %rbx
jmpq *%rcx
movq 0x3a8b1(%rip), %rax     # 0x69cf8
movq %rax, 0x228(%rbx)
movl $0x1, 0xc8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: func_timer_use
void func_timer_use (edict_t *self, edict_t *other, edict_t *activator)
{
	self->activator = activator;

	// if on, turn it off
	if (self->nextthink)
	{
		self->nextthink = 0;
		return;
	}

	// turn it on
	if (self->delay)
		self->nextthink = level.time + self->delay;
	else
		func_timer_think (self);
}

// Assembly:
movq %rdx, 0x2b0(%rdi)
movss 0x200(%rdi), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f520
jnp 0x2f52b
movl $0x0, 0x200(%rdi)
retq
movss 0x2fc(%rdi), %xmm0
ucomiss %xmm1, %xmm0
jne 0x2f53a
jnp 0x2f54f
movq 0x3a85f(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rdi)
retq
jmp 0x19ab8
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: SP_func_timer
void SP_func_timer (edict_t *self)
{
	if (!self->wait)
		self->wait = 1.0;

	self->use = func_timer_use;
	self->think = func_timer_think;

	if (self->random >= self->wait)
	{
		self->random = self->wait - FRAMETIME;
		gi.dprintf("func_timer at %s has random >= wait\n", vtos(self->s.origin));
	}

	if (self->spawnflags & 1)
	{
		self->nextthink = level.time + 1.0 + st.pausetime + self->delay + self->wait + crandom() * self->random;
		self->activator = self;
	}

	self->svflags = SVF_NOCLIENT;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x2f8(%rdi), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f577
jp 0x2f577
movl $0x3f800000, 0x2f8(%rbx) # imm = 0x3F800000
movq 0x3a062(%rip), %rax     # 0x695e0
movq %rax, 0x228(%rbx)
movq 0x3a28c(%rip), %rax     # 0x69818
movq %rax, 0x210(%rbx)
movss 0x2f8(%rbx), %xmm0
movss 0x300(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jb 0x2f5db
addss 0x25650(%rip), %xmm0    # 0x54c00
movss %xmm0, 0x300(%rbx)
movq 0x3a041(%rip), %rax     # 0x69600
movq 0x8(%rax), %r14
leaq 0x4(%rbx), %rdi
callq 0x190a0
leaq 0x278cc(%rip), %rdi     # 0x56e9f
movq %rax, %rsi
xorl %eax, %eax
callq *%r14
testb $0x1, 0x140(%rbx)
je 0x2f688
movq 0x3a7b1(%rip), %rax     # 0x69da0
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
addsd 0x27609(%rip), %xmm0    # 0x56c08
movq 0x3a062(%rip), %rax     # 0x69668
xorps %xmm1, %xmm1
cvtss2sd 0x38(%rax), %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x2fc(%rbx), %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x2f8(%rbx), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
callq 0x19a20
andl $0x7fff, %eax           # imm = 0x7FFF
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x24c3a(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x27556(%rip), %xmm0    # 0x56bb0
addsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x300(%rbx), %xmm1
mulsd %xmm0, %xmm1
addsd (%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x200(%rbx)
movq %rbx, 0x2b0(%rbx)
movl $0x1, 0xc8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: SP_func_conveyor
void SP_func_conveyor (edict_t *self)
{
	if (!self->speed)
		self->speed = 100;

	if (!(self->spawnflags & 1))
	{
		self->count = self->speed;
		self->speed = 0;
	}

	self->use = func_conveyor_use;

	gi.setmodel (self, self->model);
	self->solid = SOLID_BSP;
	gi.linkentity (self);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x190(%rdi), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2f6fe
jp 0x2f6fe
movl $0x42c80000, 0x190(%rbx) # imm = 0x42C80000
testb $0x1, 0x140(%rbx)
jne 0x2f71f
cvttss2si 0x190(%rbx), %eax
movl %eax, 0x290(%rbx)
movl $0x0, 0x190(%rbx)
movq 0x3a3c2(%rip), %rax     # 0x69ae8
movq %rax, 0x228(%rbx)
movq 0x39ecc(%rip), %r14     # 0x69600
movq 0x120(%rbx), %rsi
movq %rbx, %rdi
callq *0x58(%r14)
movl $0x3, 0x108(%rbx)
movq %rbx, %rdi
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x90(%rax)
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: door_secret_done
void door_secret_done (edict_t *self)
{
	if (!(self->targetname) || (self->spawnflags & SECRET_ALWAYS_SHOOT))
	{
		self->health = 0;
		self->takedamage = DAMAGE_YES;
	}
	door_use_areaportals (self, false);
}

// Assembly:
cmpq $0x0, 0x158(%rdi)
je 0x2f876
testb $0x1, 0x140(%rdi)
je 0x2f88a
movl $0x0, 0x254(%rdi)
movl $0x1, 0x27c(%rdi)
xorl %esi, %esi
jmp 0x18230
// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: FindItemByClassname
gitem_t	*FindItemByClassname (char *classname)
{
	int		i;
	gitem_t	*it;

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

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x3a103(%rip), %r15     # 0x69d40
cmpl $0x0, 0x61c(%r15)
jle 0x2fc79
movq %rdi, %r14
movq 0x3a1ef(%rip), %rbx     # 0x69e40
xorl %ebp, %ebp
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2fc67
movq %r14, %rsi
callq 0x18690
testl %eax, %eax
je 0x2fc7b
incl %ebp
addq $0x88, %rbx
cmpl 0x61c(%r15), %ebp
jl 0x2fc53
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3a0a9(%rip), %r15     # 0x69d40
cmpl $0x0, 0x61c(%r15)
jle 0x2fcd4
movq %rdi, %r14
movq 0x3a195(%rip), %rbx     # 0x69e40
xorl %ebp, %ebp
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x2fcc2
movq %r14, %rsi
callq 0x18690
testl %eax, %eax
je 0x2fcd6
incl %ebp
addq $0x88, %rbx
cmpl 0x61c(%r15), %ebp
jl 0x2fcad
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2fd76
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x168(%rdi)
je 0x2fd48
movq 0x2d0(%rbx), %r14
testq %r14, %r14
je 0x2fd43
xorl %ebx, %ebx
movq %r14, %rax
incl %ebx
movq 0x298(%rax), %rax
testq %rax, %rax
jne 0x2fd0f
testl %ebx, %ebx
je 0x2fd2c
callq 0x19a20
xorl %edx, %edx
divl %ebx
jmp 0x2fd2e
xorl %edx, %edx
movq %r14, %rbx
testl %edx, %edx
je 0x2fd43
movq %r14, %rbx
movq 0x298(%rbx), %rbx
decl %edx
jne 0x2fd38
testq %r14, %r14
je 0x2fd72
testq %rbx, %rbx
je 0x2fd72
andb $-0x2, 0xc8(%rbx)
movl $0x1, %ebp
movl %ebp, 0x108(%rbx)
movq 0x3989a(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x90(%rax)
movl %ebp, 0x50(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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)
movl $0x0, 0x108(%rdi)
movq 0x3a00a(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rdi)
movq 0x39fa6(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rdi)
movq 0x39848(%rip), %rax     # 0x69600
jmpq *0x90(%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0x330(%rdi), %rax
movq %rax, %rsi
subq 0x3a067(%rip), %rsi     # 0x69e40
movq 0x58(%rbx), %rcx
sarq $0x3, %rsi
movabsq $-0xf0f0f0f0f0f0f0f, %rdx # imm = 0xF0F0F0F0F0F0F0F1
imulq %rsi, %rdx
movl 0x318(%rcx,%rdx,4), %esi
movq 0x3993b(%rip), %rdi     # 0x69738
movq (%rdi), %rdi
movss 0x20(%rdi), %xmm0
xorl %ebp, %ebp
ucomiss 0x2411a(%rip), %xmm0    # 0x53f28
jne 0x2fe1b
jp 0x2fe1b
cmpl $0x1, %esi
jg 0x2ff59
ucomiss 0x24636(%rip), %xmm0    # 0x54458
jb 0x2fe2c
testl %esi, %esi
jg 0x2ff59
movq 0x3a12d(%rip), %rdi     # 0x69f60
movq (%rdi), %rdi
movss 0x20(%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x2fe45
jnp 0x2fe53
testb $0x8, 0x68(%rax)
je 0x2fe53
testl %esi, %esi
jg 0x2ff59
incl %esi
movl %esi, 0x318(%rcx,%rdx,4)
movq 0x3a05d(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm1
movl $0x1, %ebp
ucomiss %xmm0, %xmm1
jne 0x2fe7b
jnp 0x2ff59
testb $0x1, 0x142(%r14)
jne 0x2fede
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%r14) # imm = 0x80000000
orb $0x1, 0xc8(%r14)
movl $0x0, 0x108(%r14)
movq 0x39eee(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%r14)
movq 0x39e89(%rip), %rax     # 0x69d50
movq %rax, 0x210(%r14)
movq 0x3972b(%rip), %rax     # 0x69600
movq %r14, %rdi
callq *0x90(%rax)
movq 0x39733(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x10, %al
jne 0x2ff0f
movq 0x330(%r14), %rax
movq 0x10(%rax), %rax
cmpq 0x39a75(%rip), %rax     # 0x69978
jne 0x2ff59
testb $0x2, 0x142(%r14)
je 0x2ff59
movq 0x330(%r14), %rsi
movq 0x10(%rsi), %rax
cmpq 0x39a57(%rip), %rax     # 0x69978
jne 0x2ff54
testb $0x2, 0x142(%r14)
je 0x2ff54
movss 0x200(%r14), %xmm0
movq 0x39e63(%rip), %rcx     # 0x69da0
subss 0x4(%rcx), %xmm0
divss 0x24346(%rip), %xmm0    # 0x54290
cvttss2si %xmm0, %ecx
movl %ecx, 0x43bec(%rip)     # 0x73b40
movq %rbx, %rdi
callq *%rax
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %rbx
movq 0x58(%rdi), %rax
subq 0x39ece(%rip), %rsi     # 0x69e40
sarq $0x3, %rsi
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rsi, %rcx
decl 0x318(%rax,%rcx)
callq 0x18280
movl 0x43baa(%rip), %eax     # 0x73b40
testl %eax, %eax
je 0x2ffa6
movl $0x0, 0x43b9c(%rip)     # 0x73b40
jmp 0x2ffab
movl $0x12c, %eax            # imm = 0x12C
movq 0x58(%rbx), %rcx
movq 0x39dea(%rip), %rdx     # 0x69da0
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 0x39611(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x26f08(%rip), %rdi     # 0x56f02
callq *0x48(%rax)
movss 0x23f23(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/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 0x39c60(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30278
jp 0x30278
incl 0x258(%rsi)
movl 0x258(%rsi), %eax
cmpl %eax, 0x254(%rsi)
jge 0x3028c
movl %eax, 0x254(%rsi)
ucomiss %xmm1, %xmm0
jne 0x30293
jnp 0x302fe
movl $0x10000, %eax          # imm = 0x10000
andl 0x140(%rdi), %eax
jne 0x302fe
pushq %rax
movq 0x330(%rdi), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%rdi) # imm = 0x80000000
orb $0x1, 0xc8(%rdi)
movl $0x0, 0x108(%rdi)
movq 0x39ace(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rdi)
movq 0x39a6a(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rdi)
movq 0x3930c(%rip), %rax     # 0x69600
callq *0x90(%rax)
addq $0x8, %rsp
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3038b
movq 0x39ba5(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3032d
jnp 0x3038b
pushq %rax
movq 0x330(%rdi), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%rdi) # imm = 0x80000000
orb $0x1, 0xc8(%rdi)
movl $0x0, 0x108(%rdi)
movq 0x39a41(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rdi)
movq 0x399dd(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rdi)
movq 0x3927f(%rip), %rax     # 0x69600
callq *0x90(%rax)
addq $0x8, %rsp
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x303b5
movl $0xfa, 0x718(%rax)
cmpl $0x95, 0x71c(%rax)
jg 0x303cb
movl $0x96, 0x71c(%rax)
cmpl $0xf9, 0x728(%rax)
jg 0x303e1
movl $0xfa, 0x728(%rax)
cmpl $0x4a, 0x72c(%rax)
jg 0x303f4
movl $0x4b, 0x72c(%rax)
leaq 0x26ae1(%rip), %rdi     # 0x56edc
callq 0x189e0
testq %rax, %rax
je 0x30443
movq %rax, %rcx
subq 0x39a31(%rip), %rcx     # 0x69e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x718(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x26a9a(%rip), %rdi     # 0x56ee4
callq 0x189e0
testq %rax, %rax
je 0x30492
movq %rax, %rcx
subq 0x399e2(%rip), %rcx     # 0x69e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x71c(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
testb $0x1, 0x142(%rbx)
jne 0x30510
movq 0x39a1e(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x304b4
jnp 0x30510
movq 0x330(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%rbx) # imm = 0x80000000
orb $0x1, 0xc8(%rbx)
movl $0x0, 0x108(%rbx)
movq 0x398bb(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rbx)
movq 0x39857(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rbx)
movq 0x390f9(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x90(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %rbx
movq 0x58(%rdi), %rax
subq 0x39543(%rip), %rsi     # 0x69e40
sarq $0x3, %rsi
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rsi, %rcx
decl 0x318(%rax,%rcx)
callq 0x18280
movq 0x58(%rbx), %rax
movss 0xf08(%rax), %xmm0
movq 0x39472(%rip), %rcx     # 0x69da0
movl (%rcx), %ecx
cvtsi2ss %ecx, %xmm1
addl $0x12c, %ecx            # imm = 0x12C
cvtsi2ss %ecx, %xmm2
cmpltss %xmm0, %xmm1
addss 0x2657d(%rip), %xmm0    # 0x56ec8
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
movss %xmm1, 0xf08(%rax)
movq 0x38c9d(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x265a5(%rip), %rdi     # 0x56f13
callq *0x48(%rax)
movss 0x235af(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/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 0x39580(%rip), %rax     # 0x69f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x309f2
jnp 0x30a44
movq 0x138(%rbx), %rdi
leaq 0x26525(%rip), %rsi     # 0x56f25
callq 0x18b20
movq 0x58(%r14), %rcx
testl %eax, %eax
je 0x30a76
movq 0x330(%rbx), %rdx
subq 0x39425(%rip), %rdx     # 0x69e40
sarq $0x3, %rdx
movabsq $-0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F1
imulq %rdx, %rax
cmpl $0x0, 0x318(%rcx,%rax,4)
jne 0x30a84
movl $0x1, 0x318(%rcx,%rax,4)
jmp 0x30a6f
movq 0x330(%rbx), %rax
subq 0x393ee(%rip), %rax     # 0x69e40
movq 0x58(%r14), %rcx
sarq $0x3, %rax
movabsq $-0x3c3c3c3c3c3c3c3c, %rdx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rax, %rdx
incl 0x318(%rcx,%rdx)
movl $0x1, %eax
jmp 0x30a86
movb 0x740(%rcx), %al
testb %al, 0x141(%rbx)
je 0x30a8e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x330(%rbx), %rax
subq 0x393a4(%rip), %rax     # 0x69e40
sarq $0x3, %rax
movabsq $-0x3c3c3c3c3c3c3c3c, %rdx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rax, %rdx
incl 0x318(%rcx,%rdx)
movzbl 0x141(%rbx), %eax
orl %eax, 0x740(%rcx)
jmp 0x30a6f
// File: /workspace/github_c_makefile_star2_O1/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 0x30b4f
movq 0x38adc(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movl $0x3e8, %edx            # imm = 0x3E8
btl $0xd, %eax
jb 0x30b5c
movl 0x290(%rbx), %edx
testl %edx, %edx
jne 0x30b5c
movl 0x5c(%rsi), %edx
movq 0x58(%r14), %rax
movq %rsi, %rcx
subq 0x392d6(%rip), %rcx     # 0x69e40
sarq $0x3, %rcx
movabsq $-0x3c3c3c3c3c3c3c3c, %rdi # imm = 0xC3C3C3C3C3C3C3C4
imulq %rcx, %rdi
movl 0x318(%rax,%rdi), %r15d
movq %r14, %rdi
callq 0x19230
testl %eax, %eax
je 0x30c6a
testb $0x1, %bpl
je 0x30bef
testl %r15d, %r15d
jne 0x30bef
movq 0x58(%r14), %rax
movq 0x730(%rax), %r15
cmpq 0x330(%rbx), %r15
je 0x30bef
movq 0x39306(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30bcc
jnp 0x30bdd
leaq 0x2a1d3(%rip), %rdi     # 0x5ada6
callq 0x189e0
cmpq %rax, %r15
jne 0x30bef
movq 0x330(%rbx), %rax
movq 0x58(%r14), %rcx
movq %rax, 0xe50(%rcx)
movl $0x1, %ebp
testb $0x3, 0x142(%rbx)
jne 0x30c6c
movq 0x392bc(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30c16
jnp 0x30c6c
orb $-0x80, 0x11f(%rbx)
orb $0x1, 0xc8(%rbx)
movl $0x0, 0x108(%rbx)
movq 0x3916b(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x23652(%rip), %xmm0    # 0x54294
movss %xmm0, 0x200(%rbx)
movq 0x390ff(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rbx)
movq 0x389a1(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x90(%rax)
jmp 0x30c6c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rax
subq 0x391b0(%rip), %rax     # 0x69e40
shrq $0x3, %rax
imull $0xf0f0f0f1, %eax, %ebp # imm = 0xF0F0F0F1
callq 0x18460
movq 0x58(%rbx), %rcx
movslq %ebp, %rdx
movl 0x318(%rcx,%rdx,4), %esi
movl 0x5c(%r14), %edi
cmpl %edi, %esi
cmovll %esi, %edi
movq %rax, %r15
movl %edi, 0x290(%rax)
movq 0x730(%rcx), %rax
testq %rax, %rax
je 0x30ce8
cmpl $0x3, 0x78(%rax)
jne 0x30ce8
cmpl $0x3, 0x78(%r14)
jne 0x30ce8
movl 0x318(%rcx,%rdx,4), %eax
cmpl 0x290(%r15), %eax
jle 0x30d08
movl 0x290(%r15), %eax
subl %eax, 0x318(%rcx,%rdx,4)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x18280
movq 0x388f1(%rip), %rcx     # 0x69600
leaq 0x2621e(%rip), %rdx     # 0x56f34
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq *0x10(%rcx)
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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 0x30dbb
movq 0x58(%rax), %rcx
testq %rcx, %rcx
je 0x30d88
movq 0xf68(%rcx), %rcx
testq %rcx, %rcx
je 0x30d88
cmpl $0x8, 0x478(%rcx)
jne 0x30d88
movl 0x254(%rax), %ecx
movl 0x258(%rax), %edx
addl $0x19, %edx
cmpl %edx, %ecx
jle 0x30dbb
movq 0x39027(%rip), %rdx     # 0x69da0
movss 0x4(%rdx), %xmm0
addss 0x236d2(%rip), %xmm0    # 0x54458
jmp 0x30daa
movl 0x254(%rax), %ecx
cmpl 0x258(%rax), %ecx
jle 0x30dbb
movq 0x39003(%rip), %rdx     # 0x69da0
movss 0x4(%rdx), %xmm0
addss 0x2317e(%rip), %xmm0    # 0x53f28
movss %xmm0, 0x200(%rdi)
decl %ecx
movl %ecx, 0x254(%rax)
retq
testb $0x1, 0x142(%rdi)
jne 0x19a60
movq 0x390f1(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30de1
jnp 0x30e30
orb $-0x80, 0x11f(%rdi)
orb $0x1, 0xc8(%rdi)
movl $0x0, 0x108(%rdi)
movq 0x38fa0(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x23e03(%rip), %xmm0    # 0x54c10
movss %xmm0, 0x200(%rdi)
movq 0x38f34(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rdi)
movq 0x387d6(%rip), %rax     # 0x69600
jmpq *0x90(%rax)
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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
testb $0x1, %al
jne 0x30e54
movl 0x254(%rsi), %ecx
xorl %ebx, %ebx
cmpl 0x258(%rsi), %ecx
jge 0x30f50
movl 0x254(%rsi), %ecx
addl 0x290(%rdi), %ecx
movl %ecx, 0x254(%rsi)
testb $0x1, %al
jne 0x30e7a
movl 0x258(%rsi), %edx
cmpl %edx, %ecx
jle 0x30e7a
movl %edx, 0x254(%rsi)
testb $0x2, %al
jne 0x30f02
movl $0x1, %ebx
testb $0x1, 0x142(%rdi)
jne 0x30f50
movq 0x39025(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30eb1
jnp 0x30f50
orb $-0x80, 0x11f(%rdi)
orb $0x1, 0xc8(%rdi)
movl $0x0, 0x108(%rdi)
movq 0x38ed0(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x233b7(%rip), %xmm0    # 0x54294
movss %xmm0, 0x200(%rdi)
movq 0x38e64(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rdi)
movq 0x38706(%rip), %rax     # 0x69600
callq *0x90(%rax)
jmp 0x30f50
movq 0x389f7(%rip), %rax     # 0x69900
movq %rax, 0x210(%rdi)
movq 0x38e89(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x22fe0(%rip), %xmm0    # 0x53f04
movss %xmm0, 0x200(%rdi)
movq %rsi, 0x110(%rdi)
orb $-0x80, 0x11f(%rdi)
orb $0x1, 0xc8(%rdi)
movl $0x0, 0x108(%rdi)
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x30f6f
movslq 0x42be0(%rip), %rax     # 0x73b44
cmpl $0x0, 0x318(%rcx,%rax,4)
jle 0x30f72
retq
xorl %eax, %eax
retq
movslq 0x42bcf(%rip), %rax     # 0x73b48
cmpl $0x0, 0x318(%rcx,%rax,4)
jg 0x30f6e
movslq 0x42bc2(%rip), %rdx     # 0x73b4c
xorl %eax, %eax
cmpl $0x0, 0x318(%rcx,%rdx,4)
cmovgl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x311ac
testb $0x10, 0x11d(%rdi)
je 0x311ac
movslq 0x429b3(%rip), %rdx     # 0x73b50
movl $0x2, %eax
cmpl $0x0, 0x318(%rcx,%rdx,4)
jle 0x311ad
retq
movslq 0x429a0(%rip), %rdx     # 0x73b54
xorl %eax, %eax
cmpl $0x0, 0x318(%rcx,%rdx,4)
setg %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3121d
leaq 0x26827(%rip), %rdi     # 0x57a03
callq 0x189e0
subq 0x38c58(%rip), %rax     # 0x69e40
shrq $0x3, %rax
imull $0xf0f0f0f1, %eax, %eax # imm = 0xF0F0F0F1
movq 0x58(%rbx), %rcx
cltq
cmpl $0x0, 0x318(%rcx,%rax,4)
je 0x3125e
orb $0x10, 0x11d(%rbx)
movq 0x383f0(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x25f8d(%rip), %rdi     # 0x571a8
jmp 0x3123a
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
movl %eax, 0x11c(%rbx)
movq 0x383d1(%rip), %rax     # 0x69600
movq 0x20(%rax), %r14
leaq 0x231a4(%rip), %rdi     # 0x543de
callq *0x48(%rax)
movss 0x22ce3(%rip), %xmm0    # 0x53f28
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 0x25cea(%rip), %rdx     # 0x56f4f
movl $0x2, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18da0
// File: /workspace/github_c_makefile_star2_O1/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 0x38745(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3178d
jnp 0x317f9
movq $0x0, 0x4a0(%rbx)
xorl %eax, %eax
movl %eax, 0x290(%rbx)
movl %eax, 0x47c(%rbx)
leaq 0x2a43e(%rip), %rdi     # 0x5bbeb
callq 0x18170
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18ec0
movq 0x37dfc(%rip), %rax     # 0x695c0
movq %rax, 0x210(%rbx)
movq 0x385ce(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x22749(%rip), %xmm0    # 0x53f28
movss %xmm0, 0x200(%rbx)
movq 0x37e12(%rip), %rax     # 0x69600
leaq 0x26796(%rip), %rdi     # 0x57f8b
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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 0x58(%rsi), %rcx
movq 0x330(%rdi), %rax
movq %rax, %rdx
subq 0x38208(%rip), %rdx     # 0x69e40
sarq $0x3, %rdx
movabsq $-0x3c3c3c3c3c3c3c3c, %rsi # imm = 0xC3C3C3C3C3C3C3C4
imulq %rdx, %rsi
movl 0x318(%rcx,%rsi), %r15d
leal 0x1(%r15), %edx
movl %edx, 0x318(%rcx,%rsi)
movq 0x3825c(%rip), %rcx     # 0x69ec0
movq (%rcx), %rcx
movss 0x20(%rcx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x31c76
jnp 0x31ced
movq %rdi, %r14
testb $0x1, 0x142(%rdi)
jne 0x31cdb
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%r14) # imm = 0x80000000
orb $0x1, 0xc8(%r14)
movl $0x0, 0x108(%r14)
movq 0x380f1(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%r14)
movq 0x3808c(%rip), %rax     # 0x69d50
movq %rax, 0x210(%r14)
movq 0x3792e(%rip), %rax     # 0x69600
movq %r14, %rdi
callq *0x90(%rax)
testl %r15d, %r15d
jne 0x31ced
movq 0x330(%r14), %rsi
movq %rbx, %rdi
callq *0x10(%rsi)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x37afa(%rip), %rax     # 0x69880
movq %rax, 0x220(%rdi)
movq 0x3812c(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x31da6
jnp 0x31dd0
movq 0x37ff3(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x2511e(%rip), %xmm0    # 0x56ed8
movss %xmm0, 0x200(%rdi)
movq 0x37667(%rip), %rax     # 0x69430
movq %rax, 0x210(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x37c7b(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x32257
jnp 0x3226a
movq 0x373ba(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x322ab
leaq 0x25e41(%rip), %rax     # 0x580b2
movq %rax, 0x120(%rbx)
movl $0xa, 0x290(%rbx)
leaq 0x21d2c(%rip), %rdi     # 0x53fb5
callq 0x189e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18ec0
movq 0x37360(%rip), %rax     # 0x69600
leaq 0x24cd6(%rip), %rdi     # 0x56f7d
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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 0x37c01(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x322d1
jnp 0x322e4
movq 0x37340(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x3232f
leaq 0x25dec(%rip), %rax     # 0x580d7
movq %rax, 0x120(%rbx)
movl $0x2, 0x290(%rbx)
leaq 0x21cb2(%rip), %rdi     # 0x53fb5
callq 0x189e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18ec0
movl $0x1, 0x32c(%rbx)
movq 0x372dc(%rip), %rax     # 0x69600
leaq 0x24c3f(%rip), %rdi     # 0x56f6a
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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 0x37b7d(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x32355
jnp 0x32368
movq 0x372bc(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x323a9
leaq 0x25d8f(%rip), %rax     # 0x580fe
movq %rax, 0x120(%rbx)
movl $0x19, 0x290(%rbx)
leaq 0x21c2e(%rip), %rdi     # 0x53fb5
callq 0x189e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18ec0
movq 0x37262(%rip), %rax     # 0x69600
leaq 0x24beb(%rip), %rdi     # 0x56f90
popq %rbx
jmpq *0x48(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19a60
// File: /workspace/github_c_makefile_star2_O1/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 0x37b03(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x323cf
jnp 0x323e2
movq 0x37242(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x1, %al
jne 0x3242e
leaq 0x25d39(%rip), %rax     # 0x58122
movq %rax, 0x120(%rbx)
movl $0x64, 0x290(%rbx)
leaq 0x21bb4(%rip), %rdi     # 0x53fb5
callq 0x189e0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18ec0
movq 0x371e8(%rip), %rax     # 0x69600
leaq 0x25b6c(%rip), %rdi     # 0x57f8b
callq *0x48(%rax)
movl $0x3, 0x32c(%rbx)
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x19a60