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

```asm
<unescape_seq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L78
L307:
  cmpl   $0x3,-0xc(%rbp)
  je     L267
  cmpl   $0x3,-0xc(%rbp)
  ja     L65
  cmpl   $0x0,-0xc(%rbp)
  je     L14
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  cmp    $0x1,%eax
  ja     L65
  jmp    L112
L14:
  cmpb   $0x5e,-0xd(%rbp)
  jne    L44
  movl   $0x3,-0xc(%rbp)
  jmp    L101
L44:
  cmpb   $0x5c,-0xd(%rbp)
  jne    L135
  movl   $0x1,-0xc(%rbp)
  jmp    L101
L135:
  cmpb   $0x3d,-0xd(%rbp)
  jne    L132
  movl   $0x4,-0xc(%rbp)
  jmp    L101
L132:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl -0xd(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L101
L267:
  cmpb   $0x40,-0xd(%rbp)
  jle    L209
  cmpb   $0x5f,-0xd(%rbp)
  jg     L209
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl -0xd(%rbp),%edx
  and    $0x1f,%edx
  mov    %dl,(%rax)
  jmp    L208
L209:
  cmpb   $0x3f,-0xd(%rbp)
  jne    L208
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x7f,(%rax)
L208:
  movl   $0x0,-0xc(%rbp)
  jmp    L101
L112:
  cmpl   $0x1,-0xc(%rbp)
  jne    L134
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L134
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x37,%al
  jg     L134
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L134
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x37,%al
  jg     L134
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L134
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x37,%al
  jg     L134
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  shl    $0x6,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  shl    $0x3,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  sub    $0x30,%eax
  mov    %eax,%esi
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  or     %esi,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  addq   $0x2,-0x20(%rbp)
  jmp    L101
L134:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl -0xd(%rbp),%edx
  mov    %dl,(%rax)
  cmpb   $0x5c,-0xd(%rbp)
  jne    L282
  movl   $0x2,-0xc(%rbp)
  jmp    L101
L282:
  movl   $0x0,-0xc(%rbp)
  jmp    L101
L65:
  nop
L101:
  cmpl   $0x4,-0xc(%rbp)
  je     L86
  addq   $0x1,-0x20(%rbp)
L78:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x0,-0xd(%rbp)
  jne    L307
  jmp    L32
L86:
  nop
L32:
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *unescape_seq(char *buf, char *seq, int *seqlen) {
  char c, *start = buf;
  enum { NORM, ESCSINGLE, ESCAPE, CARET, DONE } state = NORM;
  for (; (c = *seq); seq++) {
    switch (state) {
    case NORM:
      if (c == '^')
        state = CARET;
      else if (c == '\\')
        state = ESCSINGLE;
      else if (c == '=')
        state = DONE;
      else
        *(buf++) = c;
      break;
    case CARET:
      if (c > 0x40 && c < 0x60)
        *(buf++) = c & 0x1f;
      else if (c == '?')
        *(buf++) = 0x7f;
      state = NORM;
      break;
    case ESCSINGLE:
    case ESCAPE:
      if (state == ESCSINGLE && ((seq[0]) >= '0' && (seq[0]) <= '7') && ((seq[1]) >= '0' && (seq[1]) <= '7') && ((seq[2]) >= '0' && (seq[2]) <= '7')) {
        *(buf++) = (((seq[0] - '0') << 6) | ((seq[1] - '0') << 3) | (seq[2] - '0'));
        seq += 2;
      } else {
        *(buf++) = c;
        if (c == '\\')
          state = ESCAPE;
        else
          state = NORM;
      }
      break;
    default:
      break;
    }
    if (state == DONE)
      break;
  }
  *buf = '\0';
  *seqlen = buf - start;
  return seq;
}
```