// File: /workspace/github_c_makefile_star2_O2/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 0x19240
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x24(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rcx
callq 0x183d0
callq 0x198d0
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)
cvtsi2ss %r13d, %xmm0
leaq 0x1c0(%rax), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18a70
callq 0x19bf0
movl $0x7fff, %ebx           # imm = 0x7FFF
andl %ebx, %eax
cvtsi2ss %eax, %xmm0
divss 0x12b3b(%rip), %xmm0    # 0x4f288
cvtss2sd %xmm0, %xmm0
addsd 0x1549f(%rip), %xmm0    # 0x51bf8
addsd %xmm0, %xmm0
mulsd 0x18df3(%rip), %xmm0    # 0x55558
addsd 0x16bbb(%rip), %xmm0    # 0x53328
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x19940
callq 0x19bf0
andl %ebx, %eax
cvtsi2ss %eax, %xmm0
divss 0x12af6(%rip), %xmm0    # 0x4f288
cvtss2sd %xmm0, %xmm0
addsd 0x1545a(%rip), %xmm0    # 0x51bf8
addsd %xmm0, %xmm0
mulsd 0x18dae(%rip), %xmm0    # 0x55558
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x19940
movsd 0x18daa(%rip), %xmm0    # 0x55570
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)
andq $0x0, 0xdc(%r15)
movq 0x29deb(%rip), %rbx     # 0x66600
leaq 0x18d87(%rip), %rdi     # 0x555a3
callq *0x40(%rbx)
movl %eax, 0x28(%r15)
movq %r14, 0x110(%r15)
leaq 0x70(%rip), %rax        # 0x3c8a1
movq %rax, 0x220(%r15)
movq 0x2a561(%rip), %rax     # 0x66da0
movss 0xc(%rsp), %xmm0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%r15)
leaq 0x11a(%rip), %rax       # 0x3c974
movq %rax, 0x210(%r15)
movl 0x10(%rsp), %eax
movl %eax, 0x280(%r15)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x288(%r15)
leaq 0x1970f(%rip), %rax     # 0x55f91
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