// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: rocket_touch
void rocket_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
	vec3_t		origin;
	int			n;

	if (other == ent->owner)
		return;

	if (surf && (surf->flags & SURF_SKY))
	{
		G_FreeEdict (ent);
		return;
	}

	if (ent->owner->client)
		PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);

	// calculate position for the explosion entity
	VectorMA (ent->s.origin, -0.02f, ent->velocity, origin);

	if (other->takedamage)
	{
		T_Damage (other, ent, ent->owner, ent->velocity, ent->s.origin, plane->normal, ent->dmg, 0, 0, MOD_ROCKET);
	}
	else
	{
		// don't throw any debris in net games
		if (!deathmatch->value && !coop->value)
		{
			if ((surf) && !(surf->flags & (SURF_WARP|SURF_TRANS33|SURF_TRANS66|SURF_FLOWING)))
			{
				n = rand() % 5;
				while(n--)
					ThrowDebris (ent, "models/objects/debris2/tris.md2", 2, ent->s.origin);
			}
		}
	}

	T_RadiusDamage(ent, ent->owner, ent->radius_dmg, other, ent->dmg_radius, MOD_R_SPLASH);

	gi.WriteByte (svc_temp_entity);
	if (ent->waterlevel)
		gi.WriteByte (TE_ROCKET_EXPLOSION_WATER);
	else
		gi.WriteByte (TE_ROCKET_EXPLOSION);
	gi.WritePosition (origin);
	gi.multicast (ent->s.origin, MULTICAST_PHS);

	G_FreeEdict (ent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x534ce
jmp 0x536f2
cmpq $0x0, -0x20(%rbp)
je 0x534f2
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x534f2
movq -0x8(%rbp), %rdi
callq 0x19cd0
jmp 0x536f2
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x53521
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movl $0x2, %edx
callq 0x19080
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movq -0x8(%rbp), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
leaq -0x2c(%rbp), %rdx
movss 0x22d0c(%rip), %xmm0    # 0x7624c
callq 0x199c0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x27c(%rax)
je 0x535ae
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rdx
movq -0x8(%rbp), %rcx
addq $0x1c0, %rcx            # imm = 0x1C0
movq -0x8(%rbp), %r8
addq $0x4, %r8
movq -0x18(%rbp), %r9
movq -0x8(%rbp), %rax
movl 0x280(%rax), %eax
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x8, 0x18(%rsp)
callq 0x192c0
jmp 0x5363e
movq 0x2f90b(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5363c
jp 0x5363c
movq 0x2f992(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5363c
jp 0x5363c
cmpq $0x0, -0x20(%rbp)
je 0x5363a
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x78, %eax
cmpl $0x0, %eax
jne 0x5363a
callq 0x19c80
movl $0x5, %ecx
cltd
idivl %ecx
movl %edx, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x30(%rbp)
cmpl $0x0, %eax
je 0x53638
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x4, %rdx
leaq 0x2002c(%rip), %rsi     # 0x73655
movss 0x1c8b7(%rip), %xmm0    # 0x6fee8
callq 0x18700
jmp 0x53606
jmp 0x5363a
jmp 0x5363c
jmp 0x5363e
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rsi
movq -0x8(%rbp), %rax
cvtsi2ssl 0x284(%rax), %xmm0
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movss 0x288(%rax), %xmm1
movl $0x9, %ecx
callq 0x180c0
movl $0x3, %edi
movq 0x2ef81(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30c(%rax)
je 0x536a6
movl $0x11, %edi
movq 0x2ef62(%rip), %rax     # 0x82600
callq *0xc8(%rax)
jmp 0x536b8
movl $0x7, %edi
movq 0x2ef4e(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq 0x2ef41(%rip), %rax     # 0x82600
movq 0xf0(%rax), %rax
leaq -0x2c(%rbp), %rdi
callq *%rax
movq 0x2ef2d(%rip), %rax     # 0x82600
movq 0xb0(%rax), %rax
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movl $0x1, %esi
callq *%rax
movq -0x8(%rbp), %rdi
callq 0x19cd0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)