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

```asm
<dtoa>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  movslq %esi,%rbx
  sub    $0x28,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isnan@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  je     L205
  mov    $0x616e,%ecx
  movb   $0x6e,0x2(%r13)
  lea    0x3(%r13),%r14
  mov    %cx,0x0(%r13)
L328:
  add    $0x28,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L205:
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <isinf@plt>
  movsd  0x8(%rsp),%xmm1
  test   %rax,%rax
  jne    L52
  test   %ebx,%ebx
  mov    $0x1,%eax
  pxor   %xmm5,%xmm5
  cmovle %rax,%rbx
  ucomisd %xmm5,%xmm1
  jp     L246
  je     L84
L246:
  pxor   %xmm4,%xmm4
  comisd %xmm1,%xmm4
  ja     L315
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  mov    %r13,%r14
  call   <log10@plt>
  movsd  0x8(%rsp),%xmm1
  mov    %eax,%ebp
  movsd  %xmm1,0x10(%rsp)
L333:
  test   %r12d,%r12d
  jne    L127
  cmp    $0xd,%ebp
  jg     L105
  pxor   %xmm7,%xmm7
  comisd %xmm1,%xmm7
  seta   %dl
  cmp    $0x8,%ebp
  setg   %al
  test   %al,%dl
  jne    L66
  cmp    $0xfffffff8,%ebp
  jge    L147
L66:
  mov    $0x1,%r12d
L127:
  test   %ebp,%ebp
  jns    L32
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  subsd  D14(%rip),%xmm0
  cvttsd2si %xmm0,%ebp
L32:
  movsd  D5(%rip),%xmm6
  mov    %ebp,%edi
  xor    %r15d,%r15d
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x8(%rsp)
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm7
  divsd  %xmm0,%xmm7
  movsd  %xmm7,0x10(%rsp)
L39:
  xor    %r13d,%r13d
L342:
  movsd  0x8(%rsp),%xmm0
  mov    %r15d,%edi
  call   <pow@plt>
  pxor   %xmm2,%xmm2
  comisd %xmm0,%xmm2
  jae    L328
  comisd %xmm2,%xmm0
  ja     L131
L187:
  test   %r13,%r13
  je     L185
L2:
  sub    $0x1,%r15d
  sub    $0x1,%ebx
  jne    L342
  test   %r12d,%r12d
  je     L287
  movb   $0x65,(%r14)
  lea    0x2(%r14),%rcx
  test   %ebp,%ebp
  js     L30
  movb   $0x2b,0x1(%r14)
  mov    %rcx,%r14
  je     L150
L23:
  mov    %rcx,%r14
  mov    $0xcccccccd,%edi
  nopl   0x0(%rax,%rax,1)
L28:
  mov    %ebp,%eax
  mov    %r14,%rsi
  lea    0x1(%r14),%r14
  add    $0x1,%ebx
  imul   %rdi,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%ebp
  add    $0x30,%ebp
  mov    %bpl,-0x1(%r14)
  mov    %eax,%ebp
  test   %eax,%eax
  jne    L28
  mov    %r14,%rax
  sub    %rcx,%rax
  cmp    $0x1,%rax
  jg     L169
L150:
  sub    %r14d,%ebx
  nopl   0x0(%rax,%rax,1)
L332:
  mov    %r14,%rsi
  add    $0x1,%r14
  mov    %r14,%rax
  lea    (%rbx,%r14,1),%edx
  movb   $0x30,-0x1(%r14)
  sub    %rcx,%rax
  cmp    $0x1,%rax
  jle    L332
L40:
  movslq %edx,%rdx
  mov    %r14,%rdi
  sub    %rdx,%rdi
  call   <mem_reverse@plt>
L287:
  movb   $0x0,(%r14)
  jmp    L328
  nopl   0x0(%rax,%rax,1)
L315:
  movapd %xmm1,%xmm6
  xorpd  D24(%rip),%xmm6
  movsd  %xmm1,0x8(%rsp)
  lea    0x1(%r13),%r14
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x10(%rsp)
  call   <log10@plt>
  movb   $0x2d,0x0(%r13)
  movsd  0x8(%rsp),%xmm1
  mov    %eax,%ebp
  jmp    L333
  nopw   0x0(%rax,%rax,1)
L52:
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L7
  movb   $0x2d,0x0(%r13)
  add    $0x1,%r13
L7:
  mov    $0x6e69,%edx
  movb   $0x66,0x2(%r13)
  lea    0x3(%r13),%r14
  mov    %dx,0x0(%r13)
  jmp    L328
  nopl   0x0(%rax,%rax,1)
L131:
  movsd  %xmm0,0x18(%rsp)
  call   <isinf@plt>
  movsd  0x18(%rsp),%xmm1
  test   %rax,%rax
  jne    L187
  movsd  0x10(%rsp),%xmm0
  add    $0x1,%r14
  divsd  %xmm1,%xmm0
  call   <floor@plt>
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm4
  cvtsi2sd %eax,%xmm0
  add    $0x30,%eax
  mov    %al,-0x1(%r14)
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm4
  movsd  %xmm4,0x10(%rsp)
  test   %r13,%r13
  jne    L2
  nop
L185:
  test   %r15d,%r15d
  jne    L112
  movsd  0x10(%rsp),%xmm7
  pxor   %xmm5,%xmm5
  comisd %xmm5,%xmm7
  jbe    L112
  lea    0x1(%r14),%r13
  movb   $0x2e,(%r14)
  mov    %r13,%r14
L112:
  sub    $0x1,%r15d
  jmp    L342
  nopl   0x0(%rax)
L84:
  mov    $0x2e30,%eax
  lea    0x2(%r13),%r14
  mov    %rbx,%rdx
  mov    $0x30,%esi
  mov    %ax,0x0(%r13)
  mov    %r14,%rdi
  add    %rbx,%r14
  call   <memset@plt>
  test   %r12d,%r12d
  je     L328
  movl   $0x30302b65,(%r14)
  add    $0x4,%r14
  jmp    L328
  nopw   0x0(%rax,%rax,1)
L105:
  mov    $0x1,%r12d
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L30:
  movb   $0x2d,0x1(%r14)
  neg    %ebp
  jmp    L23
L147:
  movsd  D5(%rip),%xmm4
  xor    %r15d,%r15d
  test   %ebp,%ebp
  cmovns %ebp,%r15d
  xor    %ebp,%ebp
  movsd  %xmm4,0x8(%rsp)
  jmp    L39
L169:
  mov    %ebx,%edx
  jmp    L40
```

