// File: /workspace/github_c_makefile_star2_O1/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 0x19a20
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x5f6d(%rip), %xmm0     # 0x54288
cvtss2sd %xmm0, %xmm0
mulsd 0xd7e9(%rip), %xmm0     # 0x5bb10
cvttsd2si %xmm0, %eax
cmpl $0x0, 0x4bd62(%rip)     # 0x9a094
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 0x14(%rsp), %r13
leaq 0x8(%rsp), %r15
movq %r13, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x183a0
movl $0xe88, %esi            # imm = 0xE88
addq 0x58(%rbx), %rsi
movss 0x7091(%rip), %xmm0     # 0x55410
movq %r13, %rdi
callq 0x189d0
movq 0x58(%rbx), %rdi
movl $0xbf800000, 0xe7c(%rdi) # imm = 0xBF800000
movabsq $0x4100000041000000, %rax # imm = 0x4100000041000000
leaq 0x2c(%rsp), %rdx
movq %rax, (%rdx)
movl 0x278(%rbx), %eax
addl $-0x8, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rdx)
leaq 0x4(%rbx), %r12
leaq 0x20(%rsp), %r9
movq %r12, %rsi
movq %r13, %rcx
movq %r15, %r8
movq %r9, %r15
callq 0x4dde7
movss 0xd722(%rip), %xmm0     # 0x5bb00
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %ebp, %ecx
movl $0x28a, %r8d            # imm = 0x28A
movl %r14d, %r9d
callq 0x185e0
movq 0x1b202(%rip), %r14     # 0x69600
movl $0x1, %edi
callq *0xc8(%r14)
movq 0x1b147(%rip), %rax     # 0x69558
movq %rbx, %rcx
subq (%rax), %rcx
shrq $0x3, %rcx
imull $0x8ce2cabd, %ecx, %edi # imm = 0x8CE2CABD
callq *0xd0(%r14)
movzbl 0x4bc69(%rip), %edi     # 0x9a098
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 0x1b1af(%rip), %rax     # 0x69618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xd, %eax
jb 0x4e489
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