// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Kick_f
void Cmd_Kick_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: kick <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 kick them.\n", target->client->pers.netname);
		ctf_SafePrint(ent, PRINT_HIGH, message);
	}

	// 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 kick them.\n", target->client->pers.netname);
		ctf_SafePrint(ent, PRINT_HIGH, message);
	}

	sprintf(message, "%s was kicked 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, "disconnect\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 0x2ff37
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x41dc6(%rip), %rdx     # 0x71cf3
callq 0x18f20
jmp 0x3011c
movq 0x526c2(%rip), %rax     # 0x82600
callq *0x148(%rax)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x3fe5c(%rip), %rsi     # 0x6fdaf
leaq -0x10(%rbp), %rdx
movb $0x0, %al
callq 0x19180
cmpl $0x0, %eax
jne 0x2ff7d
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x423b9(%rip), %rdx     # 0x7232c
callq 0x18f20
jmp 0x3011c
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 0x2ffce
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x9120(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x2ffb6
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 0x2ff92
cmpq $0x0, -0x20(%rbp)
jne 0x2ffef
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0x42240(%rip), %rdx     # 0x72225
callq 0x18f20
jmp 0x3011c
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3005b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x3005b
leaq -0x230(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
leaq 0x4232a(%rip), %rsi     # 0x72369
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x230(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1108(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x300b1
leaq -0x230(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
leaq 0x422fd(%rip), %rsi     # 0x72392
movb $0x0, %al
callq 0x19940
movq -0x8(%rbp), %rdi
leaq -0x230(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
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 0x422ce(%rip), %rsi     # 0x723b9
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 0x422b8(%rip), %rsi     # 0x723cf
callq 0x18d80
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)