user: What is the c source code of the assembly code below:

```asm
<gcvt>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movq   %xmm0,%rbx
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <localeconv@plt>
  test   %r12d,%r12d
  jne    L142
  movb   $0x0,0x0(%rbp)
  mov    %rbp,%rbx
L20:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L80
  mov    %rbx,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L142:
  mov    %rax,%r13
  lea    0x4(%rsp),%rcx
  mov    %rsp,%rdx
  mov    $0x0,%r8d
  mov    %r12d,%esi
  mov    $0x2,%edi
  movq   %rbx,%xmm0
  call   <__dtoa@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L20
  mov    (%rsp),%ecx
  cmp    $0x270f,%ecx
  je     L195
  mov    %rbp,%rdi
  cmpl   $0x0,0x4(%rsp)
  je     L212
  lea    0x1(%rbp),%rdi
  movb   $0x2d,0x0(%rbp)
L212:
  cmp    %r12d,%ecx
  jg     L264
  test   %ecx,%ecx
  jns    L233
L264:
  lea    -0x1(%rcx),%eax
  mov    %eax,(%rsp)
  test   %eax,%eax
  js     L147
  movl   $0x0,0x4(%rsp)
L308:
  lea    0x1(%rbx),%r12
  lea    0x1(%rdi),%rax
  movzbl (%rbx),%edx
  mov    %dl,(%rdi)
  mov    0x0(%r13),%esi
  mov    %rax,%rdi
  call   <stpcpy@plt>
  movzbl 0x1(%rbx),%edx
  test   %dl,%dl
  je     L202
L137:
  add    $0x1,%r12
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  movzbl (%r12),%edx
  test   %dl,%dl
  jne    L137
L202:
  movb   $0x65,(%rax)
  cmpl   $0x0,0x4(%rsp)
  je     L190
  lea    0x2(%rax),%rcx
  mov    $0x2d,%edx
L105:
  mov    %dl,0x1(%rax)
  mov    (%rsp),%edx
  cmp    $0x9,%edx
  jg     L88
  movb   $0x30,(%rcx)
  movzbl (%rsp),%eax
  add    $0x30,%eax
  mov    %al,0x1(%rcx)
  movb   $0x0,0x2(%rcx)
L181:
  mov    %rbx,%rdi
  call   <__freedtoa@plt>
  mov    %rbp,%rbx
  jmp    L20
L195:
  cmpb   $0x49,(%rax)
  lea    D42(%rip),%r8
  lea    D15(%rip),%rax
  cmovne %rax,%r8
  cmpl   $0x0,0x4(%rsp)
  lea    D9(%rip),%rcx
  lea    D23(%rip),%rax
  cmove  %rax,%rcx
  lea    0x1(%r12),%esi
  lea    D20(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <__freedtoa@plt>
  mov    %rbp,%rbx
  jmp    L20
L233:
  jle    L118
  lea    0x1(%rdi),%rax
  lea    -0x1(%rcx),%edx
  lea    0x2(%rdi,%rdx,1),%r8
  mov    %rbx,%rsi
  mov    $0x30,%r9d
  jmp    L284
L147:
  movl   $0x1,0x4(%rsp)
  mov    $0x1,%eax
  sub    %ecx,%eax
  mov    %eax,(%rsp)
  jmp    L308
L190:
  lea    0x2(%rax),%rcx
  mov    $0x2b,%edx
  jmp    L105
L88:
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    $0x0,%edx
L38:
  add    $0x1,%edx
  movslq %eax,%rsi
  imul   $0x66666667,%rsi,%rsi
  sar    $0x22,%rsi
  sar    $0x1f,%eax
  sub    %eax,%esi
  mov    %esi,%eax
  jne    L38
  movl   $0x0,0x4(%rsp)
  movslq %edx,%rdx
  movb   $0x0,0x1(%rcx,%rdx,1)
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L181
  add    %rdx,%rcx
L134:
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  sub    %edx,%eax
  add    $0x30,%eax
  mov    %al,(%rcx)
  mov    (%rsp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sar    $0x1f,%edx
  sub    %edx,%eax
  mov    %eax,(%rsp)
  sub    $0x1,%rcx
  test   %eax,%eax
  jne    L134
  jmp    L181
L112:
  mov    %r9d,%edx
L96:
  mov    %dl,-0x1(%rax)
  add    $0x1,%rax
  cmp    %r8,%rax
  je     L304
L284:
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L112
  add    $0x1,%rsi
  jmp    L96
L304:
  mov    %ecx,%ecx
  add    %rcx,%rdi
  cmpb   $0x0,(%rsi)
  je     L119
  cmp    %rbx,%rsi
  je     L192
L139:
  mov    0x0(%r13),%esi
  call   <stpcpy@plt>
  mov    %rax,%rdi
  movslq (%rsp),%rdx
  movzbl (%rbx,%rdx,1),%eax
  test   %al,%al
  je     L119
  lea    0x1(%rbx,%rdx,1),%rdx
L73:
  add    $0x1,%rdi
  mov    %al,-0x1(%rdi)
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L73
L119:
  movb   $0x0,(%rdi)
  jmp    L181
L118:
  cmpb   $0x0,(%rbx)
  je     L119
L192:
  movb   $0x30,(%rdi)
  lea    0x1(%rdi),%rdi
  jmp    L139
L80:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D42
type_guessed: string
name: disassemble_data
arguments: tag: D15
type_guessed: string
name: disassemble_data
arguments: tag: D9
type_guessed: string
name: disassemble_data
arguments: tag: D23
type_guessed: string
name: disassemble_data
arguments: tag: D20
type_guessed: string

tool: D42: inf

tool: D15: nan

tool: D9: -

tool: 

tool: D20: %s%s

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