// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_main.c
// Function: G_RunFrame
void G_RunFrame (void)
{
	int		i;
	edict_t	*ent;

	// CTF CODE -- LM_JORM
	int			score;
	edict_t		*cl_ent;

	// Paril
	if (GamePaused())
	{
		ClientEndServerFrames();
		return;
	}
	// Paril

	bluescore = 0; 
	redscore = 0;  

	if ((int)(skinset->value) > 3)
		gi.cvar_set("skinset", va("%d", 3));

	for (i=0 ; i<game.maxclients ; i++)
	{
		cl_ent = g_edicts + 1 + i;
		if (!cl_ent->inuse)
			continue;
		score = stats_get(cl_ent, STATS_SCORE);

		if (cl_ent->client->ctf.teamnum == CTF_TEAM_RED) // RED TEAM
		{
			redscore += score;
		}
		else if (cl_ent->client->ctf.teamnum == CTF_TEAM_BLUE) // BLUE TEAM
		{
			bluescore += score;
		}
	}
	// END CTF CODE -- LM_JORM


	level.framenum++;
	level.time = level.framenum*FRAMETIME;

	// choose a client for monsters to target this frame
	//no monsters
	//bat
#ifdef MONSTERS_OK
	AI_SetSightClient ();
#endif

	// exit intermissions

	if (level.exitintermission)
	{
		ExitLevel ();
		return;
	}

	//
	// treat each object in turn
	// even the world gets a chance to think
	//
	ent = &g_edicts[0];
	for (i=0 ; i<globals.num_edicts ; i++, ent++)
	{
		if (!ent->inuse)
			continue;

		level.current_entity = ent;

		VectorCopy (ent->s.origin, ent->s.old_origin);

		// if the ground entity moved, make sure we are still on it
		if ((ent->groundentity) && (ent->groundentity->linkcount != ent->groundentity_linkcount))
		{
			ent->groundentity = NULL;
#ifdef MONSTERS_OK
			if ( !(ent->flags & (FL_SWIM|FL_FLY)) && (ent->svflags & SVF_MONSTER) )
			{
				M_CheckGround (ent);
			}
#endif
		}

		if (i > 0 && i <= maxclients->value)
		{
			ClientBeginServerFrame (ent);
			continue;
		}

		G_RunEntity (ent);
	}

	// see if it is time to end a deathmatch
	CheckDMRules ();

	// build the playerstate_t structures for all players
	ClientEndServerFrames ();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb $0x0, %al
callq 0x18160
cmpl $0x0, %eax
je 0x3da1e
callq 0x19130
jmp 0x3dca1
movq 0x45023(%rip), %rax     # 0x82a48
movl $0x0, (%rax)
movq 0x451a6(%rip), %rax     # 0x82bd8
movl $0x0, (%rax)
movq 0x44eb9(%rip), %rax     # 0x828f8
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
cmpl $0x3, %eax
jle 0x3da81
movq 0x44bad(%rip), %rax     # 0x82600
movq 0x128(%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0x31e11(%rip), %rdi     # 0x6f876
movl $0x3, %esi
movb $0x0, %al
callq 0x19560
movq %rax, %rsi
movq -0x28(%rbp), %rax
leaq 0x36732(%rip), %rdi     # 0x741b1
callq *%rax
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq 0x452ae(%rip), %rcx     # 0x82d40
cmpl 0x610(%rcx), %eax
jge 0x3db3d
movq 0x44ab3(%rip), %rax     # 0x82558
movq (%rax), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movslq -0x4(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x3dacc
jmp 0x3db2f
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x18030
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x1, 0x1100(%rax)
jne 0x3db05
movl -0x14(%rbp), %ecx
movq 0x450e0(%rip), %rax     # 0x82bd8
addl (%rax), %ecx
movq 0x450d7(%rip), %rax     # 0x82bd8
movl %ecx, (%rax)
jmp 0x3db2d
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x2, 0x1100(%rax)
jne 0x3db2b
movl -0x14(%rbp), %ecx
movq 0x44f28(%rip), %rax     # 0x82a48
addl (%rax), %ecx
movq 0x44f1f(%rip), %rax     # 0x82a48
movl %ecx, (%rax)
jmp 0x3db2d
jmp 0x3db2f
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3da88
movq 0x4525c(%rip), %rax     # 0x82da0
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x45250(%rip), %rax     # 0x82da0
movl %ecx, (%rax)
movq 0x45247(%rip), %rax     # 0x82da0
cvtsi2ssl (%rax), %xmm0
movss 0x3272f(%rip), %xmm1    # 0x70294
mulss %xmm1, %xmm0
movq 0x45230(%rip), %rax     # 0x82da0
movss %xmm0, 0x4(%rax)
movq 0x45224(%rip), %rax     # 0x82da0
cmpl $0x0, 0xd8(%rax)
je 0x3db8f
callq 0x193d0
jmp 0x3dca1
movq 0x449c2(%rip), %rax     # 0x82558
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq 0x44f5a(%rip), %rcx     # 0x82b08
cmpl 0x8c(%rcx), %eax
jge 0x3dc97
movq -0x10(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x3dbc9
jmp 0x3dc7b
movq -0x10(%rbp), %rcx
movq 0x451cc(%rip), %rax     # 0x82da0
movq %rcx, 0x148(%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x20(%rax)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x24(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2b8(%rax)
je 0x3dc48
movq -0x10(%rbp), %rax
movq 0x2b8(%rax), %rax
movl 0x64(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c0(%rcx), %eax
je 0x3dc48
movq -0x10(%rbp), %rax
movq $0x0, 0x2b8(%rax)
cmpl $0x0, -0x4(%rbp)
jle 0x3dc72
cvtsi2ssl -0x4(%rbp), %xmm1
movq 0x448d6(%rip), %rax     # 0x82530
movq (%rax), %rax
movss 0x20(%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x3dc72
movq -0x10(%rbp), %rdi
callq 0x19220
jmp 0x3dc7b
movq -0x10(%rbp), %rdi
callq 0x18d30
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movq -0x10(%rbp), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movq %rax, -0x10(%rbp)
jmp 0x3dba4
callq 0x18840
callq 0x19130
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)