// File: /workspace/github_cpp_makefile_star2_O3/m0Mh42[P]mash/./src/mash.cpp
// Function: Mash::chunkdata(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
string* Mash::chunkdata(string* input){
    string* data;
    data = new string;
    if (data == nullptr){
        cout << memerr;
        exit(MEMERR);
    }
    *data = *input;

    if (data->length() % 32 > 0){
        int len  = 32 - (data->length() % 32);
        for (int l = 0; l < len; l++){
            data->push_back((unsigned char) '0' + len);
        }
    } // Divisible to 32.

    cspace = data->length() / 32; // Each byte space
    chunk_count = cspace; // Chunk count
    string* chunks;

    if (cspace % 2 != 0)
        chunk_count++; // Extra chunk

    chunks = new string[chunk_count];
    prv_chunks = new string[chunk_count];
    if (chunks == nullptr){
        cout << memerr;
        exit(MEMERR);
    }

    for (int a = 0; a < cspace; a++){ // Chunk all data
        for (int r = 0; r < 32; r++){
            (chunks + a)->push_back((*data)[r * cspace + a]);
        }
    }

    if (cspace != chunk_count){ // Last empty chunk
        for (int i = 0; i < 32; i++){
            rand_c_generator();
            (chunks + cspace)->push_back(rand_c);
        }
    }

    delete data;
    return chunks;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x21d0
movq %rax, %rbx
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
movq 0x8(%rbx), %r15
testb $0x1f, %r15b
je 0x31e5
andl $0x1f, %r15d
movb $0x50, %al
subb %r15b, %al
orl $-0x20, %r15d
movzbl %al, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2150
incl %r15d
jne 0x31d2
movq 0x8(%rbx), %r15
movq %r15, %rbp
shrq $0x5, %rbp
movl %ebp, 0x4(%r14)
btl $0x5, %r15d
movl %ebp, %eax
adcl $0x0, %eax
movl %eax, 0x8(%r14)
movl %eax, 0xc(%rsp)
movslq %eax, %r12
movq %r12, %r13
shlq $0x5, %r13
leaq 0x8(%r13), %rax
testl %r12d, %r12d
movq $-0x1, %rdi
movq %rax, 0x10(%rsp)
cmovnsq %rax, %rdi
movq %rdi, 0x18(%rsp)
callq 0x2030
movq %rax, %r15
movq %r12, (%rax)
testl %r12d, %r12d
je 0x328c
leaq 0x18(%r15), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r13
jne 0x323c
movq 0x18(%rsp), %rdi
callq 0x2030
movq %rax, %rcx
movq %r12, (%rax)
addq $0x8, %rax
addq $0x18, %rcx
shlq $0x5, %r12
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rcx
addq $-0x20, %r12
jne 0x3271
jmp 0x329d
movq 0x10(%rsp), %rdi
callq 0x2030
movq %r12, (%rax)
addq $0x8, %rax
addq $0x8, %r15
movq %rax, 0x10(%r14)
testl %ebp, %ebp
movl 0xc(%rsp), %eax
jle 0x32ee
xorl %r13d, %r13d
movq %r13, %r12
shlq $0x5, %r12
addq %r15, %r12
xorl %ebp, %ebp
movl 0x4(%r14), %eax
imull %ebp, %eax
addl %r13d, %eax
cltq
movq (%rbx), %rcx
movsbl (%rcx,%rax), %esi
movq %r12, %rdi
callq 0x2150
incl %ebp
cmpl $0x20, %ebp
jne 0x32bc
incq %r13
movslq 0x4(%r14), %rbp
cmpq %rbp, %r13
jl 0x32b0
movl 0x8(%r14), %eax
cmpl %eax, %ebp
je 0x3316
movl $0x20, %ebp
callq 0x20a0
movb %al, (%r14)
movslq 0x4(%r14), %rdi
shlq $0x5, %rdi
addq %r15, %rdi
movsbl %al, %esi
callq 0x2150
decl %ebp
jne 0x32f7
movq (%rbx), %rdi
movq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x332e
movq (%rax), %rsi
incq %rsi
callq 0x21e0
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21e0
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop