// File: /workspace/github_cpp_makefile_star2_O3/KitchMKelly[P]Team-9-OSU-Hackathon-Winter-2018/BawkBusterFunctions.cpp
// Function: titleSearchVector(std::vector<Video, std::allocator<Video>> const&, std::vector<Video, std::allocator<Video>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void titleSearchVector(const vector<Video>& videos, vector<Video>& results, string titleIn)  
//takes a const vector of movies to search, a vector of videos to add results to, and a search term.
{
    Video temp;  //creates a temporary video to hold values as we process vector
    int index = 0;
    int size = videos.size();
    for(int i = 0; i < titleIn.size(); i++)
      titleIn.at(i) = toupper(titleIn.at(i));
    while(index < size)
    {
       	temp = videos[index];  //set temp equal to the video at [index]
        std::string tempName = temp.getTitle();
        for (int i = 0; i < tempName.size(); i++)
          tempName.at(i) = toupper(tempName.at(i));
       	if(tempName == titleIn)
    		results.push_back(videos[index]);  //if video is found, add it to results
       	index++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
movq %rsi, -0x60(%rbp)
movq %rdi, %r15
leaq -0xf8(%rbp), %rdi
callq 0x666c
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x0, 0x8(%rbx)
je 0x491e
xorl %r14d, %r14d
movq (%rbx), %r12
movsbl (%r12,%r14), %edi
callq 0x2260
movb %al, (%r12,%r14)
incq %r14
cmpq %r14, 0x8(%rbx)
ja 0x4904
movq %rbx, -0x38(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x4a41
movq -0x30(%rbp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
leaq -0xf8(%rbp), %rbx
imulq $0x98, %r13, %r12
movq (%r15), %r14
addq %r12, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20b0
leaq 0x20(%r14), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x20b0
leaq 0x40(%r14), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x20b0
leaq 0x60(%r14), %rsi
leaq -0x98(%rbp), %rdi
callq 0x20b0
subq $-0x80, %r14
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x5b80
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x6922
cmpq $0x0, -0x50(%rbp)
je 0x4a01
movq %r15, %rbx
xorl %r14d, %r14d
movq -0x58(%rbp), %r15
movsbl (%r15,%r14), %edi
callq 0x2260
movb %al, (%r15,%r14)
incq %r14
movq -0x50(%rbp), %rdx
cmpq %r14, %rdx
ja 0x49b4
movq -0x38(%rbp), %rax
cmpq 0x8(%rax), %rdx
movq %rbx, %r15
leaq -0xf8(%rbp), %rbx
jne 0x4a1b
testq %rdx, %rdx
je 0x4a0c
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq -0x58(%rbp), %rdi
callq 0x2170
testl %eax, %eax
jne 0x4a1b
jmp 0x4a0c
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x4a1b
addq (%r15), %r12
movq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x5952
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4a34
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2160
incq %r13
cmpq -0x30(%rbp), %r13
jne 0x4943
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x2506
movq -0x20(%rbx), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x4a6c
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a8b
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xc8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4aaa
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4ac9
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x2160
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x4afe
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2160
jmp 0x4afe
jmp 0x4afb
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x5798
movq %rbx, %rdi
callq 0x2220