// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/m_move.c
// Function: SV_movestep
qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
{
	float		dz;
	vec3_t		oldorg, neworg, end;
	trace_t		trace;
	int			i;
	float		stepsize;
	vec3_t		test;
	int			contents;

// try the move	
	VectorCopy (ent->s.origin, oldorg);
	VectorAdd (ent->s.origin, move, neworg);

// flying monsters don't step up
	if ( ent->flags & (FL_SWIM | FL_FLY) )
	{
	// try one move with vertical motion, then one without
		for (i=0 ; i<2 ; i++)
		{
			VectorAdd (ent->s.origin, move, neworg);
			if (i == 0 && ent->enemy)
			{
				if (!ent->goalentity)
					ent->goalentity = ent->enemy;
				dz = ent->s.origin[2] - ent->goalentity->s.origin[2];
				if (ent->goalentity->client)
				{
					if (dz > 40)
						neworg[2] -= 8;
					if (!((ent->flags & FL_SWIM) && (ent->waterlevel < 2)))
						if (dz < 30)
							neworg[2] += 8;
				}
				else
				{
					if (dz > 8)
						neworg[2] -= 8;
					else if (dz > 0)
						neworg[2] -= dz;
					else if (dz < -8)
						neworg[2] += 8;
					else
						neworg[2] += dz;
				}
			}
			trace = gi.trace (ent->s.origin, ent->mins, ent->maxs, neworg, ent, MASK_MONSTERSOLID);
	
			// fly monsters don't enter water voluntarily
			if (ent->flags & FL_FLY)
			{
				if (!ent->waterlevel)
				{
					test[0] = trace.endpos[0];
					test[1] = trace.endpos[1];
					test[2] = trace.endpos[2] + ent->mins[2] + 1;
					contents = gi.pointcontents(test);
					if (contents & MASK_WATER)
						return false;
				}
			}

			// swim monsters don't exit water voluntarily
			if (ent->flags & FL_SWIM)
			{
				if (ent->waterlevel < 2)
				{
					test[0] = trace.endpos[0];
					test[1] = trace.endpos[1];
					test[2] = trace.endpos[2] + ent->mins[2] + 1;
					contents = gi.pointcontents(test);
					if (!(contents & MASK_WATER))
						return false;
				}
			}

			if (trace.fraction == 1)
			{
				VectorCopy (trace.endpos, ent->s.origin);
				if (relink)
				{
					gi.linkentity (ent);
					G_TouchTriggers (ent);
				}
				return true;
			}
			
			if (!ent->enemy)
				break;
		}
		
		return false;
	}

// push down from a step height above the wished position
	if (!(ent->monsterinfo.aiflags & AI_NOSTEP))
		stepsize = STEPSIZE;
	else
		stepsize = 1;

	neworg[2] += stepsize;
	VectorCopy (neworg, end);
	end[2] -= stepsize*2;

	trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);

	if (trace.allsolid)
		return false;

	if (trace.startsolid)
	{
		neworg[2] -= stepsize;
		trace = gi.trace (neworg, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID);
		if (trace.allsolid || trace.startsolid)
			return false;
	}


	// don't go in to water
	if (ent->waterlevel == 0)
	{
		test[0] = trace.endpos[0];
		test[1] = trace.endpos[1];
		test[2] = trace.endpos[2] + ent->mins[2] + 1;	
		contents = gi.pointcontents(test);

		if (contents & MASK_WATER)
			return false;
	}

	if (trace.fraction == 1)
	{
	// if monster had the ground pulled out, go ahead and fall
		if ( ent->flags & FL_PARTIALGROUND )
		{
			VectorAdd (ent->s.origin, move, ent->s.origin);
			if (relink)
			{
				gi.linkentity (ent);
				G_TouchTriggers (ent);
			}
			ent->groundentity = NULL;
			return true;
		}
	
		return false;		// walked off an edge
	}

// check point traces down for dangling corners
	VectorCopy (trace.endpos, ent->s.origin);
	
	if (!M_CheckBottom (ent))
	{
		if ( ent->flags & FL_PARTIALGROUND )
		{	// entity had floor mostly pulled out from underneath it
			// and is trying to correct
			if (relink)
			{
				gi.linkentity (ent);
				G_TouchTriggers (ent);
			}
			return true;
		}
		VectorCopy (oldorg, ent->s.origin);
		return false;
	}

	if ( ent->flags & FL_PARTIALGROUND )
	{
		ent->flags &= ~FL_PARTIALGROUND;
	}
	ent->groundentity = trace.ent;
	ent->groundentity_linkcount = trace.ent->linkcount;

