user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<lz77_compress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x98,%rsp
  mov    %rsi,0x40(%rsp)
  mov    %rdi,%r14
  mov    $0x4,%edi
  mov    %edx,0x4c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x1088(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsi)
  call   <malloc@plt>
  test   %rax,%rax
  je     L148
  lea    0x4c(%rsp),%rsi
  mov    $0x4,%edx
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <memcpy@plt>
  lea    0x80(%rsp),%rax
  lea    0x60(%rsp),%rbx
  xor    %esi,%esi
  mov    $0x1000,%edx
  mov    %rax,%rdi
  mov    %rax,0x18(%rsp)
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x20,%edx
  mov    %rbx,%rdi
  mov    %rbx,0x10(%rsp)
  call   <memset@plt>
  mov    0x4c(%rsp),%ecx
  xor    %eax,%eax
  mov    %rbx,%rsi
  mov    %ecx,0xc(%rsp)
  jmp    L185
  nopl   0x0(%rax,%rax,1)
L193:
  movzbl (%r14,%rax,1),%edx
  mov    %dl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    $0x20,%rax
  je     L208
L185:
  mov    %eax,%ebx
  cmp    %eax,%ecx
  jg     L193
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L41
L70:
  lea    0x53(%rsp),%rax
  mov    %ebx,0x24(%rsp)
  mov    $0x20,%r15d
  mov    %rax,0x28(%rsp)
  lea    0x54(%rsp),%rax
  mov    %rax,0x30(%rsp)
  mov    %r14,%rax
  mov    %r15d,%r14d
  mov    %rax,%r15
