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

```asm
<qd_to_digits>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x78,%rsp
  mov    %rdx,0x10(%rsp)
  lea    0x20(%rsp),%r12
  mov    %r12,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  call   <qd_abs@plt>
  movsd  0x0(%r13),%xmm0
  ucomisd D46(%rip),%xmm0
  jp     L52
  jne    L52
  test   %ebx,%ebx
  jle    L85
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L257
  add    $0x78,%rsp
  movslq %ebx,%rdx
  mov    %rbp,%rdi
  mov    $0x30,%esi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    11c0 <memset@plt>
L235:
  movzbl 0x0(%rbp),%eax
  cmp    $0x30,%al
  jle    L54
  movslq 0x1c(%rsp),%r14
  movslq %ebx,%r13
  cmpb   $0x34,-0x1(%rbp,%r14,1)
  jle    L270
  lea    -0x1(%rbx),%eax
  addb   $0x1,-0x2(%rbp,%r14,1)
  test   %eax,%eax
  jle    L83
  cltq
  lea    -0x2(%rbp,%r13,1),%rcx
  lea    -0x2(%rbx),%edx
  add    %rbp,%rax
  sub    %rdx,%rcx
  jmp    L247
  nopl   0x0(%rax,%rax,1)
L238:
  sub    $0xa,%edx
  addb   $0x1,-0x1(%rax)
  sub    $0x1,%rax
  mov    %dl,0x1(%rax)
  cmp    %rcx,%rax
  je     L83
L247:
  movzbl (%rax),%edx
  cmp    $0x39,%dl
  jg     L238
L83:
  movzbl 0x0(%rbp),%eax
L270:
  cmp    $0x39,%al
  jle    L328
  addl   $0x1,0x18(%rsp)
  cmp    $0x1,%ebx
  jle    L39
  lea    -0x2(%rbx),%eax
  lea    -0x1(%r13),%rsi
  mov    %r13,%rdi
  sub    %rax,%rsi
  sub    %rax,%rdi
  lea    0x1(%rax),%rdx
  add    %rbp,%rsi
  add    %rbp,%rdi
  call   <memmove@plt>
L39:
  mov    $0x3031,%eax
  mov    %ax,0x0(%rbp)
L328:
  mov    0x10(%rsp),%rax
  mov    0x18(%rsp),%ebx
  movb   $0x0,0x0(%rbp,%r13,1)
  mov    %ebx,(%rax)
L85:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L257
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L52:
  call   <fabs@plt>
  mov    %eax,%edi
  call   <log10@plt>
  mov    %eax,%edi
  call   <floor@plt>
  mov    %eax,0x18(%rsp)
  mov    %rax,%r13
  cmp    $0xfffffed4,%eax
  jl     L302
  cmp    $0x12c,%eax
  jg     L274
  movsd  D57(%rip),%xmm2
  lea    0x40(%rsp),%r14
  mov    %r14,%rdi
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x8(%rsp)
  call   <qd_real@plt>
  mov    0x18(%rsp),%esi
  mov    %r14,%rdx
L24:
  mov    %r14,%rdi
  call   <qd_npwr@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <qd_div@plt>
L56:
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rdi
  call   <qd_gt_qd_d@plt>
  cmp    $0x1,%eax
  je     L317
  movsd  D41(%rip),%xmm0
  mov    %r12,%rdi
  call   <qd_lt_qd_d@plt>
  cmp    $0x1,%eax
  je     L261
L179:
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rdi
  call   <qd_geq_qd_d@plt>
  cmp    $0x1,%eax
  je     L48
  movsd  D41(%rip),%xmm0
  mov    %r12,%rdi
  call   <qd_lt_qd_d@plt>
  cmp    $0x1,%eax
  je     L48
  lea    0x1(%rbx),%ecx
  mov    %ebx,%eax
  mov    %rbp,%r14
  mov    %ecx,0x1c(%rsp)
  lea    0x1(%rbp,%rax,1),%r13
  test   %ecx,%ecx
  jle    L15
  nopl   0x0(%rax)
L242:
  pxor   %xmm0,%xmm0
  mov    %r12,%rsi
  mov    %r12,%rdi
  add    $0x1,%r14
  cvttsd2si 0x20(%rsp),%r15d
  cvtsi2sd %r15d,%xmm0
  call   <qd_sub_qd_d@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rsi
  mov    %r12,%rdi
  call   <qd_mul_d@plt>
  lea    0x30(%r15),%edx
  mov    %dl,-0x1(%r14)
  cmp    %r13,%r14
  jne    L242
L15:
  test   %ebx,%ebx
  jle    L235
  movslq %ebx,%r13
  lea    -0x1(%rbx),%edx
  lea    -0x1(%rbp,%r13,1),%rcx
  lea    0x0(%rbp,%r13,1),%rax
  sub    %rdx,%rcx
  jmp    L241
  nopw   0x0(%rax,%rax,1)
L313:
  add    $0xa,%edx
  subb   $0x1,-0x1(%rax)
  mov    %dl,(%rax)
L32:
  sub    $0x1,%rax
  cmp    %rax,%rcx
  je     L235
L241:
  movzbl (%rax),%edx
  cmp    $0x2f,%dl
  jle    L313
  cmp    $0x39,%dl
  jle    L32
  sub    $0xa,%edx
  addb   $0x1,-0x1(%rax)
  mov    %dl,(%rax)
  jmp    L32
  cs nopw 0x0(%rax,%rax,1)
L274:
  mov    $0xffffffcb,%esi
  mov    %r12,%rdi
  lea    0x40(%rsp),%r14
  call   <qd_ldexp@plt>
  movsd  D57(%rip),%xmm1
  mov    %r14,%rdi
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <qd_real@plt>
  mov    0x18(%rsp),%esi
  mov    %r14,%rdx
  mov    %r14,%rdi
  call   <qd_npwr@plt>
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    %r12,%rdx
  call   <qd_div@plt>
  mov    $0x35,%esi
  mov    %r12,%rdi
  call   <qd_ldexp@plt>
  jmp    L56
  nopl   0x0(%rax,%rax,1)
L48:
  lea    D45(%rip),%rdi
  call   <printf@plt>
  jmp    L85
  nopl   0x0(%rax)
L317:
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rsi
  mov    %r12,%rdi
  call   <qd_div_qd_d@plt>
  lea    0x1(%r13),%eax
  mov    %eax,0x18(%rsp)
  jmp    L179
  cs nopw 0x0(%rax,%rax,1)
L302:
  movsd  D57(%rip),%xmm3
  lea    0x40(%rsp),%r14
  mov    %r14,%rdi
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <qd_real@plt>
  mov    %r14,%rdx
  mov    $0x12c,%esi
  mov    %r14,%rdi
  call   <qd_npwr@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <qd_mul@plt>
  movsd  0x8(%rsp),%xmm0
  mov    %r14,%rdi
  call   <qd_real@plt>
  lea    0x12c(%r13),%esi
  mov    %r14,%rdx
  jmp    L24
  nopw   0x0(%rax,%rax,1)
L261:
  movsd  0x8(%rsp),%xmm0
  mov    %r12,%rsi
  mov    %r12,%rdi
  call   <qd_mul_d@plt>
  lea    -0x1(%r13),%eax
  mov    %eax,0x18(%rsp)
  jmp    L179
  xchg   %ax,%ax
L54:
  lea    D61(%rip),%rdi
  call   <printf@plt>
  jmp    L85
L257:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D46
type_guessed: f64
name: disassemble_data
arguments: tag: D57
type_guessed: f64
name: disassemble_data
arguments: tag: D41
type_guessed: f64
name: disassemble_data
arguments: tag: D45
type_guessed: string
name: disassemble_data
arguments: tag: D61
type_guessed: string

tool: D46: 0

tool: D57: 10

tool: D41: 1

tool: D45: qd_to_digits: cannot compute exponent

tool: D61: 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;
}
```