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

```asm
<str2datatype>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x1,%rax
  jbe    L82
  lea    0x1(%rbp),%r13
  mov    %rax,%r12
  mov    %r13,%rdi
  call   <atoi@plt>
  mov    %r12,%rdx
  lea    D36(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <strncmp@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  jne    L8
L154:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L8:
  mov    $0x1,%edx
  lea    D118(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L13
  sub    $0x1,%ebx
  cmp    $0x1f,%ebx
  jbe    L1
L13:
  mov    %r12,%rdx
  lea    D73(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x40,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D51(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x80,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D132(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L156
L184:
  mov    $0x84,%eax
  jmp    L154
L1:
  add    $0x8,%rsp
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1090 <atoi@plt>
  nopw   0x0(%rax,%rax,1)
L156:
  mov    %r12,%rdx
  lea    D25(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L106
  mov    %r12,%rdx
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0xd0,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D50(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0xd8,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D126(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0xe8,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D120(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x134,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x13c,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D49(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x14c,%eax
  test   %r8,%r8
  je     L154
  mov    %r12,%rdx
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L184
  mov    %r12,%rdx
  lea    D69(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L82
  nopw   0x0(%rax,%rax,1)
L106:
  mov    $0xa4,%eax
  jmp    L154
  nopw   0x0(%rax,%rax,1)
L82:
  mov    $0xffffffff,%eax
  jmp    L154
```

tool_calls: name: extract_symbolic_data
arguments: tag: D36
data_type: string
name: extract_symbolic_data
arguments: tag: D118
data_type: string
name: extract_symbolic_data
arguments: tag: D73
data_type: string
name: extract_symbolic_data
arguments: tag: D51
data_type: string
name: extract_symbolic_data
arguments: tag: D132
data_type: string
name: extract_symbolic_data
arguments: tag: D25
data_type: string
name: extract_symbolic_data
arguments: tag: D45
data_type: string
name: extract_symbolic_data
arguments: tag: D50
data_type: string
name: extract_symbolic_data
arguments: tag: D126
data_type: string
name: extract_symbolic_data
arguments: tag: D120
data_type: string
name: extract_symbolic_data
arguments: tag: D14
data_type: string
name: extract_symbolic_data
arguments: tag: D49
data_type: string
name: extract_symbolic_data
arguments: tag: D39
data_type: string
name: extract_symbolic_data
arguments: tag: D69
data_type: string

tool: D36: P0

tool: D118: P

tool: D73: C32

tool: D51: C64

tool: D132: F32

tool: D25: F64

tool: D45: I8

tool: D50: I16

tool: D126: I32

tool: D120: U8

tool: D14: U16

tool: D49: U32

tool: D39: real

tool: D69: double

assistant: ```c
int str2datatype(const char *datatypestr) {
  int datatype = -1;
  size_t len;
  len = strlen(datatypestr);
  if (len > 1) {
    int ilen = atoi(datatypestr + 1);
    if (strncmp(datatypestr, "P0", len) == 0)
      datatype = 0;
    else if (strncmp(datatypestr, "P", 1) == 0 && ilen > 0 && ilen <= 32)
      datatype = atoi(datatypestr + 1);
    else if (strncmp(datatypestr, "C32", len) == 0)
      datatype = 64;
    else if (strncmp(datatypestr, "C64", len) == 0)
      datatype = 128;
    else if (strncmp(datatypestr, "F32", len) == 0)
      datatype = 132;
    else if (strncmp(datatypestr, "F64", len) == 0)
      datatype = 164;
    else if (strncmp(datatypestr, "I8", len) == 0)
      datatype = 208;
    else if (strncmp(datatypestr, "I16", len) == 0)
      datatype = 216;
    else if (strncmp(datatypestr, "I32", len) == 0)
      datatype = 232;
    else if (strncmp(datatypestr, "U8", len) == 0)
      datatype = 308;
    else if (strncmp(datatypestr, "U16", len) == 0)
      datatype = 316;
    else if (strncmp(datatypestr, "U32", len) == 0)
      datatype = 332;
    else if (strncmp(datatypestr, "real", len) == 0)
      datatype = 132;
    else if (strncmp(datatypestr, "double", len) == 0)
      datatype = 164;
  }
  return (datatype);
}
```