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     L1326
  mov    %edx,%edi
  lea    0x1(%rbx),%rsi
  lea    0x2(%rbx),%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L1349
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L1565
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L1330
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L1109
  mov    %edx,%edi
  mov    %edx,%ecx
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  je     L812
L272:
  test   %cl,%cl
  js     L1016
  mov    %r8,%r10
  jmp    L1356
  nopw   0x0(%rax,%rax,1)
L1349:
  mov    %r8,%rdi
  nopl   0x0(%rax,%rax,1)
L881:
  shl    $0x1e,%edx
  movsbl (%rsi),%ecx
  and    $0x40000000,%edx
  mov    %edx,%r11d
  test   %ecx,%ecx
  je     L1506
  mov    %ecx,%r9d
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  je     L111
L1337:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  test   %dl,%dl
  jns    L1045
  mov    %rsi,%rax
  jmp    L1337
  nopw   0x0(%rax,%rax,1)
L488:
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  xor    %r9d,%r9d
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L1356
L72:
  lea    -0x800(%r9),%rdx
  mov    %rdi,%rcx
  mov    %rsi,%rax
L928:
  cmp    $0xf7ff,%rdx
  ja     L358
  mov    %r9b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  jne    L488
L820:
  movsbl (%rsi),%ecx
  test   %ecx,%ecx
  je     L1506
  mov    %ecx,%r10d
  mov    $0xffffffff,%r9d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  je     L719
L115:
  mov    %rdi,%rcx
L1542:
  lea    -0x200000(%r9),%rdx
  cmp    $0x3dfffff,%rdx
  ja     L379
  mov    %r9b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  xor    %r9d,%r9d
  test   %dl,%dl
  jns    L674
  mov    %rsi,%rax
  mov    %rdi,%rcx
  jmp    L1542
  nopw   0x0(%rax,%rax,1)
L1564:
  mov    %r9,%rsi
  nopl   0x0(%rax,%rax,1)
L305:
  movsbl (%rsi),%r9d
  test   %r9d,%r9d
  je     L1506
  mov    %r9d,%ecx
  mov    $0xffffffff,%r10d
  and    $0xc0,%ecx
  cmp    $0x80,%ecx
  je     L29
L712:
  mov    %rdi,%rcx
L353:
  lea    -0x10000(%r10),%rdx
  cmp    $0x1effff,%rdx
  ja     L1117
  mov    %r10b,(%rcx)
  movsbl (%rax),%edx
  add    $0x1,%rdi
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  xor    %r10d,%r10d
  test   %dl,%dl
  js     L121
L674:
  mov    %rdi,%r10
  jmp    L1356
  nopl   0x0(%rax)
L497:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  jne    L945
L775:
  movsbl (%rsi),%ecx
  test   %ecx,%ecx
  je     L1506
  mov    %ecx,%r10d
  mov    $0xffffffff,%r9d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  je     L1436
L1253:
  mov    %rax,%rsi
  jmp    L72
  nopl   (%rax)
L1326:
  mov    %r8,%rdi
L1506:
  movb   $0x0,(%rdi)
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L111:
  shl    $0x18,%ecx
  lea    0x2(%rsi),%rax
  and    $0x3f000000,%ecx
  mov    %ecx,%r9d
  movsbl 0x1(%rsi),%ecx
  test   %ecx,%ecx
  je     L1506
  mov    %ecx,%r10d
  and    $0xc0,%r10d
  cmp    $0x80,%r10d
  jne    L1337
  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     L1506
  mov    %ecx,%esi
  and    $0xc0,%esi
  cmp    $0x80,%esi
  jne    L1337
  mov    $0x6,%esi
L1134:
  shl    $0xc,%ecx
  and    $0x3f000,%ecx
  or     %rdx,%rcx
  movsbl (%rax),%edx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  add    $0x1,%rax
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  je     L1072
  cmp    $0x6,%esi
  je     L1337
