// File: Caproner[P]Naive_Compiler/Lexical/Lexical.cpp
// Function: Lexical::Get_Keyword(int&)
Word Lexical::Get_Keyword(int &pos)
{
	if(pos+2<this->Source.length())
	{
		std::string check;
		check+=this->Source[pos];
		check+=this->Source[pos+1];
		check+=this->Source[pos+2];
		if(check=="var")
		{
			pos+=3;
			return Word(1,0);
		}
	}
	
	if(pos+4<this->Source.length())
	{
		std::string check;
		check+=this->Source[pos];
		check+=this->Source[pos+1];
		check+=this->Source[pos+2];
		check+=this->Source[pos+3];
		check+=this->Source[pos+4];
		if(check=="print")
		{
			pos+=5;
			return Word(2,0);
		}
	}
	
	return Word(-1,0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq %rdi, -0x80(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x2, %eax
cltq
movq %rax, -0x78(%rbp)
callq 0x22e0
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x6980
leaq -0x40(%rbp), %rdi
callq 0x22c0
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq (%rax), %rsi
callq 0x23b0
movq %rax, -0x88(%rbp)
jmp 0x6881
movq -0x88(%rbp), %rax
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x2150
jmp 0x6896
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
incl %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0x90(%rbp)
jmp 0x68b3
movq -0x90(%rbp), %rax
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x2150
jmp 0x68c8
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0x98(%rbp)
jmp 0x68e6
movq -0x98(%rbp), %rax
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x2150
jmp 0x68fb
leaq 0xb82e(%rip), %rsi      # 0x12130
leaq -0x40(%rbp), %rdi
callq 0x7420
movb %al, -0x99(%rbp)
jmp 0x6913
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x691f
jmp 0x6960
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
leaq -0x10(%rbp), %rdi
movl $0x1, %esi
xorps %xmm0, %xmm0
callq 0x7450
jmp 0x693d
movl $0x1, -0x50(%rbp)
jmp 0x6967
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2140
jmp 0x6b51
movl $0x0, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2140
movl -0x50(%rbp), %eax
testl %eax, %eax
je 0x697e
jmp 0x6979
jmp 0x6b40
jmp 0x6980
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x4, %eax
cltq
movq %rax, -0xa8(%rbp)
callq 0x22e0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6b2f
leaq -0x70(%rbp), %rdi
callq 0x22c0
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq (%rax), %rsi
callq 0x23b0
movq %rax, -0xb0(%rbp)
jmp 0x69d0
movq -0xb0(%rbp), %rax
movsbl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x2150
jmp 0x69e5
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
incl %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0xb8(%rbp)
jmp 0x6a02
movq -0xb8(%rbp), %rax
movsbl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x2150
jmp 0x6a17
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0xc0(%rbp)
jmp 0x6a35
movq -0xc0(%rbp), %rax
movsbl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x2150
jmp 0x6a4a
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x3, %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0xc8(%rbp)
jmp 0x6a68
movq -0xc8(%rbp), %rax
movsbl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x2150
jmp 0x6a7d
movq -0x80(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x4, %eax
movslq %eax, %rsi
callq 0x23b0
movq %rax, -0xd0(%rbp)
jmp 0x6a9b
movq -0xd0(%rbp), %rax
movsbl (%rax), %esi
leaq -0x70(%rbp), %rdi
callq 0x2150
jmp 0x6ab0
leaq 0xb67d(%rip), %rsi      # 0x12134
leaq -0x70(%rbp), %rdi
callq 0x7420
movb %al, -0xd1(%rbp)
jmp 0x6ac8
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x6ad4
jmp 0x6b12
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x5, %ecx
movl %ecx, (%rax)
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
xorps %xmm0, %xmm0
callq 0x7450
jmp 0x6af2
movl $0x1, -0x50(%rbp)
jmp 0x6b19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2140
jmp 0x6b51
movl $0x0, -0x50(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2140
movl -0x50(%rbp), %eax
testl %eax, %eax
je 0x6b2d
jmp 0x6b2b
jmp 0x6b40
jmp 0x6b2f
leaq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
callq 0x7450
movl -0x10(%rbp), %eax
movsd -0x8(%rbp), %xmm0
addq $0xe0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2350
nopw (%rax,%rax)