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

```asm
<TclWordEnd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %edx,0xc(%rsp)
  mov    %rcx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rcx,%rcx
  je     L295
  movl   $0x0,(%rcx)
  jmp    L295
L250:
  add    $0x1,%rbx
L295:
  movzbl (%rbx),%ebp
  movzbl %bpl,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L250
  cmp    $0x5c,%bpl
  jne    L307
  cmpb   $0xa,0x1(%rbx)
  jne    L110
  lea    0x2(%rbx),%rax
  cmp    %rax,%r12
  jne    L250
L430:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L198
  mov    %r12,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L307:
  cmp    $0x22,%bpl
  je     L299
  cmp    $0x7b,%bpl
  jne    L110
  mov    $0x1,%r15d
  lea    0x14(%rsp),%r13
  jmp    L205
L299:
  lea    0x1(%rbx),%rdi
  mov    $0x22,%edx
  mov    %r12,%rsi
  mov    $0x0,%eax
  call   <QuoteEnd@plt>
  movslq %eax,%rbx
  cmp    %rbx,%r12
  je     L264
  add    $0x1,%rbx
  jmp    L110
L313:
  mov    %rbp,%rbx
  jmp    L176
L381:
  sub    $0x1,%r15d
L2:
  test   %r15d,%r15d
  je     L118
L205:
  lea    0x1(%rbx),%rbp
  movzbl 0x1(%rbx),%eax
  cmp    $0x5c,%al
  jne    L313
L338:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <Tcl_Backslash@plt>
  movslq 0x14(%rsp),%rax
  add    %rax,%rbp
  movzbl 0x0(%rbp),%eax
  cmp    $0x5c,%al
  je     L338
  mov    %rbp,%rbx
L176:
  cmp    $0x7d,%al
  je     L381
  cmp    $0x7b,%al
  je     L318
  cmp    %rbx,%r12
  jne    L2
  mov    %rbx,%r12
  jmp    L430
L318:
  add    $0x1,%r15d
  jmp    L2
L118:
  add    $0x1,%rbx
L110:
  lea    0x14(%rsp),%rbp
  jmp    L82
L235:
  lea    0x1(%rbx),%rdi
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    $0x0,%eax
  call   <ScriptEnd@plt>
  movslq %eax,%rbx
  cmp    %rbx,%r12
  je     L63
  add    $0x1,%rbx
  jmp    L82
L173:
  cmpb   $0xa,0x1(%rbx)
  je     L103
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Tcl_Backslash@plt>
  movslq 0x14(%rsp),%rax
  add    %rax,%rbx
  jmp    L82
L103:
  lea    -0x1(%rbx),%r12
  jmp    L430
L81:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <VarNameEnd@plt>
  movslq %eax,%rbx
  cmp    %rbx,%r12
  je     L21
  add    $0x1,%rbx
  jmp    L82
L449:
  mov    %rbx,%r12
  test   %r14,%r14
  je     L430
  movl   $0x1,(%r14)
  jmp    L430
L214:
  lea    -0x1(%rbx),%r12
  jmp    L430
L322:
  cmp    %r12,%rbx
  je     L44
  add    $0x1,%rbx
L82:
  movzbl (%rbx),%r13d
  cmp    $0x5b,%r13b
  je     L235
  cmp    $0x5c,%r13b
  je     L173
  cmp    $0x24,%r13b
  je     L81
  cmp    $0x3b,%r13b
  je     L449
  movzbl %r13b,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L214
  cmp    $0x5d,%r13b
  jne    L322
  cmpl   $0x0,0xc(%rsp)
  je     L322
  lea    -0x1(%rbx),%r12
  jmp    L430
L44:
  cmpl   $0x1,0xc(%rsp)
  sbb    $0x0,%rbx
  mov    %rbx,%r12
  jmp    L430
L264:
  mov    %rbx,%r12
  jmp    L430
L63:
  mov    %rbx,%r12
  jmp    L430
L21:
  mov    %rbx,%r12
  jmp    L430
L198:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *TclWordEnd(start, lastChar, nested, semiPtr)
char *start;
char *lastChar;
int nested;
int *semiPtr;
{
  register char *p;
  int count;
  if (semiPtr != 0) {
    *semiPtr = 0;
  }
  for (p = start;; p++) {
    if (isspace(((unsigned char)(*p)))) {
      continue;
    }
    if ((p[0] == '\\') && (p[1] == '\n')) {
      if (p + 2 == lastChar) {
        return p + 2;
      }
      continue;
    }
    break;
  }
  if (*p == '"') {
    p = QuoteEnd(p + 1, lastChar, '"');
    if (p == lastChar) {
      return p;
    }
    p++;
  } else if (*p == '{') {
    int braces = 1;
    while (braces != 0) {
      p++;
      while (*p == '\\') {
        (void)Tcl_Backslash(p, &count);
        p += count;
      }
      if (*p == '}') {
        braces--;
      } else if (*p == '{') {
        braces++;
      } else if (p == lastChar) {
        return p;
      }
    }
    p++;
  }
  while (1) {
    if (*p == '[') {
      p = ScriptEnd(p + 1, lastChar, 1);
      if (p == lastChar) {
        return p;
      }
      p++;
    } else if (*p == '\\') {
      if (p[1] == '\n') {
        return p - 1;
      }
      (void)Tcl_Backslash(p, &count);
      p += count;
    } else if (*p == '$') {
      p = VarNameEnd(p, lastChar);
      if (p == lastChar) {
        return p;
      }
      p++;
    } else if (*p == ';') {
      if (semiPtr != 0) {
        *semiPtr = 1;
      }
      return p;
    } else if (isspace(((unsigned char)(*p)))) {
      return p - 1;
    } else if ((*p == ']') && nested) {
      return p - 1;
    } else if (p == lastChar) {
      if (nested) {
        return p;
      }
      return p - 1;
    } else {
      p++;
    }
  }
}
```