L54:
  mov    0x28(%rsp),%rcx
  mov    0x30(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <compare_win@plt>
  mov    %eax,0x20(%rsp)
  test   %eax,%eax
  je     L62
  mov    0x54(%rsp),%edi
  shl    $0x8,%eax
  mov    $0x26,%r12d
  mov    $0x1a,%r13d
  shl    $0xd,%edi
  or     %eax,%edi
  movzbl 0x53(%rsp),%eax
  or     $0x2000000,%edi
  movslq %edi,%rdi
  or     %rax,%rdi
L152:
  mov    %rdi,0x58(%rsp)
  add    %r14d,%r13d
  mov    %r14d,%ebx
  sub    %r14d,%r12d
  call   <htonl@plt>
  mov    %rax,0x58(%rsp)
  jmp    L67
  nop
L27:
  mov    %r14d,%ebx
L67:
  test   $0x7,%r14b
  jne    L113
  mov    %r14d,%esi
  mov    %rbp,%rdi
  sar    $0x3,%esi
  add    $0x1,%esi
  call   <realloc@plt>
  test   %rax,%rax
  je     L16
  mov    %rax,%rbp
L113:
  lea    (%r12,%r14,1),%esi
  lea    0x58(%rsp),%rdi
  call   <bit_get@plt>
  mov    %r14d,%esi
  mov    %rbp,%rdi
  add    $0x1,%r14d
  mov    %eax,%edx
  call   <bit_set@plt>
  cmp    %r13d,%r14d
  jne    L27
  mov    0x20(%rsp),%eax
  mov    %ebx,0x48(%rsp)
  mov    $0x1000,%r12d
  mov    0x18(%rsp),%rbx
  lea    0x1(%rax),%r13d
  movslq %r13d,%rcx
  sub    %r13d,%r12d
  mov    %rbx,%rdi
  lea    (%rbx,%rcx,1),%rsi
  mov    %r12d,%edx
  mov    %rcx,0x38(%rsp)
  call   <memmove@plt>
  movslq %r12d,%rdi
  mov    %r13d,%edx
  mov    $0x20,%r12d
  add    %rbx,%rdi
  mov    0x10(%rsp),%rbx
  sub    %r13d,%r12d
  mov    %rbx,%rsi
  call   <memmove@plt>
  mov    0x38(%rsp),%rcx
  mov    %r12d,%edx
  mov    %rbx,%rdi
  lea    (%rbx,%rcx,1),%rsi
  call   <memmove@plt>
  cmp    $0x1f,%r12d
  jg     L169
  movslq 0x24(%rsp),%rax
  mov    0x20(%rsp),%edx
  movslq %r12d,%r12
  mov    0x4c(%rsp),%ecx
  sub    %rax,%r12
  lea    0x1(%rax,%rdx,1),%rsi
  lea    (%rbx,%r12,1),%rdx
  jmp    L168
  nopw   0x0(%rax,%rax,1)
L24:
  movzbl (%r15,%rax,1),%edi
  lea    0x1(%rax),%ebx
  mov    %dil,(%rdx,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  je     L195
L168:
  mov    %eax,%ebx
  cmp    %eax,%ecx
  jg     L24
L195:
  mov    %ebx,0x24(%rsp)
L169:
  sub    %r13d,0xc(%rsp)
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jg     L54
  mov    0x48(%rsp),%eax
  sar    $0x3,%eax
  add    $0x1,%eax
L4:
  mov    0x40(%rsp),%rcx
  mov    %rbp,(%rcx)
  jmp    L89
  nopl   0x0(%rax)
L62:
  movzbl 0x53(%rsp),%edi
  mov    $0x37,%r12d
  mov    $0x9,%r13d
  jmp    L152
  cs nopw 0x0(%rax,%rax,1)
L16:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
L89:
  mov    0x1088(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L164
  add    $0x1098,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L208:
  mov    $0x20,%ebx
  jmp    L70
L41:
  mov    $0x4,%eax
  jmp    L4
L148:
  mov    $0xffffffff,%eax
  jmp    L89
L164:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lz77_compress(const unsigned char *original, unsigned char **compressed, int size) {
  unsigned long token;
  unsigned char window[4096], buffer[32], *comp, *temp, next;
  int offset, length, remaining, tbits, hsize, ipos, opos, tpos, i;
  *compressed = NULL;
  hsize = sizeof(int);
  if ((comp = (unsigned char *)malloc(hsize)) == NULL)
    return -1;
  memcpy(comp, &size, sizeof(int));
  memset(window, 0, 4096);
  memset(buffer, 0, 32);
  ipos = 0;
  for (i = 0; i < 32 && ipos < size; i++) {
    buffer[i] = original[ipos];
    ipos++;
  }
  opos = hsize * 8;
  remaining = size;
  while (remaining > 0) {
    if ((length = compare_win(window, buffer, &offset, &next)) != 0) {
      token = 0x00000001 << ((1 + 12 + 8 + 5) - 1);
      token = token | (offset << ((1 + 12 + 8 + 5) - 1 - 12));
      token = token | (length << ((1 + 12 + 8 + 5) - 1 - 12 - 5));
      token = token | next;
      tbits = (1 + 12 + 8 + 5);
    } else {
      token = 0x00000000;
      token = token | next;
      tbits = (1 + 8);
    }
    token = htonl(token);
    for (i = 0; i < tbits; i++) {
      if (opos % 8 == 0) {
        if ((temp = (unsigned char *)realloc(comp, (opos / 8) + 1)) == NULL) {
          free(comp);
          return -1;
        }
        comp = temp;
      }
      tpos = (sizeof(unsigned long) * 8) - tbits + i;
      bit_set(comp, opos, bit_get((unsigned char *)&token, tpos));
      opos++;
    }
    length++;
    memmove(&window[0], &window[length], 4096 - length);
    memmove(&window[4096 - length], &buffer[0], length);
    memmove(&buffer[0], &buffer[length], 32 - length);
    for (i = 32 - length; i < 32 && ipos < size; i++) {
      buffer[i] = original[ipos];
      ipos++;
    }
    remaining = remaining - length;
  }
  *compressed = comp;
  return ((opos - 1) / 8) + 1;
}
```