user: Translate the below assembly code into C programming language:

```asm
<extract_double>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%r12
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rbx
  jmp    L137
L79:
  add    $0x1,%rbx
L137:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L79
  movzbl (%rbx),%eax
  lea    -0x2d(%rax),%edx
  cmp    $0x1,%dl
  jbe    L79
  cmp    $0x2b,%al
  je     L79
  test   %al,%al
  jne    L235
  movzbl (%rbx),%r14d
  movb   $0x0,(%rbx)
  lea    0x10(%rsp),%rsi
  mov    0x0(%rbp),%rdi
  call   <strtod@plt>
  movsd  %xmm0,(%r12)
  mov    0x10(%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L108
  mov    %r14b,(%rbx)
  mov    %rbx,%r13
  mov    %rbx,%r12
L122:
  test   %r13,%r13
  je     L134
  mov    %r13,0x0(%rbp)
  mov    $0x1,%eax
L194:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L48
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L235:
  movsbl %al,%edi
  call   <isspace@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L82
  movzbl (%rbx),%eax
  cmp    $0x29,%al
  je     L68
  cmp    $0x3b,%al
  je     L68
  test   %r13d,%r13d
  je     L36
  and    $0xffffffdf,%eax
  mov    $0x1,%r15d
  cmp    $0x4d,%al
  je     L68
L36:
  mov    0x8(%rsp),%rsi
  lea    D18(%rip),%rdi
  call   <bitch@plt>
  mov    $0xffffffff,%eax
  jmp    L194
L82:
  mov    $0x0,%r15d
L68:
  movzbl (%rbx),%r14d
  test   %r14b,%r14b
  mov    $0x0,%r13d
  cmove  %rbx,%r13
  movb   $0x0,(%rbx)
  lea    0x10(%rsp),%rsi
  mov    0x0(%rbp),%rdi
  call   <strtod@plt>
  movsd  %xmm0,(%r12)
  mov    0x10(%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L108
  mov    %r14b,(%rbx)
  test   %r15d,%r15d
  je     L161
  lea    0x1(%rbx),%r12
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L122
  movsbl %al,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L122
  movzbl 0x1(%rbx),%eax
  cmp    $0x29,%al
  je     L122
  cmp    $0x3b,%al
  je     L122
  mov    0x8(%rsp),%rsi
  lea    D18(%rip),%rdi
  call   <bitch@plt>
  mov    $0xffffffff,%eax
  jmp    L194
L108:
  mov    %r14b,(%rbx)
  mov    0x8(%rsp),%rsi
  lea    D18(%rip),%rdi
  call   <bitch@plt>
  mov    $0xffffffff,%eax
  jmp    L194
L161:
  mov    %rbx,%r12
  jmp    L122
L134:
  mov    %r12,%rdi
  call   <skip_white_space@plt>
  mov    %rax,0x0(%rbp)
  cmp    $0x1,%rax
  sbb    %eax,%eax
  or     $0x1,%eax
  jmp    L194
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D18
datatype: string

tool: D18: %s is not valid

assistant: ```c
int extract_double(char **input, char *what, double *val, int skip_m) {
  char *s = *input;
  char *end = NULL;
  char *stop;
  char c;
  int saw_m = 0;
  while (isdigit(*s) || *s == '+' || *s == '-' || *s == '.')
    s++;
  if (*s && !isspace(*s) && *s != ';' && *s != ')') {
    if (skip_m && (*s == 'm' || *s == 'M')) {
      saw_m = 1;
    } else {
      bitch("%s is not valid", what);
      return -1;
    }
  }
  if (!*s)
    end = s;
  c = *s;
  *s = '\0';
  *val = strtod(*input, &stop);
  if (*stop != '\0') {
    *s = c;
    bitch("%s is not valid", what);
    return -1;
  }
  *s = c;
  if (saw_m) {
    s++;
    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
      bitch("%s is not valid", what);
      return -1;
    }
  }
  if (end) {
    *input = end;
  } else {
    *input = skip_white_space(s);
    if (!*input)
      return -1;
  }
  return 1;
}
```