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

```asm
<SCE_String_Strof>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  movsd  %xmm0,-0x48(%rbp)
  mov    %edi,-0x4c(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movsd  -0x48(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <SCE_String_lenof@plt>
  mov    %eax,-0x20(%rbp)
  movsd  -0x48(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  -0x48(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    $0x20,%edx
  mov    $0x0,%esi
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <memset@plt>
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L107
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  je     L154
L107:
  mov    -0x4c(%rbp),%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x18(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x18(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  lea    0x5(%rax),%ebx
  mov    -0x4c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  cmp    %eax,%ebx
  jl     L199
  movsd  -0x48(%rbp),%xmm1
  movsd  D139(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L46
L199:
  mov    -0x34(%rbp),%eax
  imul   $0xfffffff6,%eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cmp    $0x4,%eax
  jle    L46
  addl   $0x1,-0x34(%rbp)
L46:
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <SCE_String_lenof@plt>
  mov    %eax,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L1
  movb   $0x2d,D53(%rip)
  movsd  -0x48(%rbp),%xmm0
  movq   D0(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  addl   $0x1,-0x30(%rbp)
L1:
  jmp    L279
L182:
  mov    -0x20(%rbp),%eax
  sub    -0x30(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %rax,%rax
  js     L200
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L209
L200:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L209:
  movsd  -0x48(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  movsd  D121(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%eax
  lea    D53(%rip),%rdx
  mov    %cl,(%rax,%rdx,1)
  addl   $0x1,-0x30(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %rax,%rax
  js     L271
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L161
L271:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L161:
  movsd  -0x48(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%eax
  test   %rax,%rax
  js     L237
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L175
L237:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L175:
  movsd  -0x48(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x48(%rbp)
L279:
  mov    -0x30(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jb     L182
  mov    -0x30(%rbp),%eax
  lea    D53(%rip),%rdx
  movb   $0x2e,(%rax,%rdx,1)
  addl   $0x1,-0x30(%rbp)
  mov    -0x28(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jae    L180
  movl   $0x0,-0x2c(%rbp)
  jmp    L16
L255:
  mov    -0x30(%rbp),%eax
  lea    D53(%rip),%rdx
  movb   $0x30,(%rax,%rdx,1)
  addl   $0x1,-0x2c(%rbp)
  addl   $0x1,-0x30(%rbp)
L16:
  mov    -0x4c(%rbp),%eax
  sub    -0x28(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jb     L255
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L180
L36:
  mov    -0x28(%rbp),%eax
  sub    -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x34(%rbp),%eax
  mov    $0x0,%edx
  divl   -0x1c(%rbp)
  add    $0x30,%eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%eax
  lea    D53(%rip),%rdx
  mov    %cl,(%rax,%rdx,1)
  addl   $0x1,-0x30(%rbp)
  mov    -0x34(%rbp),%eax
  mov    $0x0,%edx
  divl   -0x1c(%rbp)
  mov    %edx,%eax
  mov    %eax,-0x34(%rbp)
L180:
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  cmp    %eax,-0x30(%rbp)
  jb     L36
  jmp    L257
L154:
  pxor   %xmm0,%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L216
  movb   $0x2d,D53(%rip)
  movsd  -0x48(%rbp),%xmm0
  movq   D0(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  addl   $0x1,-0x30(%rbp)
L216:
  jmp    L231
L113:
  mov    -0x20(%rbp),%eax
  sub    -0x30(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <SCE_Math_Powi@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %rax,%rax
  js     L19
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L284
L19:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L284:
  movsd  -0x48(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  movsd  D121(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%eax
  lea    D53(%rip),%rdx
  mov    %cl,(%rax,%rdx,1)
  addl   $0x1,-0x30(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %rax,%rax
  js     L95
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L233
L95:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L233:
  movsd  -0x48(%rbp),%xmm1
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%eax
  test   %rax,%rax
  js     L194
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L226
L194:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L226:
  movsd  -0x48(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x48(%rbp)
L231:
  mov    -0x30(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jb     L113
L257:
  lea    D53(%rip),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D139
type: f32[2]
name: retrieve_data
arguments: tag: D0
type: f32[2]
name: retrieve_data
arguments: tag: D121
type: f32[2]

tool: {"D139": [0.0,1.875]}

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

tool: {"D121": [0.0,3.125]}

assistant: ```c
const char *SCE_String_Strof(double arg, unsigned int nd) {
  static char str[32] = {0};
  double vf = 0.0;
  int dec = 0;
  int dec1 = 0;
  unsigned int i = 0, j = 0;
  unsigned int lenof_arg = 0, lenof_dec = 0;
  unsigned int div = 0;
  lenof_arg = SCE_String_lenof(arg);
  vf = arg - (long)arg;
  memset(str, '\0', sizeof str);
  if (vf != 0.0) {
    dec = vf * SCE_Math_Powi(10, nd);
    dec1 = vf * SCE_Math_Powi(10, nd + 1);
    if (dec1 + 5 >= SCE_Math_Powi(10, nd + 1)) {
      arg++;
      dec = 0;
    } else {
      if (dec1 - (dec * 10) >= 5)
        dec++;
    }
    lenof_dec = SCE_String_lenof(dec);
    if (arg < 0) {
      str[0] = '-';
      arg = -arg;
      i++;
    }
    while (i < lenof_arg) {
      div = SCE_Math_Powi(10, lenof_arg - i - 1);
      str[i] = (arg / div) + '0';
      i++;
      arg = arg - ((int)(arg / div) * div);
    }
    str[i] = '.';
    i++;
    if (lenof_dec < nd) {
      for (j = 0; j < nd - lenof_dec; j++, i++)
        str[i] = '0';
      lenof_dec = nd;
    }
    while (i < lenof_arg + lenof_dec + 1) {
      div = SCE_Math_Powi(10, lenof_dec - i + lenof_arg);
      str[i] = (dec / div) + '0';
      i++;
      dec = dec - ((int)(dec / div) * div);
    }
  } else {
    if (arg < 0) {
      str[0] = '-';
      arg = -arg;
      i++;
    }
    while (i < lenof_arg) {
      div = SCE_Math_Powi(10, lenof_arg - i - 1);
      str[i] = (arg / div) + '0';
      i++;
      arg = arg - ((int)(arg / div) * div);
    }
  }
  return str;
}
```