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

```asm
<tgoto>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl (%rdi),%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %cl,%cl
  je     L317
  lea    D37(%rip),%rbp
  mov    %esi,%r14d
  mov    %edx,%r12d
  mov    %edx,%esi
  lea    0x1(%rdi),%rbx
  xor    %r15d,%r15d
  lea    0x14(%rbp),%r13
L143:
  cmp    $0x25,%cl
  je     L229
L67:
  lea    0x1(%rbp),%rdx
  mov    %cl,0x0(%rbp)
  cmp    %r13,%rdx
  jae    L100
  mov    %rdx,%rbp
  mov    %rbx,%rdi
L167:
  movzbl (%rdi),%ecx
  add    $0x1,%rbx
  test   %cl,%cl
  jne    L143
L25:
  movb   $0x0,0x0(%rbp)
  lea    D37(%rip),%rax
  jmp    L14
  nopl   (%rax)
L229:
  movzbl 0x1(%rdi),%ecx
  lea    0x2(%rdi),%rbx
  cmp    $0x25,%cl
  je     L67
  cmp    $0x69,%cl
  je     L77
  jg     L427
  cmp    $0x33,%cl
  jg     L430
  cmp    $0x31,%cl
  jg     L7
L135:
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    D5(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  jmp    L14
  nopl   0x0(%rax)
L427:
  cmp    $0x72,%cl
  jne    L135
L355:
  mov    %r14d,%esi
  mov    %rbx,%rdi
  mov    $0x1,%r15d
  jmp    L167
  nopl   0x0(%rax,%rax,1)
L430:
  cmp    $0x64,%cl
  jne    L135
  mov    %esi,%eax
  mov    $0xa,%edi
  cltd
  idiv   %edi
  or     $0x30,%edx
  mov    %dl,0x12(%rsp)
  test   %eax,%eax
  jne    L255
  lea    0x1(%rbp),%rax
  cmp    %r13,%rax
  jae    L100
  mov    %dl,0x0(%rbp)
  xor    %eax,%eax
  jmp    L165
  nopl   (%rax)
L100:
  mov    D60(%rip),%rax
  mov    (%rax),%edx
  mov    D5(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
L14:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L92
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L7:
  movslq %esi,%rax
  mov    %esi,%edx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%esi
  or     $0x30,%esi
  mov    %sil,0x12(%rsp)
  test   %eax,%eax
  je     L273
L255:
  movslq %eax,%rdx
  mov    %eax,%esi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x22,%rdx
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  mov    %eax,%esi
  or     $0x30,%esi
  mov    %sil,0x13(%rsp)
  test   %edx,%edx
  je     L268
  movslq %edx,%rsi
  mov    %edx,%eax
  imul   $0x66666667,%rsi,%rsi
  sar    $0x1f,%eax
  sar    $0x22,%rsi
  sub    %eax,%esi
  mov    %edx,%eax
  lea    (%rsi,%rsi,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  or     $0x30,%eax
  mov    %al,0x14(%rsp)
  test   %esi,%esi
  je     L293
  movslq %esi,%rdx
  mov    %esi,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%eax
  sar    $0x22,%rdx
  sub    %eax,%edx
  mov    %esi,%eax
  lea    (%rdx,%rdx,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  or     $0x30,%eax
  mov    %al,0x15(%rsp)
  test   %edx,%edx
  je     L245
  movslq %edx,%rax
  mov    %edx,%edi
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x22,%rax
  sub    %edi,%eax
  lea    (%rax,%rax,4),%edi
  mov    %eax,%esi
  mov    %edx,%eax
  add    %edi,%edi
  sub    %edi,%eax
  or     $0x30,%eax
  mov    %al,0x16(%rsp)
  test   %esi,%esi
  je     L93
  movslq %esi,%rdx
  mov    %esi,%eax
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%eax
  sar    $0x22,%rdx
  sub    %eax,%edx
  mov    %esi,%eax
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%eax
  or     $0x30,%eax
  mov    %al,0x17(%rsp)
  mov    $0x6,%eax
L357:
  cmp    $0x64,%cl
  je     L409
  sub    $0x30,%ecx
  movzbl %cl,%ecx
  cmp    %eax,%ecx
  jl     L135
L336:
  cmp    %eax,%ecx
  jle    L409
  lea    -0x1(%rcx),%r8d
  lea    0x12(%rsp,%rax,1),%rdi
  mov    $0x30,%esi
  mov    %ecx,0xc(%rsp)
  mov    %r8d,%edx
  mov    %r8d,0x8(%rsp)
  sub    %eax,%edx
  add    $0x1,%rdx
  call   <memset@plt>
  movslq 0xc(%rsp),%rcx
  mov    0x8(%rsp),%r8d
  add    %rbp,%rcx
  cmp    %r13,%rcx
  jae    L100
  movslq %r8d,%rcx
  lea    0x1(%rbp),%rdx
  mov    %rcx,%rax
  movzbl 0x12(%rsp,%rcx,1),%ecx
  mov    %cl,0x0(%rbp)
L115:
  lea    -0x1(%rax),%ecx
  movslq %ecx,%rsi
  movzbl 0x12(%rsp,%rsi,1),%esi
  mov    %sil,(%rdx)
  test   %ecx,%ecx
  je     L82
  lea    -0x2(%rax),%ecx
  movslq %ecx,%rsi
  movzbl 0x12(%rsp,%rsi,1),%esi
  mov    %sil,0x1(%rdx)
  test   %ecx,%ecx
  je     L165
  lea    -0x3(%rax),%ecx
  movslq %ecx,%rsi
  movzbl 0x12(%rsp,%rsi,1),%esi
  mov    %sil,0x2(%rdx)
  test   %ecx,%ecx
  je     L165
  lea    -0x4(%rax),%ecx
  movslq %ecx,%rsi
  movzbl 0x12(%rsp,%rsi,1),%esi
  mov    %sil,0x3(%rdx)
  test   %ecx,%ecx
  je     L165
  lea    -0x5(%rax),%ecx
  movslq %ecx,%rcx
  movzbl 0x12(%rsp,%rcx,1),%ecx
  mov    %cl,0x4(%rdx)
L165:
  add    $0x1,%eax
  cltq
  add    %rax,%rbp
  cmp    $0x1,%r15d
  jne    L355
  mov    %r12d,%esi
  mov    %rbx,%rdi
  xor    %r15d,%r15d
  jmp    L167
  cs nopw 0x0(%rax,%rax,1)
L77:
  add    $0x1,%r14d
  add    $0x1,%r12d
  add    $0x1,%esi
  mov    %rbx,%rdi
  jmp    L167
  nopl   0x0(%rax,%rax,1)
L409:
  movslq %eax,%rdx
  add    %rbp,%rdx
  cmp    %r13,%rdx
  jae    L100
  sub    $0x1,%eax
  lea    0x1(%rbp),%rdx
  movslq %eax,%rcx
  movzbl 0x12(%rsp,%rcx,1),%ecx
  mov    %cl,0x0(%rbp)
  jne    L115
  xor    %eax,%eax
  jmp    L165
L273:
  sub    $0x30,%ecx
  mov    $0x1,%eax
  movzbl %cl,%ecx
  jmp    L336
L268:
  mov    $0x2,%eax
  jmp    L357
L82:
  mov    $0x1,%eax
  jmp    L165
L317:
  lea    D37(%rip),%rbp
  jmp    L25
L293:
  mov    $0x3,%eax
  jmp    L357
L245:
  mov    $0x4,%eax
  jmp    L357
L93:
  mov    $0x5,%eax
  jmp    L357
L92:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *tgoto(const char *cap, int col, int line) {
  static char buf[20];
  char *p, *e, c, dbuf[6];
  int oncol = 0, which = line, i;
  p = buf;
  e = p + sizeof(buf);
  while ((c = *cap++)) {
    if (c != '%' || ((c = *cap++) == '%')) {
      *p++ = c;
      if (p >= e) {
        errno = E2BIG;
        return NULL;
      }
      continue;
    }
    switch (c) {
    case '3':
    case '2':
    case 'd':
      i = 0;
      do
        dbuf[i++] = which % 10 | '0';
      while ((which /= 10));
      if (c != 'd') {
        c -= '0';
        if (i > c) {
          errno = EINVAL;
          return NULL;
        }
        while (i < c)
          dbuf[i++] = '0';
      }
      if (p + i >= e) {
        errno = E2BIG;
        return NULL;
      }
      do
        *p++ = dbuf[--i];
      while (i);
      break;
    case 'r':
      oncol = 0;
      break;
    case 'i':
      col++;
      line++;
      which++;
      continue;
    default:
      errno = EINVAL;
      return NULL;
    }
    oncol = 1 - oncol;
    which = oncol ? col : line;
  }
  *p = '\0';
  return buf;
}
```