// File: /workspace/github_cpp_makefile_star2_O3/dnegovan[P]Intruder-On-Donnar-V/dansLibrary.cpp
// Function: printFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double)
void printFile(std::string fileName, std::string color, double seconds)
{
    //open file
    std::ifstream stream(fileName, std::ios::in);

    //keep a character count, newline if we hit the line width global const
    int counter = 0;

    std::cout << color;
    std::string contents;

    //grab each line
    while(getline(stream, contents))
    {
        if (contents.empty())
        {
            counter = 0;
        }
        std::string temp;
        std::stringstream ss;

        //put each line into stream
        ss << contents;
        while (!ss.eof())
        {
            //put each word into string
            ss >> temp;
            counter += temp.size();
            if (counter < LINE_WIDTH)
            {
                std::cout << temp;
            }
            if (counter >= LINE_WIDTH)
            {
                //wait given seconds to print next line
                wait(seconds);
                std::cout << "\n" << temp;
                counter = 0;
                counter += temp.size();
            }
            //put the space back in
            std::cout << " ";
        }

        ss.clear();
        //wait a bit between lines
        wait(seconds/2);
        std::cout << "\n";
        counter = 0;
    }

    // a bit at the end for drama!
    wait(seconds);

    std::cout << RESET;
    stream.close();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movsd %xmm0, -0x30(%rbp)
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x408(%rbp), %rdi
movl $0x8, %edx
callq 0x32e0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xb8d2(%rip), %rdi      # 0x1bfc8
callq 0x3210
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsd 0x5d7a(%rip), %xmm0     # 0x16490
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x200(%rbp), %r13
leaq -0x50(%rbp), %r14
movq 0xb896(%rip), %r15      # 0x1bfc8
leaq 0x691e(%rip), %r12      # 0x17057
leaq -0x408(%rbp), %rbx
movq -0x408(%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
callq 0x3350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x10895
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r13, %rdi
callq 0x3150
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x3210
xorl %ebx, %ebx
movq -0x200(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x1e0(%rbp,%rax)
jne 0x1082f
movq %r13, %rdi
movq %r14, %rsi
callq 0x3240
movq -0x48(%rbp), %rdx
movslq %ebx, %rbx
addq %rdx, %rbx
cmpl $0x39, %ebx
jg 0x107e8
movq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0x3210
jmp 0x1081a
movsd -0x30(%rbp), %xmm0
callq 0x10960
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6143(%rip), %rsi      # 0x16944
callq 0x3210
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r15, %rdi
callq 0x3210
movq -0x48(%rbp), %rbx
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3210
jmp 0x107ab
leaq (%rax,%rbp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
xorl %esi, %esi
callq 0x3300
movsd -0x58(%rbp), %xmm0
callq 0x10960
movl $0x1, %edx
movq %r15, %rdi
leaq 0x60ea(%rip), %rsi      # 0x16944
callq 0x3210
movq %r13, %rdi
movq 0xb737(%rip), %rsi      # 0x1bfa0
callq 0x3170
leaq -0x180(%rbp), %rdi
callq 0x3090
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x10739
callq 0x31c0
jmp 0x10739
movsd -0x30(%rbp), %xmm0
callq 0x10960
movq 0xb722(%rip), %rdi      # 0x1bfc8
leaq 0x5801(%rip), %rsi      # 0x160ae
movl $0x4, %edx
callq 0x3210
leaq -0x408(%rbp), %rdi
callq 0x3040
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x108d5
callq 0x31c0
leaq -0x408(%rbp), %rdi
callq 0x3050
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1094c
jmp 0x108ff
movq %rax, %rbx
jmp 0x10928
movq %rax, %rbx
jmp 0x1093a
jmp 0x10906
movq %rax, %rbx
movq 0xb690(%rip), %rsi      # 0x1bfa0
leaq -0x200(%rbp), %rdi
callq 0x3170
leaq -0x180(%rbp), %rdi
callq 0x3090
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1093a
callq 0x31c0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1094c
callq 0x31c0
leaq -0x408(%rbp), %rdi
callq 0x3050
movq %rbx, %rdi
callq 0x3320