// File: /workspace/github_cpp_makefile_star2_O2/KitchMKelly[P]Team-9-OSU-Hackathon-Winter-2018/BawkBusterFunctions.cpp
// Function: importMovieDataFromFile(std::vector<Video, std::allocator<Video>>&)
bool importMovieDataFromFile(vector<Video> &videoList)
{
    string title;
    string genre;
    string director;
    string actor;
    
    std::ifstream inputFile("movie-dataset.csv");
    if (!inputFile)  // ifstream object equals 0 if open fails
    {
        cout << "Could not access file" << endl;
        return false;
    }

    while(inputFile) //read through to the end of the file
    {
        getline(inputFile,title,',');  //title = title from file
        getline(inputFile,genre,',');  //genre = genre from file
        getline(inputFile,director,',');  //director = director from file
        getline(inputFile,actor,'\n');  //actor = actor from file

        videoList.push_back(Video(title, genre, director, actor)); 
    }

    inputFile.close();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rdi, -0x38(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0x68(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x39ed(%rip), %rsi      # 0x603c
leaq -0x340(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2270
movq -0x340(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x320(%rbp,%rax), %ecx
movl %ecx, -0x2c(%rbp)
testb $0x5, %cl
je 0x2698
movq 0x7951(%rip), %rdi      # 0x9fd0
leaq 0x39c8(%rip), %rsi      # 0x604e
callq 0x2180
movq %rax, %rdi
callq 0x20d0
jmp 0x27b1
leaq -0x340(%rbp), %r14
leaq -0x138(%rbp), %rbx
leaq -0x118(%rbp), %r15
leaq -0xf8(%rbp), %r12
leaq -0x3d8(%rbp), %r13
testb $0x5, -0x320(%rbp,%rax)
jne 0x27a5
movq %r14, %rdi
leaq -0xb8(%rbp), %rsi
pushq $0x2c
popq %rdx
callq 0x2280
movq %r14, %rdi
leaq -0x98(%rbp), %rsi
pushq $0x2c
popq %rdx
callq 0x2280
movq %r14, %rdi
leaq -0x78(%rbp), %rsi
pushq $0x2c
popq %rdx
callq 0x2280
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
pushq $0xa
popq %rdx
callq 0x2280
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x21e0
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
callq 0x21e0
movq %r15, %rdi
leaq -0x78(%rbp), %rsi
callq 0x21e0
movq %r12, %rdi
leaq -0x58(%rbp), %rsi
callq 0x21e0
movq %r13, %rdi
leaq -0xd8(%rbp), %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x4d7c
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x4832
movq %r13, %rdi
callq 0x258e
movq %r12, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x20c0
leaq -0xd8(%rbp), %rdi
callq 0x20c0
movq -0x340(%rbp), %rax
movq -0x18(%rax), %rax
jmp 0x26bb
leaq -0x340(%rbp), %rdi
callq 0x2040
testb $0x5, -0x2c(%rbp)
sete %bl
leaq -0x340(%rbp), %rdi
callq 0x2050
leaq -0x58(%rbp), %rdi
callq 0x20c0
leaq -0x78(%rbp), %rdi
callq 0x20c0
leaq -0x98(%rbp), %rdi
callq 0x20c0
leaq -0xb8(%rbp), %rdi
callq 0x20c0
movl %ebx, %eax
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x286f
jmp 0x2860
jmp 0x2860
movq %rax, %rbx
leaq -0x3d8(%rbp), %rdi
callq 0x258e
jmp 0x281f
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x20c0
jmp 0x2835
movq %rax, %rbx
jmp 0x2841
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x20c0
leaq -0x138(%rbp), %rdi
callq 0x20c0
jmp 0x2852
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x20c0
jmp 0x2863
movq %rax, %rbx
leaq -0x340(%rbp), %rdi
callq 0x2050
leaq -0x58(%rbp), %rdi
callq 0x20c0
leaq -0x78(%rbp), %rdi
callq 0x20c0
leaq -0x98(%rbp), %rdi
callq 0x20c0
leaq -0xb8(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2250