// the move is ok
	if (relink)
	{
		gi.linkentity (ent);
		G_TouchTriggers (ent);
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
addss (%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x4(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x8(%rax), %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x553e3
movl $0x0, -0x94(%rbp)
cmpl $0x2, -0x94(%rbp)
jge 0x553d7
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
addss (%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x4(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x8(%rax), %xmm0
movss %xmm0, -0x30(%rbp)
cmpl $0x0, -0x94(%rbp)
jne 0x551ab
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x551ab
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1e8(%rax)
jne 0x55088
movq -0x10(%rbp), %rax
movq 0x2a0(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1e8(%rax)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
movq 0x1e8(%rax), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x1e8(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x55126
movss -0x20(%rbp), %xmm0
movss 0x1bc5b(%rip), %xmm1    # 0x70d20
ucomiss %xmm1, %xmm0
jbe 0x550e0
movss -0x30(%rbp), %xmm0
movss 0x1ae25(%rip), %xmm1    # 0x6fefc
subss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x550ff
movq -0x10(%rbp), %rax
cmpl $0x2, 0x30c(%rax)
jl 0x55121
movss 0x1b189(%rip), %xmm0    # 0x70290
ucomiss -0x20(%rbp), %xmm0
jbe 0x5511f
movss 0x1ade7(%rip), %xmm0    # 0x6fefc
addss -0x30(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
jmp 0x55121
jmp 0x551a9
movss -0x20(%rbp), %xmm0
movss 0x1adc9(%rip), %xmm1    # 0x6fefc
ucomiss %xmm1, %xmm0
jbe 0x55150
movss -0x30(%rbp), %xmm0
movss 0x1adb7(%rip), %xmm1    # 0x6fefc
subss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
jmp 0x551a7
movss -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x55172
movss -0x20(%rbp), %xmm1
movss -0x30(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
jmp 0x551a5
movss 0x1c296(%rip), %xmm0    # 0x71410
ucomiss -0x20(%rbp), %xmm0
jbe 0x55194
movss 0x1ad74(%rip), %xmm0    # 0x6fefc
addss -0x30(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
jmp 0x551a3
movss -0x20(%rbp), %xmm0
addss -0x30(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
jmp 0x551a5
jmp 0x551a7
jmp 0x551a9
jmp 0x551ab
movq 0x2d44e(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movq -0x10(%rbp), %rdx
addq $0xcc, %rdx
movq -0x10(%rbp), %rcx
addq $0xd8, %rcx
leaq -0x38(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0xf0(%rbp), %rdi
movl $0x2020003, (%rsp)      # imm = 0x2020003
callq *%rax
leaq -0x90(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x552a1
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30c(%rax)
jne 0x5529f
movss -0x84(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0x80(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0x7c(%rbp), %xmm0
movq -0x10(%rbp), %rax
addss 0xd4(%rax), %xmm0
movss 0x1ac8f(%rip), %xmm1    # 0x6feec
addss %xmm1, %xmm0
movss %xmm0, -0x9c(%rbp)
movq 0x2d390(%rip), %rax     # 0x82600
movq 0x68(%rax), %rax
leaq -0xa4(%rbp), %rdi
callq *%rax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
andl $0x38, %eax
cmpl $0x0, %eax
je 0x5529d
movl $0x0, -0x4(%rbp)
jmp 0x557ed
jmp 0x5529f
jmp 0x552a1
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x5533e
movq -0x10(%rbp), %rax
cmpl $0x2, 0x30c(%rax)
jge 0x5533c
movss -0x84(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0x80(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0x7c(%rbp), %xmm0
movq -0x10(%rbp), %rax
addss 0xd4(%rax), %xmm0
movss 0x1abf2(%rip), %xmm1    # 0x6feec
addss %xmm1, %xmm0
movss %xmm0, -0x9c(%rbp)
movq 0x2d2f3(%rip), %rax     # 0x82600
movq 0x68(%rax), %rax
leaq -0xa4(%rbp), %rdi
callq *%rax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
andl $0x38, %eax
cmpl $0x0, %eax
jne 0x5533a
movl $0x0, -0x4(%rbp)
jmp 0x557ed
jmp 0x5533c
jmp 0x5533e
movss -0x88(%rbp), %xmm0
movss 0x1ab9e(%rip), %xmm1    # 0x6feec
ucomiss %xmm1, %xmm0
jne 0x553b1
jp 0x553b1
movss -0x84(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x80(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x7c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x553a5
movq 0x2d271(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x193f0
movl $0x1, -0x4(%rbp)
jmp 0x557ed
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2a0(%rax)
jne 0x553c1
jmp 0x553d7
jmp 0x553c3
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x54ff4
movl $0x0, -0x4(%rbp)
jmp 0x557ed
movq -0x10(%rbp), %rax
movl 0x3c0(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x55409
movss 0x20fdd(%rip), %xmm0    # 0x763dc
movss %xmm0, -0x98(%rbp)
jmp 0x55419
movss 0x1aadb(%rip), %xmm0    # 0x6feec
movss %xmm0, -0x98(%rbp)
movss -0x98(%rbp), %xmm0
addss -0x30(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x38(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x34(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x98(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movq 0x2d189(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0xcc, %rdx
movq -0x10(%rbp), %rcx
addq $0xd8, %rcx
leaq -0x44(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0x138(%rbp), %rdi
movl $0x2020003, (%rsp)      # imm = 0x2020003
callq *%rax
leaq -0x90(%rbp), %rdi
leaq -0x138(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
cmpl $0x0, -0x90(%rbp)
je 0x554da
movl $0x0, -0x4(%rbp)
jmp 0x557ed
cmpl $0x0, -0x8c(%rbp)
je 0x55572
movss -0x98(%rbp), %xmm1
movss -0x30(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movq 0x2d0fc(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0xcc, %rdx
movq -0x10(%rbp), %rcx
addq $0xd8, %rcx
leaq -0x44(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0x180(%rbp), %rdi
movl $0x2020003, (%rsp)      # imm = 0x2020003
callq *%rax
leaq -0x90(%rbp), %rdi
leaq -0x180(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
cmpl $0x0, -0x90(%rbp)
jne 0x55564
cmpl $0x0, -0x8c(%rbp)
je 0x55570
movl $0x0, -0x4(%rbp)
jmp 0x557ed
jmp 0x55572
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30c(%rax)
jne 0x555f7
movss -0x84(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0x80(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0x7c(%rbp), %xmm0
movq -0x10(%rbp), %rax
addss 0xd4(%rax), %xmm0
movss 0x1a937(%rip), %xmm1    # 0x6feec
addss %xmm1, %xmm0
movss %xmm0, -0x9c(%rbp)
movq 0x2d038(%rip), %rax     # 0x82600
movq 0x68(%rax), %rax
leaq -0xa4(%rbp), %rdi
callq *%rax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
andl $0x38, %eax
cmpl $0x0, %eax
je 0x555f5
movl $0x0, -0x4(%rbp)
jmp 0x557ed
jmp 0x555f7
movss -0x88(%rbp), %xmm0
movss 0x1a8e5(%rip), %xmm1    # 0x6feec
ucomiss %xmm1, %xmm0
jne 0x556c8
jp 0x556c8
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x556bc
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
addss (%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x18(%rbp), %rax
addss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x556a1
movq 0x2cf75(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x193f0
movq -0x10(%rbp), %rax
movq $0x0, 0x2b8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x557ed
movl $0x0, -0x4(%rbp)
jmp 0x557ed
movss -0x84(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x80(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x7c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x10(%rbp), %rdi
callq 0x19300
cmpl $0x0, %eax
jne 0x55779
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x55746
cmpl $0x0, -0x1c(%rbp)
je 0x5573a
movq 0x2cedc(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x193f0
movl $0x1, -0x4(%rbp)
jmp 0x557ed
movss -0x2c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x24(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x557ed
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x557a3
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %ecx
andl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
movl %ecx, 0x11c(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x2b8(%rax)
movq -0x50(%rbp), %rax
movl 0x64(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c0(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x557e6
movq 0x2ce30(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x193f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopl (%rax)