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

```asm
<mgetword>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r13d
L315:
  call   <getch@plt>
  mov    %eax,%ebx
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L315
  cmp    $0x2f,%ebx
  je     L294
  cmp    $0x22,%ebx
  sete   %r15b
  sete   %r12b
  movzbl %r12b,%r12d
  cmp    $0x23,%ebx
  sete   %r14b
  cmp    $0x5c,%ebx
  je     L250
L148:
  test   %r14b,%r14b
  jne    L295
  test   %r15b,%r15b
  jne    L295
L199:
  mov    %rbp,%r12
  mov    D6(%rip),%rax
  cmp    %ebx,(%rax)
  je     L122
  lea    0x1(%rbp),%r12
  mov    %bl,0x0(%rbp)
L122:
  movsbl %bl,%edi
  call   <isalnum@plt>
  cmp    $0x5f,%ebx
  je     L272
  test   %eax,%eax
  jne    L272
  movb   $0x0,(%r12)
  jmp    L186
L294:
  call   <getch@plt>
  mov    %eax,%r14d
  mov    $0x1,%r12d
  cmp    $0x2a,%eax
  jne    L264
L245:
  test   %r12d,%r12d
  je     L199
  cmp    $0x1,%r12d
  jne    L295
  movb   $0x2f,0x0(%rbp)
  lea    0x2(%rbp),%r12
  mov    %r14b,0x1(%rbp)
  jmp    L126
L264:
  mov    %eax,%edi
  call   <ungetch@plt>
  mov    $0x0,%r12d
  jmp    L245
L250:
  call   <getch@plt>
  mov    %eax,%ebx
  jmp    L148
L272:
  lea    -0x2(%r13),%eax
  lea    0x1(%r12,%rax,1),%rbx
  cmp    $0x1,%r13d
  jg     L105
  mov    %r12,%rbx
  jmp    L268
L225:
  add    $0x1,%r12
  cmp    %rbx,%r12
  je     L268
L105:
  call   <getch@plt>
  mov    %al,(%r12)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L225
  movzbl (%r12),%eax
  cmp    $0x5f,%al
  je     L225
  movsbl %al,%edi
  call   <ungetch@plt>
  mov    %r12,%rbx
L268:
  movb   $0x0,(%rbx)
  movsbl 0x0(%rbp),%ebx
L186:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L201:
  movb   $0x2f,0x0(%rbp)
  lea    0x2(%r12),%rbp
L134:
  movb   $0x0,0x0(%rbp)
  jmp    L186
L313:
  mov    %rbp,%r12
L126:
  call   <getch@plt>
  mov    %eax,%ebx
  lea    0x1(%r12),%rbp
  mov    %al,-0x1(%rbp)
  test   %al,%al
  je     L134
  cmp    $0x2a,%ebx
  jne    L313
  call   <getch@plt>
  mov    %eax,%ebx
  cmp    $0x2f,%eax
  je     L201
  mov    %eax,%edi
  call   <ungetch@plt>
  jmp    L313
L295:
  cmp    $0x1,%r12d
  je     L129
  lea    0x1(%rbp),%r12
  mov    %bl,0x0(%rbp)
L52:
  call   <getch@plt>
  mov    %r12,%rbp
  add    $0x1,%r12
  mov    %al,-0x1(%r12)
  cmp    $0xa,%al
  je     L327
  cmp    $0x5c,%ebx
  jne    L52
  call   <getch@plt>
  mov    %al,(%r12)
  lea    0x2(%rbp),%r12
  jmp    L52
L129:
  lea    0x1(%rbp),%r12
  mov    %bl,0x0(%rbp)
L303:
  call   <getch@plt>
  mov    %r12,%rbp
  add    $0x1,%r12
  mov    %al,-0x1(%r12)
  cmp    $0x22,%al
  je     L334
  cmpb   $0x5c,(%r12)
  jne    L303
  call   <getch@plt>
  mov    %al,(%r12)
  lea    0x2(%rbp),%r12
  jmp    L303
L334:
  movb   $0x0,(%r12)
  jmp    L186
L327:
  movb   $0x0,(%r12)
  jmp    L186
```

assistant: ```c
int mgetword(char *word, int lim) {
  int c, d, getch(void), comment, string, directive;
  void ungetch(int);
  char *w = word;
  comment = string = directive = 0;
  while (isspace(c = getch()))
    ;
  if (c == '/') {
    if ((d = getch()) == '*') {
      comment = 1;
    } else {
      comment = 0;
      ungetch(d);
    }
  }
  if (c == '\"') {
    string = 1;
  }
  if (c == '#') {
    directive = 1;
  }
  if (c == '\\') {
    c = getch();
  }
  if (comment == 0 && string == 0 && directive == 0) {
    if (c != EOF)
      *w++ = c;
    if (!isalnum(c) && c != '_') {
      *w = '\0';
      return c;
    }
    for (; --lim > 0; w++) {
      *w = getch();
      if (!isalnum(*w) && *w != '_') {
        ungetch(*w);
        break;
      }
    }
    *w = '\0';
    return word[0];
  } else if (comment == 1) {
    *w++ = c;
    *w++ = d;
    while ((*w++ = c = getch())) {
      if (c == '*') {
        if ((c = getch()) == '/') {
          *w++ = c;
          comment = 0;
          break;
        } else {
          ungetch(c);
        }
      }
    }
    *w = '\0';
  } else if (string == 1) {
    *w++ = c;
    while ((*w++ = getch()) != '\"') {
      if (*w == '\\')
        *w++ = getch();
    }
    string = 0;
    *w = '\0';
  } else if (directive == 1) {
    *w++ = c;
    while ((*w++ = getch()) != '\n') {
      if (c == '\\') {
        *w++ = getch();
      }
    }
    directive = 0;
    *w = '\0';
  }
  return c;
}
```