user: What is the c source code of the assembly code below?

```asm
<csamplestatepath>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r12
  push   %rbx
  sub    $0x90,%rsp
  mov    %edi,-0x74(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %rdx,-0x88(%rbp)
  mov    %ecx,-0x78(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x98(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xa0(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0xb0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  mov    -0x74(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  mov    %edx,-0x50(%rbp)
  cmpl   $0x0,-0x50(%rbp)
  jne    L38
  mov    -0x78(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x74(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  mov    %eax,-0x5c(%rbp)
  jmp    L58
L38:
  mov    -0x74(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  add    $0x1,%eax
  mov    %eax,-0x5c(%rbp)
L58:
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x74(%rbp),%eax
  sub    -0x50(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    0x28(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x40(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L135:
  cmp    %rdx,%rsp
  je     L95
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L135
L95:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L108
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L108:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x4c(%rbp)
  jmp    L118
L73:
  mov    -0x4c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  movslq %edx,%rdx
  movsd  (%rax,%rdx,8),%xmm1
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%rax
  mov    -0x4c(%rbp),%edx
  movslq %edx,%rdx
  movsd  %xmm0,(%rax,%rdx,8)
  addl   $0x1,-0x4c(%rbp)
L118:
  mov    -0x4c(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jl     L73
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x28(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <sample@plt>
  mov    %eax,(%rbx)
  jmp    L88
L132:
  subl   $0x1,-0x5c(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x48(%rbp)
  cmpl   $0x0,-0x58(%rbp)
  jle    L89
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x60(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0xa0(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    0x28(%rbp),%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <samplebinsearch@plt>
  mov    %eax,(%rbx)
  jmp    L138
L89:
  movl   $0x0,-0x60(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x60(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0xa0(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    0x28(%rbp),%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <samplebinsearch@plt>
  mov    %eax,(%rbx)
L138:
  mov    -0x50(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  sub    $0x2,%eax
  mov    %eax,-0x44(%rbp)
  jmp    L127
L36:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0xa0(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x60(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x28(%rbp),%edx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <samplebinsearch@plt>
  mov    %eax,(%rbx)
  mov    -0x60(%rbp),%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x64(%rbp)
  addl   $0x1,-0x60(%rbp)
L127:
  mov    -0x60(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L36
  mov    -0x78(%rbp),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  sub    %eax,-0x58(%rbp)
  mov    -0x58(%rbp),%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x54(%rbp)
L88:
  cmpl   $0x0,-0x58(%rbp)
  jns    L132
  mov    %r12,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L55
  call   <__stack_chk_fail@plt>
L55:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void csamplestatepath(int T, int *obs, double **fwds, int R, double ***mats, double ****rmats, int *states, int *storedpos, double ***sneak, int N) {
  double *distribution;
  int pos, cs, js, je;
  int p, s, e;
  int md = T % R;
  if (md == 0) {
    md = R;
    p = T / R;
  } else {
    p = T / R + 1;
  }
  e = T;
  s = T - md;
  double tmp[N];
  tmp[0] = fwds[p][0];
  int i;
  for (i = 1; i < N; i++)
    tmp[i] = tmp[i - 1] + fwds[p][i];
  states[e - 1] = sample(0, tmp, N);
  while (s >= 0) {
    p--;
    cs = states[e - 1];
    if (s > 0) {
      js = s - 1;
      pos = storedpos[s];
      states[js] = samplebinsearch(0, sneak[p + 1][cs], N);
    } else {
      js = 0;
      pos = storedpos[1];
      states[js] = samplebinsearch(0, sneak[p + 1][cs], N);
    }
    je = md + s - 2;
    for (; js < je; js++) {
      distribution = rmats[pos][states[js]][cs];
      states[js + 1] = samplebinsearch(0, distribution, N);
      pos = storedpos[js + 2];
    }
    md = R;
    s -= md;
    e = s + md;
  }
}
```