user: 请将以下的汇编代码转换成C语言代码:

```asm
<tokenizeCommand>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  jle    L50
L319:
  movzbl (%r12),%eax
  lea    0x1(%r12),%rsi
  xor    %r8d,%r8d
  test   %al,%al
  je     L198
  xor    %edx,%edx
  mov    $0x9,%ecx
  jmp    L224
  nopl   0x0(%rax,%rax,1)
L294:
  cmp    $0x6e,%al
  je     L257
  cmp    $0x74,%al
  cmove  %ecx,%eax
L128:
  mov    %al,(%rbx)
  and    $0xfffffffe,%edx
  add    $0x1,%rbx
  xor    %edi,%edi
L101:
  movzbl (%rsi),%eax
  add    $0x1,%rsi
  test   %al,%al
  je     L185
L224:
  mov    %edx,%edi
  and    $0x1,%edi
  jne    L294
  test   $0x2,%dl
  je     L284
  cmp    $0x22,%al
  je     L9
  cmp    $0x5c,%al
  je     L7
  add    $0x1,%rsi
  mov    %al,(%rbx)
  add    $0x1,%rbx
  movzbl -0x1(%rsi),%eax
  test   %al,%al
  jne    L224
  nopl   0x0(%rax)
L185:
  test   %edi,%edi
  jne    L39
  test   $0x2,%dl
  jne    L186
  and    $0x4,%edx
  je     L198
  movb   $0x0,(%rbx)
L198:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L284:
  mov    %edx,%edi
  and    $0x4,%edi
  cmp    $0xa,%al
  jg     L305
  cmp    $0x8,%al
  jg     L244
  test   %edi,%edi
  je     L100
L269:
  mov    %al,(%rbx)
  xor    %edi,%edi
  add    $0x1,%rbx
  jmp    L101
  xchg   %ax,%ax
L305:
  cmp    $0x20,%al
  je     L244
  test   %edi,%edi
  jne    L277
  nopl   0x0(%rax)
L100:
  cmp    %r8d,%ebp
  je     L41
  movslq %r8d,%rdi
  or     $0x4,%edx
  add    $0x1,%r8d
  mov    %rbx,0x0(%r13,%rdi,8)
  mov    %edx,%r9d
L174:
  mov    %r9d,%edx
  mov    %r9d,%edi
  or     $0x2,%edx
  and    $0x1,%edi
  cmp    $0x22,%al
  je     L101
  mov    %r9d,%edx
  cmp    $0x5c,%al
  jne    L269
L7:
  or     $0x1,%edx
  mov    $0x1,%edi
  jmp    L101
  nopl   0x0(%rax,%rax,1)
L257:
  mov    $0xa,%eax
  jmp    L128
  nopw   0x0(%rax,%rax,1)
L244:
  test   %edi,%edi
  je     L101
  movb   $0x0,(%rbx)
  and    $0xfffffffb,%edx
  xor    %edi,%edi
  add    $0x1,%rbx
  jmp    L101
  nopl   0x0(%rax)
L9:
  and    $0xfffffffd,%edx
  jmp    L101
L50:
  mov    $0x20,%esi
  lea    D29(%rip),%rdi
  call   <__assert@plt>
  jmp    L319
L41:
  mov    $0xffffffff,%r8d
  jmp    L198
L186:
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%r8d
  jmp    L198
L39:
  lea    D26(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%r8d
  jmp    L198
L277:
  mov    %edx,%r9d
  jmp    L174
```

tool_calls: name: unpack_data
arguments: tag: D29
datatype: string
name: unpack_data
arguments: tag: D4
datatype: string
name: unpack_data
arguments: tag: D26
datatype: string

tool: D29: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ElvisLouis/code/refs/heads/master/bin/nachos/test/sh.c

tool: D4: Unmatched ".


tool: D26: Unmatched \.


assistant: ```c
int tokenizeCommand(char *command, int maxTokens, char *tokens[], char *storage) {
  const int quotingCharacter = 0x00000001;
  const int quotingString = 0x00000002;
  const int startedArg = 0x00000004;
  int state = 0;
  int numTokens = 0;
  char c;
  ((maxTokens > 0) ? (void)0 : __assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ElvisLouis/code/refs/heads/master/bin/nachos/test/sh.c", 32));
  while ((c = *(command++)) != '\0') {
    if (state & quotingCharacter) {
      switch (c) {
      case 't':
        c = '\t';
        break;
      case 'n':
        c = '\n';
        break;
      }
      *(storage++) = c;
      state &= ~quotingCharacter;
    } else if (state & quotingString) {
      switch (c) {
      case '\\':
        state |= quotingCharacter;
        break;
      case '"':
        state &= ~quotingString;
        break;
      default:
        *(storage++) = c;
        break;
      }
    } else {
      switch (c) {
      case ' ':
      case '\t':
      case '\n':
        if (state & startedArg) {
          *(storage++) = '\0';
          state &= ~startedArg;
        }
        break;
      default:
        if (!(state & startedArg)) {
          if (numTokens == maxTokens) {
            return -1;
          }
          tokens[numTokens++] = storage;
          state |= startedArg;
        }
        switch (c) {
        case '\\':
          state |= quotingCharacter;
          break;
        case '"':
          state |= quotingString;
          break;
        default:
          *(storage++) = c;
          break;
        }
      }
    }
  }
  if (state & quotingCharacter) {
    printf("Unmatched \\.\n");
    return -1;
  }
  if (state & quotingString) {
    printf("Unmatched \".\n");
    return -1;
  }
  if (state & startedArg) {
    *(storage++) = '\0';
  }
  return numTokens;
}
```