// File: /workspace/github_cpp_makefile_star2_O2/AndrewAlbert[P]Compiler-Theory/SourceCode/scanner.cpp
// Function: Scanner::InitScanner(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
bool Scanner::InitScanner(string filename, bool debug_input){
	debug = debug_input;
	line_number = 1;
	fPtr = fopen(filename.c_str(),"r");
	if (fPtr == nullptr){
		cout << "\nThe file: " << filename << "\ndoes not exist, or cannot be opened.\n" << endl;
		return false;
	}

	//Populate the reserved keyword table
	reserved_table[";"] = T_SEMICOLON;
	reserved_table["("] = T_LPAREN;
	reserved_table[")"] = T_RPAREN;
	reserved_table[":="] = T_ASSIGNMENT;
	reserved_table[">="] = T_COMPARE;
	reserved_table[">"] = T_COMPARE;
	reserved_table["<="] = T_COMPARE;
	reserved_table["<"] = T_COMPARE;
	reserved_table["/"] = T_DIVIDE;
	reserved_table["*"] = T_MULTIPLY;
	reserved_table["+"] = T_ADD;
	reserved_table["-"] = T_SUBTRACT;
	reserved_table[","] = T_COMMA;
	reserved_table["["] = T_LBRACKET;
	reserved_table["]"] = T_RBRACKET;
	reserved_table["PROGRAM"] = T_PROGRAM;
	reserved_table["IS"] = T_IS;
	reserved_table["BEGIN"] = T_BEGIN;
	reserved_table["END"] = T_END;
	reserved_table["GLOBAL"] = T_GLOBAL;
	reserved_table["PROCEDURE"] = T_PROCEDURE;
	reserved_table["IN"] = T_IN;
	reserved_table["OUT"] = T_OUT;
	reserved_table["INOUT"] = T_INOUT;
	reserved_table["INTEGER"] = T_INTEGER;
	reserved_table["FLOAT"] = T_FLOAT;
	reserved_table["BOOL"] = T_BOOL;
	reserved_table["STRING"] = T_STRING;
	reserved_table["CHAR"] = T_CHAR;
	reserved_table["NOT"] = T_NOT;
	reserved_table["IF"] = T_IF;
	reserved_table["THEN"] = T_THEN;
	reserved_table["ELSE"] = T_ELSE;
	reserved_table["FOR"] = T_FOR;
	reserved_table["RETURN"] = T_RETURN;
	reserved_table["TRUE"] = T_TRUE;
	reserved_table["FALSE"] = T_FALSE;
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r15
movq %rdi, %r14
movb %dl, 0x138(%rdi)
movl $0x1, (%rdi)
movq (%rsi), %rdi
leaq 0x102e3(%rip), %rsi     # 0x12900
callq 0x2220
movq %rax, %rbx
movq %rax, 0x130(%r14)
testq %rax, %rax
je 0x2d9d
leaq 0xea73(%rip), %rsi      # 0x110af
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
addq $0x140, %r14            # imm = 0x140
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x12c, (%rax)          # imm = 0x12C
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xea3b(%rip), %rsi      # 0x110b1
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x12d, (%rax)          # imm = 0x12D
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x10098(%rip), %rsi     # 0x12741
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x12e, (%rax)          # imm = 0x12E
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe9d7(%rip), %rsi      # 0x110b3
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x13a, (%rax)          # imm = 0x13A
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe9a7(%rip), %rsi      # 0x110b6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x139, (%rax)          # imm = 0x139
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe977(%rip), %rsi      # 0x110b9
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x139, (%rax)          # imm = 0x139
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe946(%rip), %rsi      # 0x110bb
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x139, (%rax)          # imm = 0x139
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe916(%rip), %rsi      # 0x110be
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x139, (%rax)          # imm = 0x139
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe8e5(%rip), %rsi      # 0x110c0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x130, (%rax)          # imm = 0x130
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x1053c(%rip), %rsi     # 0x12d4a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x131, (%rax)          # imm = 0x131
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe881(%rip), %rsi      # 0x110c2
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x132, (%rax)          # imm = 0x132
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x1004d(%rip), %rsi     # 0x128c1
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x133, (%rax)          # imm = 0x133
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe81d(%rip), %rsi      # 0x110c4
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x134, (%rax)          # imm = 0x134
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0x10661(%rip), %rsi     # 0x12f3b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x135, (%rax)          # imm = 0x135
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe7b9(%rip), %rsi      # 0x110c6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x136, (%rax)          # imm = 0x136
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe788(%rip), %rsi      # 0x110c8
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x101, (%rax)          # imm = 0x101
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe75d(%rip), %rsi      # 0x110d0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x102, (%rax)          # imm = 0x102
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe72d(%rip), %rsi      # 0x110d3
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x103, (%rax)          # imm = 0x103
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe700(%rip), %rsi      # 0x110d9
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x104, (%rax)          # imm = 0x104
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe6d1(%rip), %rsi      # 0x110dd
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x105, (%rax)          # imm = 0x105
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe6a5(%rip), %rsi      # 0x110e4
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x106, (%rax)          # imm = 0x106
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe664(%rip), %rsi      # 0x110d6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x107, (%rax)          # imm = 0x107
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe64b(%rip), %rsi      # 0x110f0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x108, (%rax)          # imm = 0x108
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe616(%rip), %rsi      # 0x110ee
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x109, (%rax)          # imm = 0x109
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe7f9(%rip), %rsi      # 0x11304
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10a, (%rax)          # imm = 0x10A
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe7d1(%rip), %rsi      # 0x1130f
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10b, (%rax)          # imm = 0x10B
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe78b(%rip), %rsi      # 0x112fc
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10c, (%rax)          # imm = 0x10C
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe774(%rip), %rsi      # 0x11318
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10d, (%rax)          # imm = 0x10D
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe74b(%rip), %rsi      # 0x11322
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10e, (%rax)          # imm = 0x10E
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe4ea(%rip), %rsi      # 0x110f4
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x10f, (%rax)          # imm = 0x10F
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe4bb(%rip), %rsi      # 0x110f8
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x110, (%rax)          # imm = 0x110
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe48b(%rip), %rsi      # 0x110fb
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x111, (%rax)          # imm = 0x111
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe45d(%rip), %rsi      # 0x11100
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x112, (%rax)          # imm = 0x112
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe42f(%rip), %rsi      # 0x11105
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x113, (%rax)          # imm = 0x113
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe400(%rip), %rsi      # 0x11109
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x114, (%rax)          # imm = 0x114
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe3d4(%rip), %rsi      # 0x11110
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x115, (%rax)          # imm = 0x115
leaq 0x10(%rsp), %rdi
callq 0x20f0
leaq 0xe3a6(%rip), %rsi      # 0x11115
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3652
movl $0x116, (%rax)          # imm = 0x116
leaq 0x10(%rsp), %rdi
callq 0x20f0
jmp 0x2dd2
movq 0x1822c(%rip), %rdi     # 0x1afd0
leaq 0xe2d1(%rip), %rsi      # 0x1107c
callq 0x21c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
leaq 0xe2c6(%rip), %rsi      # 0x11088
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x2100
testq %rbx, %rbx
setne %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
jmp 0x2e99
jmp 0x2ea8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20f0
jmp 0x2eab
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2310
nop