L379:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L1356
  mov    %rsi,%rax
  xor    %r9d,%r9d
  jmp    L115
  nopl   0x0(%rax)
L29:
  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     L1506
  mov    %edx,%r9d
  mov    $0x4,%esi
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  jne    L1117
L1072:
  shl    $0x6,%edx
  and    $0xfc0,%edx
  or     %rcx,%rdx
  movsbl (%rax),%ecx
  mov    %ecx,%r9d
  test   %ecx,%ecx
  je     L1506
  add    $0x1,%rax
L235:
  and    $0xc0,%ecx
  cmp    $0x80,%ecx
  je     L991
L743:
  lea    -0x3(%rsi),%edx
  cmp    $0x3,%edx
  ja     L497
  lea    D10(%rip),%rcx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
L1436:
  lea    0x2(%rsi),%rax
  movsbl 0x1(%rsi),%esi
  mov    %esi,%r10d
  test   %esi,%esi
  je     L1506
  and    $0xc0,%esi
  cmp    $0x80,%esi
  jne    L1253
  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    L1253
  nopl   (%rax)
L358:
  movsbl (%rax),%edx
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  mov    %rdi,%r10
  xor    %r9d,%r9d
  test   %dl,%dl
  jns    L1356
  jmp    L72
  nopl   0x0(%rax,%rax,1)
L1117:
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  mov    %edx,%r9d
  lea    0x1(%rax),%rsi
  add    $0x2,%rax
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  mov    %rdi,%r10
  test   %dl,%dl
  jns    L1356
  mov    %rsi,%rax
  xor    %r10d,%r10d
  jmp    L712
  cs nopw 0x0(%rax,%rax,1)
L991:
  and    $0x3f,%r9d
  or     %rdx,%r9
  lea    -0x80(%r9),%rdx
  cmp    $0x77f,%rdx
  ja     L743
  lea    -0x3(%rsi),%edx
  cmp    $0x3,%edx
  ja     L1290
  lea    D19(%rip),%rcx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
  nopl   (%rax)
L719:
  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     L1506
  mov    %ecx,%r9d
  mov    $0x5,%esi
  and    $0xc0,%r9d
  cmp    $0x80,%r9d
  jne    L379
  jmp    L1134
L945:
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
L846:
  mov    %rsi,%rax
  test   %cl,%cl
  js     L497
L1045:
  mov    %cl,(%rdi)
  movsbl (%rsi),%edx
  lea    0x1(%rdi),%r10
  lea    0x1(%rsi),%r9
  mov    %edx,%ecx
  test   %edx,%edx
  je     L987
  lea    0x2(%rsi),%rax
  mov    %edx,%esi
  and    $0xfe,%esi
  cmp    $0xfc,%esi
  je     L132
  mov    %edx,%esi
  and    $0xfc,%esi
  cmp    $0xf8,%esi
  je     L550
  mov    %edx,%esi
  and    $0xf8,%esi
  cmp    $0xf0,%esi
  je     L1157
  mov    %edx,%esi
  and    $0xf0,%esi
  cmp    $0xe0,%esi
  je     L114
  mov    %edx,%esi
  and    $0xe0,%esi
  cmp    $0xc0,%esi
  mov    %r9,%rsi
  je     L276
  mov    %r10,%rdi
  test   %cl,%cl
  js     L293
L1356:
  mov    %cl,(%r10)
  movsbl (%rsi),%edx
  lea    0x1(%r10),%rdi
  lea    0x1(%rsi),%r9
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  lea    0x2(%rsi),%rax
  mov    %edx,%esi
  and    $0xfe,%esi
  cmp    $0xfc,%esi
  je     L273
  mov    %edx,%esi
  and    $0xfc,%esi
  cmp    $0xf8,%esi
  je     L727
  mov    %edx,%esi
  and    $0xf8,%esi
  cmp    $0xf0,%esi
  je     L1564
  mov    %edx,%esi
  and    $0xf0,%esi
  cmp    $0xe0,%esi
  je     L1280
  mov    %edx,%esi
  and    $0xe0,%esi
  cmp    $0xc0,%esi
  mov    %r9,%rsi
  je     L84
  test   %dl,%dl
  jns    L1045
