user: Please show me the C implementation that matches the assembly code listed below:

```asm
<decompose>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  movsd  %xmm0,-0x28(%rbp)
  movsd  %xmm1,-0x30(%rbp)
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L41
L49:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmod@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L90
  movsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movq   D20(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L111
L90:
  movsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm0
L111:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L61
  movsd  -0x10(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L46
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D20(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L94
L46:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L94:
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L61:
  pxor   %xmm0,%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L137
  movsd  -0x10(%rbp),%xmm0
  movq   D20(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  jmp    L117
L137:
  movsd  -0x10(%rbp),%xmm0
L117:
  movsd  -0x30(%rbp),%xmm1
  comisd %xmm0,%xmm1
  jb     L26
  pxor   %xmm0,%xmm0
  comisd -0x28(%rbp),%xmm0
  jbe    L23
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D20(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  D31(%rip),%xmm1
  divsd  %xmm1,%xmm0
  jmp    L64
L23:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  D31(%rip),%xmm1
  divsd  %xmm1,%xmm0
L64:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  movsd  -0x28(%rbp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  jmp    L102
L26:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movsd  %xmm2,-0x50(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  mulsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x14(%rbp)
L41:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L49
L102:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L159
  subl   $0x1,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  movsd  (%rdx),%xmm0
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L70
L159:
  addl   $0x1,-0x14(%rbp)
  jmp    L156
L108:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L156:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L108
L70:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D20
data_type: f32[2]
name: retrieve_data
arguments: tag: D31
data_type: f64

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

tool: D31: 2

assistant: ```c
void decompose(value, uncer, nbasis, basis, count) double value;
double uncer;
int nbasis;
double *basis;
double *count;
{
  int i;
  for (i = 0; i < nbasis; i++) {
    double r = fmod(value, basis[i]);
    if (((2 * r) < 0 ? -(2 * r) : (2 * r)) > basis[i])
      r += r > 0 ? -basis[i] : basis[i];
    if (((r) < 0 ? -(r) : (r)) <= uncer) {
      double half = value < 0 ? -basis[i] / 2 : basis[i] / 2;
      modf((value + half) / basis[i], count + i);
      break;
    }
    value = basis[i] * modf(value / basis[i], count + i);
  }
  if (i >= nbasis) {
    count[--i] += value;
  } else {
    for (i++; i < nbasis; i++)
      count[i] = 0;
  }
}
```