// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: fire_grenade
void fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
{
	edict_t	*grenade;
	vec3_t	dir;
	vec3_t	forward, right, up;

	vectoangles (aimdir, dir);
	AngleVectors (dir, forward, right, up);

	grenade = G_Spawn();
	VectorCopy (start, grenade->s.origin);
	VectorScale (aimdir, speed, grenade->velocity);
	VectorMA (grenade->velocity, 200 + crandom() * 10.0, up, grenade->velocity);
	VectorMA (grenade->velocity, crandom() * 10.0, right, grenade->velocity);
	VectorSet (grenade->avelocity, 300, 300, 300);
	grenade->movetype = MOVETYPE_BOUNCE;
	grenade->clipmask = MASK_SHOT;
	grenade->solid = SOLID_BBOX;
	grenade->s.effects |= EF_GRENADE;
	VectorClear (grenade->mins);
	VectorClear (grenade->maxs);
	grenade->s.modelindex = gi.modelindex ("models/objects/grenade/tris.md2");
	grenade->owner = self;
	grenade->touch = Grenade_Touch;
	grenade->nextthink = level.time + timer;
	grenade->think = Grenade_Explode;
	grenade->dmg = damage;
	grenade->dmg_radius = damage_radius;
	grenade->classname = "grenade";

	gi.linkentity (grenade);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movss %xmm1, 0x14(%rsp)
movss %xmm0, 0xc(%rsp)
movl %r8d, %r13d
movl %ecx, 0x10(%rsp)
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x3c(%rsp), %r15
movq %rdx, %rdi
movq %r15, %rsi
callq 0x190d0
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x24(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rcx
callq 0x183a0
callq 0x19700
movq %rax, %r15
movss (%r12), %xmm0
movss %xmm0, 0x4(%rax)
movss 0x4(%r12), %xmm0
movss %xmm0, 0x8(%rax)
movss 0x8(%r12), %xmm0
movss %xmm0, 0xc(%rax)
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
leaq 0x1c0(%rax), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x189d0
callq 0x19a10
movl $0x7fff, %ebx           # imm = 0x7FFF
andl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x135be(%rip), %xmm0    # 0x53288
cvtss2sd %xmm0, %xmm0
addsd 0x15f42(%rip), %xmm0    # 0x55c18
addsd %xmm0, %xmm0
mulsd 0x19896(%rip), %xmm0    # 0x59578
addsd 0x1765e(%rip), %xmm0    # 0x57348
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x19760
callq 0x19a10
andl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x13576(%rip), %xmm0    # 0x53288
cvtss2sd %xmm0, %xmm0
addsd 0x15efa(%rip), %xmm0    # 0x55c18
addsd %xmm0, %xmm0
mulsd 0x1984e(%rip), %xmm0    # 0x59578
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x19760
movsd 0x1984a(%rip), %xmm0    # 0x59590
movsd %xmm0, 0x1cc(%r15)
movl $0x43960000, 0x1d4(%r15) # imm = 0x43960000
movl $0x9, 0x118(%r15)
movabsq $0x600000300000002, %rax # imm = 0x600000300000002
movq %rax, 0x108(%r15)
orb $0x20, 0x40(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0xcc(%r15)
movq $0x0, 0xdc(%r15)
movq 0x28868(%rip), %rbx     # 0x68600
leaq 0x19824(%rip), %rdi     # 0x595c3
callq *0x40(%rbx)
movl %eax, 0x28(%r15)
movq %r14, 0x110(%r15)
leaq 0x70(%rip), %rax        # 0x3fe24
movq %rax, 0x220(%r15)
movq 0x28fde(%rip), %rax     # 0x68da0
movss 0xc(%rsp), %xmm0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%r15)
leaq 0x11c(%rip), %rax       # 0x3fef9
movq %rax, 0x210(%r15)
movl 0x10(%rsp), %eax
movl %eax, 0x280(%r15)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x288(%r15)
leaq 0x1a19c(%rip), %rax     # 0x59fa1
movq %rax, 0x138(%r15)
movq %r15, %rdi
callq *0x90(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq