// File: yanlinlin82[P]icpp/icpp.cpp
// Function: next()
void next()
{
	bool in_comment = false;
retry:
	if (!p || !*p) {
		if (line_no >= src.size()) { token = ""; type = unknown; goto end; } // end of source code
		p = src[line_no++].c_str(); while (*p == ' ' || *p == '\t') ++p;   // next line and skip leading spaces
		if (*p == '#') { while (*p) ++p; goto retry; }                     // skip '#'-leading line
		if (!*p) goto retry;
	}
	if (in_comment) { while (*p) { if (*p == '*' && *(p+1) == '/') { p += 2; in_comment = false; goto retry; }; ++p; }; goto retry; } // skip '/* ... */' comments
	if (*p == ' ' || *p == '\t') { ++p; while (*p && (*p == ' ' || *p == '\t')) ++p; goto retry; } // skip spaces
	if (*p == '/' && *(p+1) == '/') { p += 2; while (*p) ++p; goto retry; } // skip '// ...' comments
	if (*p == '/' && *(p+1) == '*') { p += 2; in_comment = true; goto retry; } // found '/* ... */' comments
	if (*p == '_' || (*p >= 'a' && *p <= 'z') || (*p >= 'a' && *p <= 'z')) { // symbol
		type = symbol; token = *p++; while (*p == '_' || (*p >= 'a' && *p <= 'z') || (*p >= 'a' && *p <= 'z')) token += *p++;
	} else if ((*p >= '0' && *p <= '9') || (*p == '.' && *(p+1) >= '0' && *(p+1) <= '9')) { // number
		type = number; token = *p++; while ((*p >= '0' && *p <= '9') || (*p == '.') || (*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')) token += *p++;
	} else if (*p == '\"' || *p == '\'') { // string
		type = text; char c = *p; token = *p++; while (*p && *p != c) { if (*p == '\\') { token += *p++; }; token += *p++; } token += *p++;
	} else { // operator
		static const char* ops[] = { "==", "=", "!=", "!", "++", "+=", "+", "--", "-=", "->*", "->", "-", "<=>", "<=", "<<=", "<<", "<", ">=", ">>=", ">>", ">",
			"||", "|=", "|", "&&", "&=", "&", "::", ":", "^", "*=", "*", "/=", "/", "%=", "%", "?", "~=", "~", ";", ".*", ".", "{", "}", "[", "]", "(", ")", ",", nullptr };
		for (const char** q = ops; *q; ++q) { size_t l = strlen(*q); if (memcmp(p, *q, l) == 0) { type = op; token = *q; p += l; goto end; } }
		type = unknown; token = *p++;
	}
end:
	if (verbose >= 3) {
		if (next_display_source_code < line_no) {
			log("[DEBUG] parsing source code (up to line %zd):\n" COLOR_GREEN, line_no);
			while (next_display_source_code < line_no) {
				print_source_code_line(next_display_source_code++);
			}
			log(COLOR_YELLOW);
			print_current(false);
			log(COLOR_NORMAL);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb $0x0, -0x1(%rbp)
cmpq $0x0, 0x4a48c(%rip)     # 0x504d0
je 0x6056
movq 0x4a483(%rip), %rax     # 0x504d0
cmpb $0x0, (%rax)
jne 0x6158
movq 0x4a47b(%rip), %rax     # 0x504d8
movq %rax, -0x20(%rbp)
leaq 0x4a450(%rip), %rdi     # 0x504b8
callq 0x1a730
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jb 0x609b
leaq 0x4a468(%rip), %rdi     # 0x504e8
leaq 0x3233d(%rip), %rsi     # 0x383c4
callq 0x3370
movl $0x0, 0x4a44a(%rip)     # 0x504e0
jmp 0x6707
movq 0x4a436(%rip), %rsi     # 0x504d8
movq %rsi, %rax
addq $0x1, %rax
movq %rax, 0x4a428(%rip)     # 0x504d8
leaq 0x4a401(%rip), %rdi     # 0x504b8
callq 0x19740
movq %rax, %rdi
callq 0x3110
movq %rax, 0x4a405(%rip)     # 0x504d0
movq 0x4a3fe(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x21(%rbp)
je 0x60f2
movq 0x4a3ea(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x60fb
jmp 0x610f
movq 0x4a3ce(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a3c3(%rip)     # 0x504d0
jmp 0x60cb
movq 0x4a3ba(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x6145
jmp 0x6120
movq 0x4a3a9(%rip), %rax     # 0x504d0
cmpb $0x0, (%rax)
je 0x6140
movq 0x4a39d(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a392(%rip)     # 0x504d0
jmp 0x6120
jmp 0x603c
movq 0x4a384(%rip), %rax     # 0x504d0
cmpb $0x0, (%rax)
jne 0x6156
jmp 0x603c
jmp 0x6158
testb $0x1, -0x1(%rbp)
je 0x61bf
jmp 0x6160
movq 0x4a369(%rip), %rax     # 0x504d0
cmpb $0x0, (%rax)
je 0x61ba
movq 0x4a35d(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x61a6
movq 0x4a34e(%rip), %rax     # 0x504d0
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x61a6
movq 0x4a33e(%rip), %rax     # 0x504d0
addq $0x2, %rax
movq %rax, 0x4a333(%rip)     # 0x504d0
movb $0x0, -0x1(%rbp)
jmp 0x603c
movq 0x4a323(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a318(%rip)     # 0x504d0
jmp 0x6160
jmp 0x603c
movq 0x4a30a(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x61dd
movq 0x4a2fb(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x9, %eax
jne 0x624f
movq 0x4a2ec(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a2e1(%rip)     # 0x504d0
movq 0x4a2da(%rip), %rcx     # 0x504d0
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x22(%rbp)
je 0x622d
movq 0x4a2c9(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x23(%rbp)
je 0x6227
movq 0x4a2b5(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x6236
jmp 0x624a
movq 0x4a293(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a288(%rip)     # 0x504d0
jmp 0x61ef
jmp 0x603c
movq 0x4a27a(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x62a5
movq 0x4a26b(%rip), %rax     # 0x504d0
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
jne 0x62a5
movq 0x4a25b(%rip), %rax     # 0x504d0
addq $0x2, %rax
movq %rax, 0x4a250(%rip)     # 0x504d0
movq 0x4a249(%rip), %rax     # 0x504d0
cmpb $0x0, (%rax)
je 0x62a0
movq 0x4a23d(%rip), %rax     # 0x504d0
addq $0x1, %rax
movq %rax, 0x4a232(%rip)     # 0x504d0
jmp 0x6280
jmp 0x603c
movq 0x4a224(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x62df
movq 0x4a215(%rip), %rax     # 0x504d0
movsbl 0x1(%rax), %eax
cmpl $0x2a, %eax
jne 0x62df
movq 0x4a205(%rip), %rax     # 0x504d0
addq $0x2, %rax
movq %rax, 0x4a1fa(%rip)     # 0x504d0
movb $0x1, -0x1(%rbp)
jmp 0x603c
movq 0x4a1ea(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x6332
movq 0x4a1db(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x630c
movq 0x4a1cc(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x7a, %eax
jle 0x6332
movq 0x4a1bd(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x63fb
movq 0x4a1aa(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x7a, %eax
jg 0x63fb
movl $0x1, 0x4a1a4(%rip)     # 0x504e0
movq 0x4a18d(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x4a17f(%rip)     # 0x504d0
leaq 0x4a190(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3420
movq 0x4a169(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x5f, %ecx
movb %al, -0x24(%rbp)
je 0x63c4
movq 0x4a155(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x6397
movq 0x4a146(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x7a, %ecx
movb %al, -0x24(%rbp)
jle 0x63c4
movq 0x4a132(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x61, %ecx
movb %al, -0x25(%rbp)
jl 0x63be
movq 0x4a11e(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x7a, %eax
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
movb %al, -0x24(%rbp)
movb -0x24(%rbp), %al
testb $0x1, %al
jne 0x63cd
jmp 0x63f6
movq 0x4a0fc(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x4a0ee(%rip)     # 0x504d0
leaq 0x4a0ff(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3190
jmp 0x6360
jmp 0x6705
movq 0x4a0ce(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x6419
movq 0x4a0bf(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x6454
movq 0x4a0b0(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x6540
movq 0x4a09d(%rip), %rax     # 0x504d0
movsbl 0x1(%rax), %eax
cmpl $0x30, %eax
jl 0x6540
movq 0x4a089(%rip), %rax     # 0x504d0
movsbl 0x1(%rax), %eax
cmpl $0x39, %eax
jg 0x6540
movl $0x2, 0x4a082(%rip)     # 0x504e0
movq 0x4a06b(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x4a05d(%rip)     # 0x504d0
leaq 0x4a06e(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3420
movq 0x4a047(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x64a5
movq 0x4a038(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x39, %ecx
movb %al, -0x26(%rbp)
jle 0x6509
movq 0x4a024(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2e, %ecx
movb %al, -0x26(%rbp)
je 0x6509
movq 0x4a010(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x64dc
movq 0x4a001(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x5a, %ecx
movb %al, -0x26(%rbp)
jle 0x6509
movq 0x49fed(%rip), %rax     # 0x504d0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x61, %ecx
movb %al, -0x27(%rbp)
jl 0x6503
movq 0x49fd9(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x7a, %eax
setle %al
movb %al, -0x27(%rbp)
movb -0x27(%rbp), %al
movb %al, -0x26(%rbp)
movb -0x26(%rbp), %al
testb $0x1, %al
jne 0x6512
jmp 0x653b
movq 0x49fb7(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49fa9(%rip)     # 0x504d0
leaq 0x49fba(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3190
jmp 0x6482
jmp 0x6703
movq 0x49f89(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0x6562
movq 0x49f7a(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x27, %eax
jne 0x6651
movl $0x3, 0x49f74(%rip)     # 0x504e0
movq 0x49f5d(%rip), %rax     # 0x504d0
movb (%rax), %al
movb %al, -0x2(%rbp)
movq 0x49f51(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49f43(%rip)     # 0x504d0
leaq 0x49f54(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3420
movq 0x49f2d(%rip), %rcx     # 0x504d0
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x28(%rbp)
je 0x65c3
movq 0x49f1c(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
movsbl -0x2(%rbp), %ecx
cmpl %ecx, %eax
setne %al
movb %al, -0x28(%rbp)
movb -0x28(%rbp), %al
testb $0x1, %al
jne 0x65cc
jmp 0x6628
movq 0x49efd(%rip), %rax     # 0x504d0
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x65ff
movq 0x49eee(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49ee0(%rip)     # 0x504d0
leaq 0x49ef1(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3190
movq 0x49eca(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49ebc(%rip)     # 0x504d0
leaq 0x49ecd(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3190
jmp 0x659c
movq 0x49ea1(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49e93(%rip)     # 0x504d0
leaq 0x49ea4(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3190
jmp 0x6701
leaq 0x49c68(%rip), %rax     # 0x502c0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x66d3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3130
movq %rax, -0x18(%rbp)
movq 0x49e53(%rip), %rdi     # 0x504d0
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x3140
cmpl $0x0, %eax
jne 0x66c3
movl $0x4, 0x49e44(%rip)     # 0x504e0
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x49e3e(%rip), %rdi     # 0x504e8
callq 0x3370
movq -0x18(%rbp), %rax
addq 0x49e16(%rip), %rax     # 0x504d0
movq %rax, 0x49e0f(%rip)     # 0x504d0
jmp 0x6707
jmp 0x66c5
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
jmp 0x665c
movl $0x0, 0x49e03(%rip)     # 0x504e0
movq 0x49dec(%rip), %rax     # 0x504d0
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x49dde(%rip)     # 0x504d0
leaq 0x49def(%rip), %rdi     # 0x504e8
movsbl (%rax), %esi
callq 0x3420
jmp 0x6703
jmp 0x6705
jmp 0x6707
cmpl $0x3, 0x4a11a(%rip)     # 0x50828
jl 0x6786
movq 0x4a091(%rip), %rax     # 0x507a8
cmpq 0x49dba(%rip), %rax     # 0x504d8
jae 0x6784
movq 0x49db1(%rip), %rsi     # 0x504d8
leaq 0x30c86(%rip), %rdi     # 0x373b4
movb $0x0, %al
callq 0x19420
movq 0x4a06c(%rip), %rax     # 0x507a8
cmpq 0x49d95(%rip), %rax     # 0x504d8
jae 0x6761
movq 0x4a05c(%rip), %rdi     # 0x507a8
movq %rdi, %rax
addq $0x1, %rax
movq %rax, 0x4a04e(%rip)     # 0x507a8
callq 0x4630
jmp 0x6735
leaq 0x30c80(%rip), %rdi     # 0x373e8
movb $0x0, %al
callq 0x19420
xorl %edi, %edi
callq 0x46d0
leaq 0x31c88(%rip), %rdi     # 0x38405
movb $0x0, %al
callq 0x19420
jmp 0x6786
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)