// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Weapon_RocketLauncher_Fire
void Weapon_RocketLauncher_Fire (edict_t *ent)
{
	vec3_t	offset, start;
	vec3_t	forward, right;
	int		damage;
	float	damage_radius;
	int		radius_damage;

	damage = 100 + (int)(random() * 20.0);

#ifdef WEAP_BALANCE_OK
	if ((int)ctfflags->value & CTF_WEAP_BALANCE)
	{
		radius_damage = 75; //SURT was 120
		damage_radius = 240; //LM_JORM was 360 //SURT was 120
	}
	else
	{
		radius_damage = 120;
		damage_radius = 120;
	}
#else
	radius_damage = 120;
	damage_radius = 120;
#endif	
	
	if (is_quad)
	{
		damage *= 4;
		radius_damage *= 4;
	}

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

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

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

#ifdef WEAP_BALANCE_OK	
	if ((int)ctfflags->value & CTF_WEAP_BALANCE)
		fire_rocket (ent, start, forward, damage, 750, damage_radius, radius_damage); //SURT 750 was 550 then 650 by id
	else
		fire_rocket (ent, start, forward, damage, 650, damage_radius, radius_damage); //SURT 
#else
	fire_rocket (ent, start, forward, damage, 650, damage_radius, radius_damage); //SURT 
#endif

	// send muzzle flash
	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (ent-g_edicts);
	gi.WriteByte (MZ_ROCKET | 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
callq 0x19bf0
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x5e78(%rip), %xmm0     # 0x4f288
cvtss2sd %xmm0, %xmm0
mulsd 0xda14(%rip), %xmm0     # 0x56e30
cvttsd2si %xmm0, %eax
cmpl $0x0, 0x4dd6d(%rip)     # 0x97194
leal 0x64(%rax), %ecx
leal 0x190(,%rax,4), %ebp
cmovel %ecx, %ebp
pushq $0x78
popq %rax
movl $0x1e0, %r15d           # imm = 0x1E0
cmovel %eax, %r15d
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x2c(%rsp), %r13
leaq 0x20(%rsp), %r14
movq %r13, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x183d0
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x6f9e(%rip), %xmm0     # 0x50410
movq %r13, %rdi
callq 0x18a70
movq 0x58(%rbx), %rdi
movl $0xbf800000, 0xe7c(%rdi) # imm = 0xBF800000
movsd 0x9f30(%rip), %xmm0     # 0x533c0
leaq 0x10(%rsp), %rdx
movsd %xmm0, (%rdx)
movl 0x278(%rbx), %eax
addl $-0x8, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rdx)
leaq 0x4(%rbx), %r12
leaq 0x4(%rsp), %r9
movq %r12, %rsi
movq %r13, %rcx
movq %r14, %r8
movq %r9, %r14
callq 0x48f06
movss 0xd953(%rip), %xmm0     # 0x56e20
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl $0x28a, %r8d            # imm = 0x28A
movl %r15d, %r9d
callq 0x18620
movq 0x1d113(%rip), %r14     # 0x66600
pushq $0x1
popq %rbp
movl %ebp, %edi
callq *0xc8(%r14)
movq 0x1d058(%rip), %rcx     # 0x66558
movq %rbx, %rax
subq (%rcx), %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
movl %eax, %edi
callq *0xd0(%r14)
movzbl 0x4dc78(%rip), %edi     # 0x97198
shll $0x7, %edi
orl $0x7, %edi
callq *0xc8(%r14)
pushq $0x2
popq %rsi
movq %r12, %rdi
callq *0xb0(%r14)
movq 0x58(%rbx), %rax
incl 0x5c(%rax)
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
movl %ebp, %edx
callq 0x19010
movq 0x1d0c1(%rip), %rax     # 0x66618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xd, %eax
jb 0x49577
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