user: 请从给定的汇编指令推导出C源代码：

```asm
<qd_to_digits>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %rdx,(%rsp)
  mov    %ecx,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rsi
  call   <qd_abs@plt>
  movsd  (%rbx),%xmm0
  ucomisd D33(%rip),%xmm0
  jp     L330
  jne    L330
  test   %r14d,%r14d
  jle    L198
  mov    %r13,%rax
  lea    -0x1(%r14),%edx
  lea    0x1(%r13,%rdx,1),%rdx
L90:
  movb   $0x30,(%rax)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L90
L198:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L243
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L330:
  call   <fabs@plt>
  mov    %eax,%edi
  call   <log10@plt>
  mov    %eax,%edi
  call   <floor@plt>
  mov    %rax,%rbx
  mov    %eax,0x8(%rsp)
  cmp    $0xfffffed4,%eax
  jl     L310
  cmp    $0x12c,%eax
  jle    L146
  lea    0x10(%rsp),%rbp
  mov    $0xffffffcb,%esi
  mov    %rbp,%rdi
  call   <qd_ldexp@plt>
  lea    0x30(%rsp),%r12
  mov    %r12,%rdi
  movsd  D54(%rip),%xmm0
  call   <qd_real@plt>
  mov    %r12,%rdx
  mov    0x8(%rsp),%esi
  mov    %r12,%rdi
  call   <qd_npwr@plt>
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <qd_div@plt>
  mov    $0x35,%esi
  mov    %rbp,%rdi
  call   <qd_ldexp@plt>
L32:
  lea    0x10(%rsp),%rdi
  movsd  D54(%rip),%xmm0
  call   <qd_gt_qd_d@plt>
  cmp    $0x1,%eax
  je     L65
  lea    0x10(%rsp),%rdi
  movsd  D69(%rip),%xmm0
  call   <qd_lt_qd_d@plt>
  cmp    $0x1,%eax
  je     L248
L58:
  lea    0x10(%rsp),%rdi
  movsd  D54(%rip),%xmm0
  call   <qd_geq_qd_d@plt>
  cmp    $0x1,%eax
  je     L46
  lea    0x10(%rsp),%rdi
  movsd  D69(%rip),%xmm0
  call   <qd_lt_qd_d@plt>
  cmp    $0x1,%eax
  je     L46
  lea    0x1(%r14),%eax
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  jle    L35
  mov    %r13,%r12
  mov    %r14d,%eax
  lea    0x1(%r13,%rax,1),%r15
L187:
  cvttsd2si 0x10(%rsp),%ebx
  lea    0x10(%rsp),%rbp
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mov    %rbp,%rsi
  mov    %rbp,%rdi
  call   <qd_sub_qd_d@plt>
  mov    %rbp,%rsi
  mov    D54(%rip),%rax
  movq   %rax,%xmm0
  mov    %rbp,%rdi
  call   <qd_mul_d@plt>
  add    $0x30,%ebx
  mov    %bl,(%r12)
  add    $0x1,%r12
  cmp    %r15,%r12
  jne    L187
L35:
  test   %r14d,%r14d
  jle    L122
  movslq %r14d,%rdx
  lea    0x0(%r13,%rdx,1),%rax
  lea    -0x1(%r13,%rdx,1),%rsi
  lea    -0x1(%r14),%edx
  sub    %rdx,%rsi
  jmp    L81
L310:
  lea    0x30(%rsp),%rbp
  mov    %rbp,%rdi
  mov    D54(%rip),%rax
  movq   %rax,%xmm0
  call   <qd_real@plt>
  mov    %rbp,%rdx
  mov    $0x12c,%esi
  mov    %rbp,%rdi
  call   <qd_npwr@plt>
  lea    0x10(%rsp),%r12
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <qd_mul@plt>
  mov    %rbp,%rdi
  mov    D54(%rip),%rax
  movq   %rax,%xmm0
  call   <qd_real@plt>
  lea    0x12c(%rbx),%esi
  mov    %rbp,%rdx
  mov    %rbp,%rdi
  call   <qd_npwr@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <qd_div@plt>
  jmp    L32
L146:
  lea    0x30(%rsp),%rbp
  mov    %rbp,%rdi
  movsd  D54(%rip),%xmm0
  call   <qd_real@plt>
  mov    %rbp,%rdx
  mov    0x8(%rsp),%esi
  mov    %rbp,%rdi
  call   <qd_npwr@plt>
  lea    0x10(%rsp),%rdi
  mov    %rdi,%rdx
  mov    %rbp,%rsi
  call   <qd_div@plt>
  jmp    L32
L65:
  lea    0x10(%rsp),%rdi
  mov    %rdi,%rsi
  movsd  D54(%rip),%xmm0
  call   <qd_div_qd_d@plt>
  lea    0x1(%rbx),%eax
  mov    %eax,0x8(%rsp)
  jmp    L58
L248:
  lea    0x10(%rsp),%rdi
  mov    %rdi,%rsi
  movsd  D54(%rip),%xmm0
  call   <qd_mul_d@plt>
  lea    -0x1(%rbx),%eax
  mov    %eax,0x8(%rsp)
  jmp    L58
L46:
  lea    D91(%rip),%rdi
  call   <printf@plt>
  jmp    L198
L273:
  cmp    $0x39,%dl
  jle    L109
  addb   $0x1,-0x1(%rax)
  sub    $0xa,%edx
  mov    %dl,(%rax)
L109:
  sub    $0x1,%rax
  cmp    %rsi,%rax
  je     L122
L81:
  movzbl (%rax),%edx
  cmp    $0x2f,%dl
  jg     L273
  subb   $0x1,-0x1(%rax)
  add    $0xa,%edx
  mov    %dl,(%rax)
  jmp    L109
L122:
  cmpb   $0x30,0x0(%r13)
  jle    L100
  movslq 0xc(%rsp),%rax
  cmpb   $0x34,-0x1(%r13,%rax,1)
  jle    L234
  addb   $0x1,-0x2(%r13,%rax,1)
  lea    -0x1(%r14),%eax
  test   %eax,%eax
  jle    L234
  cltq
  add    %r13,%rax
  movslq %r14d,%rdx
  lea    -0x2(%r13,%rdx,1),%rcx
  lea    -0x2(%r14),%edx
  sub    %rdx,%rcx
L280:
  movzbl (%rax),%edx
  cmp    $0x39,%dl
  jle    L234
  sub    $0xa,%edx
  mov    %dl,(%rax)
  addb   $0x1,-0x1(%rax)
  sub    $0x1,%rax
  cmp    %rcx,%rax
  jne    L280
L234:
  cmpb   $0x39,0x0(%r13)
  jle    L14
  addl   $0x1,0x8(%rsp)
  cmp    $0x1,%r14d
  jle    L204
  movslq %r14d,%rdx
  lea    0x0(%r13,%rdx,1),%rax
  lea    -0x1(%r13,%rdx,1),%rcx
  lea    -0x2(%r14),%edx
  sub    %rdx,%rcx
L63:
  movzbl -0x1(%rax),%edx
  mov    %dl,(%rax)
  sub    $0x1,%rax
  cmp    %rcx,%rax
  jne    L63
L204:
  movb   $0x31,0x0(%r13)
  movb   $0x30,0x1(%r13)
L14:
  movslq %r14d,%r14
  movb   $0x0,0x0(%r13,%r14,1)
  mov    (%rsp),%rax
  mov    0x8(%rsp),%ecx
  mov    %ecx,(%rax)
  jmp    L198
L100:
  lea    D130(%rip),%rdi
  call   <printf@plt>
  jmp    L198
L243:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D33
type: f64
name: retrieve_data
arguments: label: D54
type: f64
name: retrieve_data
arguments: label: D69
type: f64
name: retrieve_data
arguments: label: D91
type: string
name: retrieve_data
arguments: label: D130
type: string

tool: D33: 0

tool: D54: 10

tool: D69: 1

tool: D91: qd_to_digits: cannot compute exponent

tool: D130: qd_to_digits: nonpositive leading digit

assistant: ```c
void qd_to_digits(const double *a, char *s, int *expn, int precision) {
  int D = precision + 1;
  double acc[4];
  double tmp[4];
  int i, d, e;
  qd_abs(a, acc);
  if (a[0] == 0.0) {
    expn = 0;
    for (i = 0; i < precision; i++)
      s[i] = '0';
    return;
  }
  e = (int)(floor(log10(fabs(a[0]))));
  if (e < -300) {
    qd_real(10.0, tmp);
    qd_npwr(tmp, 300, tmp);
    qd_mul(acc, tmp, acc);
    qd_real(10.0, tmp);
    qd_npwr(tmp, e + 300, tmp);
    qd_div(acc, tmp, acc);
  } else if (e > 300) {
    qd_ldexp(acc, -53);
    qd_real(10.0, tmp);
    qd_npwr(tmp, e, tmp);
    qd_div(acc, tmp, acc);
    qd_ldexp(acc, 53);
  } else {
    qd_real(10.0, tmp);
    qd_npwr(tmp, e, tmp);
    qd_div(acc, tmp, acc);
  }
  if (qd_gt_qd_d(acc, 10.0) == 1) {
    qd_div_qd_d(acc, 10.0, acc);
    e++;
  } else if (qd_lt_qd_d(acc, 1.0) == 1) {
    qd_mul_d(acc, 10.0, acc);
    e--;
  }
  if ((qd_geq_qd_d(acc, 10.0) == 1) || (qd_lt_qd_d(acc, 1.0) == 1)) {
    printf("qd_to_digits: cannot compute exponent");
    return;
  }
  for (i = 0; i < D; i++) {
    d = ((int)acc[0]);
    qd_sub_qd_d(acc, (double)d, acc);
    qd_mul_d(acc, 10.0, acc);
    s[i] = ((char)(d + '0'));
  }
  for (i = D - 1; i > 0; i--) {
    if (s[i] < '0') {
      s[i - 1]--;
      s[i] += 10;
    } else if (s[i] > '9') {
      s[i - 1]++;
      s[i] -= 10;
    }
  }
  if (s[0] <= '0') {
    printf("qd_to_digits: nonpositive leading digit");
    return;
  }
  if (s[D - 1] >= '5') {
    s[D - 2]++;
    i = D - 2;
    while (i > 0 && s[i] > '9') {
      s[i] -= 10;
      s[--i]++;
    }
  }
  if (s[0] > '9') {
    e++;
    for (i = precision; i >= 2; i--)
      s[i] = s[i - 1];
    s[0] = '1';
    s[1] = '0';
  }
  s[precision] = 0;
  *expn = e;
}
```