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

```asm
<string_commas_double>:
  endbr64
  push   %r14
  pxor   %xmm1,%xmm1
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x578,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x568(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <double_virtually_same@plt>
  movsd  0x8(%rsp),%xmm0
  test   %rax,%rax
  je     L23
  pxor   %xmm0,%xmm0
L23:
  lea    0x20(%rsp),%rbx
  mov    $0x1,%eax
  lea    0x18(%rsp),%r12
  lea    0xe0(%rsp),%r13
  lea    D13(%rip),%rsi
  mov    %r13,%rdi
  call   <sprintf@plt>
  xor    %ecx,%ecx
  mov    %r13,%rdx
  mov    $0x2e,%esi
  mov    %rbx,%rdi
  call   <piece@plt>
  mov    %r13,%rdx
  mov    $0x1,%ecx
  mov    %r12,%rdi
  mov    $0x2e,%esi
  call   <piece@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbx,%rax,1),%rdx
  cmp    %rbx,%rdx
  jb     L98
  jbe    L19
  mov    %rdx,%rsi
  lea    0xa0(%rsp),%r10
  movzbl 0x1f(%rsp,%rax,1),%ecx
  not    %rsi
  mov    %r10,%rax
  add    %rbx,%rsi
  add    %rdx,%rsi
  cmp    %rsi,%rbx
  cmovae %rbx,%rsi
  xor    %r8d,%r8d
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L12:
  mov    %rdi,%rax
L5:
  sub    $0x1,%rdx
  cmp    %rsi,%rdx
  jbe    L81
L59:
  mov    %cl,(%rax)
  movzbl -0x1(%rdx),%ecx
  lea    0x1(%rax),%rdi
  cmp    $0x2d,%cl
  je     L12
  add    $0x1,%r8d
  imul   $0xaaaaaaab,%r8d,%r9d
  cmp    $0x55555555,%r9d
  ja     L12
  movb   $0x2c,0x1(%rax)
  add    $0x2,%rax
  jmp    L5
  nopl   0x0(%rax)
L19:
  lea    0xa0(%rsp),%r10
  mov    %r10,%rax
  nopl   0x0(%rax,%rax,1)
L34:
  movzbl (%rdx),%ecx
  add    $0x1,%rax
  sub    $0x1,%rdx
  mov    %cl,-0x1(%rax)
L81:
  cmp    %rbx,%rdx
  jae    L34
L74:
  movb   $0x0,(%rax)
  lea    0x60(%rsp),%r14
  mov    %r10,%rsi
  lea    0x160(%rsp),%r13
  mov    %r14,%rdi
  call   <reverse_string@plt>
  mov    %r14,%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    %r12,%rcx
  lea    D14(%rip),%rsi
  call   <sprintf@plt>
  mov    %r13,%rdi
  call   <strdup@plt>
  mov    0x568(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L100
  add    $0x578,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L98:
  lea    0xa0(%rsp),%r10
  mov    %r10,%rax
  jmp    L74
L100:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D13
type_guessed: string
name: unpack_data
arguments: label: D14
type_guessed: string

tool: D13: %.3lf

tool: D14: %s.%s

assistant: ```c
char *string_commas_double(double d) {
  char integer_part[64];
  char buffer[64];
  char decimal_part[8];
  char d_string[128];
  char reversed_integer[64];
  char *reversed_integer_pointer = reversed_integer;
  char *integer_part_pointer;
  int counter = 0;
  char destination[1024];
  if (double_virtually_same(d, 0.0))
    d = 0.0;
  sprintf(d_string, "%.3lf", d);
  piece(integer_part, '.', d_string, 0);
  piece(decimal_part, '.', d_string, 1);
  integer_part_pointer = integer_part + strlen(integer_part) - 1;
  while (integer_part_pointer >= integer_part) {
    *reversed_integer_pointer++ = *integer_part_pointer;
    if (integer_part_pointer > integer_part && *(integer_part_pointer - 1) != '-') {
      if (!(++counter % 3)) {
        if (integer_part_pointer != integer_part) {
          *reversed_integer_pointer++ = ',';
        }
      }
    }
    integer_part_pointer--;
  }
  *reversed_integer_pointer = '\0';
  reverse_string(buffer, reversed_integer);
  sprintf(destination, "%s.%s", buffer, decimal_part);
  return strdup(destination);
}
```