// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movl $0x20, %edi
callq 0x21d0
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%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 0x31f9
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 0x31ea
movq 0x8(%rbx), %rax
movq %rax, %rcx
shrq $0x5, %rcx
movl %ecx, 0x4(%r14)
btl $0x5, %eax
adcl $0x0, %ecx
movl %ecx, 0x8(%r14)
movslq %ecx, %r13
movq %r13, %rbp
shlq $0x5, %rbp
leaq 0x8(%rbp), %rax
testl %r13d, %r13d
movq $-0x1, %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
movq %r13, (%rax)
testl %r13d, %r13d
je 0x325f
leaq 0x18(%r15), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %rbp
jne 0x3246
movq %r12, %rdi
callq 0x2030
leaq 0x8(%rax), %rcx
movq %r13, (%rax)
testl %r13d, %r13d
je 0x3294
addq $0x18, %rax
shlq $0x5, %r13
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r13
jne 0x327b
addq $0x8, %r15
movq %rcx, 0x10(%r14)
movl 0x4(%r14), %eax
testl %eax, %eax
jle 0x32e3
xorl %ebp, %ebp
movq %rbp, %r12
shlq $0x5, %r12
addq %r15, %r12
xorl %r13d, %r13d
movl 0x4(%r14), %eax
imull %r13d, %eax
addl %ebp, %eax
cltq
movq (%rbx), %rcx
movsbl (%rcx,%rax), %esi
movq %r12, %rdi
callq 0x2150
incl %r13d
cmpl $0x20, %r13d
jne 0x32b3
incq %rbp
movslq 0x4(%r14), %rax
cmpq %rax, %rbp
jl 0x32a6
cmpl 0x8(%r14), %eax
je 0x330d
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 0x32ee
movq (%rbx), %rdi
movq (%rsp), %rax
cmpq %rax, %rdi
je 0x3324
movq (%rax), %rsi
incq %rsi
callq 0x21e0
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21e0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop