// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: fire_grenade2
void fire_grenade2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held)
{
	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/grenade2/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 = "hgrenade";
	if (held)
		grenade->spawnflags = 3;
	else
		grenade->spawnflags = 1;
	grenade->s.sound = gi.soundindex("weapons/hgrenc1b.wav");

	if (timer <= 0.0)
		Grenade_Explode (grenade);
	else
	{
		gi.sound (self, CHAN_WEAPON, gi.soundindex ("weapons/hgrent1a.wav"), 1, ATTN_NORM, 0);
		gi.linkentity (grenade);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movss %xmm0, -0x24(%rbp)
movss %xmm1, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x192a0
leaq -0x44(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x5c(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x183e0
callq 0x19950
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x18(%rbp), %rdi
cvtsi2ssl -0x20(%rbp), %xmm0
movq -0x38(%rbp), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
callq 0x18a80
movq -0x38(%rbp), %rax
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x78(%rbp)
callq 0x19c80
movq -0x78(%rbp), %rdi
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x1d0db(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1e26b(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm1
movsd 0x1f9cf(%rip), %xmm0    # 0x72b98
mulsd %xmm1, %xmm0
movsd 0x23083(%rip), %xmm1    # 0x76258
mulsd %xmm1, %xmm0
movsd 0x20fe7(%rip), %xmm1    # 0x741c8
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq -0x68(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq $0x1c0, %rdx            # imm = 0x1C0
callq 0x199c0
movq -0x38(%rbp), %rax
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x70(%rbp)
callq 0x19c80
movq -0x70(%rbp), %rdi
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x1d063(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1e1f3(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm1
movsd 0x1f957(%rip), %xmm0    # 0x72b98
mulsd %xmm1, %xmm0
movsd 0x2300b(%rip), %xmm1    # 0x76258
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq -0x5c(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq $0x1c0, %rdx            # imm = 0x1C0
callq 0x199c0
movq -0x38(%rbp), %rax
movss 0x1d20f(%rip), %xmm0    # 0x70484
movss %xmm0, 0x1cc(%rax)
movq -0x38(%rbp), %rax
movss 0x1d1fb(%rip), %xmm0    # 0x70484
movss %xmm0, 0x1d0(%rax)
movq -0x38(%rbp), %rax
movss 0x1d1e7(%rip), %xmm0    # 0x70484
movss %xmm0, 0x1d4(%rax)
movq -0x38(%rbp), %rax
movl $0x9, 0x118(%rax)
movq -0x38(%rbp), %rax
movl $0x6000003, 0x10c(%rax) # imm = 0x6000003
movq -0x38(%rbp), %rax
movl $0x2, 0x108(%rax)
movq -0x38(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x40(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd4(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd0(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xcc(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xe0(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xdc(%rax)
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd8(%rax)
leaq 0x22f66(%rip), %rdi     # 0x762a3
movq 0x2f2bc(%rip), %rax     # 0x82600
callq *0x40(%rax)
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x110(%rax)
movq -0x38(%rbp), %rax
leaq -0x7da(%rip), %rcx      # 0x52b90
movq %rcx, 0x220(%rax)
movq 0x2fa28(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
addss -0x24(%rbp), %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq -0x38(%rbp), %rax
leaq -0x669(%rip), %rcx      # 0x52d30
movq %rcx, 0x210(%rax)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x280(%rax)
movss -0x28(%rbp), %xmm0
movq -0x38(%rbp), %rax
movss %xmm0, 0x288(%rax)
movq -0x38(%rbp), %rax
leaq 0x22efb(%rip), %rcx     # 0x762c4
movq %rcx, 0x138(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x533e6
movq -0x38(%rbp), %rax
movl $0x3, 0x140(%rax)
jmp 0x533f4
movq -0x38(%rbp), %rax
movl $0x1, 0x140(%rax)
leaq 0x22ed2(%rip), %rdi     # 0x762cd
movq 0x2f1fe(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4c(%rax)
movss -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x5342b
movq -0x38(%rbp), %rdi
callq 0x52d30
jmp 0x5348c
movq 0x2f1ce(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0x22e96(%rip), %rdi     # 0x762e2
movq 0x2f1ad(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x88(%rbp), %rdi
movl %eax, %edx
movq -0x80(%rbp), %rax
movl $0x1, %esi
movss 0x1ca7c(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movq 0x2f181(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x38(%rbp), %rdi
callq *%rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)