// File: /workspace/github_c_makefile_star2_O3/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 0x19a10
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x5c82(%rip), %xmm0     # 0x53288
cvtss2sd %xmm0, %xmm0
mulsd 0xd85e(%rip), %xmm0     # 0x5ae70
cvttsd2si %xmm0, %eax
cmpl $0x0, 0x4ba77(%rip)     # 0x99094
leal 0x64(%rax), %ecx
leal 0x190(,%rax,4), %ebp
cmovel %ecx, %ebp
movl $0x78, %eax
movl $0x1e0, %r14d           # imm = 0x1E0
cmovel %eax, %r14d
movl $0xebc, %edi            # imm = 0xEBC
addq 0x58(%rbx), %rdi
leaq 0x20(%rsp), %r13
leaq 0x4(%rsp), %rdx
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x183a0
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x6da9(%rip), %xmm0     # 0x54410
movq %r13, %rdi
callq 0x189d0
movq 0x58(%rbx), %rax
movl $0xbf800000, 0xe7c(%rax) # imm = 0xBF800000
movsd 0x9d5b(%rip), %xmm0     # 0x573e0
leaq 0x10(%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), %r12
movl 0x300(%rax), %edi
leaq 0x2c(%rsp), %r15
movq %r12, %rsi
movq %r13, %rcx
leaq 0x4(%rsp), %r8
movq %r15, %r9
callq 0x4d0c5
movss 0xd793(%rip), %xmm0     # 0x5ae60
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl $0x28a, %r8d            # imm = 0x28A
movl %r14d, %r9d
callq 0x185e0
movq 0x1af13(%rip), %r14     # 0x68600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1ae58(%rip), %rax     # 0x68558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4b97a(%rip), %edi     # 0x99098
shll $0x7, %edi
orl $0x7, %edi
callq *0xc8(%r14)
movq %r12, %rdi
movl $0x2, %esi
callq *0xb0(%r14)
movq 0x58(%rbx), %rax
incl 0x5c(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x18ef0
movq 0x1aec0(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xd, %eax
jb 0x4d778
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