// File: twekkel[P]mzpq/libzpaq.cpp
// Function: libzpaq::compress(libzpaq::Reader*, libzpaq::Writer*, char const*, char const*, char const*, bool)
void compress(Reader* in, Writer* out, const char* method,
              const char* filename, const char* comment, bool dosha1) {

  // Get block size
  int bs=4;
  if (method && method[0] && method[1]>='0' && method[1]<='9') {
    bs=method[1]-'0';
    if (method[2]>='0' && method[2]<='9') bs=bs*10+method[2]-'0';
    if (bs>11) bs=11;
  }
  bs=(0x100000<<bs)-4096;

  // Compress in blocks
  StringBuffer sb(bs);
  sb.write(0, bs);
  int n=0;
  while (in && (n=in->read((char*)sb.data(), bs))>0) {
    sb.resize(n);
    compressBlock(&sb, out, method, filename, comment, dosha1);
    filename=0;
    comment=0;
    sb.resize(0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movl $0x4, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x16973
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16973
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x30, %eax
jl 0x16973
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x39, %eax
jg 0x16973
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
subl $0x30, %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x30, %eax
jl 0x16964
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x39, %eax
jg 0x16964
imull $0xa, -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
movsbl 0x2(%rcx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x30(%rbp)
cmpl $0xb, -0x30(%rbp)
jle 0x16971
movl $0xb, -0x30(%rbp)
jmp 0x16973
movb -0x30(%rbp), %cl
movl $0x100000, %eax         # imm = 0x100000
shll %cl, %eax
addl $0xfffff000, %eax       # imm = 0xFFFFF000
movl %eax, -0x30(%rbp)
movslq -0x30(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x312c0
movq -0x88(%rbp), %rdi
movl -0x30(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x31370
jmp 0x169ae
movl $0x0, -0x80(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x89(%rbp)
je 0x16a18
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x313e0
movq %rax, -0x98(%rbp)
jmp 0x169e1
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdi
movl -0x30(%rbp), %edx
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
movl %eax, -0xa4(%rbp)
jmp 0x16a03
movl -0xa4(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x0, %eax
setg %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x16a24
jmp 0x16a92
movslq -0x80(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x31400
jmp 0x16a33
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movzbl -0x29(%rbp), %r9d
andl $0x1, %r9d
leaq -0x70(%rbp), %rdi
callq 0x16ab0
jmp 0x16a57
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x31400
jmp 0x16a76
jmp 0x169b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x31440
jmp 0x16aa4
leaq -0x70(%rbp), %rdi
callq 0x31440
addq $0xb0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x5490
nopl (%rax)