user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<cmyth_utf8tolatin1>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  xor    %edx,%edx
  xor    %ecx,%ecx
  xor    %esi,%esi
  lea    0x1(%rax),%rdi
  call   <__ref_alloc@plt>
  movb   $0x0,(%rax)
  movsbl (%rbx),%edx
  mov    %rax,%r8
  test   %edx,%edx
  je     L1538
  mov    %edx,%edi
  lea    0x1(%rbx),%rsi
  lea    0x2(%rbx),%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L968
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L767
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L543
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L306
  mov    %edx,%edi
  mov    %edx,%ecx
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  je     L1551
L709:
  test   %cl,%cl
  js     L1390
  mov    %r8,%r10
  jmp    L374
  nopw   0x0(%rax,%rax,1)
L968:
  mov    %r8,%rdi
  nopl   0x0(%rax,%rax,1)
L855:
  shl    $0x1e,%edx
  movsbl (%rsi),%ecx
  and    $0x40000000,%edx
  mov    %edx,%r11d
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%r9d
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  je     L1290
L828:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  test   %dl,%dl
  jns    L1262
  mov    %rsi,%rax
  jmp    L828
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  xor    %r9d,%r9d
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L374
L1549:
  lea    -0x800(%r9),%rdx
  mov    %rdi,%rcx
  mov    %rsi,%rax
L883:
  cmp    $0xf7ff,%rdx
  ja     L329
  mov    %r9b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  jne    L69
L820:
  movsbl (%rsi),%ecx
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%r10d
  mov    $0xffffffff,%r9d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  je     L662
L845:
  mov    %rdi,%rcx
L1428:
  lea    -0x200000(%r9),%rdx
  cmp    $0x3dfffff,%rdx
  ja     L148
  mov    %r9b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  xor    %r9d,%r9d
  test   %dl,%dl
  jns    L1274
  mov    %rsi,%rax
  mov    %rdi,%rcx
  jmp    L1428
  nopw   0x0(%rax,%rax,1)
L875:
  mov    %r9,%rsi
  nopl   0x0(%rax,%rax,1)
L770:
  movsbl (%rsi),%r9d
  test   %r9d,%r9d
  je     L1075
  mov    %r9d,%ecx
  mov    $0xffffffff,%r10d
  and    $0xc0,%ecx
  cmp    $0x80,%ecx
  je     L1019
L384:
  mov    %rdi,%rcx
L1361:
  lea    -0x10000(%r10),%rdx
  cmp    $0x1effff,%rdx
  ja     L1102
  mov    %r10b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  xor    %r10d,%r10d
  test   %dl,%dl
  js     L1104
L1274:
  mov    %rdi,%r10
  jmp    L374
  nopl   0x0(%rax)
L275:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  jne    L1307
L971:
  movsbl (%rsi),%ecx
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%r10d
  mov    $0xffffffff,%r9d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  je     L1086
L307:
  mov    %rax,%rsi
  jmp    L1549
  nopl   (%rax)
L1538:
  mov    %r8,%rdi
L1075:
  movb   $0x0,(%rdi)
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L1290:
  shl    $0x18,%ecx
  lea    0x2(%rsi),%rax
  and    $0x3f000000,%ecx
  mov    %ecx,%r9d
  movsbl 0x1(%rsi),%ecx
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%r10d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  jne    L828
  shl    $0x12,%ecx
  lea    0x3(%rsi),%rax
  mov    %ecx,%edx
  movsbl 0x2(%rsi),%ecx
  and    $0xfc0000,%edx
  or     %r9d,%edx
  or     %r11d,%edx
  movslq %edx,%rdx
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%esi
  and    $0xc0,%esi
  cmp    $0x80,%esi
  jne    L828
  mov    $0x6,%esi
L1554:
  shl    $0xc,%ecx
  and    $0x3f000,%ecx
  or     %rdx,%rcx
  movsbl (%rax),%edx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  add    $0x1,%rax
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  je     L1321
  cmp    $0x6,%esi
  je     L828
L148:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L374
  mov    %rsi,%rax
  xor    %r9d,%r9d
  jmp    L845
  nopl   0x0(%rax)
L1019:
  mov    %edx,%ecx
  shl    $0xc,%r9d
  movsbl 0x1(%rsi),%edx
  lea    0x2(%rsi),%rax
  shl    $0x12,%ecx
  and    $0x3f000,%r9d
  and    $0x1c0000,%ecx
  or     %r9d,%ecx
  movslq %ecx,%rcx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  mov    $0x4,%esi
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  jne    L1102
L1321:
  shl    $0x6,%edx
  and    $0xfc0,%edx
  or     %rcx,%rdx
  movsbl (%rax),%ecx
  mov    %ecx,%r9d
  test   %ecx,%ecx
  je     L1075
  add    $0x1,%rax
L740:
  and    $0xc0,%ecx
  cmp    $0x80,%ecx
  je     L737
L687:
  lea    -0x3(%rsi),%edx
  cmp    $0x3,%edx
  ja     L275
  lea    D11(%rip),%rcx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
