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

```asm
<BASM_Parse_EmitChar>:
  endbr64
  mov    (%rdi),%rdx
  mov    %rdi,%rcx
  mov    %esi,%eax
  cmp    $0x3ffffff,%esi
  jle    L47
  sar    $0x1e,%esi
  sub    $0x4,%esi
  mov    %sil,(%rdx)
  mov    %eax,%esi
  sar    $0x18,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x1(%rdx)
  mov    %eax,%esi
  sar    $0x12,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x2(%rdx)
  mov    %eax,%esi
  sar    $0xc,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x3(%rdx)
  mov    %eax,%esi
  and    $0x3f,%eax
  sar    $0x6,%esi
  add    $0xffffff80,%eax
  and    $0x3f,%esi
  mov    %al,0x5(%rdx)
  add    $0xffffff80,%esi
  mov    %sil,0x4(%rdx)
  lea    0x6(%rdx),%rsi
L27:
  mov    %rsi,(%rcx)
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L47:
  cmp    $0x1fffff,%esi
  jle    L74
  sar    $0x18,%esi
  sub    $0x8,%esi
  mov    %sil,(%rdx)
  mov    %eax,%esi
  sar    $0x12,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x1(%rdx)
  mov    %eax,%esi
  sar    $0xc,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x2(%rdx)
  mov    %eax,%esi
  and    $0x3f,%eax
  sar    $0x6,%esi
  add    $0xffffff80,%eax
  and    $0x3f,%esi
  mov    %al,0x4(%rdx)
  xor    %eax,%eax
  add    $0xffffff80,%esi
  mov    %sil,0x3(%rdx)
  lea    0x5(%rdx),%rsi
  mov    %rsi,(%rcx)
  ret
  nopl   0x0(%rax)
L74:
  cmp    $0xffff,%esi
  jg     L80
  cmp    $0x7ff,%esi
  jle    L24
  sar    $0xc,%esi
  sub    $0x20,%esi
  mov    %sil,(%rdx)
  mov    %eax,%esi
  and    $0x3f,%eax
  sar    $0x6,%esi
  add    $0xffffff80,%eax
  and    $0x3f,%esi
  mov    %al,0x2(%rdx)
  add    $0xffffff80,%esi
  mov    %sil,0x1(%rdx)
  lea    0x3(%rdx),%rsi
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L80:
  sar    $0x12,%esi
  sub    $0x10,%esi
  mov    %sil,(%rdx)
  mov    %eax,%esi
  sar    $0xc,%esi
  and    $0x3f,%esi
  add    $0xffffff80,%esi
  mov    %sil,0x1(%rdx)
  mov    %eax,%esi
  and    $0x3f,%eax
  sar    $0x6,%esi
  add    $0xffffff80,%eax
  and    $0x3f,%esi
  mov    %al,0x3(%rdx)
  xor    %eax,%eax
  add    $0xffffff80,%esi
  mov    %sil,0x2(%rdx)
  lea    0x4(%rdx),%rsi
  mov    %rsi,(%rcx)
  ret
  nopw   0x0(%rax,%rax,1)
L24:
  cmp    $0x7f,%esi
  jg     L70
  test   %esi,%esi
  je     L70
  mov    %al,(%rdx)
  lea    0x1(%rdx),%rsi
  jmp    L27
  nopl   0x0(%rax)
L70:
  mov    %eax,%esi
  and    $0x3f,%eax
  sar    $0x6,%esi
  add    $0xffffff80,%eax
  sub    $0x40,%esi
  mov    %al,0x1(%rdx)
  mov    %sil,(%rdx)
  lea    0x2(%rdx),%rsi
  jmp    L27
```

assistant: ```c
int BASM_Parse_EmitChar(char **str, int j) {
  unsigned char *t;
  int i;
  t = (unsigned char *)(*str);
  if (j > 0x3FFFFFF) {
    *t++ = 0xFC + (j >> 30);
    *t++ = 0x80 + ((j >> 24) & 0x3F);
    *t++ = 0x80 + ((j >> 18) & 0x3F);
    *t++ = 0x80 + ((j >> 12) & 0x3F);
    *t++ = 0x80 + ((j >> 6) & 0x3F);
    *t++ = 0x80 + (j & 0x3F);
  } else if (j > 0x1FFFFF) {
    *t++ = 0xF8 + (j >> 24);
    *t++ = 0x80 + ((j >> 18) & 0x3F);
    *t++ = 0x80 + ((j >> 12) & 0x3F);
    *t++ = 0x80 + ((j >> 6) & 0x3F);
    *t++ = 0x80 + (j & 0x3F);
  } else if (j > 0xFFFF) {
    *t++ = 0xF0 + (j >> 18);
    *t++ = 0x80 + ((j >> 12) & 0x3F);
    *t++ = 0x80 + ((j >> 6) & 0x3F);
    *t++ = 0x80 + (j & 0x3F);
  } else if (j > 0x7FF) {
    *t++ = 0xE0 + (j >> 12);
    *t++ = 0x80 + ((j >> 6) & 0x3F);
    *t++ = 0x80 + (j & 0x3F);
  } else if ((j > 0x7F) || !j) {
    *t++ = 0xC0 + (j >> 6);
    *t++ = 0x80 + (j & 0x3F);
  } else {
    if (!j) {
      *t++ = 0xC0;
      *t++ = 0x80;
    } else
      *t++ = j;
  }
  *str = (char *)t;
  return (0);
}
```