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

```asm
<isUTF8>:
  endbr64
  test   %esi,%esi
  jle    L234
  lea    -0x1(%rsi),%eax
  xor    %r8d,%r8d
  lea    0x1(%rdi,%rax,1),%rcx
  nopw   0x0(%rax,%rax,1)
L112:
  movzbl (%rdi),%eax
  test   %r8d,%r8d
  jne    L199
  test   %al,%al
  jns    L7
  mov    %eax,%edx
  and    $0xffffffe0,%edx
  cmp    $0xc0,%dl
  je     L254
  mov    %eax,%edx
  and    $0xfffffff0,%edx
  cmp    $0xe0,%dl
  je     L131
  mov    %eax,%edx
  and    $0xfffffff8,%edx
  cmp    $0xf0,%dl
  je     L209
  mov    %eax,%edx
  and    $0xfffffffc,%edx
  cmp    $0xf8,%dl
  je     L189
  mov    %eax,%edx
  and    $0xfffffffe,%edx
  cmp    $0xfc,%dl
  je     L94
L316:
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L199:
  mov    %eax,%esi
  and    $0xffffffc0,%esi
  cmp    $0x80,%sil
  jne    L26
  shl    $0x6,%rdx
  and    $0x3f,%eax
  add    %rax,%rdx
  sub    $0x1,%r8d
  jne    L7
  cmp    $0x1,%r9d
  jne    L132
  cmp    $0x7f,%rdx
  jbe    L316
L132:
  cmp    $0x2,%r9d
  jne    L240
  cmp    $0x7ff,%rdx
  jbe    L316
L240:
  cmp    $0x3,%r9d
  jne    L299
  cmp    $0xffff,%rdx
  jbe    L316
L299:
  cmp    $0x4,%r9d
  jne    L129
  cmp    $0x1fffff,%rdx
  jbe    L316
L129:
  cmp    $0x5,%r9d
  jne    L7
  cmp    $0x3ffffff,%rdx
  jbe    L316
  nopw   0x0(%rax,%rax,1)
L7:
  add    $0x1,%rdi
  cmp    %rdi,%rcx
  jne    L112
L234:
  mov    $0x1,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L254:
  mov    %rax,%rdx
  add    $0x1,%rdi
  mov    $0x1,%r9d
  mov    $0x1,%r8d
  and    $0x1f,%edx
  cmp    %rdi,%rcx
  jne    L112
  jmp    L234
  nopl   0x0(%rax)
L131:
  mov    %rax,%rdx
  add    $0x1,%rdi
  mov    $0x2,%r9d
  mov    $0x2,%r8d
  and    $0xf,%edx
  cmp    %rdi,%rcx
  jne    L112
  jmp    L234
  nopl   0x0(%rax)
L94:
  mov    %rax,%rdx
  add    $0x1,%rdi
  mov    $0x5,%r9d
  mov    $0x5,%r8d
  and    $0x1,%edx
  cmp    %rdi,%rcx
  jne    L112
  jmp    L234
  nopl   0x0(%rax)
L209:
  mov    %rax,%rdx
  add    $0x1,%rdi
  mov    $0x3,%r9d
  mov    $0x3,%r8d
  and    $0x7,%edx
  cmp    %rdi,%rcx
  jne    L112
  jmp    L234
  nopl   0x0(%rax)
L189:
  mov    %rax,%rdx
  add    $0x1,%rdi
  mov    $0x4,%r9d
  mov    $0x4,%r8d
  and    $0x3,%edx
  cmp    %rdi,%rcx
  jne    L112
  jmp    L234
  nopl   0x0(%rax)
L26:
  xor    %r8d,%r8d
  jmp    L316
```

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