user: What is the c source code of the assembly code below?

```asm
<CheckTokenType>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <CheckOpcode@plt>
  test   %rax,%rax
  je     L0
  mov    $0x1,%eax
  jmp    L426
L0:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <CheckDotCommand@plt>
  test   %rax,%rax
  je     L158
  mov    $0x2,%eax
  jmp    L426
L158:
  mov    -0x18(%rbp),%rax
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L91
  mov    -0x18(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L450
L91:
  mov    $0x2,%eax
  jmp    L426
L450:
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L279
  movl   $0x10,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  jne    L268
  orl    $0x8,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
  jmp    L294
L268:
  orl    $0x4,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L294
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L379
  mov    $0x0,%eax
  jmp    L426
L379:
  addl   $0x2,-0xc(%rbp)
  orl    $0x40,-0x4(%rbp)
  jmp    L294
L279:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x26,%al
  jne    L385
  movl   $0x8,-0x4(%rbp)
  addl   $0x1,-0xc(%rbp)
  jmp    L294
L385:
  movl   $0x4,-0x4(%rbp)
L294:
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  movsbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,-0xd(%rbp)
  cmpl   $0x3,-0x8(%rbp)
  jg     L294
  cmpl   $0x2,-0x8(%rbp)
  jge    L330
  cmpl   $0x0,-0x8(%rbp)
  je     L289
  cmpl   $0x1,-0x8(%rbp)
  je     L389
  jmp    L469
L289:
  cmpb   $0x42,-0xd(%rbp)
  je     L96
  cmpb   $0x43,-0xd(%rbp)
  je     L96
  cmpb   $0x52,-0xd(%rbp)
  je     L96
  cmpb   $0x54,-0xd(%rbp)
  je     L96
  cmpb   $0x57,-0xd(%rbp)
  jne    L367
L96:
  movl   $0x1,-0x8(%rbp)
  jmp    L469
L367:
  mov    $0x0,%eax
  jmp    L426
L389:
  movsbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L398
  movl   $0x2,-0x8(%rbp)
  jmp    L469
L398:
  mov    $0x0,%eax
  jmp    L426
L330:
  movsbl -0xd(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L286
  addl   $0x1,-0x8(%rbp)
  cmpl   $0x3,-0x8(%rbp)
  jle    L328
  mov    $0x0,%eax
  jmp    L426
L286:
  cmpb   $0x2e,-0xd(%rbp)
  jne    L168
  movl   $0x0,-0x8(%rbp)
  jmp    L328
L168:
  cmpb   $0x0,-0xd(%rbp)
  je     L115
  cmpb   $0x20,-0xd(%rbp)
  je     L115
  cmpb   $0x9,-0xd(%rbp)
  jne    L223
L115:
  mov    -0x4(%rbp),%eax
  jmp    L426
L223:
  cmpb   $0x2b,-0xd(%rbp)
  jne    L151
  mov    -0x4(%rbp),%eax
  and    $0x48,%eax
  test   %eax,%eax
  je     L211
  mov    $0x0,%eax
  jmp    L426
L211:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0xd(%rbp)
  jne    L251
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L18
L251:
  mov    $0x0,%eax
  jmp    L426
L18:
  orl    $0x20,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L426
L151:
  mov    $0x0,%eax
  jmp    L426
L328:
  nop
L469:
  jmp    L294
L426:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D16
datatype: string
name: retrieve_data
arguments: label: D1
datatype: string

tool: D16: SIZE

tool: D1: OFFSET

assistant: ```c
uint CheckTokenType(char *word) {
  int i, parse_state;
  uint flags;
  char c;
  if (CheckOpcode(word))
    return (0x0001);
  if (CheckDotCommand(word))
    return (0x0002);
  if (!strcmp(word, "SIZE") || !strcmp(word, "OFFSET"))
    return (0x0002);
  i = 0;
  parse_state = 0;
  if (word[i] == '*') {
    flags = 0x0010;
    i++;
    if (word[i] == '&') {
      flags |= 0x0008;
      i++;
    } else {
      flags |= 0x0004;
      if (word[i] == '-') {
        if (word[i + 1] != '-')
          return (0);
        i += 2;
        flags |= 0x0040;
      }
    }
  } else if (word[i] == '&') {
    flags = 0x0008;
    i++;
  } else
    flags = 0x0004;
  for (;;) {
    c = word[i++];
    c = toupper(c);
    switch (parse_state) {
    case 0:
      if (c == 'B' || c == 'C' || c == 'R' || c == 'T' || c == 'W')
        parse_state = 1;
      else
        return (0);
      break;
    case 1:
      if (isdigit(c))
        parse_state = 2;
      else
        return (0);
      break;
    case 2:
    case 3:
      if (isdigit(c)) {
        parse_state++;
        if (parse_state > 3)
          return (0);
      } else if (c == '.')
        parse_state = 0;
      else if (!c || c == ' ' || c == 0x9)
        return (flags);
      else if (c == '+') {
        if (flags & (0x0008 | 0x0040))
          return (0);
        if (word[i] != c || word[i + 1] != 0)
          return (0);
        flags |= 0x0020;
        return (flags);
      } else
        return (0);
      break;
    }
  }
}
```