user: Please show me the C implementation that matches the assembly code listed below:

```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     L138
  cmpb   $0x54,(%rdx)
  jne    L228
L81:
  lea    D7(%rip),%rbp
  cmp    $0x1,%rbx
  jbe    L148
  cmpb   $0x49,0x1(%r14)
  jne    L484
  lea    D7(%rip),%rbp
  cmp    $0x2,%rbx
  jbe    L475
L253:
  cmpb   $0x4e,0x2(%r14)
  jne    L347
L134:
  lea    D7(%rip),%rbp
  cmp    $0x3,%rbx
  jbe    L306
L194:
  cmpb   $0x59,0x3(%r14)
  je     L82
  lea    D17(%rip),%rdi
  call   <error@plt>
L82:
  movq   $0x0,0x8(%rsp)
  mov    $0x4,%r15d
  lea    D7(%rip),%rbp
  mov    %r15,%r13
  mov    %r14,%r15
  nopl   0x0(%rax)
L237:
  cmp    %rbx,%r13
  jae    L499
L147:
  lea    0x1(%r13),%r12
  movzbl (%r15,%r13,1),%r13d
  cmp    $0xff,%r13b
  je     L482
L450:
  mov    0x18(%rsp),%rdi
  cmp    %rdi,0x8(%rsp)
  jae    L75
L152:
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rsi
  mov    %r13b,(%rsi,%rax,1)
  add    $0x1,%rax
  mov    %r12,%r13
  mov    %rax,0x8(%rsp)
  cmp    %rbx,%r13
  jb     L147
L499:
  mov    %rbp,%rdi
  lea    0x1(%r13),%r12
  call   <error@plt>
  movzbl (%r15,%r13,1),%r13d
  cmp    $0xff,%r13b
  jne    L450
L482:
  xor    %r13d,%r13d
  xor    %r14d,%r14d
L14:
  cmp    %rbx,%r12
  jb     L477
  mov    %rbp,%rdi
  call   <error@plt>
L477:
  add    $0x1,%r12
  mov    %r13d,%ecx
  add    $0x7,%r13d
  movzbl -0x1(%r15,%r12,1),%edx
  mov    %rdx,%rax
  and    $0x7f,%eax
  shl    %cl,%rax
  or     %rax,%r14
  test   %dl,%dl
  js     L14
  mov    %r14,%rsi
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  nopw   0x0(%rax,%rax,1)
L317:
  cmp    %rbx,%r12
  jae    L178
  add    $0x1,%r12
  mov    %r13d,%ecx
  add    $0x7,%r13d
  movzbl -0x1(%r15,%r12,1),%edx
  mov    %rdx,%rax
  and    $0x7f,%eax
  shl    %cl,%rax
  or     %rax,%r14
  test   %dl,%dl
  js     L317
  test   %rsi,%rsi
  jne    L111
L188:
  test   %r14,%r14
  je     L326
  cmp    $0x1,%r14
  jne    L57
  mov    0x18(%rsp),%rdi
  cmp    %rdi,0x8(%rsp)
  jae    L169
L113:
  mov    0x8(%rsp),%rax
  mov    0x10(%rsp),%rdi
  mov    %r12,%r13
  movb   $0xff,(%rdi,%rax,1)
  add    $0x1,%rax
  mov    %rax,0x8(%rsp)
  jmp    L237
  nopl   (%rax)
L178:
  add    $0x1,%r12
  mov    %rbp,%rdi
  mov    %rsi,(%rsp)
  call   <error@plt>
  movzbl -0x1(%r15,%r12,1),%edx
  mov    %r13d,%ecx
  add    $0x7,%r13d
  mov    (%rsp),%rsi
  mov    %rdx,%rax
  and    $0x7f,%eax
  shl    %cl,%rax
  or     %rax,%r14
  test   %dl,%dl
  js     L317
  test   %rsi,%rsi
  je     L188
L111:
  test   %r14,%r14
  je     L442
  mov    0x8(%rsp),%rdx
  lea    -0x1(%rsi),%rdi
  lea    -0x1(%r14),%rax
  mov    %rdx,%rcx
  sub    %rsi,%rcx
  cmp    $0xe,%rdi
  jbe    L445
  cmp    $0x6,%rax
  jbe    L445
  cmp    $0xe,%rax
  jbe    L199
  mov    0x10(%rsp),%rax
  mov    %r14,%rdi
  and    $0xfffffffffffffff0,%rdi
  lea    (%rax,%rcx,1),%r10
  add    %rdx,%rax
  mov    %rax,%r9
  xor    %eax,%eax
  nopl   0x0(%rax)
L70:
  movdqu (%r10,%rax,1),%xmm0
  movups %xmm0,(%r9,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdi
  jne    L70
  mov    0x8(%rsp),%rdi
  mov    %r14,%rax
  and    $0xfffffffffffffff0,%rax
  add    %rax,%rdi
  cmp    %r14,%rax
  je     L469
  mov    %r14,%r9
  sub    %rax,%r9
  lea    -0x1(%r9),%r10
  cmp    $0x6,%r10
  jbe    L225
L34:
  mov    0x10(%rsp),%rdx
  lea    (%rdx,%rax,1),%r10
  mov    0x8(%rsp),%rdx
  mov    (%r10,%rcx,1),%rcx
  mov    %rcx,(%r10,%rdx,1)
  mov    %r9,%rcx
  and    $0xfffffffffffffff8,%rcx
  add    %rcx,%rdi
  add    %rcx,%rax
  cmp    %r9,%rcx
  je     L469
L225:
  mov    0x10(%rsp),%rdx
  mov    %rdi,%rcx
  lea    0x1(%rax),%r9
  sub    %rsi,%rcx
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,(%rdx,%rdi,1)
  lea    0x1(%rdi),%rcx
  cmp    %r14,%r9
  jae    L469
  sub    %rsi,%rcx
  lea    0x2(%rax),%r9
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,0x1(%rdx,%rdi,1)
  lea    0x2(%rdi),%rcx
  cmp    %r14,%r9
  jae    L469
  sub    %rsi,%rcx
  lea    0x3(%rax),%r9
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,0x2(%rdx,%rdi,1)
  lea    0x3(%rdi),%rcx
  cmp    %r14,%r9
  jae    L469
  sub    %rsi,%rcx
  lea    0x4(%rax),%r9
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,0x3(%rdx,%rdi,1)
  lea    0x4(%rdi),%rcx
  cmp    %r14,%r9
  jae    L469
  sub    %rsi,%rcx
  lea    0x5(%rax),%r9
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,0x4(%rdx,%rdi,1)
  lea    0x5(%rdi),%rcx
  cmp    %r14,%r9
  jae    L469
  sub    %rsi,%rcx
  add    $0x6,%rax
  movzbl (%rdx,%rcx,1),%ecx
  mov    %cl,0x5(%rdx,%rdi,1)
  lea    0x6(%rdi),%rcx
  cmp    %rax,%r14
  jbe    L469
  sub    %rsi,%rcx
  movzbl (%rdx,%rcx,1),%eax
  mov    %al,0x6(%rdx,%rdi,1)
L469:
  add    %r14,0x8(%rsp)
  mov    %r12,%r13
  jmp    L237
  nopl   0x0(%rax,%rax,1)
L75:
  lea    D55(%rip),%rdi
  call   <error@plt>
  jmp    L152
  nopl   0x0(%rax)
L57:
  lea    D98(%rip),%rdi
  mov    %r12,%r13
  call   <error@plt>
  jmp    L237
  nopl   0x0(%rax)
L169:
  lea    D55(%rip),%rdi
  call   <error@plt>
  jmp    L113
L326:
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L445:
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%rcx,1),%rax
  add    0x8(%rsp),%rdi
  sub    %rsi,%rdi
  add    %r14,%rdi
  nopl   0x0(%rax)
L502:
  movzbl (%rax),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax,%rsi,1)
  cmp    %rdi,%rax
  jne    L502
  jmp    L469
L138:
  lea    D7(%rip),%rbp
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x54,(%r14)
  jne    L228
L148:
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x49,0x1(%r14)
  je     L475
L484:
  lea    D17(%rip),%rdi
  lea    D7(%rip),%rbp
  call   <error@plt>
  cmp    $0x2,%rbx
  ja     L253
L475:
  mov    %rbp,%rdi
  call   <error@plt>
  cmpb   $0x4e,0x2(%r14)
  jne    L347
L306:
  mov    %rbp,%rdi
  call   <error@plt>
  jmp    L194
L347:
  lea    D17(%rip),%rdi
  call   <error@plt>
  jmp    L134
L228:
  lea    D17(%rip),%rdi
  call   <error@plt>
  jmp    L81
L442:
  mov    %r12,%r13
  jmp    L237
L199:
  mov    %rdx,%rdi
  mov    %r14,%r9
  xor    %eax,%eax
  jmp    L34
```

tool_calls: name: parse_data
arguments: data_label: D7
type_infered: string
name: parse_data
arguments: data_label: D17
type_infered: string
name: parse_data
arguments: data_label: D55
type_infered: string
name: parse_data
arguments: data_label: D98
type_infered: string

tool: D7: input underflow

tool: D17: bad magic

tool: D55: destination overflow

tool: D98: 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;
}
```