user: Please show me the C implementation that matches the assembly code listed below:

```asm
<BASM_Parse_EmitChar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  cmpl   $0x3ffffff,-0x1c(%rbp)
  jle    L91
  mov    -0x1c(%rbp),%eax
  sar    $0x1e,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x4(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x18,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x12,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  jmp    L39
L91:
  cmpl   $0x1fffff,-0x1c(%rbp)
  jle    L26
  mov    -0x1c(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x8(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x12,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  jmp    L39
L26:
  cmpl   $0xffff,-0x1c(%rbp)
  jle    L126
  mov    -0x1c(%rbp),%eax
  sar    $0x12,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x10(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0xc,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  jmp    L39
L126:
  cmpl   $0x7ff,-0x1c(%rbp)
  jle    L99
  mov    -0x1c(%rbp),%eax
  sar    $0xc,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x20(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  sar    $0x6,%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  jmp    L39
L99:
  cmpl   $0x7f,-0x1c(%rbp)
  jg     L70
  cmpl   $0x0,-0x1c(%rbp)
  jne    L17
L70:
  mov    -0x1c(%rbp),%eax
  sar    $0x6,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x40(%rcx),%edx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%eax
  and    $0x3f,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  lea    -0x80(%rcx),%edx
  mov    %dl,(%rax)
  jmp    L39
L17:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L15
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0xc0,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x80,(%rax)
  jmp    L39
L15:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    %dl,(%rax)
L39:
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  pop    %rbp
  ret
```

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);
}
```