user: Translate the below assembly code into C programming language:

```asm
<decompress>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x18(%rsp)
  test   %rcx,%rcx
  je     L103
  cmpb   $0x54,(%rdx)
  jne    L65
L197:
  lea    D117(%rip),%rbp
  cmp    $0x1,%rbx
  jbe    L158
  cmpb   $0x49,0x1(%r14)
  jne    L32
  lea    D117(%rip),%rbp
  cmp    $0x2,%rbx
  jbe    L301
L196:
  cmpb   $0x4e,0x2(%r14)
  jne    L350
L230:
  lea    D117(%rip),%rbp
  cmp    $0x3,%rbx
  jbe    L358
L49:
  cmpb   $0x59,0x3(%r14)
  je     L17
  lea    D116(%rip),%rdi
  call   <error@plt>
L17:
  movq   $0x0,0x8(%rsp)
  mov    $0x4,%r15d
  lea    D117(%rip),%rbp
  cs nopw 0x0(%rax,%rax,1)
L293:
  cmp    %rbx,%r15
  jae    L52
L339:
  movzbl (%r14,%r15,1),%r12d
  lea    0x1(%r15),%r13
  cmp    $0xff,%r12b
  je     L19
L259:
  mov    0x18(%rsp),%rdx
  cmp    %rdx,0x8(%rsp)
  jae    L40
L200:
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rsi
  mov    %r13,%r15
  mov    %r12b,(%rsi,%rax,1)
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  cmp    %rbx,%r15
  jb     L339
L52:
  mov    %rbp,%rdi
  lea    0x1(%r15),%r13
  call   <error@plt>
  movzbl (%r14,%r15,1),%r12d
  cmp    $0xff,%r12b
  jne    L259
L19:
  xor    %r15d,%r15d
  xor    %r12d,%r12d
L176:
  cmp    %rbx,%r13
  jb     L12
  mov    %rbp,%rdi
  call   <error@plt>
L12:
  add    $0x1,%r13
  mov    %r15d,%ecx
  add    $0x7,%r15d
  movzbl -0x1(%r14,%r13,1),%edi
  mov    %rdi,%rax
  and    $0x7f,%eax
  shl    %cl,%rax
  or     %rax,%r12
  test   %dil,%dil
  js     L176
  xor    %ecx,%ecx
  xor    %r15d,%r15d
  nopl   0x0(%rax)
L260:
  cmp    %rbx,%r13
  jb     L277
  mov    %rbp,%rdi
  mov    %ecx,0x4(%rsp)
  call   <error@plt>
  mov    0x4(%rsp),%ecx
L277:
  add    $0x1,%r13
  movzbl -0x1(%r14,%r13,1),%edi
  mov    %rdi,%rax
  and    $0x7f,%eax
  shl    %cl,%rax
  add    $0x7,%ecx
  or     %rax,%r15
  test   %dil,%dil
  js     L260
  test   %r12,%r12
  jne    L132
  test   %r15,%r15
  je     L83
  cmp    $0x1,%r15
  jne    L243
  mov    0x18(%rsp),%rdx
  cmp    %rdx,0x8(%rsp)
  jae    L273
L279:
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rdx
  mov    %r13,%r15
  movb   $0xff,(%rdx,%rax,1)
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  jmp    L293
  xchg   %ax,%ax
L40:
  lea    D119(%rip),%rdi
  call   <error@plt>
  jmp    L200
  nopl   0x0(%rax)
L243:
  lea    D28(%rip),%rdi
  mov    %r13,%r15
  call   <error@plt>
  jmp    L293
  nopl   0x0(%rax)
L132:
  test   %r15,%r15
  je     L345
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  mov    %rdx,%rax
  sub    %r12,%rax
  add    %rsi,%rax
  add    %rdx,%rsi
  mov    %rsi,%rdi
  sub    %r12,%rdi
  add    %r15,%rdi
  nopl   0x0(%rax,%rax,1)
L245:
  movzbl (%rax),%ecx
  add    $0x1,%rax
  mov    %cl,-0x1(%rax,%r12,1)
  cmp    %rax,%rdi
  jne    L245
  add    %r15,0x8(%rsp)
  mov    %r13,%r15
  jmp    L293
  xchg   %ax,%ax
L273:
  lea    D119(%rip),%rdi
  call   <error@plt>
  jmp    L279
L83:
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  lea    D117(%rip),%rbp
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x54,(%r14)
  jne    L65
L158:
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x49,0x1(%r14)
  je     L301
L32:
  lea    D116(%rip),%rdi
  lea    D117(%rip),%rbp
  call   <error@plt>
  cmp    $0x2,%rbx
  ja     L196
L301:
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x4e,0x2(%r14)
  jne    L350
L358:
  mov    %rbp,%rdi
  call   <error@plt>
  jmp    L49
L350:
  lea    D116(%rip),%rdi
  call   <error@plt>
  jmp    L230
L65:
  lea    D116(%rip),%rdi
  call   <error@plt>
  jmp    L197
L345:
  mov    %r13,%r15
  jmp    L293
```

