// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_misc.c
// Function: ThrowGib
void ThrowGib (edict_t *self, char *gibname, int damage, int type)
{
	edict_t *gib;
	vec3_t	vd;
	vec3_t	origin;
	vec3_t	size;
	float	vscale;

	gib = G_Spawn();

	VectorScale (self->size, 0.5, size);
	VectorAdd (self->absmin, size, origin);
	gib->s.origin[0] = origin[0] + crandom() * size[0];
	gib->s.origin[1] = origin[1] + crandom() * size[1];
	gib->s.origin[2] = origin[2] + crandom() * size[2];

	gi.setmodel (gib, gibname);
	gib->solid = SOLID_NOT;
	gib->s.effects |= EF_GIB;
	gib->flags |= FL_NO_KNOCKBACK;
	gib->takedamage = DAMAGE_YES;
	gib->die = gib_die;

	if (type == GIB_ORGANIC)
	{
		gib->movetype = MOVETYPE_TOSS;
		gib->touch = gib_touch;
		vscale = 0.5;
	}
	else
	{
		gib->movetype = MOVETYPE_BOUNCE;
		vscale = 1.0;
	}

	VelocityForDamage (damage, vd);
	VectorMA (self->velocity, vscale, vd, gib->velocity);
	ClipGibVelocity (gib);
	gib->avelocity[0] = random()*600;
	gib->avelocity[1] = random()*600;
	gib->avelocity[2] = random()*600;

	gib->think = G_FreeEdict;
	gib->nextthink = level.time + 10 + random()*10;

	gi.linkentity (gib);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
callq 0x19950
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0xfc, %rdi
leaq -0x44(%rbp), %rsi
movss 0x336aa(%rip), %xmm0    # 0x72b50
callq 0x18a80
movq -0x8(%rbp), %rax
movss 0xe4(%rax), %xmm0
addss -0x44(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movss 0xe8(%rax), %xmm0
addss -0x40(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movss 0xec(%rax), %xmm0
addss -0x3c(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x38(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x19c80
movsd -0x60(%rbp), %xmm1
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30d72(%rip), %xmm2    # 0x70288
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x31f02(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm2
movsd 0x33666(%rip), %xmm0    # 0x72b98
mulsd %xmm2, %xmm0
movss -0x44(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x34(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x19c80
movsd -0x58(%rbp), %xmm1
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30d0b(%rip), %xmm2    # 0x70288
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x31e9b(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm2
movsd 0x335ff(%rip), %xmm0    # 0x72b98
mulsd %xmm2, %xmm0
movss -0x40(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x19c80
movsd -0x50(%rbp), %xmm1
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30ca4(%rip), %xmm2    # 0x70288
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x31e34(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm2
movsd 0x33598(%rip), %xmm0    # 0x72b98
mulsd %xmm2, %xmm0
movss -0x3c(%rbp), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq 0x42fd7(%rip), %rax     # 0x82600
movq 0x58(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movl $0x0, 0x108(%rax)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x40(%rax)
movq -0x20(%rbp), %rax
movl 0x11c(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x11c(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x27c(%rax)
movq -0x20(%rbp), %rax
movq 0x435b7(%rip), %rcx     # 0x82c38
movq %rcx, 0x238(%rax)
cmpl $0x0, -0x18(%rbp)
jne 0x3f6bd
movq -0x20(%rbp), %rax
movl $0x7, 0x118(%rax)
movq -0x20(%rbp), %rax
movq 0x42f81(%rip), %rcx     # 0x82628
movq %rcx, 0x220(%rax)
movss 0x3349a(%rip), %xmm0    # 0x72b50
movss %xmm0, -0x48(%rbp)
jmp 0x3f6d8
movq -0x20(%rbp), %rax
movl $0x9, 0x118(%rax)
movss 0x30819(%rip), %xmm0    # 0x6feec
movss %xmm0, -0x48(%rbp)
movl -0x14(%rbp), %edi
leaq -0x2c(%rbp), %rsi
callq 0x19840
movq -0x8(%rbp), %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movss -0x48(%rbp), %xmm0
leaq -0x2c(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x1c0, %rdx            # imm = 0x1C0
callq 0x199c0
movq -0x20(%rbp), %rdi
callq 0x191e0
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30b61(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x34ac1(%rip), %xmm1    # 0x741f4
mulss %xmm1, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x1cc(%rax)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30b2f(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x34a8f(%rip), %xmm1    # 0x741f4
mulss %xmm1, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x1d0(%rax)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30afd(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x34a5d(%rip), %xmm1    # 0x741f4
mulss %xmm1, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x1d4(%rax)
movq -0x20(%rbp), %rax
movq 0x42c7e(%rip), %rcx     # 0x82430
movq %rcx, 0x210(%rax)
movss 0x3072f(%rip), %xmm0    # 0x6fef0
movq 0x435d8(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movss %xmm0, -0x64(%rbp)
callq 0x19c80
movss -0x64(%rbp), %xmm1
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30a9b(%rip), %xmm2    # 0x70288
divss %xmm2, %xmm0
movss 0x306f7(%rip), %xmm2    # 0x6fef0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq 0x42dec(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)