user: What would the C source look like for the assembly code provided here?

```asm
<utf8_to_string>:
  endbr64
  mov    %rdi,%rdx
  mov    %rsi,%rax
  test   $0x80,%al
  je     L15
  mov    %rsi,%rcx
  shr    $0x10,%rcx
  mov    %rsi,%rdi
  shr    $0x8,%rdi
  mov    %rsi,%r8
  and    $0x3f,%r8d
  mov    %rcx,%r9
  and    $0x7f,%r9d
  mov    %rcx,%rsi
  and    $0xf,%esi
  test   $0x40,%cl
  cmove  %r9,%rsi
  mov    %rdi,%r9
  and    $0x7f,%r9d
  mov    %rdi,%rcx
  and    $0x1f,%ecx
  test   $0x40,%dil
  cmove  %r9,%rcx
  mov    %rdi,%rax
  and    $0x70000,%eax
  or     %r8,%rax
  shl    $0xc,%rsi
  or     %rsi,%rax
  shl    $0x6,%rcx
  or     %rcx,%rax
L15:
  cmp    $0x7f,%rax
  jbe    L17
  cmp    $0xfffe,%rax
  jbe    L11
  movb   $0x5c,(%rdx)
  movb   $0x55,0x1(%rdx)
  movb   $0x30,0x2(%rdx)
  movb   $0x30,0x3(%rdx)
  lea    D4(%rip),%rcx
  mov    %rax,%rsi
  shr    $0x14,%rsi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x4(%rdx)
  mov    %rax,%rsi
  shr    $0x10,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x5(%rdx)
  mov    %rax,%rsi
  shr    $0xc,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x6(%rdx)
  mov    %rax,%rsi
  shr    $0x8,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x7(%rdx)
  mov    %rax,%rsi
  shr    $0x4,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x8(%rdx)
  and    $0xf,%eax
  movzbl (%rcx,%rax,1),%eax
  mov    %al,0x9(%rdx)
  movb   $0x0,0xa(%rdx)
  mov    $0xa,%eax
  ret
L17:
  mov    %al,(%rdx)
  movb   $0x0,0x1(%rdx)
  mov    $0x1,%eax
  ret
L11:
  movb   $0x5c,(%rdx)
  movb   $0x75,0x1(%rdx)
  lea    D4(%rip),%rcx
  mov    %rax,%rsi
  shr    $0xc,%rsi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x2(%rdx)
  mov    %rax,%rsi
  shr    $0x8,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x3(%rdx)
  mov    %rax,%rsi
  shr    $0x4,%rsi
  and    $0xf,%esi
  movzbl (%rcx,%rsi,1),%esi
  mov    %sil,0x4(%rdx)
  and    $0xf,%eax
  movzbl (%rcx,%rax,1),%eax
  mov    %al,0x5(%rdx)
  movb   $0x0,0x6(%rdx)
  mov    $0x6,%eax
  ret
```

assistant: ```c
int utf8_to_string(unsigned char buf[], unsigned long utf8) {
  unsigned long val = 0;
  static char hex[16] = "0123456789abcdef";
  if (utf8 & 0x80UL) {
    unsigned long x1, x2, x3, x4;
    x1 = (utf8 >> 24) & 0x7fUL;
    x2 = (utf8 >> 16) & 0x7fUL;
    x3 = (utf8 >> 8) & 0x7fUL;
    x4 = (utf8)&0x3fUL;
    x1 &= 0x07UL;
    if (x2 & 0x40UL)
      x2 &= 0x0fUL;
    if (x3 & 0x40UL)
      x3 &= 0x1fUL;
    val = x4 | (x3 << 6) | (x2 << 12) | (x1 << 16);
  } else
    val = utf8;
  if (val < 128) {
    buf[0] = val;
    buf[1] = 0;
    return 1;
  } else if (val < 0xffffUL) {
    buf[0] = '\\';
    buf[1] = 'u';
    buf[2] = hex[(size_t)(val >> 12)];
    buf[3] = hex[(size_t)((val >> 8) & 0xfU)];
    buf[4] = hex[(size_t)((val >> 4) & 0xfU)];
    buf[5] = hex[(size_t)(val & 0xfU)];
    buf[6] = 0;
    return 6;
  }
  buf[0] = '\\';
  buf[1] = 'U';
  buf[2] = '0';
  buf[3] = '0';
  buf[4] = hex[(size_t)(val >> 20)];
  buf[5] = hex[(size_t)((val >> 16) & 0xfU)];
  buf[6] = hex[(size_t)((val >> 12) & 0xfU)];
  buf[7] = hex[(size_t)((val >> 8) & 0xfU)];
  buf[8] = hex[(size_t)((val >> 4) & 0xfU)];
  buf[9] = hex[(size_t)(val & 0xfU)];
  buf[10] = 0;
  return 10;
}
```