// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %rsi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
andq $0x0, 0x10(%rdi)
leaq 0x374a(%rip), %rsi      # 0x60f5
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2090
xorl %r15d, %r15d
leaq -0x78(%rbp), %r13
leaq -0x58(%rbp), %r12
movl %r15d, %r15d
cmpq %r15, 0x8(%r14)
jbe 0x2b8c
movq %r13, %rdi
leaq 0x371b(%rip), %rsi      # 0x60f5
callq 0x2250
movq (%r14), %rdi
movzbl (%rdi,%r15), %eax
cmpl $0x58, %eax
je 0x2ad9
cmpl $0x3c, %eax
je 0x2a72
cmpl $0x2d, %eax
jne 0x2b43
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x2, %rcx
jb 0x2b43
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x2
popq %rcx
callq 0x2180
movq %r12, %rdi
leaq 0x3679(%rip), %rsi      # 0x60a3
callq 0x3955
movl %eax, %ebx
movq %r12, %rdi
callq 0x20c0
pushq $0x1
popq %rcx
testb %bl, %bl
je 0x2b84
movq %r12, %rdi
leaq 0x3655(%rip), %rsi      # 0x60a3
leaq -0x29(%rbp), %rdx
callq 0x2090
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x41ce
movq %r12, %rdi
callq 0x20c0
pushq $0x2
jmp 0x2b40
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x3, %rcx
jb 0x2b43
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x3
popq %rcx
callq 0x2180
movq %r12, %rdi
leaq 0x3604(%rip), %rsi      # 0x60a2
callq 0x3955
movl %eax, %ebx
movq %r12, %rdi
callq 0x20c0
pushq $0x1
popq %rcx
testb %bl, %bl
je 0x2b84
movq %r12, %rdi
leaq 0x35e0(%rip), %rsi      # 0x60a2
leaq -0x29(%rbp), %rdx
callq 0x2090
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x41ce
jmp 0x2b36
movq 0x8(%r14), %rcx
subq %r15, %rcx
cmpq $0x3, %rcx
jb 0x2b43
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
pushq $0x3
popq %rcx
callq 0x2180
movq %r12, %rdi
leaq 0x359d(%rip), %rsi      # 0x609e
callq 0x3955
movl %eax, %ebx
movq %r12, %rdi
callq 0x20c0
pushq $0x1
popq %rcx
testb %bl, %bl
je 0x2b84
movq %r12, %rdi
leaq 0x357d(%rip), %rsi      # 0x609e
leaq -0x29(%rbp), %rdx
callq 0x2090
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x41ce
movq %r12, %rdi
callq 0x20c0
pushq $0x3
popq %rcx
jmp 0x2b84
addq %r15, %rdi
movsbl %al, %ebx
callq 0x33d6
movl %ebx, %ecx
andb $-0x2, %cl
cmpb $0x28, %cl
sete %cl
orb %al, %cl
jne 0x2b6b
movl %ebx, %edi
callq 0x2210
pushq $0x1
popq %rcx
testl %eax, %eax
je 0x2b84
movq %r13, %rdi
movl %ebx, %esi
callq 0x2120
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x3966
pushq $0x1
popq %rcx
addl %ecx, %r15d
jmp 0x29c3
leaq -0x78(%rbp), %rdi
callq 0x20c0
movq -0x38(%rbp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2bd7
jmp 0x2bcb
jmp 0x2bcb
jmp 0x2bb7
jmp 0x2bcb
jmp 0x2bb7
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x20c0
jmp 0x2bce
jmp 0x2bcb
jmp 0x2bcb
jmp 0x2bcb
movq %rax, %r14
leaq -0x78(%rbp), %rdi
callq 0x20c0
movq -0x38(%rbp), %rdi
callq 0x3870
movq %r14, %rdi
callq 0x2240