// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: bfg_touch
void bfg_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
	if (other == self->owner)
		return;

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

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

	// core explosion - prevents firing it into the wall/floor
	if (other->takedamage)
		T_Damage (other, self, self->owner, self->velocity, self->s.origin, plane->normal, 200, 0, 0, MOD_BFG_BLAST);
	T_RadiusDamage(self, self->owner, 200, other, 100, MOD_BFG_BLAST);

	gi.sound (self, CHAN_VOICE, gi.soundindex ("weapons/bfg__x1b.wav"), 1, ATTN_NORM, 0);
	self->solid = SOLID_NOT;
	self->touch = NULL;
	VectorMA (self->s.origin, -1 * FRAMETIME, self->velocity, self->s.origin);
	VectorClear (self->velocity);
	self->s.modelindex = gi.modelindex ("sprites/s_bfg3.sp2");
	self->s.frame = 0;
	self->s.sound = 0;
	self->s.effects &= ~EF_ANIM_ALLFAST;
	self->think = bfg_explode;
	self->nextthink = level.time + FRAMETIME;
	self->enemy = other;

	gi.WriteByte (svc_temp_entity);
	gi.WriteByte (TE_BFG_BIGEXPLOSION);
	gi.WritePosition (self->s.origin);
	gi.multicast (self->s.origin, MULTICAST_PVS);
}

// 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 0x53f5e
jmp 0x541ce
cmpq $0x0, -0x20(%rbp)
je 0x53f82
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x53f82
movq -0x8(%rbp), %rdi
callq 0x19cd0
jmp 0x541ce
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x53fb1
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movl $0x2, %edx
callq 0x19080
movq -0x10(%rbp), %rax
cmpl $0x0, 0x27c(%rax)
je 0x5400e
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
xorl %eax, %eax
movl $0xc8, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0xd, 0x18(%rsp)
callq 0x192c0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rsi
movq -0x10(%rbp), %rdx
movss 0x1c277(%rip), %xmm0    # 0x702a0
movss 0x1eb4f(%rip), %xmm1    # 0x72b80
movl $0xd, %ecx
callq 0x180c0
movq 0x2e5be(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x222d1(%rip), %rdi     # 0x7632a
movq 0x2e5a0(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x30(%rbp), %rdi
movl %eax, %edx
movq -0x28(%rbp), %rax
movl $0x2, %esi
movss 0x1be72(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movq -0x8(%rbp), %rax
movl $0x0, 0x108(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x220(%rax)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movq -0x8(%rbp), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
movq -0x8(%rbp), %rdx
addq $0x4, %rdx
movss 0x1cb46(%rip), %xmm0    # 0x70c08
callq 0x199c0
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1c8(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1c4(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1c0(%rax)
leaq 0x22244(%rip), %rdi     # 0x7633f
movq 0x2e4fe(%rip), %rax     # 0x82600
callq *0x40(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x2e421(%rip), %rcx     # 0x82560
movq %rcx, 0x210(%rax)
movss 0x1c146(%rip), %xmm0    # 0x70294
movq 0x2ec4b(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x2a0(%rax)
movl $0x3, %edi
movq 0x2e47f(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movl $0x15, %edi
movq 0x2e46d(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq 0x2e460(%rip), %rax     # 0x82600
movq 0xf0(%rax), %rax
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
callq *%rax
movq 0x2e448(%rip), %rax     # 0x82600
movq 0xb0(%rax), %rax
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movl $0x2, %esi
callq *%rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)