// File: /workspace/github_c_makefile_star2_O1/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 0x19710
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 0x19a20
movl $0x7fff, %ebx           # imm = 0x7FFF
andl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x13d08(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x16624(%rip), %xmm0    # 0x56bb0
addsd %xmm0, %xmm0
mulsd 0x19dd0(%rip), %xmm0    # 0x5a368
addsd 0x17cb0(%rip), %xmm0    # 0x58250
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x19770
callq 0x19a20
andl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x13cc0(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x165dc(%rip), %xmm0    # 0x56bb0
addsd %xmm0, %xmm0
mulsd 0x19d88(%rip), %xmm0    # 0x5a368
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x19770
movabsq $0x4396000043960000, %rax # imm = 0x4396000043960000
movq %rax, 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 0x28fb2(%rip), %rbx     # 0x69600
leaq 0x19d46(%rip), %rdi     # 0x5a39b
callq *0x40(%rbx)
movl %eax, 0x28(%r15)
movq %r14, 0x110(%r15)
leaq 0x70(%rip), %rax        # 0x406da
movq %rax, 0x220(%r15)
movq 0x29728(%rip), %rax     # 0x69da0
movss 0xc(%rsp), %xmm0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%r15)
leaq 0x11c(%rip), %rax       # 0x407af
movq %rax, 0x210(%r15)
movl 0x10(%rsp), %eax
movl %eax, 0x280(%r15)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x288(%r15)
leaq 0x1a626(%rip), %rax     # 0x5ace1
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