user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<my_double2str>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  movsd  %xmm0,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  cmp    $0x7,%rsi
  jbe    L312
  mov    %rsi,%r13
  shr    %r13
  lea    -0xa(%r13),%rax
  cmp    $0x13,%rax
  ja     L391
  sub    $0xa,%r13d
  pxor   %xmm1,%xmm1
  mov    $0x0,%ebp
  comisd %xmm0,%xmm1
  jbe    L214
L50:
  xorpd  D39(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  mov    $0x2d,%ebp
L214:
  mov    D167(%rip),%r12
  test   %r13d,%r13d
  jle    L88
L368:
  sub    $0x1,%r13d
  test   %r13d,%r13d
  jle    L58
  mov    %r13d,%eax
  mov    D167(%rip),%r12
  movsd  D8(%rip),%xmm0
L20:
  movq   %r12,%xmm4
  mulsd  %xmm0,%xmm4
  movq   %xmm4,%r12
  sub    $0x1,%eax
  jne    L20
L88:
  movsd  0x18(%rsp),%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  jne    L564
  movsd  0x18(%rsp),%xmm0
  comisd D162(%rip),%xmm0
  jbe    L145
  mov    $0x0,%ebx
  movsd  D37(%rip),%xmm1
  comisd D107(%rip),%xmm0
  jb     L530
L427:
  mulsd  %xmm1,%xmm0
  add    $0x20,%ebx
  comisd D107(%rip),%xmm0
  jb     L329
  cmp    $0x15e,%ebx
  jle    L427
L329:
  movsd  %xmm0,0x18(%rsp)
L524:
  movsd  0x18(%rsp),%xmm0
  cmp    $0x15e,%ebx
  jg     L152
  comisd D144(%rip),%xmm0
  jb     L152
  movsd  D58(%rip),%xmm1
L60:
  mulsd  %xmm1,%xmm0
  add    $0x8,%ebx
  cmp    $0x15e,%ebx
  jg     L361
  comisd D144(%rip),%xmm0
  jae    L60
L361:
  movsd  %xmm0,0x18(%rsp)
L152:
  movsd  0x18(%rsp),%xmm0
  cmp    $0x15e,%ebx
  jg     L566
  comisd D38(%rip),%xmm0
  jb     L566
  movsd  D8(%rip),%xmm1
L171:
  mulsd  %xmm1,%xmm0
  add    $0x1,%ebx
  cmp    $0x15e,%ebx
  jg     L290
  comisd D38(%rip),%xmm0
  jae    L171
L290:
  movsd  %xmm0,0x18(%rsp)
L566:
  movsd  0x18(%rsp),%xmm0
  movsd  D144(%rip),%xmm2
  movsd  D58(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L444
L0:
  mulsd  %xmm2,%xmm0
  sub    $0x8,%ebx
  comisd %xmm0,%xmm1
  ja     L0
  movsd  %xmm0,0x18(%rsp)
L444:
  movsd  0x18(%rsp),%xmm0
  movsd  D38(%rip),%xmm2
  movsd  D180(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L174
L258:
  mulsd  %xmm2,%xmm0
  sub    $0x1,%ebx
  comisd %xmm0,%xmm1
  ja     L258
  movsd  %xmm0,0x18(%rsp)
L174:
  cmp    $0x15e,%ebx
  jg     L142
  movq   %r12,%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  comisd D38(%rip),%xmm0
  jae    L643
  jmp    L337
L47:
  mov    $0x14,%r13d
  jmp    L50
L58:
  mov    D167(%rip),%r12
  jmp    L88
L564:
  lea    D133(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
  jmp    L573
L530:
  mov    $0x0,%ebx
  jmp    L524
L142:
  cmp    $0x2d,%bpl
  je     L124
  lea    D91(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
  jmp    L573
L124:
  lea    D216(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
  jmp    L573
L40:
  mov    $0x0,%ebx
L643:
  mulsd  D8(%rip),%xmm0
  movsd  %xmm0,0x18(%rsp)
  add    $0x1,%ebx
L337:
  cmp    $0xfffffffc,%ebx
  jl     L190
  cmp    %r13d,%ebx
  jle    L44
L190:
  movl   $0x0,0x24(%rsp)
  test   %bpl,%bpl
  jne    L276
  mov    0x8(%rsp),%r14
  movb   $0x2,0x17(%rsp)
  mov    $0x0,%r12d
L462:
  mov    %r14,%rbp
  lea    0x24(%rsp),%r15
L393:
  lea    0x18(%rsp),%rdi
  mov    %r15,%rsi
  call   <getdigit@plt>
  add    $0x1,%rbp
  mov    %al,-0x1(%rbp)
  lea    (%r12,%r14,1),%eax
  cmp    %ebp,%eax
  jns    L393
  test   %r12d,%r12d
  mov    $0x0,%eax
  cmovns %r12d,%eax
  lea    0x1(%rax),%ebp
  add    %r14,%rbp
  sub    $0x1,%r12d
  sub    %eax,%r12d
L61:
  test   %r13d,%r13d
  jle    L676
  lea    0x1(%rbp),%r14
  movb   $0x2e,0x0(%rbp)
  add    $0x1,%r12d
  jns    L206
L445:
  mov    %r14,%rbp
  lea    0x0(%r13,%r14,1),%r15d
L151:
  mov    %r15d,%eax
  sub    %ebp,%eax
  test   %eax,%eax
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  add    $0x1,%rbp
  movb   $0x30,-0x1(%rbp)
  mov    %r12d,%eax
  sub    %r14d,%eax
  add    %ebp,%eax
  js     L151
  mov    %r12d,%ebp
  not    %ebp
  add    $0x1,%rbp
  test   %r12d,%r12d
  mov    $0x1,%eax
  cmovns %rax,%rbp
  add    %r14,%rbp
  test   %r12d,%r12d
  mov    $0xffffffff,%eax
  cmovs  %r12d,%eax
  lea    -0x1(%r13,%rax,1),%r15d
  lea    0x0(%r13,%rax,1),%eax
  test   %eax,%eax
  jle    L134
L121:
  mov    %rbp,%r12
  lea    0x24(%rsp),%r14
L71:
  lea    0x18(%rsp),%rdi
  mov    %r14,%rsi
  call   <getdigit@plt>
  add    $0x1,%r12
  mov    %al,-0x1(%r12)
  mov    %ebp,%eax
  sub    %r12d,%eax
  lea    0x1(%r15,%rax,1),%eax
  test   %eax,%eax
  jg     L71
  test   %r15d,%r15d
  mov    $0x0,%eax
  cmovns %r15d,%eax
  lea    0x1(%rax),%eax
  add    %rax,%rbp
L134:
  test   %r13d,%r13d
  jle    L244
  cmpb   $0x30,-0x1(%rbp)
  jne    L186
L616:
  sub    $0x1,%rbp
  movb   $0x0,0x0(%rbp)
  cmpb   $0x30,-0x1(%rbp)
  je     L616
L186:
  cmp    %rbp,0x8(%rsp)
  setb   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmpb   $0x2e,-0x1(%rbp)
  je     L25
L244:
  cmpb   $0x2,0x17(%rsp)
  je     L335
L46:
  movb   $0x0,0x0(%rbp)
  mov    $0x0,%eax
L573:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L331
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L44:
  sub    %ebx,%r13d
  movl   $0x0,0x24(%rsp)
  test   %bpl,%bpl
  jne    L615
  mov    %ebx,%r12d
  mov    0x8(%rsp),%r14
  movb   $0x1,0x17(%rsp)
  jmp    L390
L615:
  mov    %ebx,%r12d
  movb   $0x1,0x17(%rsp)
  jmp    L274
L276:
  movb   $0x2,0x17(%rsp)
  mov    $0x0,%r12d
L274:
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%r14
  mov    %bpl,(%rax)
L390:
  test   %r12d,%r12d
  jns    L462
  lea    0x1(%r14),%rbp
  movb   $0x30,(%r14)
  jmp    L61
L572:
  movb   $0x1,0x17(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  jmp    L274
L25:
  movb   $0x0,-0x1(%rbp)
  lea    -0x1(%rbp),%rbp
  jmp    L244
L335:
  movb   $0x65,0x0(%rbp)
  lea    0x2(%rbp),%rdx
  mov    $0x2b,%eax
  test   %ebx,%ebx
  js     L565
L403:
  mov    %al,0x1(%rbp)
  cmp    $0x63,%ebx
  jle    L511
  movslq %ebx,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  mov    %ebx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    0x30(%rax),%ecx
  mov    %cl,(%rdx)
  imul   $0x64,%eax,%eax
  sub    %eax,%ebx
  lea    0x1(%rdx),%rdx
L511:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %ebx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    0x30(%rax),%ecx
  mov    %cl,(%rdx)
  lea    0x2(%rdx),%rbp
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %eax,%ebx
  add    $0x30,%ebx
  mov    %bl,0x1(%rdx)
  jmp    L46
L565:
  neg    %ebx
  mov    $0x2d,%eax
  jmp    L403
L312:
  mov    $0xffffffff,%eax
  jmp    L573
L206:
  lea    -0x1(%r13),%r15d
  mov    %r14,%rbp
  jmp    L121
L676:
  mov    %rbp,%r14
  add    $0x1,%r12d
  js     L445
  jmp    L244
L145:
  movq   %r12,%xmm5
  addsd  %xmm5,%xmm0
  movsd  %xmm0,0x18(%rsp)
  comisd D38(%rip),%xmm0
  jae    L40
  movl   $0x0,0x24(%rsp)
  test   %bpl,%bpl
  jne    L572
  mov    0x8(%rsp),%r14
  movb   $0x1,0x17(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  jmp    L462
L391:
  movsd  0x18(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L47
  mov    $0x0,%ebp
  mov    $0x14,%r13d
  jmp    L368
L331:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D39
datatype: f32[4]
name: retrieve_data
arguments: label: D167
datatype: f64
name: retrieve_data
arguments: label: D8
datatype: f64
name: retrieve_data
arguments: label: D162
datatype: f32
name: retrieve_data
arguments: label: D37
datatype: byte[8]
name: retrieve_data
arguments: label: D107
datatype: f64[2]
name: retrieve_data
arguments: label: D144
datatype: f64[2]
name: retrieve_data
arguments: label: D58
datatype: byte[8]
name: retrieve_data
arguments: label: D38
datatype: f64[2]
name: retrieve_data
arguments: label: D180
datatype: f64
name: retrieve_data
arguments: label: D133
datatype: string
name: retrieve_data
arguments: label: D91
datatype: string
name: retrieve_data
arguments: label: D216
datatype: string

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

tool: D167: 0.5

tool: D8: 0.1

tool: D162: 0

tool: {"D37": [0x33,0xa7,0xa8,0xd5,0x23,0xf6,0x49,0x39]}

tool: {"D107": [1e32,1e-32]}

tool: {"D144": [100000000.0,1e-8]}

tool: {"D58": [0x3a,0x8c,0x30,0xe2,0x8e,0x79,0x45,0x3e]}

tool: {"D38": [10.0,1.0]}

tool: D180: 1

tool: D133: NaN

tool: D91: Inf

tool: D216: -Inf

assistant: ```c
int my_double2str(char *buf, size_t bufsize, double realvalue) {
  int precision = -1;
  char *bufpt;
  char prefix;
  char xtype = 0;
  int idx, exp, e2;
  double rounder;
  char flag_exp;
  char flag_rtz;
  char flag_dp;
  char flag_alternateform = 0;
  char flag_altform2 = 0;
  int nsd;
  if (bufsize < 8)
    return -1;
  if (precision < 0)
    precision = 20;
  if (precision > bufsize / 2 - 10)
    precision = bufsize / 2 - 10;
  if (realvalue < 0.0) {
    realvalue = -realvalue;
    prefix = '-';
  } else {
    prefix = 0;
  }
  if (xtype == 0 && precision > 0)
    precision--;
  for (idx = precision, rounder = 0.5; idx > 0; idx--, rounder *= 0.1) {
  }
  if (xtype == 1)
    realvalue += rounder;
  exp = 0;
  if (isnan(realvalue)) {
    strcpy(buf, "NaN");
    return 0;
  }
  if (realvalue > 0.0) {
    while (realvalue >= 1e32 && exp <= 350) {
      realvalue *= 1e-32;
      exp += 32;
    }
    while (realvalue >= 1e8 && exp <= 350) {
      realvalue *= 1e-8;
      exp += 8;
    }
    while (realvalue >= 10.0 && exp <= 350) {
      realvalue *= 0.1;
      exp++;
    }
    while (realvalue < 1e-8) {
      realvalue *= 1e8;
      exp -= 8;
    }
    while (realvalue < 1.0) {
      realvalue *= 10.0;
      exp--;
    }
    if (exp > 350) {
      if (prefix == '-') {
        strcpy(buf, "-Inf");
      } else {
        strcpy(buf, "Inf");
      }
      return 0;
    }
  }
  bufpt = buf;
  flag_exp = xtype == 2;
  if (xtype != 1) {
    realvalue += rounder;
    if (realvalue >= 10.0) {
      realvalue *= 0.1;
      exp++;
    }
  }
  if (xtype == 0) {
    flag_rtz = !flag_alternateform;
    if (exp < -4 || exp > precision) {
      xtype = 2;
    } else {
      precision = precision - exp;
      xtype = 1;
    }
  } else {
    flag_rtz = 0;
  }
  if (xtype == 2) {
    e2 = 0;
  } else {
    e2 = exp;
  }
  nsd = 0;
  flag_dp = (precision > 0 ? 1 : 0) | flag_alternateform | flag_altform2;
  if (prefix) {
    *(bufpt++) = prefix;
  }
  if (e2 < 0) {
    *(bufpt++) = '0';
  } else {
    for (; e2 >= 0; e2--) {
      *(bufpt++) = getdigit(&realvalue, &nsd);
    }
  }
  if (flag_dp) {
    *(bufpt++) = '.';
  }
  for (e2++; e2 < 0; precision--, e2++) {
    assert(precision > 0);
    *(bufpt++) = '0';
  }
  while ((precision--) > 0) {
    *(bufpt++) = getdigit(&realvalue, &nsd);
  }
  if (flag_rtz && flag_dp) {
    while (bufpt[-1] == '0')
      *(--bufpt) = 0;
    assert(bufpt > buf);
    if (bufpt[-1] == '.') {
      if (flag_altform2) {
        *(bufpt++) = '0';
      } else {
        *(--bufpt) = 0;
      }
    }
  }
  if (flag_exp || xtype == 2) {
    *(bufpt++) = 'e';
    if (exp < 0) {
      *(bufpt++) = '-';
      exp = -exp;
    } else {
      *(bufpt++) = '+';
    }
    if (exp >= 100) {
      *(bufpt++) = (char)((exp / 100) + '0');
      exp %= 100;
    }
    *(bufpt++) = (char)(exp / 10 + '0');
    *(bufpt++) = (char)(exp % 10 + '0');
  }
  *bufpt = 0;
  return 0;
}
```