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

```asm
<Q_atof>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  jmp    L269
L89:
  addq   $0x1,-0x28(%rbp)
L269:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L80
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jle    L89
L80:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L136
  movl   $0xffffffff,-0x18(%rbp)
  addq   $0x1,-0x28(%rbp)
  jmp    L101
L136:
  movl   $0x1,-0x18(%rbp)
L101:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L206
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L49
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L206
L49:
  addq   $0x2,-0x28(%rbp)
L251:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x2f,-0xc(%rbp)
  jle    L126
  cmpl   $0x39,-0xc(%rbp)
  jg     L126
  movsd  -0x8(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D77(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L74
L126:
  cmpl   $0x60,-0xc(%rbp)
  jle    L242
  cmpl   $0x66,-0xc(%rbp)
  jg     L242
  movsd  -0x8(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D60(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D49(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L74
L242:
  cmpl   $0x40,-0xc(%rbp)
  jle    L40
  cmpl   $0x46,-0xc(%rbp)
  jg     L40
  movsd  -0x8(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D75(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D49(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L74
L40:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L6
L74:
  jmp    L251
L206:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x27,%al
  jne    L132
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  imul   -0x18(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  jmp    L6
L132:
  movl   $0xffffffff,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
L154:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x2e,-0xc(%rbp)
  jne    L9
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L29
L9:
  cmpl   $0x2f,-0xc(%rbp)
  jle    L246
  cmpl   $0x39,-0xc(%rbp)
  jg     L246
  movsd  -0x8(%rbp),%xmm1
  movsd  D49(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0xc(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  D77(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0x10(%rbp)
L29:
  jmp    L154
L246:
  cmpl   $0xffffffff,-0x14(%rbp)
  jne    L230
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L6
L243:
  movsd  -0x8(%rbp),%xmm0
  movsd  D49(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  subl   $0x1,-0x10(%rbp)
L230:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L243
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
L6:
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D9
type: byte[8]
name: disassemble_data
arguments: data_label: D77
type: byte[8]
name: disassemble_data
arguments: data_label: D60
type: byte[8]
name: disassemble_data
arguments: data_label: D49
type: byte[8]
name: disassemble_data
arguments: data_label: D75
type: byte[8]

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x40]}

tool: {"D77": [0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x40]}

tool: {"D60": [0x00,0x00,0x00,0x00,0x00,0x40,0x58,0x40]}

tool: {"D49": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: {"D75": [0x00,0x00,0x00,0x00,0x00,0x40,0x50,0x40]}

assistant: ```c
float Q_atof(char *str) {
  double val;
  int sign;
  int c;
  int decimal, total;
  while ((*str) && (*str <= ' ')) {
    str++;
  }
  if (*str == '-') {
    sign = -1;
    str++;
  } else
    sign = 1;
  val = 0;
  if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) {
    str += 2;
    while (1) {
      c = *str++;
      if (c >= '0' && c <= '9')
        val = (val * 16) + c - '0';
      else if (c >= 'a' && c <= 'f')
        val = (val * 16) + c - 'a' + 10;
      else if (c >= 'A' && c <= 'F')
        val = (val * 16) + c - 'A' + 10;
      else
        return val * sign;
    }
  }
  if (str[0] == '\'') {
    return sign * str[1];
  }
  decimal = -1;
  total = 0;
  while (1) {
    c = *str++;
    if (c == '.') {
      decimal = total;
      continue;
    }
    if (c < '0' || c > '9')
      break;
    val = val * 10 + c - '0';
    total++;
  }
  if (decimal == -1)
    return val * sign;
  while (total > decimal) {
    val /= 10;
    total--;
  }
  return val * sign;
}
```