// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_ResetFlagProps
void ctf_ResetFlagProps(edict_t * whichflag)
{
	float		*v;
	trace_t		tr;
	vec3_t		dest;

	if (whichflag->owner)
	{
		whichflag->s.modelindex = whichflag->owner->s.modelindex3; // Turn on model
	}
	if (whichflag->model)
		gi.setmodel (whichflag, whichflag->model);
	else
		gi.setmodel (whichflag, whichflag->item->world_model);
	
	v = tv(-15,-15,-15);
	VectorCopy (v, whichflag->mins);
	v = tv(15,15,33);
	VectorCopy (v, whichflag->maxs);
	
	whichflag->solid = SOLID_TRIGGER;
	gi.linkentity(whichflag); //we changed solidity

	whichflag->movetype = MOVETYPE_TOSS;
	whichflag->touch = Touch_Item; //this then calls the pickup function as a wrapper
	whichflag->owner = NULL;
	whichflag->droptime = 0;
	v = tv(0,0,-128);
	VectorAdd (whichflag->s.origin, v, dest);
	
	tr = gi.trace (whichflag->s.origin, whichflag->mins, whichflag->maxs, dest, whichflag, MASK_SOLID);
	
	VectorCopy (tr.endpos, whichflag->s.origin);
	VectorClear (whichflag->s.angles);
	
	//surt, a flag caught moving can land off the pedastal if you don't clear the velocity
	VectorClear(whichflag->velocity);
	whichflag->flags |= FL_RESPAWN;
	
	whichflag->nextthink = level.time + FRAMETIME;	
	whichflag->think = ctf_flagwave;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x110(%rax)
je 0x229f2
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rax
movl 0x30(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x120(%rax)
je 0x22a1e
movq 0x5fbf9(%rip), %rax     # 0x82600
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x120(%rcx), %rsi
callq *%rax
jmp 0x22a3e
movq 0x5fbdb(%rip), %rax     # 0x82600
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x330(%rcx), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movss 0x4d856(%rip), %xmm2    # 0x7029c
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x19740
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xcc(%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd0(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd4(%rax)
movss 0x4d7fd(%rip), %xmm1    # 0x70298
movss 0x4d9d9(%rip), %xmm2    # 0x7047c
movaps %xmm1, %xmm0
callq 0x19740
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xd8(%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xdc(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x108(%rax)
movq 0x5fafe(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq -0x8(%rbp), %rax
movl $0x7, 0x118(%rax)
movq -0x8(%rbp), %rax
movq 0x5fd58(%rip), %rcx     # 0x82880
movq %rcx, 0x220(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x110(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x4a0(%rax)
xorps %xmm1, %xmm1
movss 0x4d920(%rip), %xmm2    # 0x70478
movaps %xmm1, %xmm0
callq 0x19740
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
addss (%rax), %xmm0
movss %xmm0, -0x64(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0x4(%rax), %xmm0
movss %xmm0, -0x60(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0x8(%rax), %xmm0
movss %xmm0, -0x5c(%rbp)
movq 0x5fa51(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movq -0x8(%rbp), %rdx
addq $0xcc, %rdx
movq -0x8(%rbp), %rcx
addq $0xd8, %rcx
leaq -0x64(%rbp), %r8
movq -0x8(%rbp), %r9
leaq -0xb0(%rbp), %rdi
movl $0x3, (%rsp)
callq *%rax
leaq -0x58(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
movss -0x4c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x48(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x44(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
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)
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x11c(%rax)
movss 0x4d5fd(%rip), %xmm0    # 0x70294
movq 0x60102(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq -0x8(%rbp), %rax
movq 0x5f906(%rip), %rcx     # 0x825c0
movq %rcx, 0x210(%rax)
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)