// File: /workspace/github_cpp_makefile_star2_O2/marknelson[P]LZW/./lzw.h
// Function: void lzw::decompress<std::istream, std::ostream>(std::istream&, std::ostream&, unsigned int)
void decompress( INPUT &input, OUTPUT &output, const unsigned int max_code = 32767  )
{
    input_code_stream<INPUT> in( input, max_code );
    output_symbol_stream<OUTPUT> out( output );

    std::unordered_map<unsigned int,std::string> strings( (max_code * 11) / 10 );
    for ( int unsigned i = 0 ; i < 256 ; i++ )
        strings[i] = std::string(1,i);
    std::string previous_string;
    unsigned int code;
    unsigned int next_code = 257;
    while ( in >> code ) {
        if ( strings.find( code ) == strings.end() ) 
            strings[ code ] = previous_string + previous_string[0];
        out << strings[code];
        if ( previous_string.size() && next_code <= max_code )
            strings[next_code++] = previous_string + strings[code][0];
        previous_string = strings[code];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, -0x60(%rbp)
movl $0x9, -0xa8(%rbp)
movq %rdi, -0xa0(%rbp)
movaps 0x17ee(%rip), %xmm0     # 0x4010
movups %xmm0, -0x98(%rbp)
movl %edx, -0x88(%rbp)
movl %edx, -0x2c(%rbp)
imull $0xb, %edx, %eax
xorl %r14d, %r14d
pushq $0xa
popq %rcx
xorl %edx, %edx
divl %ecx
leaq -0xe0(%rbp), %rdi
leaq -0x58(%rbp), %r15
leaq -0x80(%rbp), %r12
leaq -0x34(%rbp), %r8
movq %rax, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x335a
leaq -0x48(%rbp), %rbx
pushq $0x1
popq %r13
movl %r14d, -0x80(%rbp)
cmpl $0x100, %r14d           # imm = 0x100
jae 0x28b3
movq %rbx, -0x58(%rbp)
movsbl %r14b, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2190
leaq -0xe0(%rbp), %rdi
movq %r12, %rsi
callq 0x34b6
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq %r15, %rdi
callq 0x20c0
movl -0x80(%rbp), %r14d
incl %r14d
jmp 0x2868
leaq -0x58(%rbp), %r15
movq %rbx, (%r15)
andq $0x0, 0x8(%r15)
movb $0x0, 0x10(%r15)
movl $0x101, %ebx            # imm = 0x101
leaq -0x34(%rbp), %r13
leaq -0xe0(%rbp), %r12
leaq -0x80(%rbp), %r14
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x32b8
testb %al, %al
je 0x29b3
movq %r12, %rdi
movq %r13, %rsi
callq 0x3800
testq %rax, %rax
jne 0x292f
movq -0x58(%rbp), %rax
movsbl (%rax), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a43
movq %r12, %rdi
movq %r13, %rsi
callq 0x34b6
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x20c0
movq %r12, %rdi
movq %r13, %rsi
callq 0x34b6
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x2120
cmpq $0x0, -0x50(%rbp)
sete %al
cmpl -0x2c(%rbp), %ebx
seta %cl
orb %al, %cl
jne 0x2998
movq %r12, %rdi
movq %r13, %rsi
callq 0x34b6
movq (%rax), %rax
movsbl (%rax), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a43
movl %ebx, -0x30(%rbp)
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3822
incl %ebx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x20c0
movq %r12, %rdi
movq %r13, %rsi
callq 0x34b6
movq %r15, %rdi
movq %rax, %rsi
callq 0x20d0
jmp 0x28d8
leaq -0x58(%rbp), %rdi
callq 0x20c0
leaq -0xe0(%rbp), %rdi
callq 0x3906
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29de
jmp 0x29f7
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x20c0
jmp 0x29fa
jmp 0x29f7
jmp 0x29f7
jmp 0x29f7
movq %rax, %rbx
jmp 0x2a03
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20c0
leaq -0xe0(%rbp), %rdi
callq 0x3906
movq %rbx, %rdi
callq 0x2250