// File: corecodec[P]coremake/coremake.c
// Function: reader_read
int reader_read(reader* p)
{
	char* s = p->pos;
	for (;;)
	{
		if (!*s)
		{
			if (!reader_line(p))
			{
				p->token[0] = 0;
				return 0;
			}
			s = p->pos;
		}

		if (p->r.comment)
		{
			char* s0 = s;
			for (;*s;++s)
				if (s[0]=='*' && s[1]=='/')
				{
					s = strdel(s0,s+2);
					p->r.comment = 0;
					break;
				}
		}
		else
		{
			while (*s && isspace(*s))
				++s;

			if (s[0]=='/' && s[1]=='*')
			{
				s = strdel(s,s+2);
				p->r.comment = 1;
			}
			else
			if (s[0]=='/' && s[1]=='/')
				*s = 0;
			else
			if (isname(*s))
			{
				int i;
				for (i=0;*s && isname(*s);++s,++i)
					p->token[i] = *s;
				p->token[i] = 0;
				break;
			}
			else
			if (*s=='"')
			{
				int i;
				++s;
				for (i=0;*s && (s[0]!='"' || s[1]=='"');++s,++i)
                {
                    if (s[0]=='"')
                        ++s;
					p->token[i] = *s;
                }
				p->token[i] = 0;
				if (*s=='"')
					++s;
				break;
			}
			else
			if (*s)
			{
				p->token[0] = *(s++);
				p->token[1] = 0;

				if (*s && iscond(s[-1]) && iscond(*s))
				{
					p->token[1] = *(s++);
					p->token[2] = 0;
				}
				break;
			}
		}
	}

	p->pos = s;
	p->r.flags |= FLAG_READY;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x4292
movq -0x10(%rbp), %rdi
callq 0x3e50
cmpl $0x0, %eax
jne 0x4286
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x45ce
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x42fd
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x42f8
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x42e8
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x42e8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x3fe0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x42f8
jmp 0x42ea
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x42a4
jmp 0x45a6
jmp 0x42ff
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x4334
callq 0x2350
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x433d
jmp 0x434b
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x42ff
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x4389
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2a, %eax
jne 0x4389
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x3fe0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0x45a4
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x43ae
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x43ae
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
jmp 0x45a2
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4190
cmpl $0x0, %eax
je 0x4436
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2a(%rbp)
je 0x43ec
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4190
cmpl $0x0, %eax
setne %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x43f5
jmp 0x4421
movq -0x18(%rbp), %rax
movb (%rax), %dl
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x43c6
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x45ab
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x450f
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2b(%rbp)
je 0x4492
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x22, %ecx
movb %al, -0x2c(%rbp)
jne 0x448c
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x22, %eax
sete %al
movb %al, -0x2c(%rbp)
movb -0x2c(%rbp), %al
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %al
testb $0x1, %al
jne 0x449b
jmp 0x44e2
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x44b3
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb (%rax), %dl
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4459
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x450a
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x45ab
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x459c
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movb $0x0, 0x1(%rax)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x459a
movq -0x18(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x4160
cmpl $0x0, %eax
je 0x459a
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4160
cmpl $0x0, %eax
je 0x459a
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movb %cl, 0x1(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movb $0x0, 0x2(%rax)
jmp 0x45ab
jmp 0x459e
jmp 0x45a0
jmp 0x45a2
jmp 0x45a4
jmp 0x45a6
jmp 0x4258
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)