// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
cmpb $0x0, (%r14)
jne 0x376f
movq %rbx, %rdi
callq 0x3514
testl %eax, %eax
je 0x38b4
movq 0x20(%rbx), %r14
cmpl $0x0, 0x8(%rbx)
je 0x3795
leaq 0x2(%r14), %r15
movzbl -0x2(%r15), %eax
cmpl $0x2a, %eax
je 0x3789
testl %eax, %eax
jne 0x3790
jmp 0x37ce
cmpb $0x2f, -0x1(%r15)
je 0x37da
incq %r15
jmp 0x3779
movb (%r14), %bpl
testb %bpl, %bpl
je 0x37fd
callq 0x2360
movq (%rax), %rax
addq $0x2, %r14
movq %r14, %r15
movsbq %bpl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x3801
movb -0x1(%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x37ac
addq $-0x2, %r15
xorl %ebp, %ebp
movq %r15, %r14
jmp 0x3849
addq $-0x2, %r15
movq %r15, %r14
jmp 0x3755
movq %r15, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22c0
movl $0x0, 0x8(%rbx)
jmp 0x3755
xorl %ebp, %ebp
jmp 0x3849
leaq -0x2(%r15), %r14
cmpb $0x2f, %bpl
jne 0x3849
movzbl -0x1(%r15), %eax
cmpl $0x2a, %eax
je 0x3823
cmpl $0x2f, %eax
jne 0x3846
movb $0x0, (%r14)
jmp 0x3755
movq %r15, %rdi
callq 0x2120
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22c0
movl $0x1, 0x8(%rbx)
jmp 0x3755
movb $0x2f, %bpl
movsbl %bpl, %edi
callq 0x3704
testl %eax, %eax
jne 0x38c2
testb %bpl, %bpl
je 0x3755
movzbl %bpl, %eax
cmpl $0x22, %eax
jne 0x38f8
xorl %eax, %eax
leaq 0x1(%r14), %r15
movzbl 0x1(%r14), %ecx
cmpl $0x22, %ecx
je 0x3885
testl %ecx, %ecx
jne 0x3890
jmp 0x395c
cmpb $0x22, 0x2(%r14)
jne 0x395c
xorl %edx, %edx
cmpb $0x22, %cl
sete %cl
jne 0x389e
leaq 0x2(%r14), %r15
movb %cl, %dl
movb 0x1(%rdx,%r14), %cl
movq 0x30(%rbx), %rdx
movb %cl, (%rdx,%rax)
incq %rax
movq %r15, %r14
jmp 0x386e
movq 0x30(%rbx), %rax
movb $0x0, (%rax)
xorl %eax, %eax
jmp 0x398f
testb %bpl, %bpl
je 0x3975
xorl %r15d, %r15d
movsbl %bpl, %edi
callq 0x3704
testl %eax, %eax
je 0x38f0
movq 0x30(%rbx), %rax
movb %bpl, (%rax,%r15)
movb 0x1(%r14,%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x38ce
addq %r15, %r14
movl %r15d, %eax
jmp 0x3977
leaq 0x1(%r14), %r15
movq 0x30(%rbx), %rax
movb %bpl, (%rax)
movq 0x30(%rbx), %rax
movb $0x0, 0x1(%rax)
movsbl 0x1(%r14), %ebp
testl %ebp, %ebp
je 0x3982
movsbl (%r14), %esi
leaq 0xd828(%rip), %rdi      # 0x11147
movl $0xb, %edx
callq 0x21c0
testq %rax, %rax
je 0x3982
leaq 0xd812(%rip), %rdi      # 0x11147
movl $0xb, %edx
movl %ebp, %esi
callq 0x21c0
testq %rax, %rax
je 0x3982
addq $0x2, %r14
movq 0x30(%rbx), %rax
movb %bpl, 0x1(%rax)
movq 0x30(%rbx), %rax
movb $0x0, 0x2(%rax)
jmp 0x397f
movq 0x30(%rbx), %rcx
movl %eax, %eax
movb $0x0, (%rcx,%rax)
leaq 0x2(%r14), %rax
cmpb $0x22, 0x1(%r14)
cmoveq %rax, %r15
jmp 0x3982
xorl %eax, %eax
movq 0x30(%rbx), %rcx
movb $0x0, (%rcx,%rax)
movq %r14, %r15
movq %r15, 0x20(%rbx)
orb $0x2, 0x11(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq