// File: /workspace/github_cpp_makefile_star2_O1/RuiDGPires[P]CrimLang/src/tokenizer.cpp
// Function: Tracker::take(char)
void Tracker::take(char c){
	if (c == '\n'){
		if (this->preproc_line == 1){
			this->current_token.type = crl::Token::Type::PREPROC_END;
			this->current_token.str = "</PP>";
			this->dump();
		}
		this->preproc_line = 0;
		if (state == PState::COMMENT) state = PState::NONE;
		this->line++;
		this->column = 0;
	}

	this->column++;

	eval:
	switch(this->state){
		case PState::NONE:
			if (c == '#'){
				if (this->preproc_line == 0){
					this->preproc_line = 1;			
					this->set_pos();
					this->current_token.type = crl::Token::Type::PREPROC_START;
					this->current_token.str = "<PP>";
					this->dump();
				}else
					throw crl::SyntaxError(line, column, "Unexpected #");
			
			}else if (c == '<' && this->preproc_line == 1){
				state = PState::GLOBAL_FOLDER;
				set_type(crl::Token::Type::GLOBAL_FOLDER);
				this->set_pos();
			}else if (is_letter(c)){
				if (!this->preproc_line) this->preproc_line = -1;
				state = PState::IDENT;
				set_type(crl::Token::Type::IDENT);
				this->push_char(c);
				this->set_pos();
			}else if (is_number(c)){
				if (!this->preproc_line) this->preproc_line = -1;
				state = PState::NUM;
				set_type(crl::Token::Type::INT);
				this->push_char(c);
				this->set_pos();
			}else if (is_symbol(c)){
				if (!this->preproc_line) this->preproc_line = -1;
				state = PState::SYMBOL;
				this->set_pos();
				this->push_char(c);
			}else if (c == '"'){
				if (!this->preproc_line) this->preproc_line = -1;
				state = PState::STRING;
				set_type(crl::Token::Type::STRING);
				this->set_pos();
			}else if (c == '\''){
				if (!this->preproc_line) this->preproc_line = -1;
				state = PState::CHAR;
				set_type(crl::Token::Type::CHAR);
				this->set_pos();
			}else if (is_whitespace(c))
				break;
			else throw crl::SyntaxError(line, column, "Unkown character: " + std::string(1, c));
			break;
		case PState::GLOBAL_FOLDER:
			if (c == '>')
				this->dump();
			else
				this->push_char(c);	
		break;	
		case PState::IDENT:
			if (is_letter(c) || is_number(c) || c == '_')
				this->push_char(c);
			else {
				this->check_keyword();
				this->dump();
				goto eval;
			}
			break;

		case PState::NUM:
			if (is_number(c))
				this->push_char(c);
			else if (c == '.'){
				if (this->current_token.type == crl::Token::Type::INT){
					this->current_token.type = crl::Token::Type::DEC; 
					this->push_char(c);	
				}else throw crl::SyntaxError(line, column, "Invalid numberic format"); 
			} else {
				this->dump();	
				goto eval;
			}
			break;

		case PState::SYMBOL:
			if (is_symbol(c)){
				if (this->parse_symbol(this->current_token.str + c)){
					if (this->state == PState::COMMENT) break;
					this->push_char(c);
				}else{
					if (this->parse_symbol(this->current_token.str)){
						if (this->state == PState::COMMENT) break;
						this->dump();
						goto eval;
					}else throw crl::SyntaxError(line, column, "Unkown symbol: " + this->current_token.str); 
				}
			}else if (this->parse_symbol(this->current_token.str)){
				if (this->state == PState::COMMENT) break;
				this->dump();
				goto eval;
			}else throw crl::SyntaxError(line, column, "Unkown symbol: " + this->current_token.str); 
			
			break;

		case PState::STRING:
			if (c == '\\'){
				this->push_char(c);
				this->str_spec = !this->str_spec;	 // SWITCH STR SPECIAL
			}else if (c == '"'){
				if (!this->str_spec){
					this->dump();
					break;	
				}else{
					this->current_token.str.pop_back();
					this->push_char(c);
					this->str_spec = false;
				}
			}else {
				this->push_char(c);
				this->str_spec = false;
			}
			break;
		case PState::CHAR:
			{
			size_t size = this->current_token.str.size();
			if (size == 0){
				if (c == '\'') throw crl::SyntaxError(line, column, "Empty char is not allowed"); 
				this->push_char(c);
			}else if (size == 1) {
				if (this->current_token.str[0] == '\\'){
					if (c == '\'') this->current_token.str.pop_back();
					this->push_char(c);
				}else{
					if (c != '\'') throw crl::SyntaxError(line, column, "Invalid char: " + this->current_token.str); 
					this->dump();
				}
			}else if (c != '\'') throw crl::SyntaxError(line, column, "Invalid char: " + this->current_token.str);
			else this->dump();
			}
			break;
		default:
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
movq %rsi, -0x40(%rbp)
cmpb $0xa, %sil
jne 0x19bab
cmpl $0x1, 0x40(%rbx)
jne 0x19b8d
movl $0x39, 0x20(%rbx)
movq 0x8(%rbx), %rdx
leaq 0x22ab(%rip), %rcx      # 0x1be20
movl $0x5, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3340
movq %rbx, %rdi
callq 0x19a9e
movl $0x0, 0x40(%rbx)
cmpl $0x6, 0x38(%rbx)
jne 0x19ba1
movl $0x0, 0x38(%rbx)
incl 0x30(%rbx)
movl $0x0, 0x34(%rbx)
incl 0x34(%rbx)
leaq -0x78(%rbp), %r12
movq -0x40(%rbp), %rsi
leal -0x30(%rsi), %edx
movl %esi, %eax
andb $-0x21, %al
addb $-0x41, %al
movb %al, -0x29(%rbp)
cmpb $0x1a, %al
setb %al
cmpb $0x5f, %sil
sete %cl
movl %edx, -0x44(%rbp)
cmpb $0xa, %dl
setb %dl
orb %cl, %dl
orb %al, %dl
movb %dl, -0x2a(%rbp)
leaq 0x21bb(%rip), %r14      # 0x1bda0
movsbl %sil, %eax
movq %rax, -0x38(%rbp)
movl 0x38(%rbx), %eax
cmpq $0x8, %rax
ja 0x19fa7
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
cmpb $0x0, -0x2a(%rbp)
jne 0x19e48
movq %rbx, %rdi
callq 0x19896
jmp 0x19d61
cmpb $0x9, -0x44(%rbp)
jbe 0x19e48
cmpb $0x2e, -0x40(%rbp)
jne 0x19d61
jmp 0x19e2b
movq -0x38(%rbp), %r13
movl %r13d, %edi
callq 0x1a4fd
testb %al, %al
je 0x19d05
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x4d4a
movq -0x60(%rbp), %rsi
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
movl %r13d, %r8d
callq 0x3420
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1943a
leaq -0x98(%rbp), %r15
movl %eax, %r13d
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x19ca9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3230
testb %r13b, %r13b
jne 0x19e3e
movq %r15, -0xa8(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rdi
callq 0x4d4a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1943a
movl %eax, %r13d
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x19cfb
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3230
testb %r13b, %r13b
jne 0x19d57
jmp 0x1a0bb
movq %r12, %r15
movq %r12, -0x88(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r13
movq %r13, %rdi
callq 0x4d4a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1943a
movl %eax, %r13d
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x19d4e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3230
testb %r13b, %r13b
je 0x1a05a
cmpl $0x6, 0x38(%rbx)
je 0x19fa7
movq %rbx, %rdi
callq 0x19a9e
jmp 0x19bed
movq -0x38(%rbp), %r14
cmpl $0x22, %r14d
je 0x19e59
cmpl $0x5c, %r14d
jne 0x19e6b
movq %rbx, %rdi
movl %r14d, %esi
callq 0x31f0
xorb $0x1, 0x3c(%rbx)
jmp 0x19fa7
cmpb $0x3e, -0x40(%rbp)
jne 0x19e48
jmp 0x19f9f
movq -0x38(%rbp), %r14
cmpl $0x3c, %r14d
je 0x19e7f
cmpl $0x23, %r14d
jne 0x19e98
cmpl $0x0, 0x40(%rbx)
jne 0x1a18a
movl $0x1, 0x40(%rbx)
movq 0x8(%rbx), %rdx
movq 0x30(%rbx), %rax
movq %rax, 0x24(%rbx)
movl $0x37, 0x20(%rbx)
leaq 0x203a(%rip), %rcx      # 0x1be26
movl $0x4, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3340
jmp 0x19f9f
movq 0x8(%rbx), %rax
cmpq $0x1, %rax
je 0x19ed6
testq %rax, %rax
movq -0x38(%rbp), %rsi
jne 0x19efd
cmpb $0x27, -0x40(%rbp)
je 0x1a1f8
movq %rbx, %rdi
jmp 0x19e4f
cmpl $0x13, 0x20(%rbx)
jne 0x1a11c
movl $0x14, 0x20(%rbx)
jmp 0x19e48
cmpl $0x6, 0x38(%rbx)
je 0x19fa7
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x31f0
jmp 0x19fa7
cmpb $0x0, 0x3c(%rbx)
je 0x19f9f
movq %rbx, %rdi
callq 0x32a0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x31f0
movb $0x0, 0x3c(%rbx)
jmp 0x19fa7
cmpl $0x1, 0x40(%rbx)
jne 0x19e98
movl $0x8, 0x38(%rbx)
movl $0x38, 0x20(%rbx)
jmp 0x19f8b
cmpb $0x5f, -0x40(%rbp)
je 0x19f68
cmpb $0x19, -0x29(%rbp)
jbe 0x19f68
cmpb $0x9, -0x44(%rbp)
ja 0x19fb9
cmpl $0x0, 0x40(%rbx)
jne 0x19ec3
movl $0xffffffff, 0x40(%rbx) # imm = 0xFFFFFFFF
movl $0x2, 0x38(%rbx)
movl $0x13, 0x20(%rbx)
jmp 0x19f80
movq (%rbx), %rax
cmpb $0x5c, (%rax)
movq -0x38(%rbp), %r14
jne 0x19f95
cmpb $0x27, -0x40(%rbp)
jne 0x19fe1
movq %rbx, %rdi
callq 0x32a0
jmp 0x19fe1
cmpb $0x27, -0x40(%rbp)
je 0x19f9f
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %r12d
leaq 0x1f6a(%rip), %rsi      # 0x1be8d
leaq -0x148(%rbp), %rdi
movq %rbx, %rdx
callq 0x40f6
movb $0x1, %r13b
leaq -0x148(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5414
xorl %r13d, %r13d
leaq 0x8e0c(%rip), %rsi      # 0x22d60
leaq -0x14975(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
cmpl $0x0, 0x40(%rbx)
jne 0x19f75
movl $0xffffffff, 0x40(%rbx) # imm = 0xFFFFFFFF
movl $0x1, %eax
movl %eax, 0x38(%rbx)
movl %eax, 0x20(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x31f0
movq 0x30(%rbx), %rax
movq %rax, 0x24(%rbx)
jmp 0x19fa7
cmpb $0x27, -0x40(%rbp)
jne 0x1a266
movq %rbx, %rdi
callq 0x19a9e
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %edi
callq 0x1a4fd
testb %al, %al
je 0x19fec
cmpl $0x0, 0x40(%rbx)
jne 0x19fd2
movl $0xffffffff, 0x40(%rbx) # imm = 0xFFFFFFFF
movl $0x5, 0x38(%rbx)
movq 0x30(%rbx), %rax
movq %rax, 0x24(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
jmp 0x19e4f
cmpl $0x27, %r14d
ja 0x1a2c4
movabsq $0x100002600, %rax      # imm = 0x100002600
btq %r14, %rax
jb 0x19fa7
movq -0x38(%rbp), %r14
cmpq $0x22, %r14
je 0x1a03a
cmpq $0x27, %r14
jne 0x1a2c4
cmpl $0x0, 0x40(%rbx)
jne 0x1a027
movl $0xffffffff, 0x40(%rbx) # imm = 0xFFFFFFFF
movl $0x4, 0x38(%rbx)
movl $0x1b, 0x20(%rbx)
jmp 0x19f8b
cmpl $0x0, 0x40(%rbx)
jne 0x1a047
movl $0xffffffff, 0x40(%rbx) # imm = 0xFFFFFFFF
movl $0x3, 0x38(%rbx)
movl $0x1c, 0x20(%rbx)
jmp 0x19f8b
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %r12d
leaq 0x1ded(%rip), %rsi      # 0x1be63
leaq -0x188(%rbp), %rdi
movq %rbx, %rdx
callq 0x40f6
movb $0x1, %r13b
leaq -0x188(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5414
xorl %r13d, %r13d
leaq 0x8cb9(%rip), %rsi      # 0x22d60
leaq -0x14ac8(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %r12d
leaq 0x1d8c(%rip), %rsi      # 0x1be63
leaq -0x1a8(%rbp), %rdi
movq %rbx, %rdx
callq 0x40f6
movb $0x1, %r13b
leaq -0x1a8(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5414
xorl %r13d, %r13d
leaq 0x8c58(%rip), %rsi      # 0x22d60
leaq -0x14b29(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %ebx
leaq -0xd8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1d09(%rip), %rsi      # 0x1be4b
leaq 0x1d19(%rip), %rdx      # 0x1be62
leaq -0xe8(%rbp), %rdi
callq 0x433a
movb $0x1, %r12b
leaq -0xe8(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x5414
xorl %r12d, %r12d
leaq 0x8bea(%rip), %rsi      # 0x22d60
leaq -0x14b97(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %ebx
leaq -0x118(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1c7b(%rip), %rsi      # 0x1be2b
leaq 0x1c80(%rip), %rdx      # 0x1be37
leaq -0x128(%rbp), %rdi
callq 0x433a
movb $0x1, %r12b
leaq -0x128(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x5414
xorl %r12d, %r12d
leaq 0x8b7c(%rip), %rsi      # 0x22d60
leaq -0x14c05(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %ebx
leaq -0xb8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1c55(%rip), %rsi      # 0x1be73
leaq 0x1c67(%rip), %rdx      # 0x1be8c
leaq -0xc8(%rbp), %rdi
callq 0x433a
movb $0x1, %r12b
leaq -0xc8(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x5414
xorl %r12d, %r12d
leaq 0x8b0e(%rip), %rsi      # 0x22d60
leaq -0x14c73(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r14
movl 0x30(%rbx), %r15d
movl 0x34(%rbx), %r12d
leaq 0x1c0b(%rip), %rsi      # 0x1be8d
leaq -0x168(%rbp), %rdi
movq %rbx, %rdx
callq 0x40f6
movb $0x1, %r13b
leaq -0x168(%rbp), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5414
xorl %r13d, %r13d
leaq 0x8aad(%rip), %rsi      # 0x22d60
leaq -0x14cd4(%rip), %rdx    # 0x55e6
movq %r14, %rdi
callq 0x33d0
jmp 0x1a341
movl $0x50, %edi
callq 0x3120
movq %rax, %r15
movl 0x30(%rbx), %r12d
movl 0x34(%rbx), %ebx
movq %r14, %rdx
leaq -0xf8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq -0x108(%rbp), %rdi
movl $0x1, %esi
callq 0x3290
leaq 0x1b3a(%rip), %rsi      # 0x1be38
leaq -0x1c8(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x1a6b6
movb $0x1, %r13b
leaq -0x1c8(%rbp), %rcx
movq %r15, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x5414
xorl %r13d, %r13d
leaq 0x8a2e(%rip), %rsi      # 0x22d60
leaq -0x14d53(%rip), %rdx    # 0x55e6
movq %r15, %rdi
callq 0x33d0
movq %rax, %rbx
leaq -0x1b8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a36b
movq -0x1b8(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x1a36b
movq %rax, %rbx
movb $0x1, %r13b
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x1a38e
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x1a38e
movq %rax, %rbx
movb $0x1, %r13b
testb %r13b, %r13b
je 0x1a4f5
movq %r15, %rdi
jmp 0x1a4a3
movq %rax, %rbx
leaq -0x158(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a49b
movq -0x158(%rbp), %rsi
jmp 0x1a48b
jmp 0x1a495
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r13, %rdi
je 0x1a449
movq -0xb8(%rbp), %rsi
jmp 0x1a439
jmp 0x1a443
movq %rax, %rbx
leaq -0x138(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a49b
movq -0x138(%rbp), %rsi
jmp 0x1a48b
jmp 0x1a495
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r13, %rdi
je 0x1a449
movq -0x118(%rbp), %rsi
jmp 0x1a439
jmp 0x1a443
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r13, %rdi
je 0x1a449
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x1a449
movq %rax, %rbx
movb $0x1, %r12b
testb %r12b, %r12b
jne 0x1a4a0
jmp 0x1a4f5
movq %rax, %rbx
leaq -0x198(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a49b
movq -0x198(%rbp), %rsi
jmp 0x1a48b
jmp 0x1a495
movq %rax, %rbx
leaq -0x178(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a49b
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x3230
jmp 0x1a49b
movq %rax, %rbx
movb $0x1, %r13b
testb %r13b, %r13b
je 0x1a4f5
movq %r14, %rdi
callq 0x31a0
jmp 0x1a4f5
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a4f5
movq -0x98(%rbp), %rsi
jmp 0x1a4ed
jmp 0x1a4c4
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1a4f5
movq -0x58(%rbp), %rsi
jmp 0x1a4ed
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a4f5
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x33f0