tool_calls: name: unpack_data
arguments: data_label: D117
data_type: string
name: unpack_data
arguments: data_label: D116
data_type: string
name: unpack_data
arguments: data_label: D119
data_type: string
name: unpack_data
arguments: data_label: D28
data_type: string

tool: D117: input underflow

tool: D116: bad magic

tool: D119: destination overflow

tool: D28: invalid special command

assistant: ```c
size_t decompress(char *dst, size_t dst_sz, char *src, size_t src_sz) {
  size_t src_pos = 0;
  size_t dst_pos = 0;
  unsigned char c;
  do {
    if (src_pos >= src_sz)
      error("input underflow");
    c = src[src_pos++];
  } while (0);
  if (c != 'T')
    error("bad magic");
  do {
    if (src_pos >= src_sz)
      error("input underflow");
    c = src[src_pos++];
  } while (0);
  if (c != 'I')
    error("bad magic");
  do {
    if (src_pos >= src_sz)
      error("input underflow");
    c = src[src_pos++];
  } while (0);
  if (c != 'N')
    error("bad magic");
  do {
    if (src_pos >= src_sz)
      error("input underflow");
    c = src[src_pos++];
  } while (0);
  if (c != 'Y')
    error("bad magic");
  while (1) {
    do {
      if (src_pos >= src_sz)
        error("input underflow");
      c = src[src_pos++];
    } while (0);
    if (c != 0xff) {
      do {
        if (dst_pos >= dst_sz) {
          error("destination overflow");
        }
        dst[dst_pos++] = (c);
      } while (0);
    } else {
      size_t delta, length;
      do {
        delta = 0;
        int shift = 0;
        while (1) {
          unsigned char cc;
          do {
            if (src_pos >= src_sz)
              error("input underflow");
            cc = src[src_pos++];
          } while (0);
          delta |= ((size_t)(cc & 0x7fu)) << shift;
          shift += 7;
          if (!(cc & 128)) {
            break;
          }
        }
      } while (0);
      do {
        length = 0;
        int shift = 0;
        while (1) {
          unsigned char cc;
          do {
            if (src_pos >= src_sz)
              error("input underflow");
            cc = src[src_pos++];
          } while (0);
          length |= ((size_t)(cc & 0x7fu)) << shift;
          shift += 7;
          if (!(cc & 128)) {
            break;
          }
        }
      } while (0);
      if (delta != 0) {
        for (size_t i = 0; i < length; i++) {
          dst[dst_pos] = dst[dst_pos - delta];
          dst_pos++;
        }
      } else {
        if (length == 0) {
          break;
        } else if (length == 1) {
          do {
            if (dst_pos >= dst_sz) {
              error("destination overflow");
            }
            dst[dst_pos++] = (0xff);
          } while (0);
        } else {
          error("invalid special command");
        }
      }
    }
  }
  return dst_pos;
}
```