// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x20
popq %rdi
callq 0x21c0
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
movq 0x8(%rbx), %r15
testb $0x1f, %r15b
je 0x2e35
andl $0x1f, %r15d
movb $0x50, %al
subb %r15b, %al
orl $-0x20, %r15d
movzbl %al, %ebp
testl %r15d, %r15d
je 0x2e31
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2140
incl %r15d
jmp 0x2e1d
movq 0x8(%rbx), %r15
movq %r15, %r13
shrq $0x5, %r13
movl %r13d, 0x4(%r14)
btl $0x5, %r15d
movl %r13d, %eax
adcl $0x0, %eax
movl %eax, 0x8(%r14)
movslq %eax, %r12
movq %r12, %rbp
shlq $0x5, %rbp
leaq 0x8(%rbp), %rax
testl %r12d, %r12d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movq %rdi, (%rsp)
callq 0x2030
movq %rax, %r15
movq %r12, (%rax)
testl %r12d, %r12d
je 0x2e95
leaq 0x18(%r15), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %rbp
jne 0x2e7f
movq (%rsp), %rdi
callq 0x2030
leaq 0x8(%rax), %rcx
movq %r12, (%rax)
testl %r12d, %r12d
je 0x2ec8
addq $0x18, %rax
shlq $0x5, %r12
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r12
jne 0x2eb2
addq $0x8, %r15
movq %rcx, 0x10(%r14)
xorl %ebp, %ebp
movslq %r13d, %rax
cmpq %rax, %rbp
jge 0x2f16
movq %rbp, %r12
shlq $0x5, %r12
addq %r15, %r12
xorl %r13d, %r13d
cmpl $0x20, %r13d
je 0x2f0d
movl 0x4(%r14), %eax
imull %r13d, %eax
addl %ebp, %eax
cltq
movq (%rbx), %rcx
movsbl (%rcx,%rax), %esi
movq %r12, %rdi
callq 0x2140
incl %r13d
jmp 0x2ee7
incq %rbp
movl 0x4(%r14), %r13d
jmp 0x2ed2
cmpl 0x8(%r14), %r13d
jne 0x2f41
movq %rbx, %rdi
callq 0x20d0
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x21d0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rbp
subl $0x1, %ebp
jb 0x2f1c
callq 0x2090
movb %al, (%r14)
movslq 0x4(%r14), %rdi
shlq $0x5, %rdi
addq %r15, %rdi
movsbl %al, %esi
callq 0x2140
jmp 0x2f44