user: Demonstrate the C code that generates the assembly output below:

```asm
<sift_extract_principal_orientations>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  movss  %xmm0,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x6,%edi
  call   <smooth_circular_histogram@plt>
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <array_max@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L48
L23:
  mov    -0x24(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movss  -0x40(%rbp),%xmm1
  mulss  -0x20(%rbp),%xmm1
  comiss %xmm1,%xmm0
  jbe    L8
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L8
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  comiss %xmm1,%xmm0
  jbe    L8
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <interpolate_peak@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x24(%rbp),%xmm0
  addss  -0x14(%rbp),%xmm0
  movd   %xmm0,%eax
  mov    -0x28(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    -0x3c(%rbp),%edx
  mov    %edx,%edi
  movd   %eax,%xmm0
  call   <bin_to_ori@plt>
  movd   %xmm0,%eax
  mov    %eax,(%rbx)
  addl   $0x1,-0x28(%rbp)
L8:
  addl   $0x1,-0x24(%rbp)
L48:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L23
  mov    -0x28(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int sift_extract_principal_orientations(float *hist, int nbins, float threshold, float *principal_orientations) {
  int o = 0;
  smooth_circular_histogram(6, hist, nbins);
  float max_value = array_max(hist, nbins);
  for (int i = 0; i < nbins; i++) {
    int i_prev = (i - 1 + nbins) % nbins;
    int i_next = (i + 1) % nbins;
    if ((hist[i] > threshold * max_value) && (hist[i] > hist[i_prev]) && (hist[i] > hist[i_next])) {
      float offset = interpolate_peak(hist[i_prev], hist[i], hist[i_next]);
      principal_orientations[o] = bin_to_ori((float)i + offset, nbins);
      o++;
    }
  }
  return o;
}
```