// File: /workspace/github_cpp_makefile_star2_O3/iamlouk[P]asbi/src/tokenizer.cc
// Function: tok::Tokenizer::next()
Token Tokenizer::next() {
	if (tokbuffed) {
		tokbuffed = false;
		return tokbuf;
	}

	if (pos >= source.length())
		return Token(EOFTok, line);

	char c = source[pos];
	switch (c) {
	case '\n':
		line += 1;
	case ' ': case '\t': case '\v':
		pos++;
		return next();
	case '#':
		while (pos < source.length() && source[pos] != '\n') pos++;
		line++;
		pos++;
		return next();
	case '"':
	case '\'':
		return next_string(c);
	case '(':
		pos++;
		return Token(LeftBracket, line);
	case ')':
		pos++;
		return Token(RightBracket, line);
	case '{':
		pos++;
		return Token(LeftCurlyBracket, line);
	case '}':
		pos++;
		return Token(RightCurlyBracket, line);
	case '[':
		pos++;
		return Token(LeftSquareBracket, line);
	case ']':
		pos++;
		return Token(RightSquareBracket, line);
	case '-':
		pos++;
		if (pos < source.length() && source[pos] == '>') {
			pos++;
			return Token(Arrow, line);
		}
		return Token(Minus, line);
	case '+':
		pos++;
		return Token(Plus, line);
	case '*':
		pos++;
		return Token(Mul, line);
	case '/':
		pos++;
		if (pos < source.length() && source[pos] == '/') {
			while (pos < source.length() && source[pos] != '\n') pos++;
			line++;
			pos++;
			return next();
		}
		if (pos < source.length() && source[pos] == '*') {
			pos++;
			while (pos + 1 < source.length() && !(source[pos] == '*' && source[pos + 1] == '/')) {
				if (source[pos++] == '\n') {
					line++;
				}
			}
			pos += 2;
			return next();
		}
		return Token(Div, line);
	case '!':
		pos++;
		if (pos < source.length() && source[pos] == '=') {
			pos++;
			return Token(EqualsNot, line);
		}
		return Token(Not, line);
	case '=':
		pos++;
		if (pos < source.length() && source[pos] == '=') {
			pos++;
			return Token(Equals, line);
		}
		return Token(Assign, line);
	case '|':
		pos++;
		return Token(Or, line);
	case '&':
		pos++;
		return Token(And, line);
	case ',':
		pos++;
		return Token(Comma, line);
	case ':':
		pos++;
		if (pos < source.length() && source[pos] == '=') {
			pos++;
			return Token(Declare, line);
		}
		if (pos < source.length() && source[pos] == ':') {
			pos++;
			return Token(DoubleColon, line);
		}
		return Token(Colon, line);
	case '<':
		pos++;
		if (pos < source.length() && source[pos] == '=') {
			pos++;
			return Token(SmallerOrEqual, line);
		}
		return Token(Smaller, line);
	case '>':
		pos++;
		if (pos < source.length() && source[pos] == '=') {
			pos++;
			return Token(BiggerOrEqual, line);
		}
		return Token(Bigger, line);
	case ';':
		pos++;
		return Token(Semicolon, line);
	case '.':
		pos++;
		return Token(Dot, line);
	case '~':
		pos++;
		return Token(KeyValue, line);
	default:
		if ('0' <= c && c <= '9')
			return next_number();

		if (!is_identifier(c))
			throw utils::tokenizer_error("unkown char", line, source[pos]);

		std::string* str = new std::string("");
		while (pos < source.length()) {
			char c = source[pos];
			if (!is_identifier(c))
				break;

			*str += c;
			pos++;
		}

		auto mappos = keywords.find(*str);
		if (mappos == keywords.end()) {
			return Token(Identifier, str, line);
		} else {
			delete str;
			mappos->second.line = line;
			return mappos->second;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x28(%rdi)
jne 0x6a24
movb $0x0, 0x28(%rbx)
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %r14
movq %rax, %rcx
shrq $0x20, %rcx
jmp 0x6a78
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rdx
cmpq %rdx, %rax
jae 0x6a6d
movq (%rcx), %rcx
movzbl (%rcx,%rax), %esi
cmpl $0x5a, %esi
jg 0x6aaa
leal -0x9(%rsi), %edi
cmpl $0x35, %edi
ja 0x6d3d
leaq 0x1086d(%rip), %r8      # 0x172c0
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movsbl %sil, %esi
movq %rbx, %rdi
callq 0x66dc
jmp 0x6dc1
movl 0x8(%rbx), %ecx
movl $0x25, %eax
xorl %r14d, %r14d
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
incq %rax
movq %rax, (%rbx)
cmpq %rax, %rdx
je 0x6dad
cmpb $0xa, (%rcx,%rax)
jne 0x6a90
jmp 0x6db0
leal -0x7b(%rsi), %ecx
cmpl $0x3, %ecx
ja 0x6ad2
leaq 0x108df(%rip), %rdx     # 0x17398
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x19, %eax
jmp 0x6a75
cmpl $0x5b, %esi
je 0x6d2a
cmpl $0x5d, %esi
jne 0x6d3d
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x1c, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x20, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d93
movzbl (%rcx,%rsi), %ecx
cmpl $0x3a, %ecx
je 0x6ed0
cmpl $0x3d, %ecx
jne 0x6d93
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x7, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d52
cmpb $0x3d, (%rcx,%rsi)
jne 0x6d52
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x13, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x17, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6da0
movzbl (%rcx,%rsi), %edi
cmpl $0x2a, %edi
je 0x6ee4
cmpl $0x2f, %edi
jne 0x6da0
cmpb $0xa, (%rcx,%rsi)
je 0x6bbc
incq %rsi
movq %rsi, (%rbx)
cmpq %rsi, %rdx
jne 0x6ba8
movq %rdx, %rsi
incl 0x8(%rbx)
incq %rsi
jmp 0x6f25
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x16, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d5f
cmpb $0x3d, (%rcx,%rsi)
jne 0x6d5f
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0xf, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x1d, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0xa, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x18, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d6c
cmpb $0x3e, (%rcx,%rsi)
jne 0x6d6c
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0xc, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d79
cmpb $0x3d, (%rcx,%rsi)
jne 0x6d79
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0xe, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x1e, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x8, %eax
jmp 0x6a75
leaq 0x1(%rax), %rsi
movq %rsi, (%rbx)
cmpq %rdx, %rsi
jae 0x6d86
cmpb $0x3d, (%rcx,%rsi)
jne 0x6d86
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x12, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x1a, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0xd, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x15, %eax
jmp 0x6a75
incq %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x1b, %eax
jmp 0x6a75
leal -0x30(%rsi), %eax
cmpb $0x9, %al
ja 0x6dc9
movq %rbx, %rdi
callq 0x67f8
jmp 0x6dc1
movl 0x8(%rbx), %ecx
movl $0x11, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0x14, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0x9, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0x6, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0x10, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0x1f, %eax
jmp 0x6a75
movl 0x8(%rbx), %ecx
movl $0xb, %eax
jmp 0x6a75
movq %rdx, %rax
incl 0x8(%rbx)
incq %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x69fe
movq %rdx, %r14
jmp 0x6a1b
leal -0x24(%rsi), %eax
movabsq $0x800000010000001, %r15 # imm = 0x800000010000001
cmpl $0x3b, %eax
ja 0x6de1
btq %rax, %r15
jb 0x6df3
andb $-0x21, %sil
addb $-0x41, %sil
cmpb $0x1a, %sil
jae 0x6f2d
movl $0x20, %edi
callq 0x5380
movq %rax, %r14
leaq 0x10(%rax), %r12
movq %r12, (%rax)
leaq 0x102f6(%rip), %rdx     # 0x17104
movq %rax, %rdi
movq %rdx, %rsi
callq 0x6646
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x6e6c
movq (%rcx), %rcx
movzbl (%rcx,%rax), %eax
movl %eax, %ecx
addl $-0x24, %ecx
cmpl $0x3b, %ecx
ja 0x6e57
btq %rcx, %r15
jae 0x6e57
movsbl %al, %esi
movq %r14, %rdi
callq 0x5300
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
incq %rax
movq %rax, (%rbx)
jmp 0x6e20
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jb 0x6e3d
movl %eax, %ecx
andb $-0x21, %cl
addb $-0x41, %cl
cmpb $0x1a, %cl
jb 0x6e3d
leaq 0x1a4e5(%rip), %rdi     # 0x21358
movq %r14, %rsi
callq 0x7f98
movq %rax, %r15
leaq 0x1a4db(%rip), %rax     # 0x21360
cmpq %rax, %r15
je 0x6ec6
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x6e9e
movq (%r12), %rsi
incq %rsi
callq 0x5390
movl $0x20, %esi
movq %r14, %rdi
callq 0x5390
movl 0x8(%rbx), %eax
movl %eax, 0x44(%r15)
movq 0x40(%r15), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movq 0x48(%r15), %r14
jmp 0x6a78
movl 0x8(%rbx), %ecx
xorl %eax, %eax
jmp 0x6a78
addq $0x2, %rax
movq %rax, (%rbx)
movl 0x8(%rbx), %ecx
movl $0x21, %eax
jmp 0x6a75
leaq 0x2(%rax), %rsi
movq %rsi, (%rbx)
addq $0x3, %rax
cmpq %rdx, %rax
jae 0x6f21
movl 0x8(%rbx), %esi
cmpb $0x2a, -0x1(%rcx,%rax)
jne 0x6f04
cmpb $0x2f, (%rcx,%rax)
je 0x6f1b
movq %rax, (%rbx)
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x6f13
incl %esi
movl %esi, 0x8(%rbx)
incq %rax
cmpq %rax, %rdx
jne 0x6ef7
decq %rax
movq %rax, %rsi
addq $0x2, %rsi
movq %rsi, (%rbx)
jmp 0x6db9
movl $0x38, %edi
callq 0x51b0
movq %rax, %r14
movl 0x8(%rbx), %edx
movq 0x10(%rbx), %rax
movq (%rbx), %rcx
movq (%rax), %rax
movsbl (%rax,%rcx), %ecx
leaq 0x1050c(%rip), %rsi     # 0x1745e
movq %r14, %rdi
callq 0xa6d8
leaq 0x195d7(%rip), %rsi     # 0x20538
leaq 0xace(%rip), %rdx       # 0x7a36
movq %r14, %rdi
callq 0x55d0
movq %rax, %rbx
movq %r14, %rdi
callq 0x5280
jmp 0x6f8d
movq %rax, %rbx
movl $0x20, %esi
movq %r14, %rdi
callq 0x5390
movq %rbx, %rdi
callq 0x55e0