user: Translate the below assembly code into C programming language:

```asm
<LengthBounds>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %esi,%ebp
  mov    %edx,%ebx
  movsd  %xmm0,(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  lea    0x0(,%rsi,4),%r12d
  mov    %r12d,%edi
  call   <MallocOrDie@plt>
  mov    %rax,%r13
  mov    %r12d,%edi
  call   <MallocOrDie@plt>
  mov    %rax,%r14
  test   %ebp,%ebp
  jle    L104
  mov    %ebp,%ebp
  lea    0x0(%r13,%rbp,4),%r15
  mov    %r13,%rax
  neg    %rax
  mov    0x18(%rsp),%rdi
  lea    (%rdi,%rax,2),%r12
  mov    %r13,%rbp
  jmp    L132
L17:
  mov    $0x0,%eax
  jmp    L106
L198:
  cmp    %edx,%ebx
  je     L89
  movslq %edx,%rsi
  movsd  0x8(%rcx,%rsi,8),%xmm1
  movslq %eax,%rsi
  movsd  -0x8(%rcx,%rsi,8),%xmm2
  comisd %xmm1,%xmm2
  jbe    L21
  sub    $0x1,%eax
  movslq %eax,%rsi
  subsd  (%rcx,%rsi,8),%xmm0
L54:
  comisd (%rsp),%xmm0
  jbe    L100
L28:
  test   %eax,%eax
  jne    L198
  add    $0x1,%edx
  movslq %edx,%rsi
  subsd  (%rcx,%rsi,8),%xmm0
L7:
  comisd (%rsp),%xmm0
  jbe    L100
  test   %eax,%eax
  jne    L28
  cmp    %ebx,%edx
  jne    L28
  mov    $0x0,%eax
L100:
  mov    %eax,0x0(%rbp)
  mov    %r14,%rax
  sub    %r13,%rax
  mov    %edx,(%rax,%rbp,1)
  add    $0x4,%rbp
  cmp    %r15,%rbp
  je     L104
L132:
  lea    0x1(%rbx),%esi
  mov    (%r12,%rbp,2),%rdi
  call   <DNorm@plt>
  mov    (%r12,%rbp,2),%rcx
  movsd  (%rcx),%xmm0
  test   %ebx,%ebx
  jle    L17
  lea    0x1(%rbx),%esi
  mov    $0x1,%edx
  mov    $0x0,%eax
L207:
  movsd  (%rcx,%rdx,8),%xmm1
  comisd %xmm0,%xmm1
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  cmova  %edx,%eax
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L207
L106:
  movslq %eax,%rdx
  movsd  D9(%rip),%xmm0
  subsd  (%rcx,%rdx,8),%xmm0
  comisd (%rsp),%xmm0
  jbe    L201
  test   %eax,%eax
  jne    L84
  cmp    %eax,%ebx
  je     L25
L84:
  mov    %eax,%edx
  jmp    L28
L89:
  sub    $0x1,%eax
  movslq %eax,%rsi
  subsd  (%rcx,%rsi,8),%xmm0
  jmp    L7
L21:
  add    $0x1,%edx
  subsd  %xmm1,%xmm0
  jmp    L54
L201:
  mov    %eax,%edx
  jmp    L100
L25:
  mov    $0x0,%edx
  mov    $0x0,%eax
  jmp    L100
L104:
  mov    0x8(%rsp),%rax
  mov    %r13,(%rax)
  mov    0x10(%rsp),%rax
  mov    %r14,(%rax)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D9
type_infered: f64

tool: D9: 1

assistant: ```c
void LengthBounds(double **lmx, int statenum, int N, double epsilon, int **ret_min, int **ret_max) {
  int *min, *max;
  int y, len;
  int cmin, cmax;
  double best;
  double p_remain;
  min = (int *)MallocOrDie(sizeof(int) * statenum);
  max = (int *)MallocOrDie(sizeof(int) * statenum);
  for (y = 0; y < statenum; y++) {
    DNorm(lmx[y], (N + 1));
    best = lmx[y][0];
    cmin = 0;
    for (len = 1; len <= N; len++)
      if (lmx[y][len] > best) {
        best = lmx[y][len];
        cmin = len;
      }
    cmax = cmin;
    p_remain = 1.0 - lmx[y][cmin];
    while (p_remain > epsilon) {
      if (cmin == 0 && cmax == N)
        break;
      else if (cmin == 0)
        p_remain -= lmx[y][++cmax];
      else if (cmax == N)
        p_remain -= lmx[y][--cmin];
      else {
        if (lmx[y][cmin - 1] > lmx[y][cmax + 1])
          p_remain -= lmx[y][--cmin];
        else
          p_remain -= lmx[y][++cmax];
      }
    }
    min[y] = cmin;
    max[y] = cmax;
  }
  *ret_min = min;
  *ret_max = max;
}
```