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

```asm
<gcvt>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <localeconv@plt>
  test   %ebp,%ebp
  movsd  0x8(%rsp),%xmm0
  jne    L297
  movb   $0x0,(%rbx)
  mov    %rbx,%r12
L195:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L183
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L297:
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  xor    %r8d,%r8d
  mov    %ebp,%esi
  mov    $0x2,%edi
  mov    %rax,%r13
  call   <__dtoa@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L195
  mov    0x10(%rsp),%eax
  mov    0x14(%rsp),%ecx
  cmp    $0x270f,%eax
  je     L114
  mov    %rbx,%rdx
  test   %ecx,%ecx
  jne    L110
L285:
  test   %eax,%eax
  js     L85
  cmp    %ebp,%eax
  jle    L180
L85:
  mov    %eax,%ecx
  sub    $0x1,%ecx
  js     L289
  mov    %ecx,0x10(%rsp)
  xor    %eax,%eax
L240:
  mov    %eax,0x14(%rsp)
  movzbl (%r12),%eax
  lea    0x1(%rdx),%rdi
  lea    0x1(%r12),%rbp
  mov    %al,(%rdx)
  mov    0x0(%r13),%esi
  call   <stpcpy@plt>
  mov    %rax,%rdx
  movzbl 0x1(%r12),%eax
  test   %al,%al
  je     L80
  nopl   0x0(%rax)
L152:
  add    $0x1,%rbp
  mov    %al,(%rdx)
  add    $0x1,%rdx
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L152
L80:
  movb   $0x65,(%rdx)
  cmpl   $0x1,0x14(%rsp)
  lea    0x2(%rdx),%rsi
  sbb    %eax,%eax
  and    $0xfffffffe,%eax
  add    $0x2d,%eax
  mov    %al,0x1(%rdx)
  mov    0x10(%rsp),%ecx
  cmp    $0x9,%ecx
  jg     L176
  movb   $0x30,0x2(%rdx)
  movzbl 0x10(%rsp),%eax
  movb   $0x0,0x4(%rdx)
  add    $0x30,%eax
  mov    %al,0x3(%rdx)
L206:
  mov    %r12,%rdi
  mov    %rbx,%r12
  call   <__freedtoa@plt>
  jmp    L195
  nopl   0x0(%rax)
L110:
  movb   $0x2d,(%rbx)
  lea    0x1(%rbx),%rdx
  jmp    L285
  nopl   0x0(%rax)
L180:
  movslq %eax,%rdi
  movzbl (%r12),%ecx
  mov    %r12,%rsi
  add    %rdx,%rdi
  test   %eax,%eax
  jne    L245
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L177:
  add    $0x1,%rsi
L249:
  mov    %cl,-0x1(%rdx)
  cmp    %rdi,%rdx
  je     L197
L245:
  movzbl (%rsi),%ecx
  add    $0x1,%rdx
  test   %cl,%cl
  jne    L177
  mov    $0x30,%ecx
  jmp    L249
  nopw   0x0(%rax,%rax,1)
L289:
  mov    $0x1,%ecx
  sub    %eax,%ecx
  mov    $0x1,%eax
  mov    %ecx,0x10(%rsp)
  jmp    L240
  nopl   (%rax)
L176:
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  mov    $0xcccccccd,%edi
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sub    %ecx,%eax
  xor    %ecx,%ecx
L198:
  mov    %eax,%eax
  add    $0x1,%ecx
  imul   %rdi,%rax
  shr    $0x23,%rax
  test   %eax,%eax
  jne    L198
  movslq %ecx,%rcx
  movl   $0x0,0x14(%rsp)
  movb   $0x0,0x1(%rsi,%rcx,1)
  mov    0x10(%rsp),%eax
  lea    0x2(%rdx,%rcx,1),%rcx
  test   %eax,%eax
  je     L206
  nopl   0x0(%rax)
L218:
  movslq %eax,%rdx
  mov    %eax,%esi
  sub    $0x1,%rcx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x22,%rdx
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%eax
  add    $0x30,%eax
  mov    %al,0x1(%rcx)
  movslq 0x10(%rsp),%rax
  mov    %rax,%rdx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x22,%rax
  sub    %edx,%eax
  mov    %eax,0x10(%rsp)
  test   %eax,%eax
  jne    L218
  jmp    L206
  nopl   0x0(%rax,%rax,1)
L114:
  cmpb   $0x49,(%r12)
  lea    D31(%rip),%rax
  lea    0x1(%rbp),%esi
  mov    %rbx,%rdi
  lea    D0(%rip),%r8
  lea    D46(%rip),%rdx
  cmovne %rax,%r8
  test   %ecx,%ecx
  lea    D35(%rip),%rax
  lea    D30(%rip),%rcx
  cmove  %rax,%rcx
  call   <snprintf@plt>
  mov    %r12,%rdi
  mov    %rbx,%r12
  call   <__freedtoa@plt>
  jmp    L195
  nopl   (%rax)
L197:
  cmpb   $0x0,(%rsi)
  je     L283
  cmp    %r12,%rsi
  je     L162
L247:
  mov    0x0(%r13),%esi
  call   <stpcpy@plt>
  movslq 0x10(%rsp),%rdx
  mov    %rax,%rdi
  movzbl (%r12,%rdx,1),%eax
  test   %al,%al
  je     L283
  lea    0x1(%r12,%rdx,1),%rdx
  nopl   0x0(%rax)
L99:
  add    $0x1,%rdx
  mov    %al,(%rdi)
  add    $0x1,%rdi
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L99
L283:
  movb   $0x0,(%rdi)
  jmp    L206
L64:
  mov    %rdx,%rdi
  test   %cl,%cl
  je     L283
L162:
  movb   $0x30,(%rdi)
  add    $0x1,%rdi
  jmp    L247
L183:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D31
type_guessed: string
name: extract_symbolic_data
arguments: tag: D0
type_guessed: string
name: extract_symbolic_data
arguments: tag: D46
type_guessed: string
name: extract_symbolic_data
arguments: tag: D35
type_guessed: string
name: extract_symbolic_data
arguments: tag: D30
type_guessed: string

tool: D31: nan

tool: D0: inf

tool: D46: %s%s

tool: 

tool: D30: -

assistant: ```c
char *gcvt(double value, int ndigit, char *buf) {
  char *digits, *dst, *src;
  int i, decpt, sign;
  struct lconv *lconv;
  lconv = localeconv();
  if (ndigit == 0) {
    buf[0] = '\0';
    return (buf);
  }
  digits = __dtoa(value, 2, ndigit, &decpt, &sign, NULL);
  if (digits == NULL)
    return (NULL);
  if (decpt == 9999) {
    snprintf(buf, ndigit + 1, "%s%s", sign ? "-" : "", *digits == 'I' ? "inf" : "nan");
    __freedtoa(digits);
    return (buf);
  }
  dst = buf;
  if (sign)
    *dst++ = '-';
  if (decpt < 0 || decpt > ndigit) {
    if (--decpt < 0) {
      sign = 1;
      decpt = -decpt;
    } else
      sign = 0;
    src = digits;
    *dst++ = *src++;
    dst = stpcpy(dst, lconv->decimal_point);
    while (*src != '\0')
      *dst++ = *src++;
    *dst++ = 'e';
    if (sign)
      *dst++ = '-';
    else
      *dst++ = '+';
    if (decpt < 10) {
      *dst++ = '0';
      *dst++ = '0' + decpt;
      *dst = '\0';
    } else {
      for (sign = decpt, i = 0; (sign /= 10) != 0; i++)
        continue;
      dst[i + 1] = '\0';
      while (decpt != 0) {
        dst[i--] = '0' + decpt % 10;
        decpt /= 10;
      }
    }
  } else {
    for (i = 0, src = digits; i < decpt; i++) {
      if (*src != '\0')
        *dst++ = *src++;
      else
        *dst++ = '0';
    }
    if (*src != '\0') {
      if (src == digits)
        *dst++ = '0';
      dst = stpcpy(dst, lconv->decimal_point);
      for (i = decpt; digits[i] != '\0'; i++) {
        *dst++ = digits[i];
      }
    }
    *dst = '\0';
  }
  __freedtoa(digits);
  return (buf);
}
```