user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getword>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L221:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%edi
  mov    %rax,%rbx
  mov    %eax,%r12d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L221
  mov    D6(%rip),%r15
  mov    %r13,%rbp
  cmp    %ebx,(%r15)
  je     L45
  mov    %bl,0x0(%r13)
  lea    0x1(%r13),%rbp
L45:
  mov    %r12d,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L395
  cmp    $0x22,%r12d
  je     L129
  cmp    $0x5c,%r12d
  je     L90
  cmp    $0x23,%r12d
  je     L268
  cmp    $0x5f,%r12d
  je     L268
  movb   $0x0,0x0(%rbp)
  jmp    L80
  cs nopw 0x0(%rax,%rax,1)
L14:
  cmp    %eax,(%r15)
  je     L395
L129:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0x22,%eax
  jne    L14
  nopl   0x0(%rax)
L395:
  lea    -0x2(%r14),%eax
  lea    0x1(%rbp,%rax,1),%rbx
  cmp    $0x1,%r14d
  jle    L366
L272:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,0x0(%rbp)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L225
  cmp    $0x22,%r12d
  je     L46
  cmp    $0x5c,%r12d
  je     L132
  cmp    $0x23,%r12d
  je     L225
  cmp    $0x5f,%r12d
  je     L225
  movsbl 0x0(%rbp),%edi
  call   <ungetch@plt>
L366:
  movb   $0x0,0x0(%rbp)
  movsbl 0x0(%r13),%r12d
L80:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L132:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0x5c,%eax
  je     L278
  cmp    $0x2a,%eax
  je     L51
  nopl   0x0(%rax,%rax,1)
L225:
  add    $0x1,%rbp
  cmp    %rbx,%rbp
  jne    L272
  jmp    L366
  nop
L378:
  cmp    %eax,(%r15)
  je     L57
L46:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0x22,%eax
  jne    L378
L57:
  movb   $0x0,0x0(%rbp)
  jmp    L366
L204:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0x5c,%eax
  je     L263
  movb   $0x0,0x0(%rbp)
  xchg   %ax,%ax
L51:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    %eax,(%r15)
  je     L225
  cmp    $0x2a,%eax
  je     L204
  movb   $0x0,0x0(%rbp)
  jmp    L51
  nopw   0x0(%rax,%rax,1)
L268:
  mov    %bl,0x0(%rbp)
  add    $0x1,%rbp
  jmp    L395
  nopl   0x0(%rax)
L338:
  cmp    %eax,(%r15)
  je     L57
L278:
  xor    %eax,%eax
  call   <getch@plt>
  cmp    $0xa,%eax
  jne    L338
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L90:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0x5c,%eax
  je     L149
  cmp    $0x2a,%eax
  jne    L395
L137:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    %eax,(%r15)
  je     L395
  cmp    $0x2a,%eax
  jne    L137
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0x5c,%eax
  je     L395
  jmp    L137
  nopl   (%rax)
L384:
  cmp    %eax,(%r15)
  je     L395
L149:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %eax,%r12d
  cmp    $0xa,%eax
  jne    L384
  jmp    L395
L263:
  movb   $0x0,0x0(%rbp)
  jmp    L225
```

assistant: ```c
int getword(char *word, int lim) {
  int c = 0;
  char *w = word;
  while (isspace(c = getch()))
    ;
  if (c != EOF)
    *w++ = c;
  if (!isalpha(c)) {
    if (c == '"')
      while (((c = getch()) != '"') && (c != EOF))
        ;
    else if (c == '\\') {
      if ((c = getch()) == '\\') {
        while (((c = getch()) != '\n') && (c != EOF))
          ;
      } else if (c == '*') {
        while ((c = getch()) != EOF)
          if ((c == '*') && ((c = getch()) == '\\'))
            break;
          else
            continue;
      }
    } else if ((c == '#') || (c == '_'))
      *w++ = c;
    else {
      *w = '\0';
      return c;
    }
  }
  for (; --lim > 0; w++)
    if (!isalnum(*w = getch())) {
      if (c == '"') {
        while (((c = getch()) != '"') && (c != EOF))
          ;
        *w = '\0';
        break;
      } else if (c == '\\') {
        if ((c = getch()) == '\\') {
          while (((c = getch()) != '\n') && (c != EOF))
            ;
          *w = '\0';
          break;
        } else if (c == '*') {
          while ((c = getch()) != EOF)
            if ((c == '*') && ((c = getch()) == '\\')) {
              *w = '\0';
              break;
            } else {
              *w = '\0';
              continue;
            }
        }
      } else if ((c == '#') || (c == '_')) {
        continue;
      } else {
        ungetch(*w);
        break;
      }
    }
  *w = '\0';
  return word[0];
}
```