user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<compress>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  test   %rsi,%rsi
  je     L333
  movb   $0x54,(%rdi)
  cmp    $0x1,%rsi
  je     L29
  movb   $0x49,0x1(%rdi)
  cmp    $0x2,%rsi
  je     L78
  movb   $0x4e,0x2(%rdi)
  cmp    $0x3,%rsi
  je     L386
L86:
  movb   $0x59,0x3(%r14)
  mov    $0x4,%r9d
  xor    %ebx,%ebx
  lea    D42(%rip),%rbp
  test   %r12,%r12
  je     L47
  nop
L27:
  test   %rbx,%rbx
  je     L300
  mov    0x8(%rsp),%rax
  cmp    %rbx,%r12
  mov    %rbx,%r11
  cmovbe %r12,%r11
  xor    %r13d,%r13d
  xor    %ecx,%ecx
  xor    %r10d,%r10d
  mov    %rax,%rsi
  lea    (%rax,%rbx,1),%rdi
  nopl   0x0(%rax,%rax,1)
L136:
  xor    %eax,%eax
  jmp    L126
  nopl   0x0(%rax)
L371:
  add    $0x1,%rax
  lea    (%rax,%rcx,1),%rdx
  cmp    %r12,%rdx
  jae    L154
L126:
  movzbl (%rdi,%rax,1),%edx
  cmp    %dl,(%rsi,%rax,1)
  je     L371
L154:
  cmp    %rax,%r13
  jae    L208
  mov    %rcx,%r10
  mov    %rax,%r13
L208:
  add    $0x1,%rcx
  add    $0x1,%rsi
  cmp    %rcx,%r11
  ja     L136
  cmp    $0x3,%r13
  ja     L247
L300:
  cmp    %r9,%r15
  jbe    L184
L251:
  mov    0x8(%rsp),%rax
  movzbl (%rax,%rbx,1),%eax
  add    $0x1,%rbx
  mov    %al,(%r14,%r9,1)
  add    $0x1,%r9
L79:
  cmp    %r12,%rbx
  jb     L27
  lea    0x1(%r9),%rbp
  lea    0x2(%r9),%rbx
  lea    0x3(%r9),%r12
L104:
  cmp    %r9,%r15
  jbe    L200
L226:
  movb   $0xff,(%r14,%r9,1)
  cmp    %rbp,%r15
  jbe    L37
L306:
  movb   $0x0,(%r14,%rbp,1)
  cmp    %rbx,%r15
  jbe    L115
L43:
  movb   $0x0,(%r14,%rbx,1)
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L247:
  mov    %rbx,%rsi
  add    %r13,%rbx
  sub    %r10,%rsi
  cmp    %r9,%r15
  jbe    L230
L172:
  movb   $0xff,(%r14,%r9,1)
  lea    0x1(%r9),%rcx
  jmp    L361
L56:
  cmp    %r15,%rcx
  jae    L211
L357:
  mov    %esi,%eax
  shr    $0x7,%rsi
  or     $0xffffff80,%eax
  mov    %al,(%r14,%rcx,1)
  add    $0x1,%rcx
L361:
  cmp    $0x7f,%rsi
  ja     L56
  cmp    %r15,%rcx
  jae    L96
L166:
  mov    %sil,(%r14,%rcx,1)
  lea    0x1(%rcx),%rdx
  cmp    $0x7f,%r13
  jbe    L194
L21:
  cmp    %rdx,%r15
  jbe    L340
L95:
  mov    %r13d,%eax
  add    $0x1,%rdx
  shr    $0x7,%r13
  or     $0xffffff80,%eax
  mov    %al,-0x1(%r14,%rdx,1)
  cmp    $0x7f,%r13
  ja     L21
L194:
  cmp    %rdx,%r15
  jbe    L320
L317:
  mov    %r13b,(%r14,%rdx,1)
  lea    0x1(%rdx),%r9
  jmp    L79
L96:
  mov    %rbp,%rdi
  mov    %rcx,0x18(%rsp)
  mov    %rsi,0x10(%rsp)
  call   <error@plt>
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rsi
  jmp    L166
L320:
  mov    %rbp,%rdi
  mov    %rdx,0x10(%rsp)
  call   <error@plt>
  mov    0x10(%rsp),%rdx
  jmp    L317
L211:
  mov    %rbp,%rdi
  mov    %rcx,0x18(%rsp)
  mov    %rsi,0x10(%rsp)
  call   <error@plt>
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rsi
  jmp    L357
L340:
  mov    %rbp,%rdi
  mov    %rdx,0x10(%rsp)
  call   <error@plt>
  mov    0x10(%rsp),%rdx
  jmp    L95
L184:
  mov    %rbp,%rdi
  mov    %r9,0x10(%rsp)
  call   <error@plt>
  mov    0x10(%rsp),%r9
  jmp    L251
L230:
  mov    %rbp,%rdi
  mov    %rsi,0x18(%rsp)
  mov    %r9,0x10(%rsp)
  call   <error@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%r9
  jmp    L172
L333:
  lea    D42(%rip),%rbp
  mov    %rbp,%rdi
  call   <error@plt>
  movb   $0x54,(%r14)
L239:
  mov    %rbp,%rdi
  call   <error@plt>
  movb   $0x49,0x1(%r14)
L223:
  mov    %rbp,%rdi
  call   <error@plt>
  movb   $0x4e,0x2(%r14)
L217:
  mov    %rbp,%rdi
  call   <error@plt>
  jmp    L86
L115:
  lea    D42(%rip),%rdi
  call   <error@plt>
  jmp    L43
L37:
  lea    D42(%rip),%rdi
  call   <error@plt>
  jmp    L306
