// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x8536(%rip), %xmm1     # 0x70288
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xfcf6(%rip), %xmm1     # 0x77a58
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl $0x64, %eax
movl %eax, -0x3c(%rbp)
movl $0x78, -0x44(%rbp)
movss 0xc48d(%rip), %xmm0     # 0x7420c
movss %xmm0, -0x40(%rbp)
cmpl $0x0, 0x4b4d9(%rip)     # 0xb3264
je 0x67d9f
movl -0x3c(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x3c(%rbp)
movl -0x44(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0xebc, %rdi            # imm = 0xEBC
leaq -0x2c(%rbp), %rsi
leaq -0x38(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x183e0
leaq -0x2c(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xe88, %rsi            # imm = 0xE88
movss 0x963a(%rip), %xmm0     # 0x71414
callq 0x18a80
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xad99(%rip), %xmm0     # 0x72b88
movss %xmm0, 0xe7c(%rax)
movss 0x80fd(%rip), %xmm0     # 0x6fefc
movss %xmm0, -0x14(%rbp)
movss 0x80f0(%rip), %xmm0     # 0x6fefc
movss %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x278(%rax), %eax
subl $0x8, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
leaq -0x14(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x20(%rbp), %r9
callq 0x67590
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movl -0x3c(%rbp), %ecx
movss -0x40(%rbp), %xmm0
movl -0x44(%rbp), %r9d
movl $0x28a, %r8d            # imm = 0x28A
callq 0x18640
movl $0x1, %edi
movq 0x1a785(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq 0x1a778(%rip), %rax     # 0x82600
movq 0xd0(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x1a6ba(%rip), %rcx     # 0x82558
movq (%rcx), %rcx
subq %rcx, %rax
movl $0x4a8, %ecx            # imm = 0x4A8
cqto
idivq %rcx
movq %rax, %rcx
movq -0x50(%rbp), %rax
movl %ecx, %edi
callq *%rax
movq 0x1a740(%rip), %rax     # 0x82600
movq 0xc8(%rax), %rax
movzbl 0x4b39a(%rip), %edi     # 0xb3268
orl $0x7, %edi
callq *%rax
movq 0x1a726(%rip), %rax     # 0x82600
movq 0xb0(%rax), %rax
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movl $0x2, %esi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x19080
movq 0x1a6fe(%rip), %rax     # 0x82618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x67f54
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq 0xe38(%rcx), %rcx
movl 0x318(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x318(%rax,%rcx,4)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)