// File: /workspace/github_cpp_makefile_star2_O1/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 0xb6a3(%rip), %rdi      # 0x1bfc8
callq 0x3210
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsd 0x5b4b(%rip), %xmm0     # 0x16490
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x200(%rbp), %r13
leaq -0x50(%rbp), %r14
movq 0xb667(%rip), %r15      # 0x1bfc8
leaq 0x66ef(%rip), %rbx      # 0x17057
leaq -0x408(%rbp), %r12
movq -0x408(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %edx
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x3350
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x10aca
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 %r12d, %r12d
movq -0x200(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x1e0(%rbp,%rax)
jne 0x10a64
movq %r13, %rdi
movq %r14, %rsi
callq 0x3240
movq -0x48(%rbp), %rdx
movslq %r12d, %r12
addq %rdx, %r12
cmpl $0x39, %r12d
jg 0x10a17
movq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0x3210
cmpl $0x3a, %r12d
jl 0x10a4f
movsd -0x30(%rbp), %xmm0
callq 0x10b95
movl $0x1, %edx
movq %r15, %rdi
leaq 0x5f0e(%rip), %rsi      # 0x16944
callq 0x3210
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r15, %rdi
callq 0x3210
movq -0x48(%rbp), %r12
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3210
jmp 0x109db
leaq (%rax,%rbp), %rdi
addq $-0x200, %rdi           # imm = 0xFE00
xorl %esi, %esi
callq 0x3300
movsd -0x58(%rbp), %xmm0
callq 0x10b95
movl $0x1, %edx
movq %r15, %rdi
leaq 0x5eb5(%rip), %rsi      # 0x16944
callq 0x3210
movq %r13, %rdi
movq 0xb502(%rip), %rsi      # 0x1bfa0
callq 0x3170
leaq -0x180(%rbp), %rdi
callq 0x3090
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x10968
callq 0x31c0
jmp 0x10968
movsd -0x30(%rbp), %xmm0
callq 0x10b95
movq 0xb4ed(%rip), %rdi      # 0x1bfc8
leaq 0x55cc(%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 0x10b0a
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 0x10b81
jmp 0x10b34
movq %rax, %rbx
jmp 0x10b5d
movq %rax, %rbx
jmp 0x10b6f
jmp 0x10b3b
movq %rax, %rbx
movq 0xb45b(%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 0x10b6f
callq 0x31c0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x10b81
callq 0x31c0
leaq -0x408(%rbp), %rdi
callq 0x3050
movq %rbx, %rdi
callq 0x3320