user: 请将以下的汇编代码转换成C语言代码:

```asm
<cvt>:
  endbr64
  push   %r15
  pxor   %xmm6,%xmm6
  push   %r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %r8d,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  mov    $0x4e,%eax
  cmp    %eax,%edi
  cmovle %edi,%eax
  movslq %eax,%r13
  xor    %eax,%eax
  test   %r13d,%r13d
  cmovs  %rax,%r13
  comisd %xmm0,%xmm6
  ja     L136
  movl   $0x0,(%rdx)
L83:
  lea    0x28(%rsp),%r15
  lea    0x50(%r12),%rbx
  mov    %r15,%rdi
  call   <modf@plt>
  pxor   %xmm7,%xmm7
  movapd %xmm0,%xmm1
  movsd  0x28(%rsp),%xmm0
  ucomisd %xmm7,%xmm0
  jp     L262
  jne    L262
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm1
  jbe    L94
  movsd  D4(%rip),%xmm7
  movsd  D8(%rip),%xmm2
  xor    %ebp,%ebp
  movapd %xmm7,%xmm0
  movsd  %xmm7,(%rsp)
  mulsd  %xmm1,%xmm0
  comisd %xmm0,%xmm2
  movsd  %xmm0,0x30(%rsp)
  jbe    L159
  nopl   0x0(%rax)
L106:
  movapd %xmm0,%xmm1
  movsd  (%rsp),%xmm0
  sub    $0x1,%ebp
  mulsd  %xmm1,%xmm0
  comisd %xmm0,%xmm2
  ja     L106
  movsd  %xmm0,0x30(%rsp)
  mov    %r12,%r15
  jmp    L198
  nopl   0x0(%rax)
L262:
  movsd  D4(%rip),%xmm2
  mov    %rbx,%r14
  xor    %ebp,%ebp
  movsd  %xmm2,(%rsp)
  nopw   0x0(%rax,%rax,1)
L164:
  mov    %r15,%rdi
  movsd  %xmm1,0x8(%rsp)
  sub    $0x1,%r14
  add    $0x1,%ebp
  divsd  (%rsp),%xmm0
  call   <modf@plt>
  pxor   %xmm5,%xmm5
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,0x30(%rsp)
  addsd  D12(%rip),%xmm0
  mulsd  (%rsp),%xmm0
  cvttsd2si %xmm0,%eax
  movsd  0x28(%rsp),%xmm0
  add    $0x30,%eax
  ucomisd %xmm5,%xmm0
  mov    %al,(%r14)
  jp     L164
  jne    L164
  cmp    %r14,%rbx
  jbe    L159
  mov    %r12,%rsi
  sub    %r14,%rsi
  lea    0x50(%rsi),%r15
  xor    %esi,%esi
  jmp    L221
  cs nopw 0x0(%rax,%rax,1)
L72:
  movzbl (%r14,%rsi,1),%eax
L221:
  mov    %al,(%r12,%rsi,1)
  add    $0x1,%rsi
  cmp    %rsi,%r15
  jne    L72
  add    %r12,%r15
L198:
  mov    0x1c(%rsp),%edx
  lea    (%r12,%r13,1),%r14
  movslq %ebp,%rcx
  mov    0x10(%rsp),%rax
  add    %r14,%rcx
  test   %edx,%edx
  mov    %ebp,(%rax)
  cmove  %rcx,%r14
  cmp    %r12,%r14
  jb     L38
  cmp    %r14,%r15
  ja     L266
  movsd  D4(%rip),%xmm6
  lea    0x30(%rsp),%r13
  movsd  %xmm6,(%rsp)
  cmp    %rbx,%r15
  jb     L312
  jmp    L266
  nopw   0x0(%rax,%rax,1)
L107:
  cmp    %r15,%r14
  jb     L266
L312:
  mulsd  (%rsp),%xmm1
  mov    %r13,%rdi
  add    $0x1,%r15
  movapd %xmm1,%xmm0
  call   <modf@plt>
  cvttsd2si 0x30(%rsp),%edx
  movapd %xmm0,%xmm1
  add    $0x30,%edx
  mov    %dl,-0x1(%r15)
  cmp    %r15,%rbx
  ja     L107
L266:
  cmp    %rbx,%r14
  jae    L67
  movzbl (%r14),%eax
  lea    0x5(%rax),%edx
  mov    %dl,(%r14)
  cmp    $0x39,%dl
  jle    L179
  mov    %r14,%rdx
  jmp    L75
  nopl   (%rax)
L209:
  movzbl -0x1(%rdx),%eax
  sub    $0x1,%rdx
  lea    0x1(%rax),%ecx
  mov    %cl,(%rdx)
  cmp    $0x39,%cl
  jle    L179
L75:
  movb   $0x30,(%rdx)
  cmp    %rdx,%r12
  jb     L209
  mov    0x10(%rsp),%rax
  movb   $0x31,(%rdx)
  addl   $0x1,(%rax)
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jne    L182
  cmp    %r14,%r12
  jae    L286
  movb   $0x30,(%r14)
L286:
  add    $0x1,%r14
L182:
  movzbl (%rdx),%ecx
  cmp    $0x39,%cl
  jg     L75
L179:
  movb   $0x0,(%r14)
L99:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L145
  add    $0x48,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L94:
  mov    %r12,%r15
  xor    %ebp,%ebp
  jmp    L198
  nopw   0x0(%rax,%rax,1)
L136:
  movl   $0x1,(%rdx)
  xorpd  D30(%rip),%xmm0
  jmp    L83
  nopl   0x0(%rax,%rax,1)
L38:
  movb   $0x0,(%r12)
  jmp    L99
  nop
L67:
  movb   $0x0,0x4f(%r12)
  jmp    L99
  nopl   0x0(%rax,%rax,1)
L159:
  mov    %r12,%r15
  jmp    L198
L145:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D8
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D12
data_type: byte[8]
name: extract_symbolic_data
arguments: data_tag: D30
data_type: byte[16]

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: {"D8": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D12": [0xb8,0x1e,0x85,0xeb,0x51,0xb8,0x9e,0x3f]}

tool: {"D30": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag) {
  int r2;
  double fi, fj;
  char *p, *p1;
  if (ndigits < 0) {
    ndigits = 0;
  }
  if (ndigits >= 80 - 1) {
    ndigits = 80 - 2;
  }
  r2 = 0;
  *sign = 0;
  p = &buf[0];
  if (arg < 0) {
    *sign = 1;
    arg = -arg;
  }
  arg = modf(arg, &fi);
  p1 = &buf[80];
  if (fi != 0) {
    p1 = &buf[80];
    while (fi != 0) {
      fj = modf(fi / 10, &fi);
      *--p1 = (int)((fj + .03) * 10) + '0';
      r2++;
    }
    while (p1 < &buf[80]) {
      *p++ = *p1++;
    }
  } else if (arg > 0) {
    while ((fj = arg * 10) < 1) {
      arg = fj;
      r2--;
    }
  }
  p1 = &buf[ndigits];
  if (eflag == 0) {
    p1 += r2;
  }
  *decpt = r2;
  if (p1 < &buf[0]) {
    buf[0] = '\0';
    return buf;
  }
  while (p <= p1 && p < &buf[80]) {
    arg *= 10;
    arg = modf(arg, &fj);
    *p++ = (int)fj + '0';
  }
  if (p1 >= &buf[80]) {
    buf[80 - 1] = '\0';
    return buf;
  }
  p = p1;
  *p1 += 5;
  while (*p1 > '9') {
    *p1 = '0';
    if (p1 > buf) {
      ++*--p1;
    } else {
      *p1 = '1';
      (*decpt)++;
      if (eflag == 0) {
        if (p > buf) {
          *p = '0';
        }
        p++;
      }
    }
  }
  *p = '\0';
  return buf;
}
```