// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_phys.c
// Function: SV_Physics_Pusher
void SV_Physics_Pusher (edict_t *ent)
{
	vec3_t		move, amove;
	edict_t		*part, *mv;

	// if not a team captain, so movement will be handled elsewhere
	if ( ent->flags & FL_TEAMSLAVE)
		return;

	// make sure all team slaves can move before commiting
	// any moves or calling any think functions
	// if the move is blocked, all moved objects will be backed out
//retry:
	pushed_p = pushed;
	for (part = ent ; part ; part=part->teamchain)
	{
		if (part->velocity[0] || part->velocity[1] || part->velocity[2] ||
			part->avelocity[0] || part->avelocity[1] || part->avelocity[2]
			)
		{	// object is moving
			VectorScale (part->velocity, FRAMETIME, move);
			VectorScale (part->avelocity, FRAMETIME, amove);

			if (!SV_Push (part, move, amove))
				break;	// move was blocked
		}
	}
	if (pushed_p > &pushed[MAX_EDICTS])
		gi.error (ERR_FATAL, "pushed_p > &pushed[MAX_EDICTS], memory corrupted");

	if (part)
	{
		// the move failed, bump all nextthink times and back out moves
		for (mv = ent ; mv ; mv=mv->teamchain)
		{
			if (mv->nextthink > 0)
				mv->nextthink += FRAMETIME;
		}

		// if the pusher has a "blocked" function, call it
		// otherwise, just stay in place until the obstacle is gone
		if (part->blocked)
			part->blocked (part, obstacle);
#if 0
		// if the pushed entity went away and the pusher is still there
		if (!obstacle->inuse && part->inuse)
			goto retry;
#endif
	}
	else
	{
		// the move succeeded, so call all think functions
		for (part = ent ; part ; part=part->teamchain)
		{
			SV_RunThink (part);
		}
	}
}

// Assembly:
testb $0x4, 0x11d(%rdi)
jne 0x352ba
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x31b9b(%rip), %rax     # 0x66cd8
movq 0x31704(%rip), %r13     # 0x66848
movq %rax, (%r13)
leaq 0x14(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rdi, %r14
testq %r14, %r14
je 0x35222
movss 0x1c0(%r14), %xmm0
ucomiss 0x1a822(%rip), %xmm0    # 0x4f990
jne 0x351d6
jp 0x351d6
movss 0x1c4(%r14), %xmm0
ucomiss 0x1a80e(%rip), %xmm0    # 0x4f990
jne 0x351d6
jp 0x351d6
movss 0x1c8(%r14), %xmm0
ucomiss 0x1a7fa(%rip), %xmm0    # 0x4f990
jne 0x351d6
jp 0x351d6
movss 0x1cc(%r14), %xmm0
ucomiss 0x1a7e6(%rip), %xmm0    # 0x4f990
jne 0x351d6
jp 0x351d6
movss 0x1d0(%r14), %xmm0
ucomiss 0x1a7d2(%rip), %xmm0    # 0x4f990
jne 0x351d6
jp 0x351d6
movss 0x1d4(%r14), %xmm0
ucomiss 0x1a7be(%rip), %xmm0    # 0x4f990
jne 0x351d6
jnp 0x35216
leaq 0x1c0(%r14), %rdi
movss 0x1a0ab(%rip), %xmm0    # 0x4f290
movq %r15, %rsi
callq 0x18a70
leaq 0x1cc(%r14), %rdi
movss 0x1a094(%rip), %xmm0    # 0x4f290
movq %r12, %rsi
callq 0x18a70
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x18410
testl %eax, %eax
je 0x35222
movq 0x2c8(%r14), %r14
jmp 0x35155
movl $0xa000, %eax           # imm = 0xA000
addq 0x31aaa(%rip), %rax     # 0x66cd8
cmpq %rax, (%r13)
jbe 0x35249
movq 0x313c5(%rip), %rcx     # 0x66600
leaq 0x1e817(%rip), %rsi     # 0x53a59
xorl %edi, %edi
xorl %eax, %eax
callq *0x38(%rcx)
testq %r14, %r14
je 0x3528b
xorps %xmm0, %xmm0
testq %rbx, %rbx
je 0x35292
movss 0x200(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x35273
addss 0x1a025(%rip), %xmm1    # 0x4f290
movss %xmm1, 0x200(%rbx)
movq 0x2c8(%rbx), %rbx
jmp 0x35251
movq %rbx, %rdi
callq 0x18660
movq 0x2c8(%rbx), %rbx
testq %rbx, %rbx
jne 0x3527c
jmp 0x352ad
movq 0x218(%r14), %rax
testq %rax, %rax
je 0x352ad
movq 0x315d3(%rip), %rcx     # 0x66878
movq (%rcx), %rsi
movq %r14, %rdi
callq *%rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq