// File: /workspace/github_cpp_makefile_star2_O1/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, -0x68(%rbp)
movq %rdi, %r14
leaq -0x100(%rbp), %rdi
callq 0x656c
movq 0x8(%r14), %rax
movq %r14, -0x38(%rbp)
subq (%r14), %rax
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rax, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x0, 0x8(%rbx)
je 0x487e
xorl %r14d, %r14d
movq (%rbx), %r12
movsbl (%r12,%r14), %edi
callq 0x2260
movb %al, (%r12,%r14)
incq %r14
cmpq %r14, 0x8(%rbx)
ja 0x4864
movq %rbx, -0x40(%rbp)
cmpl $0x0, -0x30(%rbp)
jle 0x4997
movq -0x30(%rbp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
leaq -0x100(%rbp), %r15
imulq $0x98, %r13, %r12
movq -0x38(%rbp), %rax
movq (%rax), %r14
addq %r12, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x20b0
leaq 0x20(%r14), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x20b0
leaq 0x40(%r14), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x20b0
leaq 0x60(%r14), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x20b0
subq $-0x80, %r14
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x5aae
leaq -0x60(%rbp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x6822
movq -0x58(%rbp), %rdx
testq %rdx, %rdx
je 0x4938
xorl %r14d, %r14d
movq -0x60(%rbp), %r15
movsbl (%r15,%r14), %edi
callq 0x2260
movb %al, (%r15,%r14)
incq %r14
movq -0x58(%rbp), %rdx
cmpq %r14, %rdx
ja 0x491a
movq -0x40(%rbp), %rax
cmpq 0x8(%rax), %rdx
jne 0x496e
testq %rdx, %rdx
je 0x495b
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq -0x60(%rbp), %rdi
callq 0x2170
testl %eax, %eax
jne 0x496e
movq -0x38(%rbp), %rax
addq (%rax), %r12
movq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x5880
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
movq %rbx, %r15
je 0x498a
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2160
incq %r13
cmpq -0x30(%rbp), %r13
jne 0x48a3
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x2506
movq -0x20(%rbx), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x49c2
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49e1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a00
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a1f
movq -0xf0(%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 -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4a54
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2160
jmp 0x4a54
jmp 0x4a51
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x56c6
movq %rbx, %rdi
callq 0x2220