L1086:
  lea    0x2(%rsi),%rax
  movsbl 0x1(%rsi),%esi
  mov    %esi,%r10d
  test   %esi,%esi
  je     L1075
  and    $0xc0,%esi
  cmp    $0x80,%esi
  jne    L307
  shl    $0xc,%edx
  shl    $0x6,%ecx
  and    $0x3f,%r10d
  mov    %edx,%r9d
  mov    %ecx,%edx
  and    $0xf000,%r9d
  and    $0xfc0,%edx
  or     %r10,%r9
  or     %rdx,%r9
  lea    -0x80(%r9),%rdx
  cmp    $0x77f,%rdx
  jbe    L307
  nopl   (%rax)
L329:
  movsbl (%rax),%edx
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  mov    %rdi,%r10
  xor    %r9d,%r9d
  test   %dl,%dl
  jns    L374
  jmp    L1549
  nopl   0x0(%rax,%rax,1)
L1102:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L374
  mov    %rsi,%rax
  xor    %r10d,%r10d
  jmp    L384
  cs nopw 0x0(%rax,%rax,1)
L737:
  and    $0x3f,%r9d
  or     %rdx,%r9
  lea    -0x80(%r9),%rdx
  cmp    $0x77f,%rdx
  ja     L687
  lea    -0x3(%rsi),%edx
  cmp    $0x3,%edx
  ja     L651
  lea    D9(%rip),%rcx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
  nopl   (%rax)
L662:
  shl    $0x18,%edx
  shl    $0x12,%ecx
  lea    0x2(%rsi),%rax
  and    $0xfc0000,%ecx
  and    $0x3000000,%edx
  or     %ecx,%edx
  movsbl 0x1(%rsi),%ecx
  movslq %edx,%rdx
  test   %ecx,%ecx
  je     L1075
  mov    %ecx,%r9d
  mov    $0x5,%esi
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  jne    L148
  jmp    L1554
L1307:
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
L1180:
  mov    %rsi,%rax
  test   %cl,%cl
  js     L275
L1262:
  mov    %cl,(%rdi)
  movsbl (%rsi),%edx
  lea    0x1(%rdi),%r10
  lea    0x1(%rsi),%r9
  mov    %edx,%ecx
  test   %edx,%edx
  je     L691
  lea    0x2(%rsi),%rax
  mov    %edx,%esi
  and    $0xfe,%esi
  cmp    $0xfc,%esi
  je     L41
  mov    %edx,%esi
  and    $0xfc,%esi
  cmp    $0xf8,%esi
  je     L1021
  mov    %edx,%esi
  and    $0xf8,%esi
  cmp    $0xf0,%esi
  je     L1542
  mov    %edx,%esi
  and    $0xf0,%esi
  cmp    $0xe0,%esi
  je     L609
  mov    %edx,%esi
  and    $0xe0,%esi
  cmp    $0xc0,%esi
  mov    %r9,%rsi
  je     L876
  mov    %r10,%rdi
  test   %cl,%cl
  js     L757
L374:
  mov    %cl,(%r10)
  movsbl (%rsi),%edx
  lea    0x1(%r10),%rdi
  lea    0x1(%rsi),%r9
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  lea    0x2(%rsi),%rax
  mov    %edx,%esi
  and    $0xfe,%esi
  cmp    $0xfc,%esi
  je     L966
  mov    %edx,%esi
  and    $0xfc,%esi
  cmp    $0xf8,%esi
  je     L99
  mov    %edx,%esi
  and    $0xf8,%esi
  cmp    $0xf0,%esi
  je     L875
  mov    %edx,%esi
  and    $0xf0,%esi
  cmp    $0xe0,%esi
  je     L681
  mov    %edx,%esi
  and    $0xe0,%esi
  cmp    $0xc0,%esi
  mov    %r9,%rsi
  je     L997
  test   %dl,%dl
  jns    L1262
L757:
  mov    %rdi,%rax
L1264:
  movb   $0x0,(%rax)
  movsbl (%r9),%edx
  add    $0x1,%rdi
  lea    0x1(%r9),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1075
  lea    0x2(%r9),%rax
  mov    %edx,%r9d
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L855
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L770
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L971
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L997
  test   %dl,%dl
  jns    L1274
  mov    %rdi,%rax
  mov    %rsi,%r9
  jmp    L1264
L1390:
  mov    %rsi,%rax
  add    $0x1,%rsi
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1538
  mov    %edx,%edi
  add    $0x2,%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L968
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L767
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L543
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L306
  mov    %edx,%edi
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  jne    L709
L1551:
  mov    %r8,%rdi
L997:
  movsbl (%rsi),%ecx
  shl    $0x6,%edx
  mov    $0x2,%esi
  and    $0x7c0,%edx
  mov    %ecx,%r9d
  test   %ecx,%ecx
  jne    L740
  jmp    L1075
L966:
  mov    %r9,%rsi
  jmp    L855
L99:
  mov    %r9,%rsi
  jmp    L820
L41:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L855
L681:
  mov    %r9,%rsi
  jmp    L971
