// File: dgboy2000[P]compress/compress.cpp
// Function: DATCompression::decompression(std::vector<int, std::allocator<int>>)
vector <int> DATCompression::decompression(vector<int> compressed)
{
  vector <int> decompressed = compressed;
  int i,n=30;
  
  // // Simple decompression stack
  // decompressed = huffman_decompress(decompressed);
  // decompressed = diff_decompress(decompressed);

  // bzip-inspired decompression stack (but simpler)
  decompressed = huffman_decompress(decompressed);
  decompressed = golomb_decompress(decompressed);
  decompressed = run_length_decode(decompressed);
  decompressed = burrows_wheeler_decode(decompressed);
  decompressed = run_length_decode(decompressed);
  decompressed = diff_decompress(decompressed);

  return decompressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdx, -0x178(%rbp)
movq %rsi, %rax
movq -0x178(%rbp), %rsi
movq %rdi, -0x160(%rbp)
movq %rdi, %rcx
movq %rcx, -0x170(%rbp)
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x8f80
movq -0x160(%rbp), %rsi
movl $0x1e, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x8f80
jmp 0x3f76
movq -0x168(%rbp), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x4290
jmp 0x3f8c
movq -0x160(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %rsi, -0x180(%rbp)
callq 0x9070
movq -0x180(%rbp), %rdi
callq 0x8f20
leaq -0x58(%rbp), %rdi
callq 0x8f20
movq -0x160(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x8f80
jmp 0x3fcd
movq -0x168(%rbp), %rsi
leaq -0x80(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x48b0
jmp 0x3fe6
movq -0x160(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movq %rsi, -0x188(%rbp)
callq 0x9070
movq -0x188(%rbp), %rdi
callq 0x8f20
leaq -0x98(%rbp), %rdi
callq 0x8f20
movq -0x160(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x8f80
jmp 0x402a
movq -0x168(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x4ab0
jmp 0x4046
movq -0x160(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movq %rsi, -0x190(%rbp)
callq 0x9070
movq -0x190(%rbp), %rdi
callq 0x8f20
leaq -0xc8(%rbp), %rdi
callq 0x8f20
movq -0x160(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x8f80
jmp 0x408d
movq -0x168(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
callq 0x4c50
jmp 0x40a9
movq -0x160(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movq %rsi, -0x198(%rbp)
callq 0x9070
movq -0x198(%rbp), %rdi
callq 0x8f20
leaq -0xf8(%rbp), %rdi
callq 0x8f20
movq -0x160(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x8f80
jmp 0x40f0
movq -0x168(%rbp), %rsi
leaq -0x110(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0x4ab0
jmp 0x410c
movq -0x160(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movq %rsi, -0x1a0(%rbp)
callq 0x9070
movq -0x1a0(%rbp), %rdi
callq 0x8f20
leaq -0x128(%rbp), %rdi
callq 0x8f20
movq -0x160(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x8f80
jmp 0x4153
movq -0x168(%rbp), %rsi
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4f00
jmp 0x416f
movq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x9070
leaq -0x140(%rbp), %rdi
callq 0x8f20
leaq -0x158(%rbp), %rdi
callq 0x8f20
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x4269
jmp 0x425d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x8f20
jmp 0x4279
movq -0x160(%rbp), %rdi
callq 0x8f20
movq -0x170(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x160(%rbp), %rdi
callq 0x8f20
movq -0x60(%rbp), %rdi
callq 0x2380
nop