// File: /workspace/github_cpp_makefile_star2_O2/Davidc2525[P]Leaf/parser/Scanner.cpp
// Function: Scanner::Init()
void Scanner::Init() {
	EOL    = '\n';
	eofSym = 0;
	maxT = 50;
	noSym = 50;
	int i;
	for (i = 49; i <= 57; ++i) start.set(i, 28);
	for (i = 65; i <= 90; ++i) start.set(i, 2);
	for (i = 95; i <= 95; ++i) start.set(i, 2);
	for (i = 97; i <= 122; ++i) start.set(i, 2);
	for (i = 145; i <= 145; ++i) start.set(i, 2);
	for (i = 177; i <= 177; ++i) start.set(i, 2);
	for (i = 195; i <= 195; ++i) start.set(i, 2);
	start.set(42, 1);
	start.set(38, 56);
	start.set(39, 3);
	start.set(34, 6);
	start.set(46, 57);
	start.set(48, 29);
	start.set(123, 32);
	start.set(125, 33);
	start.set(59, 34);
	start.set(61, 58);
	start.set(40, 35);
	start.set(41, 36);
	start.set(58, 37);
	start.set(44, 38);
	start.set(91, 39);
	start.set(93, 40);
	start.set(60, 59);
	start.set(62, 60);
	start.set(126, 43);
	start.set(124, 61);
	start.set(94, 44);
	start.set(33, 48);
	start.set(43, 52);
	start.set(45, 53);
	start.set(47, 54);
	start.set(37, 55);
		start.set(Buffer::EoF, -1);
	keywords.set(L"class", 13);
	keywords.set(L"print", 14);
	keywords.set(L"sizeof", 17);
	keywords.set(L"ret", 18);
	keywords.set(L"if", 19);
	keywords.set(L"else", 20);
	keywords.set(L"throw", 21);
	keywords.set(L"try", 22);
	keywords.set(L"catch", 23);
	keywords.set(L"extern", 28);
	keywords.set(L"fun", 29);
	keywords.set(L"true", 47);
	keywords.set(L"false", 48);


	tvalLength = 128;
	tval = new wchar_t[tvalLength]; // text of current token

	// COCO_HEAP_BLOCK_SIZE byte heap + pointer to next heap block
	heap = malloc(COCO_HEAP_BLOCK_SIZE + sizeof(void*));
	firstHeap = heap;
	heapEnd = (void**) (((char*) heap) + COCO_HEAP_BLOCK_SIZE);
	*heapEnd = 0;
	heapTop = heap;
	if (sizeof(Token) > COCO_HEAP_BLOCK_SIZE) {
		printf("--- Too small COCO_HEAP_BLOCK_SIZE\n");
		exit(1);
	}

	pos = -1; line = 1; col = 0; charPos = -1;
	oldEols = 0;
	NextCh();
	if (ch == 0xEF) { // check optional byte order mark for UTF-8
		NextCh(); int ch1 = ch;
		NextCh(); int ch2 = ch;
		if (ch1 != 0xBB || ch2 != 0xBF) {
			printf("Illegal byte order mark at start of file");
			exit(1);
		}
		Buffer *oldBuf = buffer;
		buffer = new UTF8Buffer(buffer); col = 0; charPos = -1;
		delete oldBuf; oldBuf = NULL;
		NextCh();
	}


	pt = tokens = CreateToken(); // first token is a dummy
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0xa, 0x20(%rdi)
movabsq $0x3200000000, %rax     # imm = 0x3200000000
movq %rax, 0x24(%rdi)
movl $0x32, 0x2c(%rdi)
leaq 0x38(%rdi), %r14
pushq $0x31
popq %rbp
pushq $0x1c
popq %r15
cmpl $0x3a, %ebp
je 0x8ee2
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0xa4ea
incl %ebp
jmp 0x8ecc
pushq $0x41
popq %rbp
pushq $0x2
popq %r15
cmpl $0x5b, %ebp
je 0x8eff
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0xa4ea
incl %ebp
jmp 0x8ee9
pushq $0x5f
popq %rsi
pushq $0x2
popq %rbp
movq %r14, %rdi
movl %ebp, %edx
callq 0xa4ea
pushq $0x61
popq %r15
cmpl $0x7b, %r15d
je 0x8f2b
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xa4ea
incl %r15d
jmp 0x8f13
pushq $0x2
popq %rbp
movq %r14, %rdi
movl $0x91, %esi
movl %ebp, %edx
callq 0xa4ea
movq %r14, %rdi
movl $0xb1, %esi
movl %ebp, %edx
callq 0xa4ea
movq %r14, %rdi
movl $0xc3, %esi
movl %ebp, %edx
callq 0xa4ea
pushq $0x2a
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x26
popq %rsi
pushq $0x38
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x27
popq %rsi
pushq $0x3
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x22
popq %rbp
pushq $0x6
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xa4ea
pushq $0x2e
popq %rsi
pushq $0x39
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x30
popq %rsi
pushq $0x1d
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x7b
popq %rsi
pushq $0x20
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x7d
popq %rsi
pushq $0x21
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x3b
popq %r13
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0xa4ea
pushq $0x3d
popq %r12
pushq $0x3a
popq %r15
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0xa4ea
pushq $0x28
popq %rbp
pushq $0x23
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xa4ea
pushq $0x29
popq %rsi
pushq $0x24
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x25
popq %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0xa4ea
pushq $0x2c
popq %r15
movq %r14, %rdi
movl %r15d, %esi
pushq $0x26
popq %rdx
callq 0xa4ea
pushq $0x5b
popq %rsi
movq %r14, %rdi
pushq $0x27
popq %rdx
callq 0xa4ea
pushq $0x5d
popq %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0xa4ea
pushq $0x3c
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0xa4ea
pushq $0x3e
popq %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0xa4ea
pushq $0x7e
popq %rsi
pushq $0x2b
popq %rbp
movq %r14, %rdi
movl %ebp, %edx
callq 0xa4ea
pushq $0x7c
popq %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0xa4ea
pushq $0x5e
popq %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0xa4ea
movq %r14, %rdi
pushq $0x21
popq %rsi
pushq $0x30
popq %r15
movl %r15d, %edx
callq 0xa4ea
pushq $0x34
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xa4ea
pushq $0x2d
popq %rsi
pushq $0x35
popq %rdx
movq %r14, %rdi
callq 0xa4ea
pushq $0x2f
popq %r12
pushq $0x36
popq %rdx
movq %r14, %rdi
movl %r12d, %esi
callq 0xa4ea
pushq $0x37
popq %rdx
movq %r14, %rdi
pushq $0x25
popq %rsi
callq 0xa4ea
pushq $-0x1
popq %rdx
movq %r14, %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0xa4ea
leaq 0x48(%rbx), %r14
leaq 0xd5a6(%rip), %rsi      # 0x166a4
pushq $0xd
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5ac(%rip), %rsi      # 0x166bc
pushq $0xe
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5b2(%rip), %rsi      # 0x166d4
pushq $0x11
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5bc(%rip), %rsi      # 0x166f0
pushq $0x12
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5ba(%rip), %rsi      # 0x16700
pushq $0x13
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5b4(%rip), %rsi      # 0x1670c
pushq $0x14
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5b6(%rip), %rsi      # 0x16720
pushq $0x15
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5bc(%rip), %rsi      # 0x16738
pushq $0x16
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5ba(%rip), %rsi      # 0x16748
pushq $0x17
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5c0(%rip), %rsi      # 0x16760
pushq $0x1c
popq %rdx
movq %r14, %rdi
callq 0xa520
leaq 0xd5ca(%rip), %rsi      # 0x1677c
movq %r14, %rdi
pushq $0x1d
popq %rdx
callq 0xa520
leaq 0xd5c8(%rip), %rsi      # 0x1678c
movq %r14, %rdi
movl %r12d, %edx
callq 0xa520
leaq 0xd5ca(%rip), %rsi      # 0x167a0
movq %r14, %rdi
movl %r15d, %edx
callq 0xa520
movl $0x80, 0x68(%rbx)
movl $0x200, %edi            # imm = 0x200
callq 0x5040
movq %rax, 0x60(%rbx)
movl $0x4000008, %edi        # imm = 0x4000008
callq 0x5330
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
leaq 0x4000000(%rax), %rcx
movq %rcx, 0x18(%rbx)
andq $0x0, 0x4000000(%rax)
movq %rax, 0x10(%rbx)
movaps 0xd24b(%rip), %xmm0     # 0x16470
movups %xmm0, 0x84(%rbx)
andl $0x0, 0x94(%rbx)
movq %rbx, %rdi
callq 0x94b0
cmpl $0xef, 0x80(%rbx)
jne 0x92b9
movq %rbx, %rdi
callq 0x94b0
movl 0x80(%rbx), %ebp
movq %rbx, %rdi
callq 0x94b0
cmpl $0xbb, %ebp
jne 0x92d8
cmpl $0xbf, 0x80(%rbx)
jne 0x92d8
movq 0x98(%rbx), %r14
pushq $0x38
popq %rdi
callq 0x5260
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xa584
movq %r15, 0x98(%rbx)
andl $0x0, 0x90(%rbx)
orl $-0x1, 0x88(%rbx)
testq %r14, %r14
je 0x92b1
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x94b0
movq %rbx, %rdi
callq 0x9544
movq %rax, 0x70(%rbx)
movq %rax, 0x78(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd382(%rip), %rdi      # 0x16661
xorl %eax, %eax
callq 0x5060
pushq $0x1
popq %rdi
callq 0x5300