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

```asm
<arikkei_dtoa_simple>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  movsd  %xmm0,-0x48(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %ecx,-0x4c(%rbp)
  mov    %r8d,-0x50(%rbp)
  movl   $0x0,-0x24(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L18
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2d,(%rax)
  movsd  -0x48(%rbp),%xmm0
  movq   D53(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
L18:
  movsd  -0x48(%rbp),%xmm0
  movsd  D64(%rip),%xmm1
  comisd %xmm1,%xmm0
  jb     L111
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <log10@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L74
L111:
  movl   $0x0,-0x28(%rbp)
L74:
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%eax
  sub    %edx,%eax
  cmp    %eax,-0x4c(%rbp)
  jae    L4
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4c(%rbp)
L4:
  mov    -0x4c(%rbp),%eax
  test   %rax,%rax
  js     L98
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L6
L98:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L6:
  movq   D58(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    D18(%rip),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  D13(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x48(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x20(%rbp)
  movsd  -0x48(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,%esi
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <arikkei_itoa@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x24(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x40(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  je     L120
  cmpl   $0x0,-0x50(%rbp)
  jne    L90
  movsd  -0x18(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L120
L90:
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  jmp    L129
L29:
  movsd  -0x18(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  cvttsd2si -0x8(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  lea    0x30(%rcx),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x4c(%rbp)
L129:
  cmpl   $0x0,-0x4c(%rbp)
  je     L120
  cmpl   $0x0,-0x50(%rbp)
  jne    L29
  movsd  -0x18(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  ja     L29
L120:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x24(%rbp),%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D53
type_infered: qword
name: unpack_data
arguments: data_tag: D64
type_infered: f64
name: unpack_data
arguments: data_tag: D58
type_infered: f32[2]
name: unpack_data
arguments: data_tag: D18
type_infered: f64
name: unpack_data
arguments: data_tag: D13
type_infered: f64

tool: D53: 9223372036854775807

tool: D64: 1

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

tool: D18: 10

tool: D13: 0.5

assistant: ```c
unsigned int arikkei_dtoa_simple(unsigned char *buf, unsigned int len, double val, unsigned int tprec, unsigned int fprec, unsigned int padf) {
  double dival, fval, epsilon;
  int idigits, ival, ilen, i;
  i = 0;
  if (val < 0.0) {
    buf[i++] = '-';
    val = fabs(val);
  }
  if (val >= 1.0) {
    idigits = (int)floor(log10(val));
  } else {
    idigits = 0;
  }
  if ((tprec - idigits) > fprec)
    fprec = tprec - idigits;
  epsilon = 0.5 * pow(10.0, -(double)fprec);
  val += epsilon;
  epsilon *= 2;
  dival = floor(val);
  ival = (int)dival;
  fval = val - dival;
  ilen = arikkei_itoa(buf + i, len - i, ival);
  i += ilen;
  tprec -= ilen;
  if ((fprec > 0) && (padf || (fval > epsilon))) {
    buf[i++] = '.';
    while ((fprec > 0) && (padf || (fval > epsilon))) {
      fval *= 10.0;
      epsilon *= 10.0;
      dival = floor(fval);
      fval -= dival;
      buf[i++] = '0' + (unsigned char)dival;
      fprec -= 1;
    }
  }
  buf[i] = 0;
  return i;
}
```