user: Translate the below assembly code into C programming language:

```asm
<mywcscspn>:
  endbr64
  mov    (%rdi),%eax
  test   %eax,%eax
  je     L352
  mov    %edx,%r11d
  shr    %edx
  push   %rbx
  mov    %rsi,%r10
  and    $0x1,%r11d
  mov    %rdi,%r9
  xor    %ecx,%ecx
  xor    %esi,%esi
  xor    %r8d,%r8d
  and    $0x1,%edx
  mov    %r11d,%ebx
  nopl   0x0(%rax,%rax,1)
L198:
  cmp    $0x3,%esi
  ja     L50
  cmp    $0x1,%esi
  ja     L204
  jne    L58
L407:
  add    $0x1,%ecx
  movslq %ecx,%r8
  test   %r11d,%r11d
  je     L166
  cmp    $0x27,%eax
  je     L18
L187:
  cmp    $0x22,%eax
  je     L412
L166:
  mov    (%r9,%r8,4),%esi
  mov    %r8d,%ecx
  cmp    $0x5d,%eax
  je     L182
  lea    0x1(%r8),%rax
  test   %esi,%esi
  je     L484
  mov    %rax,%r8
  mov    %esi,%eax
  test   %r11d,%r11d
  je     L166
  cmp    $0x27,%eax
  jne    L187
L18:
  mov    %r8d,%ecx
  movslq %r8d,%r8
  mov    (%r9,%r8,4),%eax
  lea    0x0(,%r8,4),%rsi
  test   %eax,%eax
  je     L484
  cmp    $0x27,%eax
  je     L293
  mov    0x4(%r9,%rsi,1),%eax
  add    $0x1,%ecx
  movslq %ecx,%r8
  test   %eax,%eax
  je     L484
  mov    $0x3,%esi
  nopl   0x0(%rax,%rax,1)
L204:
  cmp    $0x27,%eax
  jne    L337
  cmp    $0x2,%esi
  setne  %sil
  movzbl %sil,%esi
L337:
  add    $0x1,%ecx
  movslq %ecx,%r8
  mov    (%r9,%r8,4),%eax
  test   %eax,%eax
  jne    L198
L484:
  mov    %r8,%rax
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L182:
  test   %esi,%esi
  je     L484
  mov    %esi,%eax
  cs nopw 0x0(%rax,%rax,1)
L58:
  lea    0x1(%rcx),%edi
  movslq %edi,%rdi
L497:
  mov    %edi,%esi
  lea    -0x1(%rdi),%ecx
  cmp    $0x5b,%eax
  jne    L178
  test   %dl,%dl
  jne    L457
L178:
  cmp    $0x27,%eax
  jne    L140
  test   %bl,%bl
  jne    L242
L140:
  cmp    $0x22,%eax
  jne    L38
  test   %bl,%bl
  je     L38
  movslq %edi,%r8
  mov    %edi,%ecx
  mov    (%r9,%r8,4),%eax
  lea    0x0(,%r8,4),%rdi
  test   %eax,%eax
  je     L484
  cmp    $0x22,%eax
  je     L421
  mov    0x4(%r9,%rdi,1),%eax
  lea    0x1(%rsi),%ecx
  movslq %ecx,%r8
  test   %eax,%eax
  je     L484
  mov    $0x4,%esi
L50:
  cmp    $0x22,%eax
  jne    L337
L72:
  cmp    $0x4,%esi
  setne  %sil
  add    $0x1,%ecx
  movslq %ecx,%r8
  movzbl %sil,%esi
  mov    (%r9,%r8,4),%eax
  test   %eax,%eax
  jne    L198
  jmp    L484
  nopl   0x0(%rax,%rax,1)
L38:
  mov    (%r10),%esi
  test   %esi,%esi
  je     L176
  lea    0x4(%r10),%rdi
  jmp    L411
  nopl   0x0(%rax)
L401:
  mov    (%rdi),%esi
  add    $0x4,%rdi
  test   %esi,%esi
  je     L337
L411:
  cmp    %esi,%eax
  jne    L401
  mov    %r8,%rax
  pop    %rbx
  ret
  nop
L242:
  movslq %edi,%r8
  mov    %edi,%ecx
  mov    (%r9,%r8,4),%eax
  lea    0x0(,%r8,4),%rdi
  test   %eax,%eax
  je     L484
  cmp    $0x27,%eax
  jne    L295
L421:
  add    $0x1,%ecx
  xor    %esi,%esi
  movslq %ecx,%r8
  mov    (%r9,%r8,4),%eax
  test   %eax,%eax
  jne    L198
  jmp    L484
  nopl   0x0(%rax,%rax,1)
L457:
  movslq %edi,%r8
  mov    %edi,%ecx
  mov    (%r9,%r8,4),%eax
  test   %eax,%eax
  jne    L407
  jmp    L484
  cs nopw 0x0(%rax,%rax,1)
L412:
  mov    %r8d,%ecx
  movslq %r8d,%r8
  mov    (%r9,%r8,4),%eax
  lea    0x0(,%r8,4),%rsi
  test   %eax,%eax
  je     L484
  cmp    $0x22,%eax
  je     L293
  mov    0x4(%r9,%rsi,1),%eax
  add    $0x1,%ecx
  movslq %ecx,%r8
  test   %eax,%eax
  je     L484
  mov    $0x5,%esi
  cmp    $0x22,%eax
  jne    L337
  jmp    L72
  nopl   (%rax)
L293:
  add    $0x1,%ecx
  mov    $0x1,%esi
  movslq %ecx,%r8
  mov    (%r9,%r8,4),%eax
  test   %eax,%eax
  jne    L198
  jmp    L484
  nopl   0x0(%rax)
L295:
  mov    0x4(%r9,%rdi,1),%eax
  lea    0x1(%rsi),%ecx
  movslq %ecx,%r8
  test   %eax,%eax
  je     L484
  mov    $0x2,%esi
  jmp    L204
L352:
  xor    %eax,%eax
  ret
L176:
  lea    0x1(%rdi),%rcx
  mov    %rdi,%r8
  mov    -0x4(%r9,%rcx,4),%eax
  test   %eax,%eax
  je     L484
  mov    %rcx,%rdi
  jmp    L497
```

