LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Use_Weapon
void Use_Weapon (edict_t *ent, gitem_t *item)
{
	int			ammo_index;
	gitem_t		*ammo_item;
	char message[MAX_INFO_STRING];

	// see if we're already using it
	if (item == ent->client->pers.weapon)
		return;

	if (item->ammo && !g_select_empty->value && !(item->flags & IT_AMMO))
	{
		ammo_item = FindItem(item->ammo);
		ammo_index = ITEM_INDEX(ammo_item);

		if (!ent->client->pers.inventory[ammo_index])
		{
			sprintf(message, "No %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
			ctf_SafePrint(ent, PRINT_HIGH, message);
			return;
		}

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

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x58(%rdi), %rcx
cmpq %rsi, 0x730(%rcx)
je 0x4cbbe
movq %rsi, %r14
movq %rdi, %rbx
movq 0x60(%rsi), %rdi
testq %rdi, %rdi
je 0x4cbb7
movq 0x1b9ec(%rip), %rax     # 0x68548
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4cbb7
jp 0x4cbb7
testb $0x2, 0x68(%r14)
jne 0x4cbb7
callq 0x189e0
movq %rax, %rcx
subq 0x1c2bc(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %edx # imm = 0xF0F0F0F1
movq 0x58(%rbx), %rcx
movslq %edx, %rdx
movl 0x318(%rcx,%rdx,4), %edx
testl %edx, %edx
je 0x4cbc9
cmpl 0x5c(%r14), %edx
jge 0x4cbb7
movq 0x50(%rax), %rdx
movq 0x50(%r14), %rcx
leaq 0x7163(%rip), %rsi      # 0x53d18
jmp 0x4cbd8
movq %r14, 0xe50(%rcx)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movq 0x50(%rax), %rdx
movq 0x50(%r14), %rcx
leaq 0x7131(%rip), %rsi      # 0x53d09
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x196f0
movl $0x2, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18da0
jmp 0x4cbbe
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Drop_Weapon
void Drop_Weapon (edict_t *ent, gitem_t *item)
{
	int		index;

	if ((int)(dmflags->value) & DF_WEAPONS_STAY)
		return;

	index = ITEM_INDEX(item);
	// see if we're already using it
	if ( ((item == ent->client->pers.weapon) || (item == ent->client->newweapon))&& (ent->client->pers.inventory[index] == 1) )
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Can't drop current weapon\n");
		return;
	}

	Drop_Item (ent, item);
	ent->client->pers.inventory[index]--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x1ba16(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
testb $0x4, %al
jne 0x4cc85
movq %rdi, %rbx
movq %rsi, %rcx
subq 0x1c225(%rip), %rcx     # 0x68e40
sarq $0x3, %rcx
movabsq $-0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F1
imulq %rcx, %rax
movq 0x58(%rdi), %rcx
cmpq %rsi, 0x730(%rcx)
je 0x4cc48
cmpq %rsi, 0xe50(%rcx)
je 0x4cc48
movslq %eax, %r14
jmp 0x4cc71
movslq %eax, %r14
cmpl $0x1, 0x318(%rcx,%r14,4)
jne 0x4cc71
leaq 0x93cb(%rip), %rdx      # 0x56028
movl $0x2, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18da0
movq %rbx, %rdi
callq 0x18460
movq 0x58(%rbx), %rax
decl 0x318(%rax,%r14,4)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: P_ProjectSource
static void P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
{
	vec3_t	_distance;

	VectorCopy (distance, _distance);
	if (client->pers.hand == LEFT_HANDED)
		_distance[1] *= -1;
	else if (client->pers.hand == CENTER_HANDED)
		_distance[1] = 0;
	G_ProjectSource (point, _distance, forward, right, result);
}

// Assembly:
subq $0x18, %rsp
movq %rsi, %rax
movsd (%rdx), %xmm0
movsd %xmm0, 0x8(%rsp)
movss 0x8(%rdx), %xmm1
movss %xmm1, 0x10(%rsp)
cmpl $0x2, %edi
je 0x4d0f8
cmpl $0x1, %edi
jne 0x4d101
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
xorps 0x8bda(%rip), %xmm0     # 0x55cd0
jmp 0x4d0fb
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x18fa0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: weapon_grenadelauncher_fire
void weapon_grenadelauncher_fire (edict_t *ent)
{
	vec3_t	offset;
	vec3_t	forward, right;
	vec3_t	start;
	int		damage = 120;
	float	radius;

	radius = damage+40;
	if (is_quad)
		damage *= 4;

#ifdef WEAP_BALANCE_OK	

	if ((int)ctfflags->value & CTF_WEAP_BALANCE)
	{
		radius*=1.5;
		damage-=10;
	}
#endif


	VectorSet(offset, 8, 8, ent->viewheight-8);
	AngleVectors (ent->client->v_angle, forward, right, NULL);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -1;

	fire_grenade (ent, start, forward, damage, 600, 2.5, radius);

	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (ent-g_edicts);
	gi.WriteByte (MZ_GRENADE | is_silenced);
	gi.multicast (ent->s.origin, MULTICAST_PVS);

	ent->client->ps.gunframe++;

	PlayerNoise(ent, start, PNOISE_WEAPON);

	if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
		ent->client->pers.inventory[ent->client->ammo_index]--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x4bc59(%rip)     # 0x99094
movl $0x78, %eax
movl $0x1e0, %ebp            # imm = 0x1E0
cmovel %eax, %ebp
movsd 0x9f90(%rip), %xmm0     # 0x573e0
leaq 0x8(%rsp), %r13
movsd %xmm0, (%r13)
movl 0x278(%rdi), %eax
addl $-0x8, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%r13)
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x2c(%rsp), %r12
leaq 0x20(%rsp), %r14
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x183a0
movq 0x58(%rbx), %rax
leaq 0x4(%rbx), %r15
movl 0x300(%rax), %edi
leaq 0x14(%rsp), %r9
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
movq %r9, %r13
callq 0x4d0c5
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x6f47(%rip), %xmm0     # 0x54410
movq %r12, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xbf800000, 0xe7c(%rax) # imm = 0xBF800000
movss 0xd971(%rip), %xmm0     # 0x5ae58
movss 0xd96d(%rip), %xmm1     # 0x5ae5c
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movl $0x258, %r8d            # imm = 0x258
callq 0x19350
movq 0x1b0f4(%rip), %r14     # 0x68600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1b039(%rip), %rax     # 0x68558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4bb5b(%rip), %edi     # 0x99098
shll $0x7, %edi
orl $0x8, %edi
callq *0xc8(%r14)
movq %r15, %rdi
movl $0x2, %esi
callq *0xb0(%r14)
movq 0x58(%rbx), %rax
incl 0x5c(%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x18ef0
movq 0x1b0a1(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xd, %eax
jb 0x4d597
movq 0x58(%rbx), %rax
movslq 0xe38(%rax), %rcx
decl 0x318(%rax,%rcx,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Blaster_Fire
void Blaster_Fire (edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int effect)
{
	vec3_t	forward, right;
	vec3_t	start;
	vec3_t	offset;

	if (is_quad)
		damage *= 4;
	AngleVectors (ent->client->v_angle, forward, right, NULL);
	VectorSet(offset, 24, 8, ent->viewheight-8);
	VectorAdd (offset, g_offset, offset);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -1;

	fire_blaster (ent, start, forward, damage, 1000, effect, hyper);

	// send muzzle flash
	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (ent-g_edicts);
	if (hyper)
		gi.WriteByte (MZ_HYPERBLASTER | is_silenced);
	else
		gi.WriteByte (MZ_BLASTER | is_silenced);
	gi.multicast (ent->s.origin, MULTICAST_PVS);

	PlayerNoise(ent, start, PNOISE_WEAPON);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movq %rsi, %r15
leal (,%rdx,4), %r13d
cmpl $0x0, 0x4b8ab(%rip)     # 0x99094
cmovel %edx, %r13d
movq %rdi, %rbx
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x3c(%rsp), %r14
leaq 0x30(%rsp), %rbp
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x183a0
movl 0x278(%rbx), %eax
addl $-0x8, %eax
cvtsi2ss %eax, %xmm0
movsd (%r15), %xmm1
addps 0xd5e7(%rip), %xmm1     # 0x5ae10
leaq 0x18(%rsp), %rdx
movlps %xmm1, (%rdx)
addss 0x8(%r15), %xmm0
movss %xmm0, 0x8(%rdx)
movq 0x58(%rbx), %rax
leaq 0x4(%rbx), %r12
movl 0x300(%rax), %edi
leaq 0x24(%rsp), %r15
movq %r12, %rsi
movq %r14, %rcx
movq %rbp, %r8
movq %r15, %r9
callq 0x4d0c5
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x6b9f(%rip), %xmm0     # 0x54410
movq %r14, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xbf800000, 0xe7c(%rax) # imm = 0xBF800000
movl 0x10(%rsp), %ebp
movl %ebp, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %r13d, %ecx
movl $0x3e8, %r8d            # imm = 0x3E8
movl 0x14(%rsp), %r9d
callq 0x189b0
movq 0x1ad4f(%rip), %r14     # 0x68600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1ac94(%rip), %rax     # 0x68558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4b7b6(%rip), %eax     # 0x99098
shll $0x7, %eax
leal 0xe(%rax), %edi
testl %ebp, %ebp
cmovel %eax, %edi
callq *0xc8(%r14)
movq %r12, %rdi
movl $0x2, %esi
callq *0xb0(%r14)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x18ef0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: weapon_fieldgun_fire
void weapon_fieldgun_fire (edict_t *ent)
{
	vec3_t		start;
	vec3_t		forward, right;
	vec3_t		offset;
	int			damage = 4;
	int			kick = 8;

	AngleVectors (ent->client->v_angle, forward, right, NULL);

	VectorScale (forward, -2, ent->client->kick_origin);
	ent->client->kick_angles[0] = -2;

	VectorSet(offset, 0, 8,  ent->viewheight-8);
	P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);

	if (is_quad)
	{
		damage *= 4;
		kick *= 4;
	}

#ifdef WEAP_BALANCE_OK	
	if ((int)ctfflags->value & CTF_WEAP_BALANCE) //surt
		damage+=1; //slightly more damage, except with quad
#endif

	if (ent->client->buttons & BUTTON_ATTACK)
	{
		if (deathmatch->value)
			fire_fieldgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_DEATHMATCH_SHOTGUN_COUNT);
		else
			fire_fieldgun (ent, start, forward, damage, kick, 500, 500, DEFAULT_SHOTGUN_COUNT);

		// send muzzle flash
		gi.WriteByte (svc_muzzleflash);
		gi.WriteShort (ent-g_edicts);
		gi.WriteByte (MZ_SHOTGUN | is_silenced);
		gi.multicast (ent->s.origin, MULTICAST_PVS);

		//ent->client->ps.gunframe++;
		//PlayerNoise(ent, start, PNOISE_WEAPON);

		//ent->client->pers.inventory[ent->client->ammo_index] -= ent->client->pers.weapon->quantity;
	}
	else
	{
		ent->client->ps.gunframe++;
		ent->client->hooklength = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x18(%rsp), %r15
leaq 0x3c(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x183a0
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x59ee(%rip), %xmm0     # 0x54410
movq %r15, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xc0000000, 0xe7c(%rax) # imm = 0xC0000000
movsd 0xc3e0(%rip), %xmm0     # 0x5ae20
leaq 0x30(%rsp), %rdx
movsd %xmm0, (%rdx)
movl 0x278(%rbx), %ecx
addl $-0x8, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0x8(%rdx)
leaq 0x4(%rbx), %r14
movl 0x300(%rax), %edi
leaq 0x24(%rsp), %r9
movq %r14, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x4d0c5
movq 0x58(%rbx), %rax
testb $0x1, 0xe3c(%rax)
jne 0x4ea97
incl 0x5c(%rax)
movl $0x0, 0xf5c(%rax)
jmp 0x4eafa
leaq 0x24(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x18f40
movq 0x19b50(%rip), %r15     # 0x68600
movl $0x1, %edi
callq *0xc8(%r15)
movq 0x19a95(%rip), %rax     # 0x68558
subq (%rax), %rbx
shrq $0x3, %rbx
imull $0x8ce2cabd, %ebx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r15)
movzbl 0x4a5ba(%rip), %edi     # 0x99098
shll $0x7, %edi
orl $0x2, %edi
callq *0xc8(%r15)
movq %r14, %rdi
movl $0x2, %esi
callq *0xb0(%r15)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Draw_Hook
void Draw_Hook (edict_t *ent, vec3_t start, vec3_t end)
{
	vec3_t	dir, mins, maxs;
	vec3_t	offset;
	float		*v;

	v = tv(-15,-15,-15);
	_VectorCopy (v, mins);
	v = tv(15,15,15);
	_VectorCopy (v, maxs);

	VectorSubtract(end, start, dir);
	VectorSet(offset, 0, 0, 0);

	// Only display the grapple line if it isn't short
	if (VectorLength(dir) > 64)
	{
		gi.WriteByte (svc_temp_entity);
		gi.WriteByte (TE_GRAPPLE_CABLE);
		gi.WriteShort (ent - g_edicts);
		gi.WritePosition (start);
		gi.WritePosition (end);
		gi.WritePosition (offset);
		gi.multicast (ent->s.origin, MULTICAST_PVS);
	}	
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movss 0x3bfc(%rip), %xmm0     # 0x53450
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
leaq 0x2c(%rsp), %rsi
movq %rax, %rdi
callq 0x199d0
movss 0x3be0(%rip), %xmm0     # 0x53454
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x199d0
movsd (%r14), %xmm0
movsd (%r15), %xmm1
subps %xmm1, %xmm0
leaq 0x10(%rsp), %rdi
movlps %xmm0, (%rdi)
movss 0x8(%r14), %xmm0
subss 0x8(%r15), %xmm0
movss %xmm0, 0x8(%rdi)
movq $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x192e0
ucomiss 0x364a(%rip), %xmm0     # 0x52f18
jbe 0x4f945
movq 0x18d29(%rip), %r12     # 0x68600
movl $0x3, %edi
callq *0xc8(%r12)
movl $0x18, %edi
callq *0xc8(%r12)
movq 0x18c60(%rip), %rax     # 0x68558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r12)
movq %r15, %rdi
callq *0xf0(%r12)
movq %r14, %rdi
callq *0xf0(%r12)
movq %rsp, %rdi
callq *0xf0(%r12)
addq $0x4, %rbx
movq %rbx, %rdi
movl $0x2, %esi
callq *0xb0(%r12)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Weapon_Hook
void Weapon_Hook (edict_t *ent)
{
	static int	pause_frames[]	= {14, 18, 26, 30, 0};
	static int	fire_frames[]	= {8, 9, 10, 11,0};

	//if (ent->client->weaponstate == WEAPON_READY)
	//		ent->client->hookstate = 0;
	
	if (ent->client->weaponstate == WEAPON_ACTIVATING)
	{
		// Speed up activation
		ent->client->ps.gunframe+=1;
	}

	if (ent->client->newweapon && ent->client->weaponstate != WEAPON_DROPPING)
	{
		ent->client->weaponstate = WEAPON_DROPPING;
		ent->client->ps.gunframe = 36; //FRAME_DEACTIVATE_FIRST;
		return;
	}
	
	if ( !((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK))
	{
		ctf_hook_abort(ent);
	}
	
	Weapon_Generic (ent, 9, 13, 34, 38, pause_frames, fire_frames, Weapon_Hook_Fire);

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
movl 0xe78(%rax), %ecx
cmpl $0x1, %ecx
jne 0x4fc9d
incl 0x5c(%rax)
jmp 0x4fca2
cmpl $0x2, %ecx
je 0x4fcbf
cmpq $0x0, 0xe50(%rax)
je 0x4fcbf
movl $0x2, 0xe78(%rax)
movl $0x24, 0x5c(%rax)
jmp 0x4fd11
movl 0xe3c(%rax), %ecx
orl 0xe44(%rax), %ecx
testb $0x1, %cl
jne 0x4fcd8
movq %rbx, %rdi
callq 0x18630
movq 0x18d89(%rip), %rax     # 0x68a68
leaq 0x1e2fa(%rip), %r10     # 0x6dfe0
leaq 0x1e2d3(%rip), %r9      # 0x6dfc0
movq %rbx, %rdi
movl $0x9, %esi
movl $0xd, %edx
movl $0x22, %ecx
movl $0x26, %r8d
pushq %rax
pushq %r10
callq 0x18450
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: PerpendicularVector
void PerpendicularVector( vec3_t dst, const vec3_t src )
{
	int	pos;
	int i;
	float minelem = 1.0F;
	vec3_t tempvec;

	/*
	** find the smallest magnitude axially aligned vector
	*/
	for ( pos = 0, i = 0; i < 3; i++ )
	{
		if ( fabs( src[i] ) < minelem )
		{
			pos = i;
			minelem = fabs( src[i] );
		}
	}
	tempvec[0] = tempvec[1] = tempvec[2] = 0.0F;
	tempvec[pos] = 1.0F;

	/*
	** project the point onto the plane defined by src
	*/
	ProjectPointOnPlane( dst, tempvec, src );

	/*
	** normalize the result
	*/
	VectorNormalize( dst );
}

// Assembly:
xorl %eax, %eax
movss 0x2d8c(%rip), %xmm1     # 0x52f28
movaps 0x2d9d(%rip), %xmm0     # 0x52f40
xorl %ecx, %ecx
movss (%rsi,%rax,4), %xmm2
andps %xmm0, %xmm2
ucomiss %xmm2, %xmm1
cmoval %eax, %ecx
minss %xmm1, %xmm2
incq %rax
movaps %xmm2, %xmm1
cmpq $0x3, %rax
jne 0x501a5
movl $0x0, -0x8(%rsp)
movq $0x0, -0x10(%rsp)
movslq %ecx, %rax
movl $0x3f800000, -0x10(%rsp,%rax,4) # imm = 0x3F800000
movss 0x8(%rsi), %xmm2
movss -0x8(%rsp), %xmm1
movsd (%rsi), %xmm3
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
mulss %xmm0, %xmm0
movaps %xmm3, %xmm4
mulss %xmm3, %xmm4
addss %xmm0, %xmm4
movaps %xmm2, %xmm5
mulss %xmm2, %xmm5
addss %xmm4, %xmm5
movss 0x2d11(%rip), %xmm0     # 0x52f28
movaps %xmm0, %xmm4
divss %xmm5, %xmm4
movsd -0x10(%rsp), %xmm5
movaps %xmm3, %xmm6
movaps %xmm4, %xmm7
shufps $0x0, %xmm4, %xmm7      # xmm7 = xmm7[0,0],xmm4[0,0]
mulps %xmm3, %xmm7
mulps %xmm5, %xmm3
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
mulss %xmm5, %xmm6
addss %xmm3, %xmm6
movaps %xmm2, %xmm3
mulss %xmm1, %xmm3
addss %xmm6, %xmm3
mulss %xmm4, %xmm2
xorps 0x5a7a(%rip), %xmm3     # 0x55cd0
mulss %xmm4, %xmm3
movaps %xmm3, %xmm4
shufps $0x0, %xmm3, %xmm4      # xmm4 = xmm4[0,0],xmm3[0,0]
mulps %xmm7, %xmm4
addps %xmm5, %xmm4
movlps %xmm4, (%rdi)
mulss %xmm2, %xmm3
addss %xmm1, %xmm3
movss %xmm3, 0x8(%rdi)
movaps %xmm4, %xmm1
mulps %xmm4, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm4, %xmm2
mulss %xmm4, %xmm2
addss %xmm1, %xmm2
movaps %xmm3, %xmm1
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
sqrtss %xmm1, %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x502a5
jnp 0x502bb
divss %xmm1, %xmm0
mulss %xmm0, %xmm3
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
mulps %xmm0, %xmm4
movlps %xmm4, (%rdi)
movss %xmm3, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: ProjectPointOnPlane
void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
{
	float d;
	vec3_t n;
	float inv_denom;

	inv_denom = 1.0F / DotProduct( normal, normal );

	d = DotProduct( normal, p ) * inv_denom;

	n[0] = normal[0] * inv_denom;
	n[1] = normal[1] * inv_denom;
	n[2] = normal[2] * inv_denom;

	dst[0] = p[0] - d * n[0];
	dst[1] = p[1] - d * n[1];
	dst[2] = p[2] - d * n[2];
}

// Assembly:
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm0
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rdx), %xmm2
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0x288b(%rip), %xmm3     # 0x52f28
divss %xmm4, %xmm3
movss (%rsi), %xmm4
movss 0x4(%rsi), %xmm5
mulss %xmm0, %xmm5
movaps %xmm1, %xmm6
mulss %xmm4, %xmm6
addss %xmm5, %xmm6
movss 0x8(%rsi), %xmm5
mulss %xmm2, %xmm5
addss %xmm6, %xmm5
mulss %xmm3, %xmm1
mulss %xmm3, %xmm0
mulss %xmm3, %xmm2
xorps 0x55f7(%rip), %xmm5     # 0x55cd0
mulss %xmm3, %xmm5
mulss %xmm5, %xmm1
addss %xmm4, %xmm1
movss %xmm1, (%rdi)
mulss %xmm5, %xmm0
addss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rdi)
mulss %xmm2, %xmm5
addss 0x8(%rsi), %xmm5
movss %xmm5, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorNormalize
vec_t VectorNormalize (vec3_t v)
{
	float	length, ilength;

	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
	length = sqrt (length);		// FIXME

	if (length)
	{
		ilength = 1/length;
		v[0] *= ilength;
		v[1] *= ilength;
		v[2] *= ilength;
	}
		
	return length;

}

// Assembly:
movsd (%rdi), %xmm1
movaps %xmm1, %xmm0
mulps %xmm1, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm1, %xmm3
mulss %xmm1, %xmm3
addss %xmm0, %xmm3
movss 0x8(%rdi), %xmm2
movaps %xmm2, %xmm0
mulss %xmm2, %xmm0
addss %xmm3, %xmm0
sqrtss %xmm0, %xmm0
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
jne 0x5073d
jnp 0x5075e
movss 0x27e3(%rip), %xmm3     # 0x52f28
divss %xmm0, %xmm3
movaps %xmm3, %xmm4
unpcklps %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0],xmm4[1],xmm3[1]
mulps %xmm1, %xmm4
movlps %xmm4, (%rdi)
mulss %xmm2, %xmm3
movss %xmm3, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: BoxOnPlaneSide2
int BoxOnPlaneSide2 (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
{
	int		i;
	float	dist1, dist2;
	int		sides;
	vec3_t	corners[2];

	for (i=0 ; i<3 ; i++)
	{
		if (p->normal[i] < 0)
		{
			corners[0][i] = emins[i];
			corners[1][i] = emaxs[i];
		}
		else
		{
			corners[1][i] = emins[i];
			corners[0][i] = emaxs[i];
		}
	}
	dist1 = DotProduct (p->normal, corners[0]) - p->dist;
	dist2 = DotProduct (p->normal, corners[1]) - p->dist;
	sides = 0;
	if (dist1 >= 0)
		sides = 1;
	if (dist2 < 0)
		sides |= 2;

	return sides;
}

// Assembly:
leaq -0xc(%rsp), %rax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
leaq -0x18(%rsp), %r8
ucomiss (%rdx,%rcx,4), %xmm0
movq %r8, %r9
movq %rax, %r10
ja 0x50a0d
movq %rax, %r9
movq %r8, %r10
movss (%rdi,%rcx,4), %xmm1
movss %xmm1, (%r9,%rcx,4)
movss (%rsi,%rcx,4), %xmm1
movss %xmm1, (%r10,%rcx,4)
incq %rcx
cmpq $0x3, %rcx
jne 0x509fb
movss (%rdx), %xmm0
movss 0x4(%rdx), %xmm1
movss -0x14(%rsp), %xmm2
mulss %xmm1, %xmm2
movss -0x18(%rsp), %xmm3
mulss %xmm0, %xmm3
addss %xmm2, %xmm3
movss 0x8(%rdx), %xmm2
movss -0x10(%rsp), %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0xc(%rdx), %xmm3
subss %xmm3, %xmm4
mulss -0x8(%rsp), %xmm1
mulss -0xc(%rsp), %xmm0
addss %xmm1, %xmm0
mulss -0x4(%rsp), %xmm2
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
xorl %ecx, %ecx
ucomiss %xmm0, %xmm4
setae %cl
leal 0x2(%rcx), %eax
ucomiss %xmm2, %xmm3
cmovbel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: AddPointToBounds
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs)
{
	int		i;
	vec_t	val;

	for (i=0 ; i<3 ; i++)
	{
		val = v[i];
		if (val < mins[i])
			mins[i] = val;
		if (val > maxs[i])
			maxs[i] = val;
	}
}

// Assembly:
xorl %eax, %eax
movss (%rdi,%rax,4), %xmm0
movss (%rsi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x50c44
movss %xmm0, (%rsi,%rax,4)
ucomiss (%rdx,%rax,4), %xmm0
jbe 0x50c4f
movss %xmm0, (%rdx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x50c30
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorNormalize2
vec_t VectorNormalize2 (vec3_t v, vec3_t out)
{
	float	length, ilength;

	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
	length = sqrt (length);		// FIXME

	if (length)
	{
		ilength = 1/length;
		out[0] = v[0]*ilength;
		out[1] = v[1]*ilength;
		out[2] = v[2]*ilength;
	}
		
	return length;

}

// Assembly:
movss (%rdi), %xmm1
movss 0x4(%rdi), %xmm0
mulss %xmm0, %xmm0
movaps %xmm1, %xmm2
mulss %xmm1, %xmm2
addss %xmm0, %xmm2
movss 0x8(%rdi), %xmm0
mulss %xmm0, %xmm0
addss %xmm2, %xmm0
sqrtss %xmm0, %xmm0
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jne 0x50cba
jnp 0x50ce6
movss 0x2266(%rip), %xmm2     # 0x52f28
divss %xmm0, %xmm2
mulss %xmm2, %xmm1
movss %xmm1, (%rsi)
movss 0x4(%rdi), %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x4(%rsi)
mulss 0x8(%rdi), %xmm2
movss %xmm2, 0x8(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: VectorLength
vec_t VectorLength(vec3_t v)
{
	int		i;
	float	length;
	
	length = 0;
	for (i=0 ; i< 3 ; i++)
		length += v[i]*v[i];

	length = sqrt (length);		// FIXME

	return length;
}

// Assembly:
xorps %xmm0, %xmm0
xorl %eax, %eax
movss (%rdi,%rax,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x50db7
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x18e80
sqrtss %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FileExtension
char *COM_FileExtension (char *in)
{
	static char exten[8];
	int		i;

	while (*in && *in != '.')
		in++;
	if (!*in)
		return "";
	in++;
	for (i=0 ; i<7 && *in ; i++,in++)
		exten[i] = *in;
	exten[i] = 0;
	return exten;
}

// Assembly:
incq %rdi
movzbl -0x1(%rdi), %eax
testl %eax, %eax
je 0x50ea8
cmpl $0x2e, %eax
jne 0x50e70
xorl %ecx, %ecx
leaq 0x48237(%rip), %rax     # 0x990c0
movb (%rdi,%rcx), %dl
testb %dl, %dl
je 0x50ea1
movb %dl, (%rcx,%rax)
incq %rcx
cmpq $0x7, %rcx
jne 0x50e89
movl $0x7, %ecx
movl %ecx, %ecx
movb $0x0, (%rcx,%rax)
retq
leaq 0x3096(%rip), %rax      # 0x53f45
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FileBase
void COM_FileBase (char *in, char *out)
{
	char *s, *s2;
	
	s = in + strlen(in) - 1;
	
	while (s != in && *s != '.')
		s--;
	
	for (s2 = s ; s2 != in && *s2 != '/' ; s2--)
	;
	
	if (s-s2 < 2)
		out[0] = 0;
	else
	{
		s--;
		strncpy (out,s2+1, s-s2);
		out[s-s2] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
leaq 0x1(%r14), %r15
cmpq $0x1, %rax
je 0x50ef2
leaq -0x1(%rax), %rcx
cmpb $0x2e, -0x1(%r14,%rax)
movq %rcx, %rax
jne 0x50ec4
leaq (%r14,%rcx), %rax
leaq (%r14,%rcx), %r15
incq %r15
cmpb $0x2f, (%r14,%rcx)
je 0x50ef7
decq %rcx
jne 0x50ee4
jmp 0x50efa
movq %r14, %rax
jmp 0x50efa
addq %rcx, %r14
subq %r14, %rax
cmpq $0x2, %rax
jl 0x50f1f
movq %r14, %rsi
incq %rsi
subq %r14, %r15
leaq -0x2(%r15), %rdx
movq %rbx, %rdi
callq 0x181c0
addq %r15, %rbx
addq $-0x2, %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_FilePath
void COM_FilePath (char *in, char *out)
{
	char *s;
	
	s = in + strlen(in) - 1;
	
	while (s != in && *s != '/')
		s--;

	strncpy (out,in, s-in);
	out[s-in] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
cmpq $0x1, %rax
je 0x50f52
leaq -0x1(%rax), %r15
cmpb $0x2f, -0x1(%r14,%rax)
movq %r15, %rax
jne 0x50f38
addq %r14, %r15
jmp 0x50f55
movq %r14, %r15
subq %r14, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x181c0
movb $0x0, (%rbx,%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_DefaultExtension
void COM_DefaultExtension (char *path, char *extension)
{
	char    *src;
//
// if path doesn't have a .EXT, append extension
// (extension should include the .)
//
	src = path + strlen(path) - 1;

	while (*src != '/' && src != path)
	{
		if (*src == '.')
			return;                 // it has an extension
		src--;
	}

	strcat (path, extension);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x18680
decq %rax
movb (%r14,%rax), %cl
cmpb $0x2f, %cl
je 0x50fa1
testq %rax, %rax
je 0x50fa1
decq %rax
cmpb $0x2e, %cl
jne 0x50f83
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x19640
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_Parse
char* COM_Parse(char** data_p)
{
	int         c;
	int         len;
	char* data;
	char* s = com_token[com_tokidx++ & 3];

	data = *data_p;
	len = 0;
	s[0] = 0;

	if (!data) {
		*data_p = NULL;
		return s;
	}

	// skip whitespace
skipwhite:
	while ((c = *data) <= ' ') {
		if (c == 0) {
			*data_p = NULL;
			return s;
		}
		data++;
	}

	// skip // comments
	if (c == '/' && data[1] == '/') {
		data += 2;
		while (*data && *data != '\n')
			data++;
		goto skipwhite;
	}

	// skip /* */ comments
	if (c == '/' && data[1] == '*') {
		data += 2;
		while (*data) {
			if (data[0] == '*' && data[1] == '/') {
				data += 2;
				break;
			}
			data++;
		}
		goto skipwhite;
	}

	// handle quoted strings specially
	if (c == '\"') {
		data++;
		while (1) {
			c = *data++;
			if (c == '\"' || !c) {
				goto finish;
			}

			if (len < MAX_TOKEN_CHARS - 1) {
				s[len++] = c;
			}
		}
	}

	// parse a regular word
	do {
		if (len < MAX_TOKEN_CHARS - 1) {
			s[len++] = c;
		}
		data++;
		c = *data;
	} while (c > 32);

finish:
	s[len] = 0;

	*data_p = data;
	return s;
}

// Assembly:
movl 0x4867a(%rip), %edx     # 0x996d0
leal 0x1(%rdx), %eax
movl %eax, 0x48671(%rip)     # 0x996d0
andl $0x3, %edx
shll $0x7, %edx
leaq 0x48464(%rip), %rsi     # 0x994d0
leaq (%rsi,%rdx), %rax
movq (%rdi), %rcx
movb $0x0, (%rdx,%rsi)
testq %rcx, %rcx
je 0x510e3
movb (%rcx), %sil
cmpb $0x20, %sil
jg 0x51097
testb %sil, %sil
je 0x510e3
movb 0x1(%rcx), %sil
incq %rcx
cmpb $0x21, %sil
jl 0x51085
cmpb $0x2f, %sil
jne 0x510e9
movzbl 0x1(%rcx), %edx
cmpl $0x2a, %edx
je 0x510c0
cmpl $0x2f, %edx
jne 0x51116
addq $0x2, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x5107c
cmpl $0xa, %edx
je 0x5107c
incq %rcx
jmp 0x510af
addq $0x2, %rcx
movzbl (%rcx), %edx
cmpl $0x2a, %edx
je 0x510d2
testl %edx, %edx
jne 0x510d8
jmp 0x5107c
cmpb $0x2f, 0x1(%rcx)
je 0x510dd
incq %rcx
jmp 0x510c4
addq $0x2, %rcx
jmp 0x5107c
xorl %ecx, %ecx
movq %rcx, (%rdi)
retq
movzbl %sil, %edx
cmpl $0x22, %edx
jne 0x51116
incq %rcx
xorl %edx, %edx
movzbl (%rcx), %esi
testl %esi, %esi
je 0x51135
cmpl $0x22, %esi
je 0x51135
incq %rcx
cmpl $0x7e, %edx
ja 0x510f7
movl %edx, %r8d
incl %edx
movb %sil, (%rax,%r8)
jmp 0x510f7
xorl %edx, %edx
cmpl $0x7e, %edx
jg 0x51126
movslq %edx, %r8
incl %edx
movb %sil, (%rax,%r8)
movb 0x1(%rcx), %sil
incq %rcx
cmpb $0x20, %sil
jg 0x51118
jmp 0x51138
incq %rcx
movslq %edx, %rdx
movb $0x0, (%rax,%rdx)
jmp 0x510e5
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Q_strnicmp
int Q_strnicmp(const char* s1, const char* s2, size_t count)
{
	if (count == 0)
		return 0;
	else
	{
		while (count-- != 0 && tolower(*s1) == tolower(*s2))
		{
			if (count == 0 || *s1 == '\0' || *s2 == '\0')
				break;
			s1++;
			s2++;
		}

		return tolower(*(unsigned char*)s1) - tolower(*(unsigned char*)s2);
	}
}

// Assembly:
testq %rdx, %rdx
je 0x51229
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x19a20
movq (%rax), %rcx
movsbq (%r15), %rax
movsbq (%r14), %rdx
testq %rdx, %rdx
je 0x51217
testb %al, %al
je 0x51217
movl (%rcx,%rdx,4), %esi
cmpl %esi, (%rcx,%rax,4)
jne 0x51217
movq %rbx, %rsi
decq %rsi
je 0x51217
addq $-0x2, %rbx
xorl %esi, %esi
movsbq 0x1(%r15,%rsi), %rax
movsbq 0x1(%r14,%rsi), %rdx
testq %rdx, %rdx
je 0x51217
testb %al, %al
je 0x51217
movl (%rcx,%rdx,4), %edi
cmpl %edi, (%rcx,%rax,4)
jne 0x51217
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rbx
movq %rdi, %rsi
jne 0x511ee
movzbl %al, %eax
movl (%rcx,%rax,4), %eax
movzbl %dl, %edx
subl (%rcx,%rdx,4), %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Com_sprintf
void Com_sprintf(char* dest, int size, char* fmt, ...)
{
	int		len;
	va_list	argptr;

	va_start(argptr, fmt);
	len = vsprintf(bigbuffer, fmt, argptr);
	va_end(argptr);
	if (len < size)
		strncpy(dest, bigbuffer, (size_t)size - 1);
	else
		Com_Printf("Com_sprintf: overflow of %i in %i\n", len, size);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x51287
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rax
movq %rsi, 0x10(%rax)
leaq 0xf0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
leaq 0x48432(%rip), %rdi     # 0x996e0
movq %rdx, %rsi
movq %rax, %rdx
callq 0x19320
cmpl %ebx, %eax
jge 0x512d4
movslq %ebx, %rdx
decq %rdx
leaq 0x48416(%rip), %rsi     # 0x996e0
movq %r14, %rdi
callq 0x181c0
jmp 0x512e6
leaq 0x9e13(%rip), %rdi      # 0x5b0ee
movl %eax, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x18f20
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_ValueForKey
char *Info_ValueForKey (char *s, char *key)
{
	char	pkey[MAX_INFO_STRING];
	static	char value[2][MAX_INFO_STRING]; // Use two buffers so compares work without stomping on each other.
	static	int	valueindex;
	char	*o;
	
	valueindex ^= 1;
	if (*s == '\\')
		s++;
	while (1)
	{
		o = pkey;
		while (*s != '\\')
		{
			if (!*s)
				return "";
			*o++ = *s++;
		}
		*o = 0;
		s++;

		o = value[valueindex];

		while (*s != '\\' && *s)
		{
			if (!*s)
				return "";
			*o++ = *s++;
		}
		*o = 0;

		if (!strcmp (key, pkey) )
			return value[valueindex];

		if (!*s)
			return "";
		s++;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movl 0x587d6(%rip), %eax     # 0xa9ae0
xorq $0x1, %rax
movl %eax, 0x587cc(%rip)     # 0xa9ae0
xorl %r12d, %r12d
cmpb $0x5c, (%rdi)
sete %r12b
addq %rdi, %r12
shlq $0x9, %rax
leaq 0x583b4(%rip), %r13     # 0xa96e0
addq %rax, %r13
movq %rsp, %r15
leaq 0x2c0c(%rip), %r14      # 0x53f45
movq %r15, %rax
movzbl (%r12), %ecx
cmpl $0x5c, %ecx
je 0x51354
testl %ecx, %ecx
je 0x51399
incq %r12
movb %cl, (%rax)
incq %rax
jmp 0x5133c
movb $0x0, (%rax)
addq $0x2, %r12
movq %r13, %rax
movzbl -0x1(%r12), %ecx
testl %ecx, %ecx
je 0x51377
cmpl $0x5c, %ecx
je 0x51377
movb %cl, (%rax)
incq %rax
incq %r12
jmp 0x5135e
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
je 0x51396
cmpb $0x0, -0x1(%r12)
movq %r15, %rax
jne 0x5133c
jmp 0x51399
movq %r13, %r14
movq %r14, %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_RemoveKey
void Info_RemoveKey (char *s, char *key)
{
	char	*start;
	char	pkey[MAX_INFO_STRING];
	char	value[MAX_INFO_STRING];
	char	*o;

	if (strstr (key, "\\"))
	{
//		Com_Printf ("Can't use a key with a \\\n");
		return;
	}

	while (1)
	{
		start = s;
		if (*s == '\\')
			s++;
		o = pkey;
		while (*s != '\\')
		{
			if (!*s)
				return;
			*o++ = *s++;
		}
		*o = 0;
		s++;

		o = value;
		while (*s != '\\' && *s)
		{
			if (!*s)
				return;
			*o++ = *s++;
		}
		*o = 0;

		if (!strcmp (key, pkey) )
		{
			strcpy (start, s);	// remove this part
			return;
		}

		if (!*s)
			return;
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
je 0x513e6
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movb (%r14), %al
leaq 0x200(%rsp), %r13
movq %rsp, %r15
xorl %ecx, %ecx
cmpb $0x5c, %al
sete %cl
leaq (%r14,%rcx), %rax
leaq (%r14,%rcx), %r12
incq %r12
xorl %ecx, %ecx
movzbl (%rax,%rcx), %edx
testl %edx, %edx
je 0x513d5
cmpl $0x5c, %edx
je 0x51420
movb %dl, (%rsp,%rcx)
incq %rcx
incq %r12
jmp 0x51408
movb $0x0, (%rsp,%rcx)
movq %r13, %rax
movzbl (%r12), %ecx
testl %ecx, %ecx
je 0x5143f
cmpl $0x5c, %ecx
je 0x5143f
movb %cl, (%rax)
incq %rax
incq %r12
jmp 0x51427
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18b20
testl %eax, %eax
je 0x51461
movb (%r12), %al
movq %r12, %r14
testb %al, %al
jne 0x513f4
jmp 0x513d5
movq %r14, %rdi
movq %r12, %rsi
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x182a0
// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: Info_SetValueForKey
void Info_SetValueForKey (char *s, char *key, char *value)
{
	char	newi[MAX_INFO_STRING], *v;
	int		c;
	size_t	maxsize = MAX_INFO_STRING;

	if (strstr (key, "\\") || strstr (value, "\\") )
	{
		Com_Printf ("Can't use keys or values with a \\\n");
		return;
	}

	if (strstr (key, ";") )
	{
		Com_Printf ("Can't use keys or values with a semicolon\n");
		return;
	}

	if (strstr (key, "\"") || strstr (value, "\"") )
	{
		Com_Printf ("Can't use keys or values with a \"\n");
		return;
	}

	if (strlen(key) > MAX_INFO_KEY-1 || strlen(value) > MAX_INFO_KEY-1)
	{
		Com_Printf ("Keys and values must be < 64 characters.\n");
		return;
	}
	Info_RemoveKey (s, key);
	if (!value || !strlen(value))
		return;

	Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);

	if (strlen(newi) + strlen(s) > maxsize)
	{
		Com_Printf ("Info string length exceeded\n");
		return;
	}

	// only copy ascii values
	s += strlen(s);
	v = newi;
	while (*v)
	{
		c = *v++;
		c &= 127;		// strip high bits
		if (c >= 32 && c < 127)
			*s++ = c;
	}
	*s = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
jne 0x514e9
movq %r14, %rdi
movl $0x5c, %esi
callq 0x18730
testq %rax, %rax
je 0x51505
leaq 0x9c21(%rip), %rdi      # 0x5b111
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18f20
movq %r15, %rdi
movl $0x3b, %esi
callq 0x18730
testq %rax, %rax
je 0x51520
leaq 0x9c16(%rip), %rdi      # 0x5b134
jmp 0x514f0
movq %r15, %rdi
movl $0x22, %esi
callq 0x18730
testq %rax, %rax
jne 0x51544
movq %r14, %rdi
movl $0x22, %esi
callq 0x18730
testq %rax, %rax
je 0x5154d
leaq 0x9c14(%rip), %rdi      # 0x5b15f
jmp 0x514f0
movq %r15, %rdi
callq 0x18680
cmpq $0x3f, %rax
ja 0x51569
movq %r14, %rdi
callq 0x18680
cmpq $0x40, %rax
jb 0x51575
leaq 0x9c12(%rip), %rdi      # 0x5b182
jmp 0x514f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19750
testq %r14, %r14
je 0x51616
cmpb $0x0, (%r14)
je 0x51616
leaq 0x9c12(%rip), %rdx      # 0x5b1ac
movq %rsp, %r12
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x18e10
movq %r12, %rdi
callq 0x18680
movq %rax, %r14
movq %rbx, %rdi
callq 0x18680
addq %rax, %r14
cmpq $0x201, %r14            # imm = 0x201
jb 0x515e1
leaq 0x9bdb(%rip), %rdi      # 0x5b1b3
xorl %eax, %eax
callq 0x18f20
jmp 0x51616
addq %rax, %rbx
movb (%rsp), %cl
testb %cl, %cl
je 0x51613
leaq 0x1(%rsp), %rax
andb $0x7f, %cl
cmpb $0x20, %cl
setb %dl
cmpb $0x7f, %cl
sete %sil
orb %dl, %sil
jne 0x5160a
movb %cl, (%rbx)
incq %rbx
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x515f0
movb $0x0, (%rbx)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/lupyuen[P]lora-sx1262/npl/linux/src/os_eventq.cc
// Function: ble_npl_eventq_remove
void
ble_npl_eventq_remove(struct ble_npl_eventq *evq, struct ble_npl_event *ev)
{
    wqueue_t *q = static_cast<wqueue_t *>(evq->q);

    if (!ev->ev_queued) {
        return;
    }

    ev->ev_queued = 0;
    q->remove(ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, (%rsi)
je 0x2567
movq (%rdi), %rdi
movb $0x0, (%rsi)
popq %rbp
jmp 0x26a2
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/lupyuen[P]lora-sx1262/npl/linux/src/wqueue.h
// Function: wqueue<ble_npl_event*>::get(unsigned int)
T get(uint32_t tmo) {
        pthread_mutex_lock(&m_mutex);
        if (tmo) {
            while (m_queue.size() == 0) {
                pthread_cond_wait(&m_condv, &m_mutex);
            }
        }

        T item = NULL;

        if (m_queue.size() != 0) {
            item = m_queue.front();
            m_queue.pop_front();
        }

        pthread_mutex_unlock(&m_mutex);
        return item;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x2210
testl %r15d, %r15d
setne %cl
movq 0x10(%r14), %rax
testq %rax, %rax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2660
leaq 0x48(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2250
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x264a
jmp 0x2665
testq %rax, %rax
je 0x269d
movq (%r14), %r12
movq 0x10(%r12), %r15
decq %rax
movq %rax, 0x10(%r14)
movq %r12, %rdi
callq 0x2280
movl $0x18, %esi
movq %r12, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2120
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x2689
// File: /workspace/github_c_makefile_star2_O3/lupyuen[P]lora-sx1262/src/main.c
// Function: main
int main(void) {

//  Uncomment to read SX1262 registers
//  #define READ_REGISTERS
#ifdef READ_REGISTERS
    //  Read SX1262 registers 0x00 to 0x0F
    read_registers();
#endif  //  READ_REGISTERS

    //  TODO: Create a Background Thread to handle LoRa Events
    create_task();

    //  Init SX1262 driver
    init_driver();

    //  TODO: Do we need to wait?
    sleep(1);

//  Uncomment to send a LoRa message
//  #define SEND_MESSAGE
#ifdef SEND_MESSAGE
    //  Send a LoRa message
    send_message();
#endif  //  SEND_MESSAGE

//  Uncomment to receive a LoRa message
#define RECEIVE_MESSAGE
#ifdef RECEIVE_MESSAGE
    //  Handle LoRa events for the next 10 seconds
    for (int i = 0; i < 10; i++) {
        //  Prepare to receive a LoRa message
        receive_message();

        //  Process the received LoRa message, if any
        RadioOnDioIrq(NULL);
        
        //  Sleep for 1 second
        usleep(1000 * 1000);
    }
#endif  //  RECEIVE_MESSAGE

    //  TODO: Close the SPI Bus
    //  close(spi);
    puts("Done!");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq 0x3906(%rip), %rdi      # 0x6092
callq 0x2260
leaq 0x7a28(%rip), %rdi      # 0xa1c0
callq 0x2416
leaq 0x7a24(%rip), %rdi      # 0xa1c8
leaq 0x242(%rip), %rsi       # 0x29ed
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x251d
leaq 0x38b5(%rip), %rdi      # 0x6070
callq 0x2260
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdi
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
leaq 0x102(%rip), %rax       # 0x28d8
movq %rax, (%rdi)
leaq 0x119(%rip), %rax       # 0x28f9
movq %rax, 0x10(%rdi)
leaq 0x19d(%rip), %rax       # 0x2988
movq %rax, 0x8(%rdi)
leaq 0x1b4(%rip), %rax       # 0x29aa
movq %rax, 0x18(%rdi)
leaq 0x1cb(%rip), %rax       # 0x29cc
movq %rax, 0x20(%rdi)
leaq 0x7504(%rip), %r14      # 0x9d10
callq *(%r14)
movl $0x3703dcc0, %edi       # imm = 0x3703DCC0
callq *0x18(%r14)
subq $0x8, %rsp
movl $0x1, %r15d
movl $0x1, %edi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x7, %r8d
movl $0x1, %r9d
pushq $0xbb8                  # imm = 0xBB8
pushq %rbx
pushq %rbx
pushq %rbx
pushq %r15
pushq %rbx
pushq $0x8
callq *0x38(%r14)
addq $0x40, %rsp
movl $0x1, %edi
xorl %esi, %esi
movl $0x7, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movl $0x8, %r9d
pushq %r15
pushq %rbx
pushq %rbx
pushq %rbx
pushq %r15
pushq %rbx
pushq %rbx
pushq $0x5
callq *0x30(%r14)
addq $0x40, %rsp
movl $0x1, %edi
callq 0x2110
movq 0x68(%r14), %r14
movl $0xa, %r15d
leaq 0x37e9(%rip), %rbx      # 0x6082
movq %rbx, %rdi
callq 0x2260
movl $0x2710, %edi           # imm = 0x2710
callq *%r14
xorl %edi, %edi
callq 0x39d8
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x21f0
decl %r15d
jne 0x2899
leaq 0x37a4(%rip), %rdi      # 0x606a
callq 0x2260
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lupyuen[P]lora-sx1262/src/main.c
// Function: on_rx_done
static void on_rx_done(
    uint8_t *payload,  //  Buffer containing received LoRa message
    uint16_t size,     //  Size of the LoRa message
    int16_t rssi,      //  Signal strength
    int8_t snr)        //  Signal To Noise ratio
{
    printf("Rx done: \r\n");

    //  Switch the LoRa Transceiver to low power, sleep mode
    Radio.Sleep();

    //  Copy the received packet
    if (size > sizeof loraping_buffer) {
        size = sizeof loraping_buffer;
    }
    loraping_rx_size = size;
    memcpy(loraping_buffer, payload, size);

    //  Log the signal strength, signal to noise ratio
    //  TODO: loraping_rxinfo_rxed(rssi, snr);

    //  Dump the contents of the received packet
    for (int i = 0; i < loraping_rx_size; i++) {
        printf("%02x ", loraping_buffer[i]);
    }
    printf("\r\n");

    //  TODO: Send a "PING" or "PONG" LoRa message
    //  os_eventq_put(os_eventq_dflt_get(), &loraping_ev_tx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r15
leaq 0x37a4(%rip), %rdi      # 0x60b4
callq 0x2260
leaq 0x73f4(%rip), %rax      # 0x9d10
callq *0x58(%rax)
cmpw $0x40, %r14w
movl $0x40, %edx
cmovbl %r14d, %edx
movl %edx, 0x78ad(%rip)      # 0xa1e0
leaq 0x78b6(%rip), %rbx      # 0xa1f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2130
testl %r14d, %r14d
je 0x2972
leaq 0x372b(%rip), %r14      # 0x607c
xorl %r15d, %r15d
movzbl (%r15,%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
incq %r15
movslq 0x7873(%rip), %rax      # 0xa1e0
cmpq %rax, %r15
jl 0x2954
leaq 0x3744(%rip), %rdi      # 0x60bd
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2260
// File: /workspace/github_c_makefile_star2_O3/lupyuen[P]lora-sx1262/src/radio.c
// Function: RadioInit
void RadioInit( RadioEvents_t *events )
{
    ////  We copy the Event Callbacks from "events", because
    ////  "events" may be stored on the stack
    assert(events != NULL);
    memcpy(&RadioEvents, events, sizeof(RadioEvents));

    ////  Previously: RadioEvents = events;

    SX126xInit( RadioOnDioIrq );
    SX126xSetStandby( STDBY_RC );

    ////  TODO: Declare the power regulation used to power the device
    ////  This command allows the user to specify if DC-DC or LDO is used for power regulation.
    ////  Using only LDO implies that the Rx or Tx current is doubled

    //// #warning SX126x is set to LDO power regulator mode (instead of DC-DC)
    //// SX126xSetRegulatorMode( USE_LDO );   ////  Default: Use LDO

    //// #warning SX126x is set to DC-DC power regulator mode (instead of LDO)
    SX126xSetRegulatorMode( USE_DCDC );  ////  Use DC-DC

    SX126xSetBufferBaseAddress( 0x00, 0x00 );
    ////TODO: SX126xSetTxParams( 0, RADIO_RAMP_200_US );
    SX126xSetTxParams( 22, RADIO_RAMP_3400_US ); //// TODO
    SX126xSetDioIrqParams( IRQ_RADIO_ALL, IRQ_RADIO_ALL, IRQ_RADIO_NONE, IRQ_RADIO_NONE );

    // Add registers to the retention list (4 is the maximum possible number)
    RadioAddRegisterToRetentionList( REG_RX_GAIN );
    RadioAddRegisterToRetentionList( REG_TX_MODULATION );

    // Initialize driver timeout timers
    TimerInit( &TxTimeoutTimer, RadioOnTxTimeoutIrq );
    TimerInit( &RxTimeoutTimer, RadioOnRxTimeoutIrq );

    IrqFired = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x2ab6
movq %rdi, %rsi
leaq 0x781d(%rip), %rdi      # 0xa240
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
leaq 0xfa6(%rip), %rdi       # 0x39d8
callq 0x3b14
xorl %edi, %edi
callq 0x3b7d
movl $0x1, %edi
callq 0x40a9
xorl %edi, %edi
xorl %esi, %esi
callq 0x470f
movl $0x16, %edi
movl $0x7, %esi
callq 0x4353
movl $0xffff, %edi           # imm = 0xFFFF
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x41ec
movl $0x8ac, %edi            # imm = 0x8AC
callq 0x39f5
movl $0x889, %edi            # imm = 0x889
callq 0x39f5
leaq 0x77fa(%rip), %rdi      # 0xa288
leaq 0xfde(%rip), %rsi       # 0x3a73
callq 0x4f7d
leaq 0x781f(%rip), %rdi      # 0xa2c0
leaq 0xfec(%rip), %rsi       # 0x3a94
callq 0x4f7d
movb $0x0, 0x7785(%rip)      # 0xa239
popq %rbp
retq
leaq 0x372f(%rip), %rdi      # 0x61ec
leaq 0x3737(%rip), %rsi      # 0x61fb
leaq 0x373c(%rip), %rcx      # 0x6207
movl $0x20f, %edx            # imm = 0x20F
callq 0x20f0