// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_ctffunc.c
// Function: ctf_SafePrint
void ctf_SafePrint(edict_t * ent, long print_priority, char * buf)
{
	long i;
	size_t printsize;
	char *cptr = NULL;
	char tempbuf[MAX_INFO_STRING];

	if (!ctf_validateplayer(ent, CTF_TEAM_IGNORETEAM))
		return;

	if (buf != NULL) //this is a queue request
	{
		ent->client->ctf.printready = true;
		printsize = strlen(ent->client->ctf.printdata[print_priority]);
		if ( printsize < (MAX_PRINT_BUF - 2048) )
			strncat(ent->client->ctf.printdata[print_priority], buf, 2000);
	}
	else
	{
		ent->client->ctf.printready = false;
		for (i=PRINT_LOW; i<=PRINT_CHAT; i++)
		{
			printsize = strlen(ent->client->ctf.printdata[i]);
			if (printsize <= 0)
				continue;
			else if (printsize < 50) //print it all
			{
				gi.cprintf(ent, i, "%s", ent->client->ctf.printdata[i]);
				strcpy(ent->client->ctf.printdata[i], "");
				ent->client->ctf.printready = true;
			}
			else
			{
				//just print up to the nearest return
				cptr = strchr(&ent->client->ctf.printdata[i][1], '\n');
				cptr++; //include the return
				memset(tempbuf, 0, 250);
				strncpy(tempbuf, ent->client->ctf.printdata[i], (long) (cptr - ent->client->ctf.printdata[i]) );
				strcpy(ent->client->ctf.printdata[i], cptr);
				gi.cprintf(ent, i, "%s", tempbuf);
				ent->client->ctf.printready = true;
			}
		}
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x18e40
cmpl $0x0, %eax
jne 0x24e87
jmp 0x250fc
cmpq $0x0, -0x18(%rbp)
je 0x24f02
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0x911c(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x10(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
callq 0x186e0
movq %rax, -0x28(%rbp)
cmpq $0x1800, -0x28(%rbp)    # imm = 0x1800
jae 0x24efd
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x10(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl $0x7d0, %edx            # imm = 0x7D0
callq 0x18970
jmp 0x250fa
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0x911c(%rax)
movq $0x0, -0x20(%rbp)
cmpq $0x3, -0x20(%rbp)
jg 0x250f8
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
callq 0x186e0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
ja 0x24f5a
jmp 0x250e7
cmpq $0x32, -0x28(%rbp)
jae 0x24fe5
movq 0x5d694(%rip), %rax     # 0x82600
movq 0x10(%rax), %r8
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0x1100, %rcx           # imm = 0x1100
addq $0x1c, %rcx
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rcx
leaq 0x4a9fe(%rip), %rdx     # 0x6f99d
movb $0x0, %al
callq *%r8
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
leaq 0x4bfb7(%rip), %rsi     # 0x70f80
callq 0x182c0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0x911c(%rax)
jmp 0x250e3
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
addq $0x1, %rdi
movl $0xa, %esi
callq 0x187a0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
movl $0xfa, %edx
callq 0x188f0
leaq -0x230(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0x1100, %rsi           # imm = 0x1100
addq $0x1c, %rsi
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
addq $0x1100, %rax           # imm = 0x1100
addq $0x1c, %rax
movq -0x20(%rbp), %rcx
shlq $0xd, %rcx
addq %rcx, %rax
subq %rax, %rdx
callq 0x181e0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
addq $0x1100, %rdi           # imm = 0x1100
addq $0x1c, %rdi
movq -0x20(%rbp), %rax
shlq $0xd, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x182c0
movq 0x5d550(%rip), %rax     # 0x82600
movq 0x10(%rax), %r8
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
leaq -0x230(%rbp), %rcx
leaq 0x4a8d1(%rip), %rdx     # 0x6f99d
movb $0x0, %al
callq *%r8
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0x911c(%rax)
jmp 0x250e5
jmp 0x250e7
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x24f1c
jmp 0x250fa
jmp 0x250fc
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)