tool_calls: name: extract_symbolic_data
arguments: tag: D14
type: f64
name: extract_symbolic_data
arguments: tag: D5
type: f64
name: extract_symbolic_data
arguments: tag: D24
type: f32[4]

tool: D14: 1

tool: D5: 10

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

assistant: ```c
char *dtoa(double n, char *s, int precision_with, bool use_exp) {
  if (precision_with <= 0) {
    precision_with = 1;
  }
  char *p_tmp = NULL;
  char *c = s;
  if (isnan(n)) {
    *s++ = 'n';
    *s++ = 'a';
    *s++ = 'n';
    return s;
  } else if (isinf(n)) {
    if (n < 0) {
      *s++ = '-';
    }
    *s++ = 'i';
    *s++ = 'n';
    *s++ = 'f';
    return s;
  } else if (n == 0.0) {
    *s++ = '0';
    *s++ = '.';
    while (precision_with-- > 0) {
      *s++ = '0';
    }
    if (use_exp) {
      *s++ = 'e';
      *s++ = '+';
      *s++ = '0';
      *s++ = '0';
    }
    return s;
  } else {
    int digit, m, m1 = 0;
    int neg = (n < 0);
    if (neg)
      n = -n;
    m = log10(n);
    if (neg)
      *(c++) = '-';
    if (!use_exp) {
      use_exp = (m >= 14 || (neg && m >= 9) || m <= -9);
    }
    if (use_exp) {
      if (m < 0)
        m -= 1.0;
      n = n / pow(10.0, m);
      m1 = m;
      m = 0;
    } else {
    }
    if (m < 1.0) {
      m = 0;
    }
    while (precision_with > 0) {
      double weight = pow(10.0, m);
      if (weight <= 0) {
        return c;
      }
      if (weight > 0 && !isinf(weight)) {
        digit = floor(n / weight);
        n -= (digit * weight);
        *(c++) = '0' + digit;
      }
      if (p_tmp) {
        precision_with--;
      } else if (m == 0 && n > 0) {
        *(c++) = '.';
        p_tmp = c;
      }
      m--;
    }
    if (use_exp) {
      *(c++) = 'e';
      if (m1 >= 0) {
        *(c++) = '+';
      } else {
        *(c++) = '-';
        m1 = -m1;
      }
      p_tmp = c;
      m = 0;
      while (m1 > 0) {
        *(c++) = '0' + m1 % 10;
        m1 /= 10;
        m++;
      }
      while ((c - p_tmp) < 2) {
        *(c++) = '0';
        m++;
      }
      mem_reverse(c - m, c - 1);
    }
    *(c) = '\0';
  }
  return c;
}
```