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

```asm
<cescape_char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %rsi,-0x20(%rbp)
  mov    %al,-0x14(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movsbl -0x14(%rbp),%eax
  cmp    $0x27,%eax
  jg     L126
  cmp    $0x7,%eax
  jl     L30
  sub    $0x7,%eax
  cmp    $0x20,%eax
  ja     L30
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D16(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D16(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L126:
  cmp    $0x5c,%eax
  je     L154
  jmp    L30
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x61,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x62,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x66,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x6e,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x72,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x74,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x76,(%rax)
  jmp    L178
L154:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x22,(%rax)
  jmp    L178
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x27,(%rax)
  jmp    L178
L30:
  cmpb   $0x1f,-0x14(%rbp)
  jle    L6
  cmpb   $0x7f,-0x14(%rbp)
  jne    L43
L6:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x5c,(%rax)
  movzbl -0x14(%rbp),%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <octchar@plt>
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x14(%rbp),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <octchar@plt>
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x14(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <octchar@plt>
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L2
L43:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl -0x14(%rbp),%edx
  mov    %dl,(%rax)
L2:
  nop
L178:
  mov    -0x20(%rbp),%rax
  sub    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
int cescape_char(char c, char *buf) {
  char *buf_old = buf;
  switch (c) {
  case '\a':
    *(buf++) = '\\';
    *(buf++) = 'a';
    break;
  case '\b':
    *(buf++) = '\\';
    *(buf++) = 'b';
    break;
  case '\f':
    *(buf++) = '\\';
    *(buf++) = 'f';
    break;
  case '\n':
    *(buf++) = '\\';
    *(buf++) = 'n';
    break;
  case '\r':
    *(buf++) = '\\';
    *(buf++) = 'r';
    break;
  case '\t':
    *(buf++) = '\\';
    *(buf++) = 't';
    break;
  case '\v':
    *(buf++) = '\\';
    *(buf++) = 'v';
    break;
  case '\\':
    *(buf++) = '\\';
    *(buf++) = '\\';
    break;
  case '"':
    *(buf++) = '\\';
    *(buf++) = '"';
    break;
  case '\'':
    *(buf++) = '\\';
    *(buf++) = '\'';
    break;
  default:
    if ((c < ' ') || (c >= 127)) {
      *(buf++) = '\\';
      *(buf++) = octchar((unsigned char)c >> 6);
      *(buf++) = octchar((unsigned char)c >> 3);
      *(buf++) = octchar((unsigned char)c);
    } else
      *(buf++) = c;
    break;
  }
  return buf - buf_old;
}
```