user: 请从给定的汇编指令推导出C源代码:

```asm
<escape_seq_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L96
  mov    %esi,%r14d
  lea    0x1(%rdi),%rbp
  mov    $0x1,%r12d
  mov    $0x0,%ebx
  jmp    L56
  mov    $0x27,%eax
  jmp    L156
  mov    $0x3f,%eax
L156:
  add    $0x2,%ebx
L90:
  mov    %rbp,%rcx
  mov    %r12d,%edx
  jmp    L177
  mov    $0x5c,%eax
  jmp    L156
  mov    $0xb,%eax
  jmp    L156
  mov    $0x9,%eax
  jmp    L156
  mov    $0xd,%eax
  jmp    L156
  mov    $0xa,%eax
  jmp    L156
  mov    $0xc,%eax
  jmp    L156
  mov    $0x8,%eax
  jmp    L156
  mov    $0x7,%eax
  jmp    L156
  mov    $0x22,%eax
  jmp    L156
L194:
  mov    %ecx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L17
  lea    0x3(%rbx),%eax
  cmp    %r14d,%eax
  jge    L234
  lea    0x2(%r15,%r13,1),%rax
  mov    %rax,0x8(%rsp)
  movzbl (%rax),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L234
  movzbl 0x3(%r15,%r13,1),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L234
  mov    0x8(%rsp),%rdi
  call   <x2c@plt>
  add    $0x4,%ebx
  jmp    L42
L17:
  sub    $0x30,%ecx
  cmp    $0x7,%cl
  jbe    L57
L234:
  mov    %rbp,%rcx
  movslq %ebx,%rax
  movzbl 0x1(%r15,%rax,1),%eax
  mov    %r12d,%edx
  add    $0x2,%ebx
  jmp    L177
L57:
  mov    $0x0,%eax
  lea    0x1(%rbx),%edi
L169:
  mov    %eax,%esi
  mov    %eax,%r13d
  lea    (%rdi,%rax,1),%ecx
  cmp    %r14d,%ecx
  jge    L190
  cmp    $0x2,%eax
  jg     L190
  movzbl 0x1(%rdx,%rax,1),%ecx
  mov    %cl,0x14(%rsp,%rax,1)
  lea    0x1(%rsi),%r13d
  movzbl 0x2(%rdx,%rax,1),%esi
  lea    -0x30(%rsi),%ecx
  add    $0x1,%rax
  cmp    $0x7,%cl
  jbe    L169
L190:
  movslq %r13d,%rax
  movb   $0x0,0x14(%rsp,%rax,1)
  mov    $0xffffffff,%eax
  test   %r13d,%r13d
  jg     L285
L42:
  cmp    $0xffffffff,%eax
  je     L234
  jmp    L90
L285:
  lea    0x14(%rsp),%rdi
  mov    $0x8,%edx
  mov    $0x0,%esi
  call   <strtol@plt>
  lea    0x1(%rbx,%r13,1),%ebx
  jmp    L42
L60:
  add    $0x1,%ebx
  mov    %rbp,%rcx
  mov    %r12d,%edx
L177:
  mov    %al,-0x1(%rbp)
  add    $0x1,%rbp
  add    $0x1,%r12
  cmp    %r14d,%ebx
  jge    L178
L56:
  movslq %ebx,%r13
  lea    (%r15,%r13,1),%rdx
  movzbl (%rdx),%eax
  cmp    $0x5c,%al
  jne    L60
  lea    0x1(%rbx),%ecx
  cmp    %r14d,%ecx
  jge    L60
  movzbl 0x1(%r15,%r13,1),%ecx
  lea    -0x22(%rcx),%eax
  cmp    $0x54,%al
  ja     L194
  movzbl %al,%eax
  lea    D6(%rip),%rsi
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
L96:
  mov    %rdi,%rcx
  mov    $0x0,%edx
L178:
  movb   $0x0,(%rcx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L99
  mov    %edx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L99:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int escape_seq_decode(unsigned char *input, int input_len) {
  unsigned char *d = input;
  int i, count;
  i = count = 0;
  while (i < input_len) {
    if ((input[i] == '\\') && (i + 1 < input_len)) {
      int c = -1;
      switch (input[i + 1]) {
      case 'a':
        c = '\a';
        break;
      case 'b':
        c = '\b';
        break;
      case 'f':
        c = '\f';
        break;
      case 'n':
        c = '\n';
        break;
      case 'r':
        c = '\r';
        break;
      case 't':
        c = '\t';
        break;
      case 'v':
        c = '\v';
        break;
      case '\\':
        c = '\\';
        break;
      case '?':
        c = '?';
        break;
      case '\'':
        c = '\'';
        break;
      case '"':
        c = '"';
        break;
      }
      if (c != -1)
        i += 2;
      if (c == -1) {
        if ((input[i + 1] == 'x') || (input[i + 1] == 'X')) {
          if ((i + 3 < input_len) && (isxdigit(input[i + 2])) && (isxdigit(input[i + 3]))) {
            c = x2c(&input[i + 2]);
            i += 4;
          } else {
          }
        } else if (((input[i + 1] >= '0') && (input[i + 1] <= '7'))) {
          char buf[4];
          int j = 0;
          while ((i + 1 + j < input_len) && (j < 3)) {
            buf[j] = input[i + 1 + j];
            j++;
            if (!((input[i + 1 + j] >= '0') && (input[i + 1 + j] <= '7')))
              break;
          }
          buf[j] = '\0';
          if (j > 0) {
            c = strtol(buf, NULL, 8);
            i += 1 + j;
          }
        }
      }
      if (c == -1) {
        *d++ = input[i + 1];
        count++;
        i += 2;
      } else {
        *d++ = c;
        count++;
      }
    } else {
      *d++ = input[i++];
      count++;
    }
  }
  *d = '\0';
  return count;
}
```