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

```asm
<find_aks>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x858,%rsp
  mov    %rdi,-0x858(%rbp)
  mov    %rsi,-0x860(%rbp)
  mov    %edx,-0x864(%rbp)
  mov    %ecx,-0x868(%rbp)
  mov    %r8,-0x870(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x868(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x840(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L33:
  cmp    %rdx,%rsp
  je     L5
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L33
L5:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L4
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L4:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x838(%rbp)
  cmpl   $0x1ff,-0x864(%rbp)
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x864(%rbp),%edx
  lea    -0x830(%rbp),%rcx
  mov    -0x858(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <hanning_window@plt>
  mov    -0x868(%rbp),%ecx
  mov    -0x864(%rbp),%edx
  mov    -0x838(%rbp),%rsi
  lea    -0x830(%rbp),%rax
  mov    %rax,%rdi
  call   <autocorrelate@plt>
  mov    -0x868(%rbp),%edx
  mov    -0x860(%rbp),%rcx
  mov    -0x838(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <levinson_durbin@plt>
  mov    -0x870(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  movl   $0x0,-0x844(%rbp)
  jmp    L37
L26:
  mov    -0x870(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x844(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x860(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm2
  mov    -0x838(%rbp),%rax
  mov    -0x844(%rbp),%edx
  movslq %edx,%rdx
  movss  (%rax,%rdx,4),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  mov    -0x870(%rbp),%rax
  movss  %xmm0,(%rax)
  addl   $0x1,-0x844(%rbp)
L37:
  mov    -0x844(%rbp),%eax
  cmp    -0x868(%rbp),%eax
  jle    L26
  mov    -0x870(%rbp),%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comiss %xmm1,%xmm0
  jbe    L43
  mov    -0x870(%rbp),%rax
  movss  D4(%rip),%xmm0
  movss  %xmm0,(%rax)
L43:
  mov    %rbx,%rsp
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D4
type_guessed: byte[4]

tool: {"D4": [0xcc,0xbc,0x8c,0x2b]}

assistant: ```c
void find_aks(float Sn[], float a[], int Nsam, int order, float *E) {
  float Wn[512];
  float R[order + 1];
  int i;
  assert(Nsam < 512);
  hanning_window(Sn, Wn, Nsam);
  autocorrelate(Wn, R, Nsam, order);
  levinson_durbin(R, a, order);
  *E = 0.0;
  for (i = 0; i <= order; i++)
    *E += a[i] * R[i];
  if (*E < 0.0)
    *E = 1E-12;
}
```