L1104:
  mov    %rsi,%rax
  mov    %rdi,%rcx
  jmp    L1361
L691:
  mov    %r10,%rdi
  jmp    L1075
L306:
  mov    %r8,%rdi
  jmp    L971
L543:
  mov    %r8,%rdi
  jmp    L770
L767:
  mov    %r8,%rdi
  jmp    L820
L651:
  mov    %r9b,(%rdi)
  movsbl (%rax),%edx
  lea    0x1(%rdi),%r10
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L691
  mov    %edx,%edi
  add    $0x2,%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L937
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L1354
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L1539
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L1447
  mov    %edx,%edi
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  je     L876
  mov    %r10,%rdi
  jmp    L1180
  lea    -0x800(%r9),%rdx
  mov    %rdi,%rcx
  jmp    L883
L1447:
  mov    %r10,%rdi
  jmp    L971
L1539:
  mov    %r10,%rdi
  jmp    L770
L1354:
  mov    %r10,%rdi
  jmp    L820
L937:
  mov    %r10,%rdi
  jmp    L855
L1021:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L820
L876:
  mov    %r10,%rdi
  jmp    L997
L609:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L971
L1542:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L770
```

assistant: ```c
char *cmyth_utf8tolatin1(char *s) {
  unsigned long ucs4;
  int c, state, octets;
  char *out, *t;
  ucs4 = 0;
  state = 0;
  octets = 0;
  out = (char *)(__ref_alloc((strlen(s) + 1), (char *)0, (char *)0, 0));
  t = out;
  *t = 0;
  while ((c = *(s++)) != 0) {
    switch (state) {
    case 0:
      ucs4 = 0;
      if ((c & 0xfe) == 0xfc) {
        ucs4 = (c & 0x01) << 30;
        octets = 6;
        state = 5;
      } else if ((c & 0xfc) == 0xf8) {
        ucs4 = (c & 0x03) << 24;
        octets = 5;
        state = 4;
      } else if ((c & 0xf8) == 0xf0) {
        ucs4 = (c & 0x07) << 18;
        octets = 4;
        state = 3;
      } else if ((c & 0xf0) == 0xe0) {
        ucs4 = (c & 0x0f) << 12;
        octets = 3;
        state = 2;
      } else if ((c & 0xe0) == 0xc0) {
        ucs4 = (c & 0x1f) << 6;
        octets = 2;
        state = 1;
      } else if ((c & 0x80) == 0x00) {
        ucs4 = (c & 0x7f);
        octets = 1;
        state = 0;
      } else {
        ;
      }
      break;
    case 1:
      if ((c & 0xc0) == 0x80) {
        ucs4 = ucs4 | (c & 0x3f);
        if (ucs4 < 0x80 || ucs4 > 0x7ff) {
          ucs4 = 0xffffffff;
        }
      } else {
        ucs4 = 0xffffffff;
      }
      state = 0;
      break;
    case 2:
      if ((c & 0xc0) == 0x80) {
        ucs4 = ucs4 | ((c & 0x3f) << 6);
        state = 1;
      } else {
        ucs4 = 0xffffffff;
        state = 0;
      }
      break;
    case 3:
      if ((c & 0xc0) == 0x80) {
        ucs4 = ucs4 | ((c & 0x3f) << 12);
        state = 2;
      } else {
        ucs4 = 0xffffffff;
        state = 0;
      }
      break;
    case 4:
      if ((c & 0xc0) == 0x80) {
        ucs4 = ucs4 | ((c & 0x3f) << 18);
        state = 3;
      } else {
        ucs4 = 0xffffffff;
        state = 0;
      }
      break;
    case 5:
      if ((c & 0xc0) == 0x80) {
        ucs4 = ucs4 | ((c & 0x3f) << 24);
        state = 4;
      } else {
        ucs4 = 0xffffffff;
        state = 0;
      }
      break;
    default:
      ucs4 = 0xffffffff;
      state = 0;
      break;
    }
    if (state == 0) {
      switch (octets) {
      case 1:
        if (ucs4 > 0x7f)
          ucs4 = 0xffffffff;
        break;
      case 2:
        if (ucs4 < 0x80 || ucs4 > 0x7ff)
          ucs4 = 0xffffffff;
        break;
      case 3:
        if (ucs4 < 0x800 || ucs4 > 0xffff)
          ucs4 = 0xffffffff;
        break;
      case 4:
        if (ucs4 < 0x10000 || ucs4 > 0x1fffff)
          ucs4 = 0xffffffff;
        break;
      case 5:
        if (ucs4 < 0x200000 || ucs4 > 0x3ffffff)
          ucs4 = 0xffffffff;
        break;
      case 6:
        if (ucs4 < 0x4000000 || ucs4 > 0x7fffffff)
          ucs4 = 0xffffffff;
        break;
      default:
        ucs4 = 0xffffffff;
        break;
      }
      if (ucs4 != 0xffffffff) {
        *(t++) = (char)ucs4;
      }
    }
  }
  *t = 0;
  return out;
}
```