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

```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    L258
  movb   $0x0,(%rbx)
  mov    %rbx,%r12
L7:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L258:
  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     L7
  mov    0x10(%rsp),%eax
  mov    0x14(%rsp),%ecx
  cmp    $0x270f,%eax
  je     L54
  mov    %rbx,%rdx
  test   %ecx,%ecx
  jne    L229
L43:
  test   %eax,%eax
  js     L38
  cmp    %ebp,%eax
  jle    L253
L38:
  lea    -0x1(%rax),%ecx
  mov    %ecx,0x10(%rsp)
  test   %ecx,%ecx
  js     L163
  movl   $0x0,0x14(%rsp)
L252:
  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     L300
  nopl   0x0(%rax,%rax,1)
L89:
  add    $0x1,%rbp
  mov    %al,(%rdx)
  add    $0x1,%rdx
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  jne    L89
L300:
  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     L83
  movb   $0x30,0x2(%rdx)
  movzbl 0x10(%rsp),%eax
  movb   $0x0,0x4(%rdx)
  add    $0x30,%eax
  mov    %al,0x3(%rdx)
L113:
  mov    %r12,%rdi
  mov    %rbx,%r12
  call   <__freedtoa@plt>
  jmp    L7
  nopl   0x0(%rax)
L229:
  movb   $0x2d,(%rbx)
  lea    0x1(%rbx),%rdx
  jmp    L43
  nopl   0x0(%rax)
L253:
  movslq %eax,%rdi
  movzbl (%r12),%ecx
  mov    %r12,%rsi
  add    %rdx,%rdi
  test   %eax,%eax
  jne    L293
  jmp    L225
  nopw   0x0(%rax,%rax,1)
L14:
  add    $0x1,%rsi
L77:
  mov    %cl,-0x1(%rdx)
  cmp    %rdx,%rdi
  je     L245
L293:
  movzbl (%rsi),%ecx
  add    $0x1,%rdx
  test   %cl,%cl
  jne    L14
  mov    $0x30,%ecx
  jmp    L77
  nopw   0x0(%rax,%rax,1)
L163:
  mov    $0x1,%ecx
  movl   $0x1,0x14(%rsp)
  sub    %eax,%ecx
  mov    %ecx,0x10(%rsp)
  jmp    L252
L83:
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  mov    $0xcccccccd,%edi
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sub    %ecx,%eax
  xor    %ecx,%ecx
L297:
  mov    %eax,%eax
  add    $0x1,%ecx
  imul   %rdi,%rax
  shr    $0x23,%rax
  test   %eax,%eax
  jne    L297
  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     L113
  nopl   0x0(%rax)
L44:
  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    L44
  jmp    L113
  nopl   0x0(%rax,%rax,1)
L54:
  cmpb   $0x49,(%r12)
  lea    D45(%rip),%rax
  lea    0x1(%rbp),%esi
  mov    %rbx,%rdi
  lea    D21(%rip),%r8
  lea    D44(%rip),%rdx
  cmovne %rax,%r8
  test   %ecx,%ecx
  lea    D40(%rip),%rax
  lea    D22(%rip),%rcx
  cmove  %rax,%rcx
  call   <snprintf@plt>
  mov    %r12,%rdi
  mov    %rbx,%r12
  call   <__freedtoa@plt>
  jmp    L7
  nopl   (%rax)
L245:
  cmpb   $0x0,(%rsi)
  je     L246
  cmp    %r12,%rsi
  je     L285
L179:
  mov    0x0(%r13),%esi
  call   <stpcpy@plt>
  movslq 0x10(%rsp),%rdx
  mov    %rax,%rdi
  movzbl (%r12,%rdx,1),%eax
  test   %al,%al
  je     L246
  lea    0x1(%r12,%rdx,1),%rdx
  nopl   0x0(%rax)
L80:
  add    $0x1,%rdx
  mov    %al,(%rdi)
  add    $0x1,%rdi
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L80
L246:
  movb   $0x0,(%rdi)
  jmp    L113
L225:
  mov    %rdx,%rdi
  test   %cl,%cl
  je     L246
L285:
  movb   $0x30,(%rdi)
  add    $0x1,%rdi
  jmp    L179
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D45
datatype: string
name: extract_symbolic_data
arguments: label: D21
datatype: string
name: extract_symbolic_data
arguments: label: D44
datatype: string
name: extract_symbolic_data
arguments: label: D40
datatype: string
name: extract_symbolic_data
arguments: label: D22
datatype: string

tool: D45: nan

tool: D21: inf

tool: D44: %s%s

tool: 

tool: D22: -

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);
}
```