user: What is the c source code of the assembly code below?

```asm
<utf16_literal_to_utf8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  movq   $0x0,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movb   $0x0,-0x24(%rbp)
  movb   $0x0,-0x23(%rbp)
  movb   $0x0,-0x22(%rbp)
  movb   $0x0,-0x21(%rbp)
  mov    -0x40(%rbp),%rax
  sub    -0x10(%rbp),%rax
  cmp    $0x5,%rax
  jg     L208
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L208:
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,%rdi
  call   <parse_hex4@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0xdbff,-0x20(%rbp)
  jbe    L258
  cmpl   $0xdfff,-0x20(%rbp)
  jbe    L58
L258:
  cmpl   $0x0,-0x20(%rbp)
  jne    L304
L58:
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L304:
  cmpl   $0xd7ff,-0x20(%rbp)
  jbe    L49
  cmpl   $0xdbff,-0x20(%rbp)
  ja     L49
  mov    -0x10(%rbp),%rax
  add    $0x6,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movb   $0xc,-0x22(%rbp)
  mov    -0x40(%rbp),%rax
  sub    -0x8(%rbp),%rax
  cmp    $0x5,%rax
  jg     L207
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L207:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L236
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x75,%al
  je     L308
L236:
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L308:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,%rdi
  call   <parse_hex4@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0xdbff,-0x1c(%rbp)
  jbe    L233
  cmpl   $0xdfff,-0x1c(%rbp)
  jbe    L226
L233:
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L226:
  mov    -0x20(%rbp),%eax
  shl    $0xa,%eax
  and    $0xffc00,%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  and    $0x3ff,%eax
  or     %edx,%eax
  add    $0x10000,%eax
  mov    %eax,%eax
  mov    %rax,-0x18(%rbp)
  jmp    L201
L49:
  movb   $0x6,-0x22(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %rax,-0x18(%rbp)
L201:
  cmpq   $0x7f,-0x18(%rbp)
  ja     L152
  movb   $0x1,-0x24(%rbp)
  jmp    L283
L152:
  cmpq   $0x7ff,-0x18(%rbp)
  ja     L138
  movb   $0x2,-0x24(%rbp)
  movb   $0xc0,-0x21(%rbp)
  jmp    L283
L138:
  cmpq   $0xffff,-0x18(%rbp)
  ja     L56
  movb   $0x3,-0x24(%rbp)
  movb   $0xe0,-0x21(%rbp)
  jmp    L283
L56:
  cmpq   $0x10ffff,-0x18(%rbp)
  ja     L72
  movb   $0x4,-0x24(%rbp)
  movb   $0xf0,-0x21(%rbp)
  jmp    L283
L72:
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L181
L283:
  movzbl -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %al,-0x23(%rbp)
  jmp    L210
L171:
  mov    -0x18(%rbp),%rax
  and    $0x3f,%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rcx
  movzbl -0x23(%rbp),%eax
  add    %rcx,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  shrq   $0x6,-0x18(%rbp)
  movzbl -0x23(%rbp),%eax
  sub    $0x1,%eax
  mov    %al,-0x23(%rbp)
L210:
  cmpb   $0x0,-0x23(%rbp)
  jne    L171
  cmpb   $0x1,-0x24(%rbp)
  jbe    L273
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  or     -0x21(%rbp),%dl
  mov    %dl,(%rax)
  jmp    L297
L273:
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  and    $0x7f,%edx
  mov    %dl,(%rax)
L297:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  movzbl -0x24(%rbp),%eax
  add    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  movzbl -0x22(%rbp),%eax
  jmp    L99
L181:
  mov    $0x0,%eax
L99:
  leave
  ret
```

assistant: ```c
unsigned char utf16_literal_to_utf8(const unsigned char *const input_pointer, const unsigned char *const input_end, unsigned char **output_pointer, const unsigned char **error_pointer) {
  long unsigned int codepoint = 0;
  unsigned int first_code = 0;
  const unsigned char *first_sequence = input_pointer;
  unsigned char utf8_length = 0;
  unsigned char utf8_position = 0;
  unsigned char sequence_length = 0;
  unsigned char first_byte_mark = 0;
  if ((input_end - first_sequence) < 6) {
    *error_pointer = first_sequence;
    goto fail;
  }
  first_code = parse_hex4(first_sequence + 2);
  if (((first_code >= 0xDC00) && (first_code <= 0xDFFF)) || (first_code == 0)) {
    *error_pointer = first_sequence;
    goto fail;
  }
  if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) {
    const unsigned char *second_sequence = first_sequence + 6;
    unsigned int second_code = 0;
    sequence_length = 12;
    if ((input_end - second_sequence) < 6) {
      *error_pointer = first_sequence;
      goto fail;
    }
    if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) {
      *error_pointer = first_sequence;
      goto fail;
    }
    second_code = parse_hex4(second_sequence + 2);
    if ((second_code < 0xDC00) || (second_code > 0xDFFF)) {
      *error_pointer = first_sequence;
      goto fail;
    }
    codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF));
  } else {
    sequence_length = 6;
    codepoint = first_code;
  }
  if (codepoint < 0x80) {
    utf8_length = 1;
  } else if (codepoint < 0x800) {
    utf8_length = 2;
    first_byte_mark = 0xC0;
  } else if (codepoint < 0x10000) {
    utf8_length = 3;
    first_byte_mark = 0xE0;
  } else if (codepoint <= 0x10FFFF) {
    utf8_length = 4;
    first_byte_mark = 0xF0;
  } else {
    *error_pointer = first_sequence;
    goto fail;
  }
  for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) {
    (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF);
    codepoint >>= 6;
  }
  if (utf8_length > 1) {
    (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF);
  } else {
    (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F);
  }
  *output_pointer += utf8_length;
  return sequence_length;
fail:
  return 0;
}
```