// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/q_shared.c
// Function: COM_Parse
char* COM_Parse(char** data_p)
{
	int         c;
	int         len;
	char* data;
	char* s = com_token[com_tokidx++ & 3];

	data = *data_p;
	len = 0;
	s[0] = 0;

	if (!data) {
		*data_p = NULL;
		return s;
	}

	// skip whitespace
skipwhite:
	while ((c = *data) <= ' ') {
		if (c == 0) {
			*data_p = NULL;
			return s;
		}
		data++;
	}

	// skip // comments
	if (c == '/' && data[1] == '/') {
		data += 2;
		while (*data && *data != '\n')
			data++;
		goto skipwhite;
	}

	// skip /* */ comments
	if (c == '/' && data[1] == '*') {
		data += 2;
		while (*data) {
			if (data[0] == '*' && data[1] == '/') {
				data += 2;
				break;
			}
			data++;
		}
		goto skipwhite;
	}

	// handle quoted strings specially
	if (c == '\"') {
		data++;
		while (1) {
			c = *data++;
			if (c == '\"' || !c) {
				goto finish;
			}

			if (len < MAX_TOKEN_CHARS - 1) {
				s[len++] = c;
			}
		}
	}

	// parse a regular word
	do {
		if (len < MAX_TOKEN_CHARS - 1) {
			s[len++] = c;
		}
		data++;
		c = *data;
	} while (c > 32);

finish:
	s[len] = 0;

	*data_p = data;
	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl 0x458b2(%rip), %eax     # 0xb38a0
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x458a7(%rip)     # 0xb38a0
andl $0x3, %eax
movslq %eax, %rcx
leaq 0x4569a(%rip), %rax     # 0xb36a0
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x20(%rbp)
jne 0x6e049
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6e1fc
jmp 0x6e04b
jmp 0x6e04d
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x20, %eax
jg 0x6e088
cmpl $0x0, -0x14(%rbp)
jne 0x6e07a
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6e1fc
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6e04d
cmpl $0x2f, -0x14(%rbp)
jne 0x6e0e4
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x6e0e4
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x6e0c8
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x6e0d1
jmp 0x6e0df
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6e0a7
jmp 0x6e04b
cmpl $0x2f, -0x14(%rbp)
jne 0x6e146
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2a, %eax
jne 0x6e146
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6e141
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x6e133
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x6e133
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
jmp 0x6e141
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6e103
jmp 0x6e04b
cmpl $0x22, -0x14(%rbp)
jne 0x6e19d
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movsbl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x22, -0x14(%rbp)
je 0x6e179
cmpl $0x0, -0x14(%rbp)
jne 0x6e17b
jmp 0x6e1dd
cmpl $0x7f, -0x18(%rbp)
jge 0x6e19b
movl -0x14(%rbp), %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x18(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x6e158
jmp 0x6e19f
cmpl $0x7f, -0x18(%rbp)
jge 0x6e1bf
movl -0x14(%rbp), %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x18(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jg 0x6e19f
jmp 0x6e1dd
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)