// File: /workspace/github_cpp_makefile_star2_O1/panosfoto[P]NGramGraphParallel/src/StringSplitter.cpp
// Function: StringSplitter::splitPayloadToAtoms(Payload<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*)
vector<Atom<std::string>> StringSplitter::splitPayloadToAtoms(Payload<std::string> *payloadToSplit)
{
    if (atomSize > (*payloadToSplit).getPayload().length())
    {
        // TODO : replace with exception throwing
        cerr << "splitPayloadToAtoms(): Warning: atom size provided is greater than the length of the payload. Payload could not be split." << endl;
        //return;
    }
    vector<Atom<std::string>> atoms;
    std::string tempString;
    Atom<std::string> *tempAtom;
    //test implementation
    for(unsigned int i = 0 ; i < (*payloadToSplit).getPayload().length()-atomSize+1 ; ++i)
    {
        tempString.clear();
        for(unsigned int j = 0 ; j < atomSize ; ++j)
        {
            tempString.push_back((*payloadToSplit).getPayload()[i+j]);
        }
        tempAtom = new Atom<std::string>(tempString);
        atoms.push_back(*tempAtom);
        // added so valgrind won't count it as a memory leak
        delete tempAtom;
    }
    return atoms;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movl 0x8(%rsi), %r12d
movq (%rdx), %rax
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
callq *0x18(%rax)
movq (%rbx), %rdi
movq 0x8(%rbx), %rbx
leaq -0x40(%rbp), %r13
cmpq %r13, %rdi
je 0x155e8
callq 0x6290
cmpq %r12, %rbx
jae 0x1562f
movq 0xf9ec(%rip), %rbx      # 0x24fe0
leaq 0x6390(%rip), %rsi      # 0x1b98b
movl $0x79, %edx
movq %rbx, %rdi
callq 0x6300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x62a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x61e0
xorps %xmm0, %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
xorl %r12d, %r12d
movq %r12, 0x10(%rax)
leaq -0x50(%rbp), %rax
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r14), %rax
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq *0x18(%rax)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rbx
movl 0x8(%r15), %r13d
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x15676
callq 0x6290
movl %r12d, %eax
subq %r13, %rbx
incq %rbx
cmpq %rax, %rbx
jbe 0x1574f
movq $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
cmpl $0x0, 0x8(%r15)
je 0x156e0
xorl %ebx, %ebx
movq (%r14), %rax
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq *0x18(%rax)
leal (%r12,%rbx), %eax
movq -0x70(%rbp), %rcx
movsbl (%rcx,%rax), %esi
leaq -0x50(%rbp), %rdi
callq 0x6270
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x156d4
callq 0x6290
incq %rbx
movl 0x8(%r15), %eax
cmpq %rax, %rbx
jb 0x156a0
movl $0x28, %edi
callq 0x62b0
movq %rax, %rbx
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %r13
movq %r13, %rdi
callq 0x7db0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x153ae
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x15732
callq 0x6290
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x157e0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
incq %r12
jmp 0x1564f
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x15761
callq 0x6290
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x15791
movq %rax, %r14
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x15791
callq 0x6290
movq %rbx, %rdi
callq 0x6290
jmp 0x157bd
jmp 0x157ba
jmp 0x157ba
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
leaq -0x40(%rbp), %rbx
je 0x157c1
callq 0x6290
jmp 0x157c1
movq %rax, %r14
leaq -0x40(%rbp), %rbx
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x157cf
callq 0x6290
movq -0x30(%rbp), %rdi
callq 0x13e12
movq %r14, %rdi
callq 0x6490