L293:
  mov    %rdi,%rax
L1558:
  movb   $0x0,(%rax)
  movsbl (%r9),%edx
  add    $0x1,%rdi
  lea    0x1(%r9),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1506
  lea    0x2(%r9),%rax
  mov    %edx,%r9d
  and    $0xfe,%r9d
  cmp    $0xfc,%r9d
  je     L881
  mov    %edx,%r9d
  and    $0xfc,%r9d
  cmp    $0xf8,%r9d
  je     L820
  mov    %edx,%r9d
  and    $0xf8,%r9d
  cmp    $0xf0,%r9d
  je     L305
  mov    %edx,%r9d
  and    $0xf0,%r9d
  cmp    $0xe0,%r9d
  je     L775
  mov    %edx,%r9d
  and    $0xe0,%r9d
  cmp    $0xc0,%r9d
  je     L84
  test   %dl,%dl
  jns    L674
  mov    %rdi,%rax
  mov    %rsi,%r9
  jmp    L1558
L1016:
  mov    %rsi,%rax
  add    $0x1,%rsi
  movsbl (%rax),%edx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L1326
  mov    %edx,%edi
  add    $0x2,%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L1349
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L1565
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L1330
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L1109
  mov    %edx,%edi
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  jne    L272
L812:
  mov    %r8,%rdi
L84:
  movsbl (%rsi),%ecx
  shl    $0x6,%edx
  mov    $0x2,%esi
  and    $0x7c0,%edx
  mov    %ecx,%r9d
  test   %ecx,%ecx
  jne    L235
  jmp    L1506
L273:
  mov    %r9,%rsi
  jmp    L881
L727:
  mov    %r9,%rsi
  jmp    L820
L132:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L881
L1280:
  mov    %r9,%rsi
  jmp    L775
L121:
  mov    %rsi,%rax
  mov    %rdi,%rcx
  jmp    L353
L987:
  mov    %r10,%rdi
  jmp    L1506
L1109:
  mov    %r8,%rdi
  jmp    L775
L1330:
  mov    %r8,%rdi
  jmp    L305
L1565:
  mov    %r8,%rdi
  jmp    L820
L1290:
  mov    %r9b,(%rdi)
  movsbl (%rax),%edx
  lea    0x1(%rdi),%r10
  lea    0x1(%rax),%rsi
  mov    %edx,%ecx
  test   %edx,%edx
  je     L987
  mov    %edx,%edi
  add    $0x2,%rax
  and    $0xfe,%edi
  cmp    $0xfc,%edi
  je     L243
  mov    %edx,%edi
  and    $0xfc,%edi
  cmp    $0xf8,%edi
  je     L138
  mov    %edx,%edi
  and    $0xf8,%edi
  cmp    $0xf0,%edi
  je     L421
  mov    %edx,%edi
  and    $0xf0,%edi
  cmp    $0xe0,%edi
  je     L748
  mov    %edx,%edi
  and    $0xe0,%edi
  cmp    $0xc0,%edi
  je     L276
  mov    %r10,%rdi
  jmp    L846
  lea    -0x800(%r9),%rdx
  mov    %rdi,%rcx
  jmp    L928
L748:
  mov    %r10,%rdi
  jmp    L775
L421:
  mov    %r10,%rdi
  jmp    L305
L138:
  mov    %r10,%rdi
  jmp    L820
L243:
  mov    %r10,%rdi
  jmp    L881
L550:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L820
L276:
  mov    %r10,%rdi
  jmp    L84
L114:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L775
L1157:
  mov    %r9,%rsi
  mov    %r10,%rdi
  jmp    L305
```

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