// File: Lartu[P]polaris/src/polaris.cpp
// Function: tokenize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
vector<pair<bool, string> > tokenize(string & source){
    vector<pair<bool, string> > tokens;
    string current_token = "";
    bool open_comment = false;
    unsigned int open_block_strings = 0;
    bool open_quoted_string = false;
    // Cuando se cerraron todos los parentesis se pushea
    // Sino cuando se cerraron todos los "
    // Sino cuando hay un espacio
    for(size_t i = 0; i <= source.length(); ++i)
    {
        char current_char = source[i];
        char next_char = source[i + 1];
        if(current_char == '/' && next_char == '*'
        && !open_quoted_string)
        {
            open_comment = true;
            ++i;
        }
        else if(current_char == '*' && next_char == '/'
        && !open_quoted_string)
        {
            open_comment = false;
            ++i;
        }
        else if(current_char == '(' && !open_comment && !open_quoted_string)
        {
            open_block_strings++;
            if(open_block_strings > 1)
            {
                current_token += current_char;
            }
        }
        else if(current_char == ')' && !open_comment && !open_quoted_string)
        {
            open_block_strings--;
            if(open_block_strings > 0)
            {
                current_token += current_char;
            }
            else
            {
                tokens.push_back(make_pair(false, current_token));
                current_token = "";
            }
        }
        else if(current_char == '"' && !open_comment)
        {
            if(open_quoted_string)
            {
                if(open_block_strings > 0)
                {
                    current_token += '"';
                }
                else
                {
                    tokens.push_back(make_pair(false, current_token));
                    current_token = "";
                }
            }
            else
            {
                if(open_block_strings > 0)
                    current_token += '"';
            }
            open_quoted_string = !open_quoted_string;
        }
        else if(
        (current_char == ' '  || current_char == '\t' ||
        current_char == '\n' || current_char == '\0' )
        && !open_comment  && open_block_strings == 0
        && !open_quoted_string)
        {
            if(current_token.length() > 0)
            {
                tokens.push_back(make_pair(true, current_token));
                current_token = "";
            }
        }
        else if(!open_comment)
        {
            current_token += current_char;
        }
    }
    return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x158(%rbp)
movq %rdi, %rax
movq %rax, -0x150(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0xa900
leaq -0x39(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x34a0
movq -0x148(%rbp), %rdx
leaq 0xb65c(%rip), %rsi      # 0x103c7
leaq -0x38(%rbp), %rdi
callq 0x33a0
jmp 0x4d76
leaq -0x39(%rbp), %rdi
callq 0x3330
movb $0x0, -0x4d(%rbp)
movl $0x0, -0x54(%rbp)
movb $0x0, -0x55(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x10(%rbp), %rdi
callq 0x33f0
movq %rax, -0x160(%rbp)
jmp 0x4db3
movq -0x168(%rbp), %rax
movq -0x160(%rbp), %rcx
cmpq %rcx, %rax
ja 0x5222
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x3500
movq %rax, -0x170(%rbp)
jmp 0x4de0
movq -0x170(%rbp), %rax
movb (%rax), %al
movb %al, -0x61(%rbp)
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3500
movq %rax, -0x178(%rbp)
jmp 0x4e05
movq -0x178(%rbp), %rax
movb (%rax), %al
movb %al, -0x62(%rbp)
movsbl -0x61(%rbp), %eax
cmpl $0x2f, %eax
jne 0x4e69
movsbl -0x62(%rbp), %eax
cmpl $0x2a, %eax
jne 0x4e69
testb $0x1, -0x55(%rbp)
jne 0x4e69
movb $0x1, -0x4d(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x520f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x3330
jmp 0x5270
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x5247
movsbl -0x61(%rbp), %eax
cmpl $0x2a, %eax
jne 0x4e96
movsbl -0x62(%rbp), %eax
cmpl $0x2f, %eax
jne 0x4e96
testb $0x1, -0x55(%rbp)
jne 0x4e96
movb $0x0, -0x4d(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x520d
movsbl -0x61(%rbp), %eax
cmpl $0x28, %eax
jne 0x4ed0
testb $0x1, -0x4d(%rbp)
jne 0x4ed0
testb $0x1, -0x55(%rbp)
jne 0x4ed0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
cmpl $0x1, -0x54(%rbp)
jbe 0x4ecb
movsbl -0x61(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x31d0
jmp 0x4ec9
jmp 0x4ecb
jmp 0x520b
movsbl -0x61(%rbp), %eax
cmpl $0x29, %eax
jne 0x4fc4
testb $0x1, -0x4d(%rbp)
jne 0x4fc4
testb $0x1, -0x55(%rbp)
jne 0x4fc4
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jbe 0x4f14
movsbl -0x61(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x31d0
jmp 0x4f0f
jmp 0x4fbf
leaq -0xb0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3170
jmp 0x4f26
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
leaq -0xb0(%rbp), %rdx
callq 0xa990
jmp 0x4f3d
movq -0x158(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xa920
jmp 0x4f52
leaq -0x90(%rbp), %rdi
callq 0xa9d0
jmp 0x4f60
leaq -0xb0(%rbp), %rdi
callq 0x31c0
jmp 0x4f6e
leaq 0xb452(%rip), %rsi      # 0x103c7
leaq -0x38(%rbp), %rdi
callq 0x3390
jmp 0x4f80
jmp 0x4fbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4fac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xa9d0
jmp 0x4faa
jmp 0x4fac
leaq -0xb0(%rbp), %rdi
callq 0x31c0
jmp 0x4fba
jmp 0x5247
jmp 0x5209
movsbl -0x61(%rbp), %eax
cmpl $0x22, %eax
jne 0x50d6
testb $0x1, -0x4d(%rbp)
jne 0x50d6
testb $0x1, -0x55(%rbp)
je 0x50ad
cmpl $0x0, -0x54(%rbp)
jbe 0x5000
leaq -0x38(%rbp), %rdi
movl $0x22, %esi
callq 0x31d0
jmp 0x4ffb
jmp 0x50ab
leaq -0xf8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3170
jmp 0x5012
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
leaq -0xf8(%rbp), %rdx
callq 0xa990
jmp 0x5029
movq -0x158(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xa920
jmp 0x503e
leaq -0xd8(%rbp), %rdi
callq 0xa9d0
jmp 0x504c
leaq -0xf8(%rbp), %rdi
callq 0x31c0
jmp 0x505a
leaq 0xb366(%rip), %rsi      # 0x103c7
leaq -0x38(%rbp), %rdi
callq 0x3390
jmp 0x506c
jmp 0x50ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x5098
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0xa9d0
jmp 0x5096
jmp 0x5098
leaq -0xf8(%rbp), %rdi
callq 0x31c0
jmp 0x50a6
jmp 0x5247
jmp 0x50c7
cmpl $0x0, -0x54(%rbp)
jbe 0x50c5
leaq -0x38(%rbp), %rdi
movl $0x22, %esi
callq 0x31d0
jmp 0x50c3
jmp 0x50c5
jmp 0x50c7
movb -0x55(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x55(%rbp)
jmp 0x5207
movsbl -0x61(%rbp), %eax
cmpl $0x20, %eax
je 0x50fe
movsbl -0x61(%rbp), %eax
cmpl $0x9, %eax
je 0x50fe
movsbl -0x61(%rbp), %eax
cmpl $0xa, %eax
je 0x50fe
movsbl -0x61(%rbp), %eax
cmpl $0x0, %eax
jne 0x51ec
testb $0x1, -0x4d(%rbp)
jne 0x51ec
cmpl $0x0, -0x54(%rbp)
jne 0x51ec
testb $0x1, -0x55(%rbp)
jne 0x51ec
leaq -0x38(%rbp), %rdi
callq 0x33f0
movq %rax, -0x180(%rbp)
jmp 0x512e
movq -0x180(%rbp), %rax
cmpq $0x0, %rax
jbe 0x51ea
leaq -0x140(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3170
jmp 0x5151
leaq -0x120(%rbp), %rdi
movl $0x1, %esi
leaq -0x140(%rbp), %rdx
callq 0xa990
jmp 0x516b
movq -0x158(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xa920
jmp 0x5180
leaq -0x120(%rbp), %rdi
callq 0xa9d0
jmp 0x518e
leaq -0x140(%rbp), %rdi
callq 0x31c0
jmp 0x519c
leaq 0xb224(%rip), %rsi      # 0x103c7
leaq -0x38(%rbp), %rdi
callq 0x3390
jmp 0x51ae
jmp 0x51ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x51da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xa9d0
jmp 0x51d8
jmp 0x51da
leaq -0x140(%rbp), %rdi
callq 0x31c0
jmp 0x51e8
jmp 0x5247
jmp 0x5205
testb $0x1, -0x4d(%rbp)
jne 0x5203
movsbl -0x61(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x31d0
jmp 0x5201
jmp 0x5203
jmp 0x5205
jmp 0x5207
jmp 0x5209
jmp 0x520b
jmp 0x520d
jmp 0x520f
jmp 0x5211
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x4d96
movb $0x1, -0x11(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x31c0
jmp 0x5231
testb $0x1, -0x11(%rbp)
jne 0x5260
jmp 0x5254
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x5270
leaq -0x38(%rbp), %rdi
callq 0x31c0
jmp 0x5252
jmp 0x5270
movq -0x158(%rbp), %rdi
callq 0xa9f0
movq -0x150(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x158(%rbp), %rdi
callq 0xa9f0
jmp 0x527e
jmp 0x5280
movq -0x48(%rbp), %rdi
callq 0x3490
movq %rax, %rdi
callq 0xa540
nopw %cs:(%rax,%rax)