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

```asm
<tgoto>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L152
  mov    %esi,%r8d
  mov    %edx,%r9d
  mov    $0x0,%esi
  mov    $0x0,%r11d
  lea    D11(%rip),%rdx
  mov    $0x1,%r10d
L15:
  cmp    $0x25,%al
  je     L168
  mov    %al,(%rdx)
  lea    0x1(%rdx),%rdx
  mov    %rdi,%rax
  lea    0x1(%rdi),%rdi
  movzbl 0x1(%rax),%eax
  test   %al,%al
  jne    L15
L171:
  movb   $0x0,(%rdx)
  lea    D11(%rip),%rax
  ret
L190:
  cmp    $0x25,%cl
  jne    L109
  movb   $0x25,(%rdx)
  lea    0x1(%rdx),%rdx
  jmp    L242
L109:
  lea    D16(%rip),%rax
L180:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L173:
  cmp    $0x69,%cl
  je     L118
  cmp    $0x72,%cl
  jne    L90
  mov    $0x1,%esi
L242:
  lea    0x1(%rax),%rdi
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L218
  cmp    $0x25,%al
  je     L121
  mov    %al,(%rdx)
  lea    0x1(%rdx),%rdx
  mov    %rdi,%rax
  jmp    L242
L90:
  lea    D16(%rip),%rax
  jmp    L180
L239:
  test   %esi,%esi
  mov    %r8d,%ebx
  cmove  %r9d,%ebx
  lea    0x2(%rdi),%rax
  mov    %r11d,%ecx
  add    0x2(%rdi),%cl
  add    %ebx,%ecx
  mov    %cl,(%rdx)
  mov    %r10d,%ebx
  sub    %esi,%ebx
  mov    %ebx,%esi
  lea    0x1(%rdx),%rdx
  jmp    L242
L236:
  test   %esi,%esi
  mov    %r8d,%edi
  cmove  %r9d,%edi
  add    %r11d,%edi
  movslq %edi,%rcx
  imul   $0x10624dd3,%rcx,%rcx
  sar    $0x26,%rcx
  mov    %edi,%ebx
  sar    $0x1f,%ebx
  sub    %ebx,%ecx
  imul   $0x3e8,%ecx,%ebx
  mov    %edi,%ecx
  sub    %ebx,%ecx
  cmp    $0x63,%ecx
  jle    L128
  lea    0x1(%rdx),%rbx
  movslq %ecx,%rdi
  imul   $0x51eb851f,%rdi,%rdi
  sar    $0x25,%rdi
  mov    %ecx,%ebp
  sar    $0x1f,%ebp
  sub    %ebp,%edi
  add    $0x30,%edi
  mov    %dil,(%rdx)
L76:
  lea    0x1(%rbx),%rdx
  movslq %ecx,%rdi
  imul   $0x66666667,%rdi,%rdi
  sar    $0x22,%rdi
  mov    %ecx,%ebp
  sar    $0x1f,%ebp
  sub    %ebp,%edi
  movslq %edi,%rbp
  imul   $0x66666667,%rbp,%rbp
  sar    $0x22,%rbp
  mov    %edi,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%ebp
  lea    0x0(%rbp,%rbp,4),%ebp
  add    %ebp,%ebp
  sub    %ebp,%edi
  add    $0x30,%edi
  mov    %dil,(%rbx)
  jmp    L169
L128:
  cmp    $0x9,%ecx
  jg     L69
L169:
  movslq %ecx,%rdi
  imul   $0x66666667,%rdi,%rdi
  sar    $0x22,%rdi
  mov    %ecx,%ebx
  sar    $0x1f,%ebx
  sub    %ebx,%edi
  lea    (%rdi,%rdi,4),%edi
  add    %edi,%edi
  sub    %edi,%ecx
  add    $0x30,%ecx
  mov    %cl,(%rdx)
  mov    %r10d,%ebx
  sub    %esi,%ebx
  mov    %ebx,%esi
  lea    0x1(%rdx),%rdx
  jmp    L242
L69:
  mov    %rdx,%rbx
  jmp    L76
L118:
  mov    %r10d,%r11d
  jmp    L242
L152:
  lea    D11(%rip),%rdx
  jmp    L171
L218:
  movb   $0x0,(%rdx)
  lea    D11(%rip),%rax
  jmp    L180
L168:
  push   %r12
  push   %rbp
  push   %rbx
L121:
  lea    0x1(%rdi),%rax
  movzbl 0x1(%rdi),%ecx
  cmp    $0x64,%cl
  je     L236
  jg     L173
  cmp    $0x2b,%cl
  je     L239
  cmp    $0x32,%cl
  jne    L190
  test   %esi,%esi
  mov    %r8d,%edi
  cmove  %r9d,%edi
  add    %r11d,%edi
  movslq %edi,%rcx
  imul   $0x51eb851f,%rcx,%rcx
  sar    $0x25,%rcx
  mov    %edi,%ebx
  sar    $0x1f,%ebx
  sub    %ebx,%ecx
  imul   $0x64,%ecx,%ebx
  mov    %edi,%ecx
  sub    %ebx,%ecx
  movslq %ecx,%rdi
  imul   $0x66666667,%rdi,%rdi
  sar    $0x22,%rdi
  mov    %ecx,%ebx
  sar    $0x1f,%ebx
  sub    %ebx,%edi
  lea    0x30(%rdi),%ebx
  mov    %bl,(%rdx)
  lea    (%rdi,%rdi,4),%edi
  add    %edi,%edi
  sub    %edi,%ecx
  add    $0x30,%ecx
  mov    %cl,0x1(%rdx)
  mov    %r10d,%ebx
  sub    %esi,%ebx
  mov    %ebx,%esi
  lea    0x2(%rdx),%rdx
  jmp    L242
```

tool_calls: name: unpack_data
arguments: tag: D16
type: string

tool: D16: OOPS

assistant: ```c
char *tgoto(const char *cm, int destcol, int destline) {
  static char ret[24];
  char *rp = ret;
  int incr = 0;
  int argno = 0;
  int numval;
  for (; *cm; cm++) {
    if (*cm == '%') {
      switch (*++cm) {
      case 'i':
        incr = 1;
        break;
      case 'r':
        argno = 1;
        break;
      case '+':
        numval = (argno == 0 ? destline : destcol);
        *rp++ = numval + incr + *++cm;
        argno = 1 - argno;
        break;
      case '2':
        numval = (argno == 0 ? destline : destcol);
        numval = (numval + incr) % 100;
        *rp++ = '0' + (numval / 10);
        *rp++ = '0' + (numval % 10);
        argno = 1 - argno;
        break;
      case 'd':
        numval = (argno == 0 ? destline : destcol);
        numval = (numval + incr) % 1000;
        if (numval > 99)
          *rp++ = '0' + (numval / 100);
        if (numval > 9)
          *rp++ = '0' + (numval / 10) % 10;
        *rp++ = '0' + (numval % 10);
        argno = 1 - argno;
        break;
      case '%':
        *rp++ = '%';
        break;
      default:
        return ("OOPS");
      }
    } else
      *rp++ = *cm;
  }
  *rp = '\0';
  return ret;
}
```