// File: 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
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdx, -0x2e0(%rbp)
movq %rdi, -0x2d8(%rbp)
movq %rdi, %rax
movq %rax, -0x2d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
leaq -0x41(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x3490
movq -0x2c0(%rbp), %rdx
leaq 0x1f14f(%rip), %rsi     # 0x2540e
leaq -0x40(%rbp), %rdi
callq 0x3870
jmp 0x62ca
leaq -0x41(%rbp), %rdi
callq 0x32e0
movq -0x2d8(%rbp), %rdi
movb $0x0, -0x55(%rbp)
callq 0x6ce0
movq -0x2e0(%rbp), %rdi
leaq 0x1f112(%rip), %rsi     # 0x25403
callq 0x3250
jmp 0x62f8
movl $0x0, -0x5c(%rbp)
movq -0x2e0(%rbp), %rdi
movslq -0x5c(%rbp), %rax
movq %rax, -0x2e8(%rbp)
callq 0x31e0
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6c2a
movq -0x2e0(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x34f0
movq %rax, -0x2f0(%rbp)
jmp 0x6342
movq -0x2c8(%rbp), %rdi
movq -0x2f0(%rbp), %rax
movsbl (%rax), %esi
callq 0x6c80
movl %eax, -0x2f4(%rbp)
jmp 0x6360
movl -0x2f4(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x6bea
leaq -0x40(%rbp), %rdi
callq 0x33d0
cmpq $0x0, %rax
jbe 0x6bb4
cmpl $0x2, -0x1c(%rbp)
je 0x6bb4
cmpl $0x1, -0x1c(%rbp)
jne 0x6505
movl $0x0, -0x64(%rbp)
movslq -0x64(%rbp), %rax
movq %rax, -0x300(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x300(%rbp), %rax
cmpq %rcx, %rax
jae 0x6500
movslq -0x64(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x308(%rbp)
jmp 0x63e0
leaq -0xd0(%rbp), %rdi
callq 0x33a0
movslq -0x64(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x310(%rbp)
jmp 0x6402
movq -0x310(%rbp), %rax
movsbl (%rax), %edx
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x6d70
jmp 0x6421
movq -0x308(%rbp), %rsi
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x6d30
jmp 0x643d
movq -0x2d8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x6d00
jmp 0x6452
leaq -0x90(%rbp), %rdi
callq 0x6dc0
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xd0(%rbp), %rdi
callq 0x31a0
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x63a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x32e0
jmp 0x6c6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6c59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x64ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x64e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6dc0
leaq -0xb0(%rbp), %rdi
callq 0x31a0
leaq -0xd0(%rbp), %rdi
callq 0x31a0
jmp 0x6c59
jmp 0x6bb2
leaq 0x1ed44(%rip), %rsi     # 0x25250
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x311(%rbp)
jmp 0x651d
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x654d
jmp 0x6529
leaq 0x1ed24(%rip), %rsi     # 0x25254
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x312(%rbp)
jmp 0x6541
movb -0x312(%rbp), %al
testb $0x1, %al
jne 0x654d
jmp 0x65b0
movb $0x54, -0xf9(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0xf9(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x656d
movq -0x2d8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x6d00
jmp 0x6582
leaq -0xf8(%rbp), %rdi
callq 0x6dc0
jmp 0x6bb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
leaq 0x1eca4(%rip), %rsi     # 0x2525b
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x313(%rbp)
jmp 0x65c8
movb -0x313(%rbp), %al
testb $0x1, %al
jne 0x65d4
jmp 0x6637
movb $0x57, -0x129(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x129(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x65f4
movq -0x2d8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x6d00
jmp 0x6609
leaq -0x128(%rbp), %rdi
callq 0x6dc0
jmp 0x6bae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
leaq 0x1ec20(%rip), %rsi     # 0x2525e
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x314(%rbp)
jmp 0x664f
movb -0x314(%rbp), %al
testb $0x1, %al
jne 0x665b
jmp 0x66be
movb $0x55, -0x159(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x159(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x667b
movq -0x2d8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x6d00
jmp 0x6690
leaq -0x158(%rbp), %rdi
callq 0x6dc0
jmp 0x6bac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
leaq 0x1eb9e(%rip), %rsi     # 0x25263
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x315(%rbp)
jmp 0x66d6
movb -0x315(%rbp), %al
testb $0x1, %al
jne 0x66e2
jmp 0x6745
movb $0x4c, -0x189(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x189(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x6702
movq -0x2d8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x6d00
jmp 0x6717
leaq -0x188(%rbp), %rdi
callq 0x6dc0
jmp 0x6baa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
leaq 0x1eb1d(%rip), %rsi     # 0x25269
leaq -0x40(%rbp), %rdi
callq 0x6de0
movb %al, -0x316(%rbp)
jmp 0x675d
movb -0x316(%rbp), %al
testb $0x1, %al
jne 0x6769
jmp 0x67cc
movb $0x47, -0x1b9(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1b9(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x6789
movq -0x2d8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x6d00
jmp 0x679e
leaq -0x1b8(%rbp), %rdi
callq 0x6dc0
jmp 0x6ba8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x320(%rbp)
jmp 0x67e2
movq -0x320(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x6b46
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x328(%rbp)
jmp 0x680b
movq -0x328(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x6b46
movl $0x0, -0x1c0(%rbp)
movl $0x0, -0x1c4(%rbp)
movslq -0x1c4(%rbp), %rax
movq %rax, -0x330(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x330(%rbp), %rax
cmpq %rcx, %rax
jae 0x69e9
movslq -0x1c4(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x338(%rbp)
jmp 0x6875
movq -0x338(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x68b1
movslq -0x1c4(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x340(%rbp)
jmp 0x689d
movq -0x340(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x68b1
jmp 0x69d3
movslq -0x1c4(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x34f0
movq %rax, -0x348(%rbp)
jmp 0x68ca
movq -0x348(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x68ed
movl -0x1c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c0(%rbp)
jmp 0x69d1
movb $0x1, -0x209(%rbp)
movl $0x28, %edi
callq 0x3150
movq %rax, -0x350(%rbp)
leaq 0x1e964(%rip), %rsi     # 0x25270
leaq -0x208(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x6ea0
jmp 0x691e
leaq 0x1ea0f(%rip), %rdx     # 0x25334
leaq -0x1e8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x6e50
jmp 0x693a
movq -0x350(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x3600
jmp 0x694f
movq -0x350(%rbp), %rdi
movb $0x0, -0x209(%rbp)
leaq 0x2f43c(%rip), %rsi     # 0x35da0
leaq -0x330b(%rip), %rdx     # 0x3660
callq 0x3460
jmp 0x6c77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x69b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x69a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x31a0
leaq -0x208(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x209(%rbp)
jne 0x69c0
jmp 0x69cc
movq -0x350(%rbp), %rdi
callq 0x3210
jmp 0x6c59
jmp 0x69d3
jmp 0x69d5
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x6832
cmpl $0x1, -0x1c0(%rbp)
jle 0x6ada
movb $0x1, -0x251(%rbp)
movl $0x28, %edi
callq 0x3150
movq %rax, -0x358(%rbp)
leaq 0x1e85b(%rip), %rsi     # 0x25270
leaq -0x250(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x6ea0
jmp 0x6a27
leaq 0x1e906(%rip), %rdx     # 0x25334
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x6e50
jmp 0x6a43
movq -0x358(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x3600
jmp 0x6a58
movq -0x358(%rbp), %rdi
movb $0x0, -0x251(%rbp)
leaq 0x2f333(%rip), %rsi     # 0x35da0
leaq -0x3414(%rip), %rdx     # 0x3660
callq 0x3460
jmp 0x6c77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6abe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6ab2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x31a0
leaq -0x250(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x251(%rbp)
jne 0x6ac9
jmp 0x6ad5
movq -0x358(%rbp), %rdi
callq 0x3210
jmp 0x6c59
movl -0x1c0(%rbp), %eax
testl %eax, %eax
setg %al
addb $0x49, %al
movb %al, -0x281(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x281(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x6b06
movq -0x2d8(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x6d00
jmp 0x6b1b
leaq -0x280(%rbp), %rdi
callq 0x6dc0
jmp 0x6ba6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
movb $0x4e, -0x2b1(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x2b1(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x6e10
jmp 0x6b66
movq -0x2d8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x6d00
jmp 0x6b7b
leaq -0x2b0(%rbp), %rdi
callq 0x6dc0
jmp 0x6ba6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x6dc0
jmp 0x6c59
jmp 0x6ba8
jmp 0x6baa
jmp 0x6bac
jmp 0x6bae
jmp 0x6bb0
jmp 0x6bb2
jmp 0x6bb4
movq -0x2e0(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x34f0
movq %rax, -0x360(%rbp)
jmp 0x6bcd
movq -0x360(%rbp), %rax
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x3450
jmp 0x6be2
movl -0x60(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x6c1a
movq -0x2e0(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x34f0
movq %rax, -0x368(%rbp)
jmp 0x6c03
movq -0x368(%rbp), %rax
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x31b0
jmp 0x6c18
jmp 0x6c1a
jmp 0x6c1c
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x62ff
movb $0x1, -0x55(%rbp)
testb $0x1, -0x55(%rbp)
jne 0x6c40
movq -0x2d8(%rbp), %rdi
callq 0x6fb0
leaq -0x40(%rbp), %rdi
callq 0x31a0
movq -0x2d0(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x2d8(%rbp), %rdi
callq 0x6fb0
leaq -0x40(%rbp), %rdi
callq 0x31a0
movq -0x50(%rbp), %rdi
callq 0x3480
nopw (%rax,%rax)