user: Converte this assembly snippet into its equivalent C code:

```asm
<tokenize>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x1f,%edi
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strlen@plt>
  mov    %r12,%rdi
  xor    %esi,%esi
  xor    %r12d,%r12d
  mov    %eax,%edx
  call   <memset@plt>
  mov    %rbp,%rdi
  mov    %rax,%r15
  call   <strlen@plt>
  cmp    %ebx,%eax
  jle    L139
  nopl   0x0(%rax,%rax,1)
L95:
  movslq %ebx,%r13
  lea    0x0(%rbp,%r13,1),%r14
  movsbl (%r14),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L74
  cmpb   $0x2d,(%r14)
  jne    L53
  movsbl -0x1(%rbp,%r13,1),%edi
  cmp    $0x20,%dil
  je     L74
  mov    %edi,%eax
  and    $0xfffffff7,%eax
  cmp    $0x21,%al
  jne    L79
L53:
  mov    $0x2,%edx
  lea    D37(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L138
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D37(%rip),%rdx
  add    $0x1,%ebx
  movslq %ebx,%r8
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  lea    0x0(%rbp,%r8,1),%r14
L166:
  movzbl (%r14),%eax
  cmp    $0x2f,%al
  jg     L118
  cmp    $0x20,%al
  jle    L196
  sub    $0x21,%eax
  cmp    $0xe,%al
  ja     L196
  lea    D104(%rip),%rcx
  movzbl %al,%eax
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L118:
  cmp    $0x65,%al
  jne    L196
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D84(%rip),%rdx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  nopl   0x0(%rax,%rax,1)
L196:
  add    $0x1,%ebx
L204:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %ebx,%eax
  jg     L95
L139:
  mov    %r15,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D38(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nopl   0x0(%rax)
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D58(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nopl   0x0(%rax)
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D124(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nop
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D18(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nop
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D29(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nop
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D55(%rip),%rdx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  jmp    L204
  nop
  mov    0x8(%rsp),%rsi
  movslq %r12d,%rax
  lea    D36(%rip),%rcx
  add    $0x1,%ebx
  add    $0x1,%r12d
  mov    %rcx,(%rsi,%rax,8)
  jmp    L204
  nop
L79:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L53
  xchg   %ax,%ax
L74:
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <readDouble@plt>
  mov    $0x1f,%edi
  mov    %eax,%r13d
  call   <malloc@plt>
  mov    0x8(%rsp),%rdx
  mov    %r15,%rsi
  mov    %rax,%rdi
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %rdi,(%rdx,%rax,8)
  call   <strcpy@plt>
  test   %r13d,%r13d
  mov    $0x1,%eax
  cmovg  %r13d,%eax
  lea    -0x1(%rbx,%rax,1),%ebx
  movslq %ebx,%r8
  lea    0x0(%rbp,%r8,1),%r14
  jmp    L166
L138:
  mov    $0x4,%edx
  lea    D17(%rip),%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L166
  mov    0x8(%rsp),%rsi
  add    $0x3,%ebx
  movslq %r12d,%rax
  lea    D17(%rip),%rdx
  movslq %ebx,%r8
  add    $0x1,%r12d
  mov    %rdx,(%rsi,%rax,8)
  lea    0x0(%rbp,%r8,1),%r14
  jmp    L166
```

tool_calls: name: disassemble_data
arguments: tag: D37
datatype: string
name: disassemble_data
arguments: tag: D84
datatype: string
name: disassemble_data
arguments: tag: D38
datatype: string
name: disassemble_data
arguments: tag: D58
datatype: string
name: disassemble_data
arguments: tag: D124
datatype: string
name: disassemble_data
arguments: tag: D18
datatype: string
name: disassemble_data
arguments: tag: D29
datatype: string
name: disassemble_data
arguments: tag: D55
datatype: string
name: disassemble_data
arguments: tag: D36
datatype: string
name: disassemble_data
arguments: tag: D17
datatype: string

tool: D37: pi

tool: D84: e

tool: D38: /

tool: D58: -

tool: D124: +

tool: D18: *

tool: D29: )

tool: D55: (

tool: D36: !

tool: D17: sqrt

assistant: ```c
int tokenize(char *string, char **tokens) {
  char *currentToken = (char *)malloc(30 + 1);
  currentToken = memset(currentToken, '\0', strlen(string));
  int j = 0;
  for (int i = 0; i < strlen(string); i++) {
    if (isdigit(string[i]) || (string[i] == '-' && (string[i - 1] == ' ' || (string[i - 1] != ')' && string[i - 1] != '!' && !isdigit(string[i - 1]))))) {
      int howMany = readDouble(currentToken, string + i);
      tokens[j] = (char *)malloc(30 + 1);
      strcpy(tokens[j], currentToken);
      j++;
      i += (howMany > 1) ? howMany - 1 : 0;
    } else if (strncmp(string + i, "pi", 2) == 0) {
      tokens[j] = "pi";
      j++;
      i++;
    } else if (strncmp(string + i, "sqrt", 4) == 0) {
      tokens[j] = "sqrt";
      j++;
      i += 3;
    }
    switch (string[i]) {
    case 'e':
      tokens[j] = "e";
      j++;
      break;
    case '+':
      tokens[j] = "+";
      j++;
      break;
    case '-':
      tokens[j] = "-";
      j++;
      break;
    case '*':
      tokens[j] = "*";
      j++;
      break;
    case '/':
      tokens[j] = "/";
      j++;
      break;
    case '(':
      tokens[j] = "(";
      j++;
      break;
    case ')':
      tokens[j] = ")";
      j++;
      break;
    case '!':
      tokens[j] = "!";
      j++;
      break;
    }
  }
  free(currentToken);
  return j;
}
```