user: Please show me the C implementation that matches the assembly code listed below:

```asm
<acvt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,%r14d
  mov    %rdx,%r15
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x1(%rdi),%r12
  cmp    $0x41,%ecx
  lea    D8(%rip),%rbp
  lea    D17(%rip),%rax
  cmove  %rax,%rbp
  movb   $0x30,(%rdi)
  fldt   0x60(%rsp)
  fldz
  fcomip %st(1),%st
  ja     L127
  fstp   %st(0)
L50:
  fldz
  fldt   0x60(%rsp)
  fucomip %st(1),%st
  fstp   %st(0)
  jp     L67
  jne    L67
L154:
  fnstcw 0xe(%rsp)
  movzwl 0xe(%rsp),%eax
  or     $0xc,%ah
  mov    %ax,0xc(%rsp)
  fldt   0x60(%rsp)
  fldcw  0xc(%rsp)
  fistpll (%rsp)
  fldcw  0xe(%rsp)
  mov    %r12,%rsi
  mov    (%rsp),%rdi
  call   <ltoa@plt>
  movslq %eax,%rbx
  add    %r12,%rbx
  fildll (%rsp)
  fldt   0x60(%rsp)
  fsubp  %st,%st(1)
  mov    %eax,(%r15)
  lea    0x1(%r14),%edx
  add    %rbx,%rdx
  flds   0xdb3(%rip)        # 2024 <_fini+0xc40>
  cmp    $0xffffffff,%r14d
  je     L109
  fnstcw 0xe(%rsp)
  movzwl 0xe(%rsp),%eax
  or     $0xc,%ah
  mov    %ax,0xc(%rsp)
  jmp    L99
L5:
  fxch   %st(1)
L99:
  fmul   %st,%st(1)
  fxch   %st(1)
  fld    %st(0)
  fldcw  0xc(%rsp)
  fistpl (%rsp)
  fldcw  0xe(%rsp)
  add    $0x1,%rbx
  movslq (%rsp),%rax
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,-0x1(%rbx)
  fildl  (%rsp)
  fsubrp %st,%st(1)
  cmp    %rdx,%rbx
  jne    L5
  fstp   %st(0)
  fstp   %st(0)
  cmp    $0x41,%r13d
  sete   %r13b
  movzbl %r13b,%r13d
  lea    -0x1(%rdx),%rbx
  mov    %r13d,%esi
  mov    %rbx,%rdi
  call   <val_hex@plt>
  cmp    $0x7,%eax
  jg     L57
  jmp    L152
L174:
  fstp   %st(0)
L152:
  movb   $0x0,(%rbx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  mov    %r12,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L127:
  fchs
  fstpt  0x60(%rsp)
  jmp    L50
L67:
  lea    0x14(%rsp),%rdi
  push   0x68(%rsp)
  push   0x68(%rsp)
  call   <frexpl@plt>
  mov    $0x1,%edi
  sub    0x24(%rsp),%edi
  push   0x78(%rsp)
  push   0x78(%rsp)
  call   <ldexpl@plt>
  fstpt  0x80(%rsp)
  add    $0x20,%rsp
  jmp    L154
L109:
  fstp   %st(0)
  fldz
  fxch   %st(1)
  fucomi %st(1),%st
  fstp   %st(1)
  jp     L53
  je     L174
L53:
  flds   0xcbd(%rip)        # 2024 <_fini+0xc40>
  fldz
  fld    %st(0)
  fxch   %st(3)
  fnstcw 0xe(%rsp)
  movzwl 0xe(%rsp),%eax
  or     $0xc,%ah
  mov    %ax,0xc(%rsp)
L108:
  fmul   %st(2),%st
  fld    %st(0)
  fldcw  0xc(%rsp)
  fistpl (%rsp)
  fldcw  0xe(%rsp)
  add    $0x1,%rbx
  movslq (%rsp),%rax
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,-0x1(%rbx)
  fildl  (%rsp)
  fsubrp %st,%st(1)
  fld    %st(1)
  fucomip %st(1),%st
  jp     L108
  fld    %st(3)
  fucomip %st(1),%st
  jne    L108
  fstp   %st(0)
  fstp   %st(0)
  fstp   %st(0)
  fstp   %st(0)
  jmp    L152
L57:
  mov    %rbx,%rbp
L31:
  sub    $0x1,%rbp
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <incr_hex@plt>
  cmp    $0xf,%eax
  jle    L152
  movb   $0x0,0x0(%rbp)
  jmp    L31
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D8
type_infered: string
name: parse_data
arguments: data_tag: D17
type_infered: string

tool: D8: 0123456789abcdef

tool: D17: 0123456789ABCDEF

assistant: ```c
char *acvt(char *out, long double value, int fdigit, int *decpt, int conv) {
  char *pos = out + 1;
  int ip_len, exp;
  int full_prec = fdigit == -1;
  const char *bnum = "0123456789abcdef";
  if (conv == 'A')
    bnum = "0123456789ABCDEF";
  out[0] = '0';
  if (value < 0)
    value = -value;
  if (value) {
    frexpl(value, &exp);
    value = ldexpl(value, -(exp - 1));
  }
  pos += ip_len = ltoa((long)value, pos);
  value -= (long)value;
  *decpt = ip_len;
  if (full_prec) {
    while (value) {
      int ival = (int)(value *= 16);
      *pos++ = bnum[ival];
      value -= ival;
    }
  } else {
    fdigit++;
    while (fdigit--) {
      int ival = (int)(value *= 16);
      *pos++ = bnum[ival];
      value -= ival;
    }
    if (val_hex(--pos, conv == 'A') >= 0x8) {
      char *ptr = pos;
      while (incr_hex(--ptr, conv == 'A') > 0xf)
        *ptr = 0;
    }
  }
  *pos = 0;
  return out + 1;
}
```