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

```asm
<u8_escape_wchar>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  xor    %edi,%edi
  cmp    $0x2,%rsi
  push   %r12
  seta   %dil
  mov    %edx,%r12d
  push   %rbp
  mov    %rsi,%rbp
  call   <assert@plt>
  lea    D128(%rip),%rsi
  cmp    $0xa,%r12d
  je     L152
  cmp    $0x1b,%r12d
  jg     L158
  cmp    $0x6,%r12d
  jle    L69
  lea    -0x7(%r12),%eax
  cmp    $0x14,%eax
  ja     L69
  lea    D37(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   (%rax)
L158:
  lea    D29(%rip),%rsi
  cmp    $0x5c,%r12d
  jne    L116
L152:
  pop    %rbp
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  jmp    1090 <buf_put2c@plt>
  nopw   0x0(%rax,%rax,1)
L116:
  cmp    $0x1f,%r12d
  jle    L69
  cmp    $0x7f,%r12d
  je     L69
  movzwl %r12w,%ecx
  lea    D91(%rip),%rdx
  cmp    $0xffff,%r12d
  jg     L85
  cmp    $0x7f,%r12d
  jg     L149
  mov    %r12b,0x0(%r13)
  pop    %rbp
  mov    $0x1,%eax
  movb   $0x0,0x1(%r13)
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
  lea    D17(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D25(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D6(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D106(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D59(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D95(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
  lea    D10(%rip),%rsi
  jmp    L152
  nopl   0x0(%rax)
L69:
  movzbl %r12b,%ecx
  lea    D20(%rip),%rdx
L85:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <snprintf@plt>
  nopl   0x0(%rax,%rax,1)
L149:
  mov    %r12d,%ecx
  lea    D114(%rip),%rdx
  jmp    L85
```

tool_calls: name: parse_data
arguments: tag: D128
data_type: string
name: parse_data
arguments: tag: D29
data_type: string
name: parse_data
arguments: tag: D91
data_type: string
name: parse_data
arguments: tag: D17
data_type: string
name: parse_data
arguments: tag: D25
data_type: string
name: parse_data
arguments: tag: D6
data_type: string
name: parse_data
arguments: tag: D106
data_type: string
name: parse_data
arguments: tag: D59
data_type: string
name: parse_data
arguments: tag: D95
data_type: string
name: parse_data
arguments: tag: D10
data_type: string
name: parse_data
arguments: tag: D20
data_type: string
name: parse_data
arguments: tag: D114
data_type: string

tool: D128: \n

tool: D29: \\

tool: D91: \U%.8x

tool: D17: \a

tool: D25: \b

tool: D6: \t

tool: D106: \v

tool: D59: \f

tool: D95: \r

tool: D10: \e

tool: D20: \x%.2hhx

tool: D114: \u%.4hx

assistant: ```c
int u8_escape_wchar(char *buf, size_t sz, uint32_t ch) {
  assert(sz > 2);
  if (ch == L'\n')
    return buf_put2c(buf, "\\n");
  else if (ch == L'\t')
    return buf_put2c(buf, "\\t");
  else if (ch == L'\r')
    return buf_put2c(buf, "\\r");
  else if (ch == L'\x1B')
    return buf_put2c(buf, "\\e");
  else if (ch == L'\b')
    return buf_put2c(buf, "\\b");
  else if (ch == L'\f')
    return buf_put2c(buf, "\\f");
  else if (ch == L'\v')
    return buf_put2c(buf, "\\v");
  else if (ch == L'\a')
    return buf_put2c(buf, "\\a");
  else if (ch == L'\\')
    return buf_put2c(buf, "\\\\");
  else if (ch < 32 || ch == 0x7f)
    return snprintf(buf, sz, "\\x%.2hhx", (unsigned char)ch);
  else if (ch > 0xFFFF)
    return snprintf(buf, sz, "\\U%.8x", (uint32_t)ch);
  else if (ch >= 0x80)
    return snprintf(buf, sz, "\\u%.4hx", (unsigned short)ch);
  buf[0] = (char)ch;
  buf[1] = '\0';
  return 1;
}
```