user: 请将以下的汇编代码转换成C语言代码:

```asm
<dd_to_string>:
  endbr64
  push   %r15
  mov    %r9d,%r15d
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x68,%rsp
  mov    0xa8(%rsp),%eax
  mov    %r8d,0x14(%rsp)
  mov    %eax,0x20(%rsp)
  mov    0xb0(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x3c(%rsp)
  call   <dd_is_negative@plt>
  mov    %eax,0x8(%rsp)
  cmp    $0x1,%eax
  je     L229
  movl   $0x0,0x8(%rsp)
  mov    %rbx,%r14
  cmp    $0x1,%r15d
  je     L216
L255:
  mov    %r13,%rdi
  call   <dd_is_zero@plt>
  cmp    $0x1,%eax
  je     L219
L166:
  cmpl   $0x1,0x14(%rsp)
  je     L102
  lea    0x2(%r12),%edi
  mov    $0x1,%esi
  call   <calloc@plt>
  lea    0x1(%r12),%ecx
  lea    0x3c(%rsp),%rdx
  mov    %r13,%rdi
  mov    %rax,%r15
  mov    %rax,%rsi
  call   <dd_to_digits@plt>
  movzbl (%r15),%eax
  mov    %al,(%r14)
  test   %r12d,%r12d
  jle    L215
  mov    0x8(%rsp),%ecx
  movb   $0x2e,0x1(%r14)
  lea    0x2(%r14),%rax
  sub    %r15,%r14
  lea    -0x1(%r12),%edx
  lea    0x1(%r15),%rsi
  mov    %r14,%r8
  add    $0x2,%ecx
  lea    0x2(%r15,%rdx,1),%r9
  nopl   0x0(%rax,%rax,1)
L78:
  movzbl (%rsi),%edx
  mov    %dl,0x1(%r8,%rsi,1)
  add    $0x1,%rsi
  cmp    %rsi,%r9
  jne    L78
  mov    %r12d,%esi
  lea    (%rcx,%r12,1),%r13d
  lea    (%rax,%rsi,1),%rdx
L109:
  mov    %r15,%rdi
  mov    %rdx,0x8(%rsp)
  call   <free@plt>
  mov    0x8(%rsp),%rdx
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L216:
  movb   $0x2b,(%rbx)
  mov    %r13,%rdi
  lea    0x1(%rbx),%r14
  movl   $0x1,0x8(%rsp)
  call   <dd_is_zero@plt>
  cmp    $0x1,%eax
  jne    L166
L219:
  movb   $0x30,(%r14)
  test   %r12d,%r12d
  jle    L151
  movb   $0x2e,0x1(%r14)
  lea    0x2(%r14),%rcx
  movslq %r12d,%r15
  mov    $0x30,%esi
  mov    %r15,%rdx
  mov    %rcx,%rdi
  call   <memset@plt>
  lea    (%rax,%r15,1),%rdx
  mov    0x8(%rsp),%eax
  lea    0x2(%rax,%r12,1),%r13d
L62:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jne    L272
  mov    $0x65,%esi
  cmpl   $0x1,0xa0(%rsp)
  mov    $0x45,%eax
  cmovne %esi,%eax
  mov    0x3c(%rsp),%esi
  mov    %al,(%rdx)
  test   %esi,%esi
  js     L91
  movb   $0x2b,0x1(%rdx)
L271:
  cmp    $0x63,%esi
  jg     L277
  lea    0x2(%rdx),%rdi
  lea    0x2(%r13),%ecx
L27:
  movslq %esi,%rax
  mov    %esi,%edx
  lea    0x2(%rcx),%r13d
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  lea    0x30(%rax),%edx
  imul   $0xfffffff6,%eax,%eax
  mov    %dl,(%rdi)
  lea    0x2(%rdi),%rdx
  add    %esi,%eax
  mov    %eax,0x3c(%rsp)
  add    $0x30,%eax
  mov    %al,0x1(%rdi)
  cmp    %ebp,%r13d
  jge    L280
L14:
  mov    %ebp,%r8d
  lea    -0x1(%r13),%edx
  mov    %rbx,%rax
  sub    %r13d,%r8d
  lea    0x1(%rbx,%rdx,1),%rcx
  movslq %r8d,%rdx
  nopl   0x0(%rax)
L161:
  movzbl (%rax),%esi
  add    $0x1,%rax
  mov    %sil,-0x1(%rax,%rdx,1)
  cmp    %rcx,%rax
  jne    L161
  movsbl 0x20(%rsp),%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  movslq %ebp,%rax
  movb   $0x0,(%rbx,%rax,1)
  jmp    L130
  nopw   0x0(%rax,%rax,1)
L102:
  lea    0x40(%rsp),%r15
  mov    %r13,%rdi
  mov    %r15,%rsi
  call   <dd_abs@plt>
  mov    %r15,%rsi
  mov    %r15,%rdi
  call   <dd_log10@plt>
  mov    %r15,%rsi
  mov    %r15,%rdi
  call   <dd_floor@plt>
  mov    %r15,%rdi
  call   <dd_to_int@plt>
  lea    0x1(%rax),%r11d
  lea    (%r11,%r12,1),%ecx
  test   %ecx,%ecx
  jg     L190
  movb   $0x30,(%r14)
  test   %r12d,%r12d
  jle    L17
  movb   $0x2e,0x1(%r14)
  lea    0x2(%r14),%rcx
  movslq %r12d,%r14
  mov    $0x30,%esi
  mov    %r14,%rdx
  mov    %rcx,%rdi
  call   <memset@plt>
  lea    (%rax,%r14,1),%rdx
  mov    0x8(%rsp),%eax
  lea    0x2(%rax,%r12,1),%r13d
L272:
  cmp    %ebp,%r13d
  jl     L14
L280:
  movb   $0x0,(%rdx)
  lea    0x1(%r13),%ebp
L130:
  mov    0x18(%rsp),%rax
  mov    %ebp,(%rax)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L321
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L229:
  movb   $0x2d,(%rbx)
  lea    0x1(%rbx),%r14
  jmp    L255
  nopl   0x0(%rax)
L277:
  mov    %esi,%eax
  lea    0x3(%rdx),%rdi
  lea    0x3(%r13),%ecx
  imul   $0x51eb851f,%rax,%rax
  shr    $0x25,%rax
  lea    0x30(%rax),%r8d
  imul   $0xffffff9c,%eax,%eax
  mov    %r8b,0x2(%rdx)
  add    %eax,%esi
  jmp    L27
  nopw   0x0(%rax,%rax,1)
L91:
  movb   $0x2d,0x1(%rdx)
  neg    %esi
  jmp    L271
  nopl   0x0(%rax,%rax,1)
L215:
  mov    0x8(%rsp),%r13d
  lea    0x1(%r14),%rdx
  add    $0x1,%r13d
  jmp    L109
  nopw   0x0(%rax,%rax,1)
L17:
  mov    0x8(%rsp),%r13d
  lea    0x1(%r14),%rdx
  add    $0x1,%r13d
  jmp    L272
  nopw   0x0(%rax,%rax,1)
L151:
  mov    0x8(%rsp),%r13d
  lea    0x1(%r14),%rdx
  add    $0x1,%r13d
  jmp    L62
L190:
  lea    0x1(%rcx),%edi
  mov    $0x1,%esi
  mov    %r11d,0x2c(%rsp)
  mov    %ecx,0x24(%rsp)
  mov    %eax,0x28(%rsp)
  call   <calloc@plt>
  mov    0x24(%rsp),%ecx
  lea    0x3c(%rsp),%rdx
  mov    %r13,%rdi
  mov    %rax,%rsi
  mov    %rax,%r15
  call   <dd_to_digits@plt>
  mov    0x2c(%rsp),%r11d
  mov    0x28(%rsp),%r9d
  test   %r11d,%r11d
  jle    L308
  mov    %r9d,%edi
  mov    %r14,%rcx
  mov    %r15,%rdx
  lea    0x1(%rdi),%rax
  sub    %r15,%rcx
  lea    (%r15,%rax,1),%rsi
  nopw   0x0(%rax,%rax,1)
L199:
  movzbl (%rdx),%r8d
  mov    %r8b,(%rcx,%rdx,1)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L199
  lea    (%r14,%rax,1),%rdx
  mov    0x8(%rsp),%eax
  add    %r14,%rdi
  lea    0x1(%rax,%r9,1),%r13d
  lea    (%r9,%rax,1),%esi
  test   %r12d,%r12d
  jle    L109
  movslq %r9d,%r9
  lea    -0x1(%r12),%r10d
  movb   $0x2e,(%rdx)
  movslq %r11d,%rax
  lea    0x2(%r10,%r9,1),%rcx
  lea    (%r15,%r9,1),%rdx
  mov    %rdi,%r8
  add    $0x2,%esi
  add    %r15,%rax
  add    %r15,%rcx
  sub    %rdx,%r8
  nopl   0x0(%rax)
L83:
  movzbl (%rax),%edx
  mov    %dl,0x1(%r8,%rax,1)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L83
  lea    0x3(%rdi,%r10,1),%rdx
  lea    (%rsi,%r12,1),%r13d
  jmp    L109
L308:
  mov    0x8(%rsp),%r12d
  mov    $0x2e30,%edx
  mov    0x24(%rsp),%ecx
  lea    0x2(%r14),%rdi
  mov    %dx,(%r14)
  add    $0x2,%r12d
  test   %r11d,%r11d
  je     L6
  not    %r9d
  mov    $0x30,%esi
  mov    %ecx,0x8(%rsp)
  movslq %r9d,%r14
  mov    %r14,%rdx
  add    %r14d,%r12d
  call   <memset@plt>
  mov    0x8(%rsp),%ecx
  mov    %rax,%rdi
  add    %r14,%rdi
L6:
  movslq %ecx,%r9
  mov    %rdi,%rsi
  mov    %r15,%rax
  lea    (%r15,%r9,1),%r8
  sub    %r15,%rsi
  nopw   0x0(%rax,%rax,1)
L289:
  movzbl (%rax),%edx
  mov    %dl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L289
  lea    (%rdi,%r9,1),%rdx
  lea    (%r12,%rcx,1),%r13d
  jmp    L109
L321:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void dd_to_string(const double *a, char *s, int precision, int width, int fixed, int showpos, int uppercase, char fill, int *endstring) {
  int sgn = 1;
  int i, e = 0;
  char *p = s;
  int cnt = 0;
  int off, d;
  double acc[2];
  if (dd_is_negative(a) == 1) {
    *(p++) = '-';
    cnt++;
  } else if (showpos == 1) {
    *(p++) = '+';
    cnt++;
  } else
    sgn = 0;
  if (dd_is_zero(a) == 1) {
    *(p++) = '0';
    cnt++;
    if (precision > 0) {
      *(p++) = '.';
      cnt++;
      for (i = 0; i < precision; i++, cnt++)
        *(p++) = '0';
    }
  } else {
    if (fixed != 1)
      off = 1;
    else {
      dd_abs(a, acc);
      dd_log10(acc, acc);
      dd_floor(acc, acc);
      off = dd_to_int(acc) + 1;
    }
    d = precision + off;
    if ((fixed == 1) && (d <= 0)) {
      *(p++) = '0';
      cnt++;
      if (precision > 0) {
        *(p++) = '.';
        cnt++;
        for (i = 0; i < precision; i++, cnt++)
          *(p++) = '0';
      }
    } else {
      char *t = (char *)calloc(d + 1, sizeof(char));
      int j;
      dd_to_digits(a, t, &e, d);
      if (fixed == 1) {
        if (off > 0) {
          for (i = 0; i < off; i++, cnt++)
            *(p++) = t[i];
          if (precision > 0) {
            *(p++) = '.';
            cnt++;
            for (j = 0; j < precision; j++, i++, cnt++)
              *(p++) = t[i];
          }
        } else {
          *(p++) = '0';
          cnt++;
          *(p++) = '.';
          cnt++;
          if (off < 0)
            for (i = 0; i < (-off); i++, cnt++)
              *(p++) = '0';
          for (i = 0; i < d; i++, cnt++)
            *(p++) = t[i];
        }
      } else {
        *(p++) = t[0];
        cnt++;
        if (precision > 0) {
          *(p++) = '.';
          cnt++;
        }
        for (i = 1; i <= precision; i++, cnt++)
          *(p++) = t[i];
      }
      free(t);
    }
  }
  if (fixed == 0) {
    *(p++) = (uppercase == 1) ? 'E' : 'e';
    cnt++;
    *(p++) = (e < 0 ? '-' : '+');
    cnt++;
    if (e < 0)
      e = -e;
    if (e >= 100) {
      i = e / 100;
      *(p++) = '0' + i;
      cnt++;
      e -= 100 * i;
    }
    i = e / 10;
    *(p++) = '0' + i;
    cnt++;
    e -= 10 * i;
    *(p++) = '0' + e;
    cnt++;
  }
  if (cnt >= width) {
    *(p++) = '\0';
    *endstring = cnt + 1;
  } else {
    d = width - cnt;
    for (i = 0; i < cnt; i++)
      s[i + d] = s[i];
    for (i = 0; i < d; i++)
      s[i] = fill;
    s[width] = '\0';
    *endstring = width;
  }
}
```