L200:
  lea    D42(%rip),%rdi
  mov    %r9,0x8(%rsp)
  call   <error@plt>
  mov    0x8(%rsp),%r9
  jmp    L226
L47:
  mov    $0x7,%r12d
  mov    $0x6,%ebx
  mov    $0x5,%ebp
  jmp    L104
L78:
  lea    D42(%rip),%rbp
  jmp    L223
L29:
  lea    D42(%rip),%rbp
  jmp    L239
L386:
  lea    D42(%rip),%rbp
  jmp    L217
```

tool_calls: name: unpack_data
arguments: tag: D42
datatype: string

tool: D42: destination overflow

assistant: ```c
size_t compress(char *dst, size_t dst_sz, char *src, size_t src_sz) {
  size_t dst_pos = 0;
  size_t src_pos = 0;
  do {
    if (dst_pos >= dst_sz) {
      error("destination overflow");
    }
    dst[dst_pos++] = ('T');
  } while (0);
  do {
    if (dst_pos >= dst_sz) {
      error("destination overflow");
    }
    dst[dst_pos++] = ('I');
  } while (0);
  do {
    if (dst_pos >= dst_sz) {
      error("destination overflow");
    }
    dst[dst_pos++] = ('N');
  } while (0);
  do {
    if (dst_pos >= dst_sz) {
      error("destination overflow");
    }
    dst[dst_pos++] = ('Y');
  } while (0);
  while (src_pos < src_sz) {
    size_t best_len = 0;
    size_t best_start = 0;
    for (size_t start = 0; start < src_pos; start++) {
      size_t len = 0;
      while (1) {
        if (start + len >= src_sz)
          break;
        if (src[start + len] != src[src_pos + len])
          break;
        len++;
      }
      if (len > best_len) {
        best_len = len;
        best_start = start;
      }
    }
    if (best_len > 3) {
      size_t delta = src_pos - best_start;
      src_pos += best_len;
      do {
        if (dst_pos >= dst_sz) {
          error("destination overflow");
        }
        dst[dst_pos++] = (0xff);
      } while (0);
      do {
        size_t tmp = (delta);
        do {
          if (tmp >= 128) {
            do {
              if (dst_pos >= dst_sz) {
                error("destination overflow");
              }
              dst[dst_pos++] = (128 | (tmp & 0x7f));
            } while (0);
          } else {
            do {
              if (dst_pos >= dst_sz) {
                error("destination overflow");
              }
              dst[dst_pos++] = (tmp & 0x7f);
            } while (0);
          }
          tmp >>= 7;
        } while (tmp > 0);
      } while (0);
      do {
        size_t tmp = (best_len);
        do {
          if (tmp >= 128) {
            do {
              if (dst_pos >= dst_sz) {
                error("destination overflow");
              }
              dst[dst_pos++] = (128 | (tmp & 0x7f));
            } while (0);
          } else {
            do {
              if (dst_pos >= dst_sz) {
                error("destination overflow");
              }
              dst[dst_pos++] = (tmp & 0x7f);
            } while (0);
          }
          tmp >>= 7;
        } while (tmp > 0);
      } while (0);
    } else {
      do {
        if (dst_pos >= dst_sz) {
          error("destination overflow");
        }
        dst[dst_pos++] = (src[src_pos]);
      } while (0);
      if (src[src_pos] == 0xff) {
        do {
          size_t tmp = (0);
          do {
            if (tmp >= 128) {
              do {
                if (dst_pos >= dst_sz) {
                  error("destination overflow");
                }
                dst[dst_pos++] = (128 | (tmp & 0x7f));
              } while (0);
            } else {
              do {
                if (dst_pos >= dst_sz) {
                  error("destination overflow");
                }
                dst[dst_pos++] = (tmp & 0x7f);
              } while (0);
            }
            tmp >>= 7;
          } while (tmp > 0);
        } while (0);
        do {
          size_t tmp = (1);
          do {
            if (tmp >= 128) {
              do {
                if (dst_pos >= dst_sz) {
                  error("destination overflow");
                }
                dst[dst_pos++] = (128 | (tmp & 0x7f));
              } while (0);
            } else {
              do {
                if (dst_pos >= dst_sz) {
                  error("destination overflow");
                }
                dst[dst_pos++] = (tmp & 0x7f);
              } while (0);
            }
            tmp >>= 7;
          } while (tmp > 0);
        } while (0);
      }
      src_pos++;
    }
  }
  do {
    if (dst_pos >= dst_sz) {
      error("destination overflow");
    }
    dst[dst_pos++] = (0xff);
  } while (0);
  do {
    size_t tmp = (0);
    do {
      if (tmp >= 128) {
        do {
          if (dst_pos >= dst_sz) {
            error("destination overflow");
          }
          dst[dst_pos++] = (128 | (tmp & 0x7f));
        } while (0);
      } else {
        do {
          if (dst_pos >= dst_sz) {
            error("destination overflow");
          }
          dst[dst_pos++] = (tmp & 0x7f);
        } while (0);
      }
      tmp >>= 7;
    } while (tmp > 0);
  } while (0);
  do {
    size_t tmp = (0);
    do {
      if (tmp >= 128) {
        do {
          if (dst_pos >= dst_sz) {
            error("destination overflow");
          }
          dst[dst_pos++] = (128 | (tmp & 0x7f));
        } while (0);
      } else {
        do {
          if (dst_pos >= dst_sz) {
            error("destination overflow");
          }
          dst[dst_pos++] = (tmp & 0x7f);
        } while (0);
      }
      tmp >>= 7;
    } while (tmp > 0);
  } while (0);
  return dst_pos;
}
```