// File: /workspace/github_cpp_makefile_star2_O3/mbottini[P]CS250lab2/main.cpp
// Function: getTokens(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
stringVector getTokens(const string& inputString) {
    stringVector tokenVector;
    string currentString = "";

    int i = 0;

    while(i < inputString.length()) {

        currentString = "";

        // Test for "implies" operator.
        if(inputString[i] == '-' && inputString.length() - i > 1) {
            if(inputString.substr(i, 2) == "->") {
                tokenVector.push_back("->");
                i += 2;
            }

            else {
                i++;
            }
        }

        // Test for "XOR" operator.
        else if(inputString[i] == 'X' && inputString.length() - i > 2) {
            if(inputString.substr(i, 3) == "XOR") {
                tokenVector.push_back("XOR");
                i += 3;
            }

            else {
                i++;
            }
        }

        // Test for "iff" operator.

        else if(inputString[i] == '<' && inputString.length() - i > 2) {
            if(inputString.substr(i, 3) == "<->") {
                tokenVector.push_back("<->");
                i += 3;
            }

            else {
                i++;
            }
        }

        // Otherwise, it's hopefully an operator ('v', '^', '!', '(', or ')')
        // or a character.      
        else if(isOperator(inputString[i]) || isParentheses(inputString[i]) 
                                           || isalpha(inputString[i])) {
            currentString += inputString[i];
            tokenVector.push_back(currentString);
            i++;
        }

        // If it's not, then it's just ignored.
        else {
            i++;
        }
    }

    return tokenVector;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x50(%rbp)
movq $0x0, 0x10(%rdi)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x33d4(%rip), %rdx      # 0x6111
leaq -0x70(%rbp), %rdi
movq %rdx, %rsi
callq 0x44d6
cmpq $0x0, 0x8(%r14)
je 0x2fd1
xorl %r15d, %r15d
leaq -0x70(%rbp), %r13
movq -0x68(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
leaq 0x33a6(%rip), %rcx      # 0x6111
xorl %r8d, %r8d
callq 0x21e0
movq (%r14), %rax
movzbl (%rax,%r15), %eax
movsbl %al, %r12d
cmpl $0x57, %eax
jg 0x2e30
cmpl $0x21, %eax
je 0x2f9f
cmpl $0x2d, %eax
je 0x2ef0
cmpl $0x3c, %eax
jne 0x2f8d
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x3, %rcx
jb 0x2f8d
movl $0x3, %ecx
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %rbx, %rdi
leaq 0x32e9(%rip), %rsi      # 0x60be
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2def
callq 0x2120
movl $0x1, %ebx
testl %r12d, %r12d
jne 0x2fbb
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
leaq 0x32ab(%rip), %rsi      # 0x60be
leaq 0x32a7(%rip), %rdx      # 0x60c1
callq 0x44d6
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x48c6
jmp 0x2ed4
cmpl $0x58, %eax
je 0x2e4c
cmpl $0x5e, %eax
je 0x2f9f
cmpl $0x76, %eax
je 0x2f9f
jmp 0x2f8d
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x3, %rcx
jb 0x2f8d
movl $0x3, %ecx
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %rbx, %rdi
leaq 0x323c(%rip), %rsi      # 0x60ba
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2e98
callq 0x2120
movl $0x1, %ebx
testl %r12d, %r12d
jne 0x2fbb
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
leaq 0x31fe(%rip), %rsi      # 0x60ba
leaq 0x31fa(%rip), %rdx      # 0x60bd
callq 0x44d6
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x48c6
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2ee6
callq 0x2120
movl $0x3, %ebx
jmp 0x2fbb
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x2, %rcx
jb 0x2f8d
movl $0x2, %ecx
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %rbx, %rdi
leaq 0x319d(%rip), %rsi      # 0x60bf
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f3c
callq 0x2120
movl $0x1, %ebx
testl %r12d, %r12d
jne 0x2fbb
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
leaq 0x3163(%rip), %rsi      # 0x60bf
leaq 0x315e(%rip), %rdx      # 0x60c1
callq 0x44d6
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x48c6
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f86
callq 0x2120
movl $0x2, %ebx
jmp 0x2fbb
andb $-0x2, %al
cmpb $0x28, %al
je 0x2f9f
movl %r12d, %edi
callq 0x21f0
testl %eax, %eax
je 0x2fca
movq %r13, %rdi
movl %r12d, %esi
callq 0x2100
movl $0x1, %ebx
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x40b8
addl %ebx, %r15d
cmpq %r15, 0x8(%r14)
ja 0x2d5b
jmp 0x2fd1
movl $0x1, %ebx
jmp 0x2fbb
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2fe3
callq 0x2120
movq -0x50(%rbp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ffe
jmp 0x3022
jmp 0x2ffe
jmp 0x3022
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3025
callq 0x2120
jmp 0x3025
jmp 0x3022
movq %rax, %r14
jmp 0x3037
jmp 0x3022
jmp 0x3022
jmp 0x3022
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3037
callq 0x2120
movq -0x50(%rbp), %rdi
callq 0x3f82
movq %r14, %rdi
callq 0x2220