// File: /workspace/github_cpp_makefile_star2_O3/davidsun[P]TinyCompiler/LexicalAnalytics.cpp
// Function: LexicalAnalytics::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) const
vector <pair <char, string> > LexicalAnalytics::parse(string input) const{
    int last_type = -1;
    string last_token = "";
    vector <pair <char, string> > ret;
    input += " ";
    for (int i = 0; i < input.size(); i ++){
        int cur_type = getType_p(input[i]);
        if (cur_type != last_type){
            if (last_token.length() > 0 && last_type != TYPE_BLANK){
                if (last_type == TYPE_TOKEN){
                    for (int j = 0; j < last_token.length(); j ++){
                        ret.push_back(make_pair(last_token[j], string() + last_token[j]));
                    }
                }  else if (last_token == "int" || last_token == "double"){
                    ret.push_back(make_pair('T', last_token));
                }  else if (last_token == "if"){
                    ret.push_back(make_pair('W', last_token));
                }  else if (last_token == "else"){
                    ret.push_back(make_pair('U', last_token));
                }  else if (last_token == "while"){
                    ret.push_back(make_pair('L', last_token));
                }  else if (last_token == "return"){
                    ret.push_back(make_pair('G', last_token));
                }  else if (last_token[0] <= '9' && last_token[0] >= '0'){
                    int point_count = 0;
                    for (int j = 0; j < last_token.length(); j ++){
                        if (last_token[j] <= '9' && last_token[j] >= '0'){
                        }  else if (last_token[j] == '.'){
                            point_count ++;
                        }  else {
                            throw Exception("Lexical analytics: error on token " + last_token + ".");
                        }
                    }
                    if (point_count > 1){
                        throw Exception("Lexical analytics: error on token " + last_token + ".");
                    }
                    ret.push_back(make_pair((point_count > 0) ? 'J' : 'I', last_token));
                }  else {
                    ret.push_back(make_pair('N', last_token));
                }
            }
            last_token = input[i];
            last_type = cur_type; 
        }  else {
            last_token += input[i];
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xcbcd(%rip), %rdx      # 0x10256
leaq 0x30(%rsp), %rdi
movq %rdx, %rsi
callq 0x2892
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, 0x50(%rsp)
movq $0x0, 0x10(%rbx)
leaq 0xcb9b(%rip), %rsi      # 0x1024b
movq %r14, %rdi
callq 0x2330
cmpq $0x0, 0x8(%r14)
je 0x3b1a
movq %r14, %rbp
leaq 0x20(%rsp), %r12
leaq 0x98(%rsp), %rbx
leaq 0x68(%rsp), %r15
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movq %rbp, 0x80(%rsp)
movq (%rbp), %rax
movsbl (%rax,%r14), %ebp
movl %ebp, %esi
callq 0x3dee
cmpl %r13d, %eax
jne 0x3717
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
callq 0x2170
movq 0x80(%rsp), %rbp
jmp 0x39d8
movl %eax, 0x7c(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x39ac
cmpl $0x2, %r13d
je 0x39ac
cmpl $0x1, %r13d
jne 0x3878
xorl %ebp, %ebp
movq 0x30(%rsp), %r13
movq %rbx, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movb $0x0, 0x98(%rsp)
movsbl (%r13,%rbp), %r8d
movl $0x1, %ecx
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2320
movq %r15, 0x58(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x379d
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x37a4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb (%r13,%rbp), %al
movb %al, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x58(%rsp), %rax
cmpq %r15, %rax
je 0x37e5
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x37ee
movups (%r15), %xmm0
movups %xmm0, (%r12)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r15, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movb $0x0, 0x68(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x3831
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x3848
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3865
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21b0
incq %rbp
cmpq %rbp, 0x38(%rsp)
ja 0x373d
jmp 0x39ac
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0xc7f5(%rip), %rsi      # 0x1007c
callq 0x2090
testl %eax, %eax
je 0x3965
movq %r13, %rdi
leaq 0xc7e2(%rip), %rsi      # 0x10080
callq 0x2090
testl %eax, %eax
je 0x3965
movq %r13, %rdi
leaq 0xc7d2(%rip), %rsi      # 0x10087
callq 0x2090
testl %eax, %eax
je 0x39ea
movq %r13, %rdi
leaq 0xc7be(%rip), %rsi      # 0x1008a
callq 0x2090
testl %eax, %eax
je 0x3a1f
movq %r13, %rdi
leaq 0xc7ac(%rip), %rsi      # 0x1008f
callq 0x2090
testl %eax, %eax
je 0x3a54
movq %r13, %rdi
leaq 0xc79b(%rip), %rsi      # 0x10095
callq 0x2090
testl %eax, %eax
je 0x3a89
movq 0x30(%rsp), %rsi
movb (%rsi), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x3abe
movq 0x38(%rsp), %rdx
testq %rdx, %rdx
je 0x3aee
xorl %eax, %eax
xorl %ecx, %ecx
movb (%rsi,%rax), %dil
cmpb $0x39, %dil
jg 0x3b4d
cmpb $0x2f, %dil
jg 0x394a
cmpb $0x2e, %dil
jne 0x3b4d
incl %ecx
incq %rax
cmpq %rax, %rdx
jne 0x392a
cmpl $0x1, %ecx
jg 0x3bf3
sete %al
addb $0x49, %al
jmp 0x3af0
movb $0x54, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x39ac
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x80(%rsp), %rbp
movq (%rbp), %rax
movsbl (%rax,%r14), %r8d
movq 0x38(%rsp), %rdx
movl $0x1, %ecx
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x2320
movl 0x7c(%rsp), %r13d
incq %r14
cmpq %r14, 0x8(%rbp)
ja 0x36e9
jmp 0x3b1a
movb $0x57, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movb $0x55, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movb $0x4c, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movb $0x47, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movb $0x4e, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movb $0x49, %al
movb %al, 0x8(%rsp)
movq %r12, 0x10(%rsp)
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2744
movq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3f14
jmp 0x3995
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3b36
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x50(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x20e0
movq %rax, %r12
leaq 0xc53b(%rip), %rsi      # 0x1009c
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x3e2e
leaq 0xc5f9(%rip), %rsi      # 0x10170
leaq 0x58(%rsp), %rdi
callq 0x2330
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3ba3
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x3bb0
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r12, %rdi
callq 0x26ac
xorl %ebx, %ebx
leaq 0x121c9(%rip), %rsi     # 0x15da8
leaq -0x14f0(%rip), %rdx     # 0x26f6
movq %r12, %rdi
callq 0x22e0
jmp 0x3c94
movl $0x28, %edi
callq 0x20e0
movq %rax, %r12
leaq 0xc495(%rip), %rsi      # 0x1009c
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x3e2e
leaq 0xc553(%rip), %rsi      # 0x10170
leaq 0x58(%rsp), %rdi
callq 0x2330
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3c49
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x3c56
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r12, %rdi
callq 0x26ac
xorl %ebx, %ebx
leaq 0x12123(%rip), %rsi     # 0x15da8
leaq -0x1596(%rip), %rdx     # 0x26f6
movq %r12, %rdi
callq 0x22e0
jmp 0x3cd3
jmp 0x3d12
jmp 0x3d30
jmp 0x3d45
jmp 0x3d63
jmp 0x3d45
jmp 0x3d63
jmp 0x3d45
jmp 0x3d63
jmp 0x3d45
jmp 0x3d63
jmp 0x3d45
jmp 0x3d63
jmp 0x3d45
jmp 0x3d63
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3ced
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d04
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
testb %bl, %bl
leaq 0x40(%rsp), %r15
jne 0x3d38
jmp 0x3dc5
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d33
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x3d33
jmp 0x3d63
movq %rax, %r14
leaq 0x40(%rsp), %r15
movq %r12, %rdi
callq 0x2140
jmp 0x3dc5
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x3d66
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x3d66
jmp 0x3d63
movq %rax, %r14
leaq 0x40(%rsp), %r15
jmp 0x3dc5
movq %rax, %r14
jmp 0x3da3
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x3d8c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x3da3
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x40(%rsp), %r15
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3dc5
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x50(%rsp), %rdi
callq 0x3eb6
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x3de6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x22f0