user: Demonstrate the C code that generates the assembly output below:

```asm
<isUTF8>:
  endbr64
  test   %esi,%esi
  jle    L81
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rdx
  lea    -0x1(%rsi),%eax
  lea    0x1(%rdi,%rax,1),%rsi
  mov    $0x0,%ecx
  mov    $0x5,%ebx
  mov    $0x4,%r12d
  mov    $0x3,%ebp
  mov    $0x2,%r11d
  mov    $0x1,%r10d
  jmp    L142
L254:
  mov    %rax,%r8
  and    $0x1f,%r8d
  mov    %r10d,%r9d
  mov    $0x1,%ecx
  jmp    L155
L210:
  mov    %rax,%r8
  and    $0xf,%r8d
  mov    %r11d,%r9d
  mov    $0x2,%ecx
  jmp    L155
L172:
  mov    %rax,%r8
  and    $0x7,%r8d
  mov    %ebp,%r9d
  mov    $0x3,%ecx
  jmp    L155
L266:
  mov    %rax,%r8
  and    $0x3,%r8d
  mov    %r12d,%r9d
  mov    $0x4,%ecx
  jmp    L155
L214:
  mov    %rax,%r8
  and    $0x1,%r8d
  mov    %ebx,%r9d
  mov    $0x5,%ecx
  jmp    L155
L178:
  mov    %eax,%edi
  and    $0xffffffc0,%edi
  cmp    $0x80,%dil
  jne    L59
  shl    $0x6,%r8
  and    $0x3f,%eax
  add    %rax,%r8
  sub    $0x1,%ecx
  jne    L155
  cmp    $0x1,%r9d
  jne    L189
  cmp    $0x7f,%r8
  jbe    L25
L189:
  cmp    $0x2,%r9d
  jne    L156
  cmp    $0x7ff,%r8
  jbe    L25
L156:
  cmp    $0x3,%r9d
  jne    L165
  cmp    $0xffff,%r8
  jbe    L25
L165:
  cmp    $0x4,%r9d
  jne    L127
  cmp    $0x1fffff,%r8
  jbe    L25
L127:
  cmp    $0x5,%r9d
  jne    L155
  cmp    $0x3ffffff,%r8
  jbe    L25
L155:
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  je     L140
L142:
  movzbl (%rdx),%eax
  test   %ecx,%ecx
  jne    L178
  test   %al,%al
  jns    L155
  mov    %eax,%edi
  and    $0xffffffe0,%edi
  cmp    $0xc0,%dil
  je     L254
  mov    %eax,%edi
  and    $0xfffffff0,%edi
  cmp    $0xe0,%dil
  je     L210
  mov    %eax,%edi
  and    $0xfffffff8,%edi
  cmp    $0xf0,%dil
  je     L172
  mov    %eax,%edi
  and    $0xfffffffc,%edi
  cmp    $0xf8,%dil
  je     L266
  mov    %eax,%edi
  and    $0xfffffffe,%edi
  cmp    $0xfc,%dil
  je     L214
L25:
  mov    %ecx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L140:
  mov    $0x1,%ecx
  jmp    L25
L81:
  mov    $0x1,%ecx
  mov    %ecx,%eax
  ret
L59:
  mov    $0x0,%ecx
  jmp    L25
```

assistant: ```c
int isUTF8(unsigned char *str, int length) {
  int i, mode = 0, m2;
  unsigned long ucs;
  unsigned char ch;
  for (i = 0; i < length; i++) {
    ch = str[i];
    if (mode == 0) {
      if ((ch & 0x80) == 0)
        continue;
      if ((ch & 0xe0) == 0xc0) {
        mode = m2 = 1;
        ucs = (ch & 0x1f);
        continue;
      }
      if ((ch & 0xf0) == 0xe0) {
        mode = m2 = 2;
        ucs = (ch & 0x0f);
        continue;
      }
      if ((ch & 0xf8) == 0xf0) {
        mode = m2 = 3;
        ucs = (ch & 0x07);
        continue;
      }
      if ((ch & 0xfc) == 0xf8) {
        mode = m2 = 4;
        ucs = (ch & 0x03);
        continue;
      }
      if ((ch & 0xfe) == 0xfc) {
        mode = m2 = 5;
        ucs = (ch & 0x01);
        continue;
      }
      return 0;
    } else {
      if ((ch & 0xc0) != 0x80)
        return 0;
      ucs <<= 6;
      ucs += (ch & 0x3f);
      mode--;
      if (!mode) {
        if (m2 == 1 && ucs < 0x0000080)
          return 0;
        if (m2 == 2 && ucs < 0x0000800)
          return 0;
        if (m2 == 3 && ucs < 0x0010000)
          return 0;
        if (m2 == 4 && ucs < 0x0200000)
          return 0;
        if (m2 == 5 && ucs < 0x4000000)
          return 0;
      }
    }
  }
  return 1;
}
```