// File: /workspace/github_cpp_makefile_star2_O1/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::compression(std::vector<int, std::allocator<int>>)
vector <int> DATCompression::compression(vector<int> data)
{
    vector <int> compressed = data;
    int i, n=30;
  
    // // Simple compression stack
    // compressed = diff_compress(data);
    // compressed = huffman_compress(compressed);

    // bzip-inspired compression stack (but simpler)
    compressed = diff_compress(compressed);
    compressed = run_length_encode(compressed);
    compressed = burrows_wheeler_encode(compressed);
    compressed = run_length_encode(compressed);
    compressed = golomb_compress(compressed);
    compressed = huffman_compress(compressed);

    return compressed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x6024
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x2996
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64be
movq (%r15), %rdi
testq %rdi, %rdi
je 0x26e5
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2702
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
leaq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x2ca2
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64be
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2749
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2766
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x2dfe
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64be
movq (%r15), %rdi
testq %rdi, %rdi
je 0x27a7
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x27be
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x2ca2
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64be
movq (%r15), %rdi
testq %rdi, %rdi
je 0x27ff
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2816
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r14, %rsi
callq 0x2f4e
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64be
movq (%r14), %rdi
testq %rdi, %rdi
je 0x285a
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2871
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x6024
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x31d6
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64be
movq (%r14), %rdi
testq %rdi, %rdi
je 0x28b2
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x28c9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0x30(%rsp), %rsi
jmp 0x296c
jmp 0x2976
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0x48(%rsp), %rsi
jmp 0x296c
jmp 0x2976
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0x60(%rsp), %rsi
jmp 0x296c
jmp 0x2976
movq %rax, %r14
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0x78(%rsp), %rsi
jmp 0x296c
jmp 0x2976
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0x90(%rsp), %rsi
jmp 0x296c
jmp 0x2976
movq %rax, %r14
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2979
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
jmp 0x2979
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x298d
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x22c0
nop