user: Demonstrate the C code that generates the assembly output below:

```asm
<unescape_string>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  lea    0x1(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r8
  movzbl (%rbx),%eax
  mov    %r8,%rdx
  test   %al,%al
  je     L21
  lea    D7(%rip),%r9
  jmp    L114
  nopl   0x0(%rax)
L158:
  add    $0x1,%rbx
  mov    %al,(%rcx)
  movzbl (%rbx),%eax
  test   %al,%al
  je     L21
L114:
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    $0x5c,%al
  jne    L158
  movzbl 0x1(%rbx),%eax
  lea    0x2(%rbx),%rdi
  lea    -0x30(%rax),%esi
  cmp    $0x46,%sil
  ja     L53
  movzbl %sil,%esi
  movslq (%r9,%rsi,4),%rsi
  add    %r9,%rsi
  notrack jmp *%rsi
  mov    $0x8,%eax
  nopl   0x0(%rax)
L53:
  mov    %al,(%rcx)
  mov    %rdi,%rbx
L81:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L114
L21:
  movb   $0x0,(%rdx)
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   0x0(%rax)
  movsbl 0x2(%rbx),%esi
  sub    $0x30,%eax
  movsbl %al,%eax
  lea    -0x30(%rsi),%r10d
  test   %sil,%sil
  je     L87
  movzbl 0x3(%rbx),%r11d
  sub    $0x30,%r11d
  cmp    $0x7,%r11b
  jbe    L95
L87:
  cmp    $0x7,%r10b
  ja     L53
  lea    -0x30(%rsi,%rax,8),%eax
  xor    %esi,%esi
L122:
  add    $0x1,%esi
  mov    %al,(%rcx)
  movslq %esi,%rsi
  add    %rsi,%rdi
  mov    %rdi,%rbx
  jmp    L81
  mov    $0xb,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L81
  mov    $0x9,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L81
  mov    $0xd,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L81
  mov    $0xa,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L81
  mov    $0xc,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L81
L95:
  lea    -0x30(%rsi,%rax,8),%eax
  cmp    $0x7,%r10b
  ja     L39
  movsbl 0x3(%rbx),%esi
  lea    -0x30(%rsi,%rax,8),%eax
  mov    $0x1,%esi
  jmp    L122
  mov    $0x7,%eax
  jmp    L53
L39:
  xor    %esi,%esi
  jmp    L122
```

assistant: ```c
char *unescape_string(const char *input) {
  char *result = (char *)malloc(strlen(input) + 1);
  char *p = result;
  while (*input) {
    if (*input != '\\') {
      *p = *input;
      p++;
      input++;
    } else {
      input++;
      switch (*input) {
      case '\"':
      case '\\':
      default:
        *p = *input++;
        break;
      case 'a':
        *p = '\a';
        input++;
        break;
      case 'b':
        *p = '\b';
        input++;
        break;
      case 'f':
        *p = '\f';
        input++;
        break;
      case 'n':
        *p = '\n';
        input++;
        break;
      case 'r':
        *p = '\r';
        input++;
        break;
      case 't':
        *p = '\t';
        input++;
        break;
      case 'v':
        *p = '\v';
        input++;
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7': {
        int digits = (input[1] && input[1] >= '0' && input[1] <= '7' ? 1 : 0) + (input[1] && input[2] && input[2] >= '0' && input[2] <= '7' ? 1 : 0);
        int result = *input++ - '0';
        while (digits--)
          result = result * 8 + *input++ - '0';
        *p = (char)result;
        break;
      }
      }
      p++;
    }
  }
  *p = 0;
  return result;
}
```