user: What would the C source look like for the assembly code provided here?

```asm
<scan_double>:
  endbr64
  test   %rdi,%rdi
  je     L138
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    (%rdi),%rax
  test   %rsi,%rsi
  je     L198
  test   %rax,%rax
  je     L198
  movsbl (%rax),%edi
  test   %edx,%edx
  mov    %edx,%ebp
  mov    $0x270f,%edx
  cmovs  %edx,%ebp
  xor    %r13d,%r13d
  cmp    $0x2d,%dil
  jne    L190
  lea    0x1(%rax),%rdx
  mov    $0x1,%r13d
  mov    %rdx,(%r14)
  movsbl 0x1(%rax),%edi
L190:
  test   %dil,%dil
  je     L198
  movq   $0x0,(%rsp)
  xor    %ebx,%ebx
  jmp    L35
  nopl   0x0(%rax)
L63:
  cmp    %ebx,%ebp
  jle    L23
  lea    0x1(%rax),%rdx
  add    $0x1,%ebx
  mov    %rdx,(%r14)
  movsbl (%rax),%edi
  call   <digit_to_num@plt>
  movsd  D42(%rip),%xmm0
  pxor   %xmm1,%xmm1
  mulsd  (%rsp),%xmm0
  cvtsi2sd %eax,%xmm1
  mov    (%r14),%rax
  movsbl (%rax),%edi
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsp)
  test   %dil,%dil
  je     L65
L35:
  call   <TOR_ISDIGIT@plt>
  test   %rax,%rax
  mov    (%r14),%rax
  jne    L63
L23:
  cmpb   $0x2e,(%rax)
  jne    L101
  lea    0x1(%rax),%rdx
  movsd  D17(%rip),%xmm6
  xor    %r15d,%r15d
  add    $0x1,%ebx
  mov    %rdx,(%r14)
  movsbl 0x1(%rax),%edi
  movq   %r15,%xmm0
  movsd  %xmm6,0x8(%rsp)
  test   %dil,%dil
  jne    L182
  jmp    L67
  nopl   0x0(%rax)
L109:
  cmp    %ebx,%ebp
  jle    L110
  mov    (%r14),%rax
  add    $0x1,%ebx
  lea    0x1(%rax),%rdx
  mov    %rdx,(%r14)
  movsbl (%rax),%edi
  call   <digit_to_num@plt>
  movq   %r15,%xmm0
  pxor   %xmm1,%xmm1
  movsd  0x8(%rsp),%xmm3
  mulsd  D42(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  mov    (%r14),%rax
  mulsd  D42(%rip),%xmm3
  movsbl (%rax),%edi
  addsd  %xmm0,%xmm1
  movsd  %xmm3,0x8(%rsp)
  movq   %xmm1,%r15
  test   %dil,%dil
  je     L157
L182:
  call   <TOR_ISDIGIT@plt>
  test   %rax,%rax
  jne    L109
L110:
  movq   %r15,%xmm0
  divsd  0x8(%rsp),%xmm0
L67:
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
L65:
  test   %r13d,%r13d
  jne    L188
L48:
  movsd  (%rsp),%xmm4
  xor    %eax,%eax
  movsd  %xmm4,(%r12)
L191:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L188:
  movsd  (%rsp),%xmm5
  xorpd  D4(%rip),%xmm5
  movsd  %xmm5,(%rsp)
  jmp    L48
  nopl   0x0(%rax)
L101:
  test   %ebx,%ebx
  jne    L65
L198:
  mov    $0xffffffff,%eax
  jmp    L191
  nopl   0x0(%rax,%rax,1)
L157:
  movapd %xmm1,%xmm0
  divsd  %xmm3,%xmm0
  jmp    L67
L138:
  or     $0xffffffff,%eax
  ret
```

tool_calls: name: read_data
arguments: data_tag: D42
type: f32[2]
name: read_data
arguments: data_tag: D17
type: f64
name: read_data
arguments: data_tag: D4
type: f32[4]

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

tool: D17: 1

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

assistant: ```c
int scan_double(const char **bufp, double *out, int width) {
  int neg = 0;
  double result = 0;
  int scanned_so_far = 0;
  if (!bufp || !*bufp || !out)
    return -1;
  if (width < 0)
    width = 9999;
  if (**bufp == '-') {
    neg = 1;
    ++*bufp;
  }
  while (**bufp && TOR_ISDIGIT(**bufp) && scanned_so_far < width) {
    const int digit = digit_to_num(*(*bufp)++);
    result = result * 10 + digit;
    ++scanned_so_far;
  }
  if (**bufp == '.') {
    double fracval = 0, denominator = 1;
    ++*bufp;
    ++scanned_so_far;
    while (**bufp && TOR_ISDIGIT(**bufp) && scanned_so_far < width) {
      const int digit = digit_to_num(*(*bufp)++);
      fracval = fracval * 10 + digit;
      denominator *= 10;
      ++scanned_so_far;
    }
    result += fracval / denominator;
  }
  if (!scanned_so_far)
    return -1;
  *out = neg ? -result : result;
  return 0;
}
```