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

```asm
<TLAString_toDoubleIfValid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L12
  movsd  -0x20(%rbp),%xmm0
  jmp    L37
L12:
  cmpb   $0x2d,-0xd(%rbp)
  je     L168
  cmpb   $0x2b,-0xd(%rbp)
  jne    L113
L168:
  addq   $0x1,-0x18(%rbp)
  jmp    L113
L61:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L161
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L55
L161:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L55
  movsd  -0x20(%rbp),%xmm0
  jmp    L37
L55:
  movsd  -0x8(%rbp),%xmm1
  movsd  D4(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  D42(%rip),%xmm2
  subss  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addq   $0x1,-0x18(%rbp)
L113:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L166
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L61
L166:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L179
  movss  D46(%rip),%xmm0
  movss  %xmm0,-0xc(%rbp)
  addq   $0x1,-0x18(%rbp)
  jmp    L120
L46:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L184
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L106
L184:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L106
  movsd  -0x20(%rbp),%xmm0
  jmp    L37
L106:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  D42(%rip),%xmm1
  subss  %xmm1,%xmm0
  divss  -0xc(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movss  -0xc(%rbp),%xmm1
  movss  D46(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  addq   $0x1,-0x18(%rbp)
L120:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L46
L179:
  cmpb   $0x2d,-0xd(%rbp)
  jne    L14
  movsd  -0x8(%rbp),%xmm0
  movq   D47(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L14:
  movsd  -0x8(%rbp),%xmm0
L37:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D4
type_infered: f32[2]
name: unpack_data
arguments: data_label: D42
type_infered: byte[4]
name: unpack_data
arguments: data_label: D46
type_infered: byte[4]
name: unpack_data
arguments: data_label: D47
type_infered: f32[2]

tool: {"D4": [0.0,2.5625]}

tool: {"D42": [0x00,0x00,0x40,0x42]}

tool: {"D46": [0x00,0x00,0x20,0x41]}

tool: {"D47": [0.0,-0.0]}

assistant: ```c
double TLAString_toDoubleIfValid(const char *string, const double valueDefault) {
  const char sign = (*string);
  double value = 0;
  if ((*string) == '\0')
    return valueDefault;
  if (sign == '-' || sign == '+')
    string++;
  while ((*string) != '\0' && (*string) != '.') {
    if (((*string) < 48 || (*string) > 57) && (*string) != '.')
      return valueDefault;
    value = (value * 10.0f) + ((*string) - 48.0f);
    string++;
  }
  if ((*string) == '.') {
    float factorDivisor = 10.0f;
    string++;
    while ((*string) != '\0') {
      if (((*string) < 48 || (*string) > 57) && (*string) != '.')
        return valueDefault;
      value += (((*string) - 48.0f) / factorDivisor);
      factorDivisor *= 10.0f;
      string++;
    }
  }
  if (sign == '-')
    value = -value;
  return value;
}
```