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

```asm
<str_to_num>:
  endbr64
  movzbl (%rdi),%eax
  cmp    $0x2d,%al
  je     L54
  movsd  D16(%rip),%xmm1
  cmp    $0x2b,%al
  je     L144
L77:
  lea    -0x30(%rax),%ecx
  xor    %edx,%edx
  cmp    $0x9,%cl
  ja     L16
  nopl   (%rax)
L155:
  sub    $0x30,%eax
  lea    (%rdx,%rdx,4),%rdx
  add    $0x1,%rdi
  movsbq %al,%rax
  lea    (%rax,%rdx,2),%rdx
  movzbl (%rdi),%eax
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  jbe    L155
L16:
  cmp    $0x2e,%al
  je     L109
  pxor   %xmm0,%xmm0
  test   %al,%al
  jne    L197
  test   %rdx,%rdx
  js     L50
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
L111:
  mulsd  %xmm1,%xmm0
L197:
  ret
  nopl   0x0(%rax)
L144:
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  jmp    L77
  nopw   0x0(%rax,%rax,1)
L109:
  movzbl 0x1(%rdi),%ecx
  lea    0x1(%rdi),%r8
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  ja     L130
  mov    $0xa,%edi
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L227:
  sub    $0x30,%ecx
  lea    (%rax,%rax,4),%rax
  lea    (%rdi,%rdi,4),%rsi
  add    $0x1,%r8
  movsbq %cl,%rcx
  add    %rsi,%rsi
  lea    (%rcx,%rax,2),%rax
  movzbl (%r8),%ecx
  mov    %rsi,%rdi
  lea    -0x30(%rcx),%r9d
  cmp    $0x9,%r9b
  jbe    L227
  pxor   %xmm0,%xmm0
  test   %cl,%cl
  jne    L197
  test   %rdx,%rdx
  js     L131
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
L5:
  test   %rsi,%rsi
  je     L111
  xor    %edx,%edx
  div    %rsi
  test   %rax,%rax
  js     L12
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
L163:
  addsd  %xmm2,%xmm0
  jmp    L111
  cs nopw 0x0(%rax,%rax,1)
L54:
  movzbl 0x1(%rdi),%eax
  movsd  D15(%rip),%xmm1
  add    $0x1,%rdi
  jmp    L77
  nopl   (%rax)
L50:
  mov    %rdx,%rax
  and    $0x1,%edx
  pxor   %xmm0,%xmm0
  shr    %rax
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L111
L131:
  mov    %rdx,%rcx
  and    $0x1,%edx
  pxor   %xmm0,%xmm0
  shr    %rcx
  or     %rdx,%rcx
  cvtsi2sd %rcx,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L5
L12:
  mov    %rax,%rdx
  and    $0x1,%eax
  pxor   %xmm2,%xmm2
  shr    %rdx
  or     %rax,%rdx
  cvtsi2sd %rdx,%xmm2
  addsd  %xmm2,%xmm2
  jmp    L163
L130:
  pxor   %xmm0,%xmm0
  test   %cl,%cl
  jne    L197
  test   %rdx,%rdx
  js     L132
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
L213:
  pxor   %xmm2,%xmm2
  jmp    L163
L132:
  mov    %rdx,%rax
  and    $0x1,%edx
  pxor   %xmm0,%xmm0
  shr    %rax
  or     %rdx,%rax
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L213
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D16
type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D15
type: byte[8]

tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

assistant: ```c
double str_to_num(char *s) {
  double res;
  signed char sign = 1;
  unsigned long int_part = 0;
  unsigned long frc_part = 0;
  unsigned long frc_exp = 0;
  if (*s == '-') {
    sign = -1;
    s++;
  } else if (*s == '+')
    s++;
  for (; *s >= '0' && *s <= '9'; s++)
    int_part = int_part * 10 + (*s - '0');
  if (*s == '.') {
    s++;
    frc_exp = 10;
    for (; *s >= '0' && *s <= '9'; s++) {
      frc_exp *= 10;
      frc_part = frc_part * 10 + (*s - '0');
    }
  }
  if (*s != '\0')
    return 0;
  res = int_part;
  if (frc_exp > 0)
    res += frc_part / frc_exp;
  res *= sign;
  return res;
}
```