// File: /workspace/github_cpp_makefile_star2_O1/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 0x3443(%rip), %rdx      # 0x6111
leaq -0x70(%rbp), %rdi
movq %rdx, %rsi
callq 0x44e2
cmpq $0x0, 0x8(%r14)
je 0x2fb2
xorl %r15d, %r15d
leaq 0x353f(%rip), %rbx      # 0x622e
movq -0x68(%rbp), %rdx
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
leaq 0x3411(%rip), %rcx      # 0x6111
xorl %r8d, %r8d
callq 0x21e0
movq (%r14), %rax
movzbl (%rax,%r15), %eax
movb $0x1, %cl
cmpl $0x3b, %eax
jg 0x2dd3
cmpl $0x21, %eax
je 0x2f61
cmpl $0x2d, %eax
leaq -0x48(%rbp), %r12
jne 0x2f45
movq 0x8(%r14), %rdx
subq %r15, %rdx
cmpq $0x2, %rdx
jb 0x2e84
movl $0x2, %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %r12, %rdi
leaq 0x3360(%rip), %rsi      # 0x60bf
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d79
callq 0x2120
movl $0x1, %r13d
testl %r12d, %r12d
jne 0x2f9b
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
leaq 0x3321(%rip), %rsi      # 0x60bf
leaq 0x331c(%rip), %rdx      # 0x60c1
callq 0x44e2
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x48d8
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2dc8
callq 0x2120
movl $0x2, %r13d
jmp 0x2f9b
cmpl $0x3c, %eax
leaq -0x48(%rbp), %r12
je 0x2ea2
cmpl $0x58, %eax
jne 0x2f45
movq 0x8(%r14), %rdx
subq %r15, %rdx
cmpq $0x3, %rdx
jb 0x2e6f
movl $0x3, %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %r12, %rdi
leaq 0x32a7(%rip), %rsi      # 0x60ba
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2e2d
callq 0x2120
movl $0x1, %r13d
testl %r12d, %r12d
jne 0x2f9b
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
leaq 0x3268(%rip), %rsi      # 0x60ba
leaq 0x3264(%rip), %rdx      # 0x60bd
callq 0x44e2
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x48d8
jmp 0x2f27
cmpb $0x21, %al
je 0x2f61
movzbl %al, %edx
cmpl $0x3c, %edx
je 0x2ea2
jmp 0x2f45
cmpb $0x21, %al
je 0x2f61
movzbl %al, %edx
cmpl $0x3c, %edx
je 0x2ea2
cmpl $0x58, %edx
je 0x2de9
jmp 0x2f45
movq 0x8(%r14), %rdx
subq %r15, %rdx
cmpq $0x3, %rdx
jb 0x2f41
movl $0x3, %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2160
movq %r12, %rdi
leaq 0x31ee(%rip), %rsi      # 0x60be
callq 0x2060
movl %eax, %r12d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2eea
callq 0x2120
movl $0x1, %r13d
testl %r12d, %r12d
jne 0x2f9b
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
leaq 0x31af(%rip), %rsi      # 0x60be
leaq 0x31ab(%rip), %rdx      # 0x60c1
callq 0x44e2
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x48d8
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f39
callq 0x2120
movl $0x3, %r13d
jmp 0x2f9b
cmpb $0x21, %al
je 0x2f61
xorl %edx, %edx
movq %rdx, %rcx
cmpq $0x2, %rdx
je 0x2f5a
leaq 0x1(%rcx), %rdx
cmpb 0x1(%rcx,%rbx), %al
jne 0x2f47
cmpq $0x2, %rcx
setb %cl
movsbl %al, %r12d
andb $-0x2, %al
cmpb $0x28, %al
sete %al
orb %cl, %al
jne 0x2f7c
movl %r12d, %edi
callq 0x21f0
testl %eax, %eax
je 0x2faa
leaq -0x70(%rbp), %rdi
movl %r12d, %esi
callq 0x2100
movl $0x1, %r13d
movq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x40d6
addl %r13d, %r15d
cmpq %r15, 0x8(%r14)
ja 0x2cef
jmp 0x2fb2
movl $0x1, %r13d
jmp 0x2f9b
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2fc4
callq 0x2120
movq -0x50(%rbp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2fdf
jmp 0x3003
jmp 0x2fdf
jmp 0x3003
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3006
callq 0x2120
jmp 0x3006
jmp 0x3003
movq %rax, %r14
jmp 0x3018
jmp 0x3003
jmp 0x3003
jmp 0x3003
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3018
callq 0x2120
movq -0x50(%rbp), %rdi
callq 0x3faa
movq %r14, %rdi
callq 0x2220