// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Fobserve_f
void Cmd_Fobserve_f (edict_t *ent)
{
	unsigned long i=0;
	char *p;
	edict_t * target = NULL;
	edict_t * player = NULL;

	char message[MAX_INFO_STRING];

	if (!(ent->client->ctf.extra_flags & CTF_EXTRAFLAGS_REFEREE))
	{
		ctf_SafePrint(ent, PRINT_HIGH, "You are not a Referee\n");
		return;
	}

	p = gi.args();
	if (!sscanf(p, "%lu", &i))
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Usage: fobserve <number>\nUse \"users\" to list players by number.\n");
		return;
	}

	player = ctf_findplayer(NULL, NULL, CTF_TEAM_IGNORETEAM);
	while (player)
	{
		if (player->client->ctf.ctfid == i)
			target = player;

		player = ctf_findplayer(player, NULL, CTF_TEAM_IGNORETEAM);
	}

	if (!target)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Couldn't find that target number.\n");
		return;
	}

	// Can't kick a referee unless you are an rcon
	if (target->client->ctf.extra_flags & CTF_EXTRAFLAGS_REFEREE &&
		!(ent->client->ctf.extra_flags & CTF_EXTRAFLAGS_RCON))
	{
		sprintf(message, "%s is a referee.  You cannot force observer on them.\n", target->client->pers.netname);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}

	// Can't kick an rcon under any circumstances
	if (target->client->ctf.extra_flags & CTF_EXTRAFLAGS_RCON)
	{
		sprintf(message, "%s is an rcon.  You cannot force observer on them.\n", target->client->pers.netname);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}

	sprintf(message, "%s was forced to observe by %s.\n",
		target->client->pers.netname, ent->client->pers.netname);
	ctf_BSafePrint(PRINT_HIGH, message);
	// clear the kicked player's stats
	stats_clear(target);
	ForceCommand(target, "observe\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x2fc07
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x420f6(%rip), %rdx     # 0x71cf3
callq 0x18f20
jmp 0x2fdf3
movq 0x529f2(%rip), %rax     # 0x82600
callq *0x148(%rax)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x4018c(%rip), %rsi     # 0x6fdaf
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x19180
cmpl $0x0, %eax
jne 0x2fc4d
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x425a1(%rip), %rdx     # 0x721e4
callq 0x18f20
jmp 0x2fdf3
xorl %eax, %eax
movl %eax, %esi
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
movq %rsi, %rdi
callq 0x19340
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2fc9e
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x9120(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x2fc86
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
callq 0x19340
movq %rax, -0x28(%rbp)
jmp 0x2fc62
cmpq $0x0, -0x20(%rbp)
jne 0x2fcbf
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x42570(%rip), %rdx     # 0x72225
callq 0x18f20
jmp 0x2fdf3
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x2fd30
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x2fd30
leaq -0x230(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
leaq 0x42539(%rip), %rsi     # 0x72248
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x230(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2fdf3
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2fd88
leaq -0x230(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
leaq 0x42514(%rip), %rsi     # 0x7227e
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x230(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
jmp 0x2fdf3
leaq -0x230(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0xc0, %rcx
addq $0x200, %rcx            # imm = 0x200
leaq 0x424f0(%rip), %rsi     # 0x722b2
movb $0x0, %al
callq 0x19940
leaq -0x230(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x20(%rbp), %rdi
callq 0x19460
movq -0x20(%rbp), %rdi
leaq 0x424e5(%rip), %rsi     # 0x722d3
callq 0x18d80
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax)