user: Converte this assembly snippet into its equivalent C code:

```asm
<itoa_dw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movsd  %xmm0,-0x28(%rbp)
  mov    %rdi,-0x30(%rbp)
  mov    %esi,%eax
  mov    %ax,-0x34(%rbp)
  movl   $0x0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  pxor   %xmm0,%xmm0
  cvtsd2ss -0x28(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x1c(%rbp),%xmm0
  jbe    L30
  movsd  -0x28(%rbp),%xmm0
  movq   D67(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  comisd D28(%rip),%xmm0
  jae    L36
  movsd  -0x28(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L37
L36:
  movsd  -0x28(%rbp),%xmm0
  movsd  D28(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movabs $0x8000000000000000,%rax
  xor    %rax,-0x18(%rbp)
L37:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  movq   %rdx,%xmm0
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L84
L30:
  movsd  -0x28(%rbp),%xmm0
  comisd D28(%rip),%xmm0
  jae    L82
  movsd  -0x28(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L23
L82:
  movsd  -0x28(%rbp),%xmm0
  movsd  D28(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movabs $0x8000000000000000,%rax
  xor    %rax,-0x18(%rbp)
L23:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  movq   %rdx,%xmm0
  mov    %rax,%rsi
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L84:
  movl   $0x0,-0x20(%rbp)
L81:
  mov    -0x18(%rbp),%rcx
  movabs $0xcccccccccccccccd,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x3,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  movabs $0xcccccccccccccccd,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x3,%rax
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L81
  movswl -0x34(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jge    L74
L65:
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
  movswl -0x34(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jl     L65
L74:
  pxor   %xmm0,%xmm0
  comiss -0x1c(%rbp),%xmm0
  jbe    L55
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2d,(%rax)
L55:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <reverse_string@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D67
data_type: f32[2]
name: extract_symbolic_data
arguments: tag: D28
data_type: f32
name: extract_symbolic_data
arguments: tag: D15
data_type: string
name: extract_symbolic_data
arguments: tag: D58
data_type: string

tool: {"D67": [0.0,-0.0]}

tool: D28: 0

tool: D15: n < 0 and digit = %lu; n = %G


tool: D58: n > 0 and digit = %lu; n = %f;


assistant: ```c
void itoa_dw(double n, char s[], short int wide) {
  int i = 0;
  float sign = 0;
  unsigned long digit = 0;
  unsigned long limit = 0;
  double word2 = 0;
  if ((sign = n) < 0) {
    n = -n;
    digit = n;
    printf("n < 0 and digit = %lu; n = %G\n", digit, n);
  } else {
    digit = n;
    printf("n > 0 and digit = %lu; n = %f;\n", digit, n);
  };
  i = 0;
  do {
    s[i++] = digit % 10 + '0';
  } while ((digit /= 10) > 0);
  if (i < wide) {
    do {
      s[i++] = ' ';
    } while (i < wide);
  };
  if (sign < 0)
    s[i++] = '-';
  s[i] = '\0';
  reverse_string(s);
}
```