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

```asm
<fb_hFloat2Str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  movsd  %xmm0,-0x48(%rbp)
  mov    %rdi,-0x50(%rbp)
  mov    %esi,-0x54(%rbp)
  mov    %edx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x58(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L54
  mov    -0x50(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  jmp    L43
L54:
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L43:
  cmpl   $0x7,-0x54(%rbp)
  je     L157
  cmpl   $0x10,-0x54(%rbp)
  je     L175
  jmp    L179
L157:
  lea    D29(%rip),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L115
L175:
  lea    D19(%rip),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L115
L179:
  mov    -0x54(%rbp),%edx
  lea    -0x20(%rbp),%rax
  lea    D21(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x28(%rbp)
L115:
  mov    -0x54(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x48(%rbp),%rsi
  mov    -0x28(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x30(%rbp),%rax
  movq   %rsi,%xmm0
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jle    L80
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L168
L80:
  mov    -0x50(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L88
L168:
  cmpl   $0x0,-0x34(%rbp)
  jle    L114
  cmpl   $0x0,-0x34(%rbp)
  jle    L114
  mov    -0x34(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L114
  mov    -0x34(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L114:
  mov    -0x58(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jle    L16
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L61
  mov    -0x50(%rbp),%rax
  movb   $0x20,(%rax)
  mov    -0x50(%rbp),%rax
  jmp    L88
L61:
  mov    -0x30(%rbp),%rax
  jmp    L88
L16:
  mov    -0x30(%rbp),%rax
L88:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L166
  call   <__stack_chk_fail@plt>
L166:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D29
type_infered: string
name: unpack_data
arguments: tag: D19
type_infered: string
name: unpack_data
arguments: tag: D21
type_infered: string

tool: D29: %.7g

tool: D19: %.16g

tool: D21: %%.%dg

assistant: ```c
char *fb_hFloat2Str(double val, char *buffer, int digits, int mask) {
  int len, maxlen;
  char *p;
  char fmtstr[16], *fstr;
  if (mask & 0x00000001)
    p = &buffer[1];
  else
    p = buffer;
  switch (digits) {
  case 7:
    fstr = (char *)&"%.7g";
    break;
  case 16:
    fstr = (char *)&"%.16g";
    break;
  default:
    sprintf(fmtstr, "%%.%dg", digits);
    fstr = &fmtstr[0];
  }
  maxlen = 1 + digits + 6 + 1;
  len = snprintf(p, maxlen, fstr, val);
  if (len <= 0 || len >= maxlen) {
    buffer[0] = '\0';
    return 0;
  }
  if (len > 0) {
    if (len > 0)
      if (p[len - 1] == '.')
        p[len - 1] = '\0';
  }
  if ((mask & 0x00000001) > 0) {
    if (p[0] != '-') {
      buffer[0] = ' ';
      return &buffer[0];
    } else
      return p;
  } else
    return p;
}
```