assistant: ```c
size_t mywcscspn(const wchar_t *wcs, const wchar_t *reject, int flags) {
  enum {
    PLAIN,
    NAME_BLOCK,
    SINGLE_QUOTE,
    SINGLE_QUOTE_NAME,
    DOUBLE_QUOTE,
    DOUBLE_QUOTE_NAME,
  } state = PLAIN;
  int len = 0;
  int i;
  while (1) {
    if (!wcs[len])
      return len;
    switch (state) {
    case PLAIN:
      if ((flags & 0x02) && (wcs[len] == L'[')) {
        state = NAME_BLOCK;
        break;
      }
      if ((flags & 0x01) && (wcs[len] == L'\'')) {
        state = SINGLE_QUOTE;
        break;
      }
      if ((flags & 0x01) && (wcs[len] == L'\"')) {
        state = DOUBLE_QUOTE;
        break;
      }
      for (i = 0; reject[i]; i++)
        if (wcs[len] == reject[i])
          return len;
      break;
    case NAME_BLOCK:
      if ((flags & 0x01) && (wcs[len] == L'\'')) {
        state = SINGLE_QUOTE_NAME;
        break;
      }
      if ((flags & 0x01) && (wcs[len] == L'\"')) {
        state = DOUBLE_QUOTE_NAME;
        break;
      }
      if (wcs[len] == L']')
        state = PLAIN;
      break;
    case SINGLE_QUOTE:
    case SINGLE_QUOTE_NAME:
      if (wcs[len] == L'\'')
        state = state == SINGLE_QUOTE ? PLAIN : NAME_BLOCK;
      break;
    case DOUBLE_QUOTE:
    case DOUBLE_QUOTE_NAME:
      if (wcs[len] == L'\"')
        state = state == DOUBLE_QUOTE ? PLAIN : NAME_BLOCK;
      break;
    }
    len++;
  }
}
```