// File: /workspace/github_c_makefile_star2_O1/zpole[P]IICV/vl/covdet.c
// Function: vl_covdet_extract_orientations
void
vl_covdet_extract_orientations (VlCovDet * self)
{
  vl_index i, j  ;
  vl_size numFeatures = vl_covdet_get_num_features(self) ;
  for (i = 0 ; i < (signed)numFeatures ; ++i) {
    vl_size numOrientations ;
    VlCovDetFeature feature = self->features[i] ;
    VlCovDetFeatureOrientation* orientations =
    vl_covdet_extract_orientations_for_frame(self, &numOrientations, feature.frame) ;

    for (j = 0 ; j < (signed)numOrientations ; ++j) {
      double A [2*2] = {
        feature.frame.a11,
        feature.frame.a21,
        feature.frame.a12,
        feature.frame.a22} ;
      double r1 = cos(orientations[j].angle) ;
      double r2 = sin(orientations[j].angle) ;
      VlCovDetFeature * oriented ;

      if (j == 0) {
        oriented = & self->features[i] ;
      } else {
        vl_covdet_append_feature(self, &feature) ;
        oriented = & self->features[self->numFeatures -1] ;
      }

      oriented->orientationScore = orientations[j].score ;
      oriented->frame.a11 = + A[0] * r1 + A[2] * r2 ;
      oriented->frame.a21 = + A[1] * r1 + A[3] * r2 ;
      oriented->frame.a12 = - A[0] * r2 + A[2] * r1 ;
      oriented->frame.a22 = - A[1] * r2 + A[3] * r1 ;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movslq 0x58(%rdi), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
jle 0xe94e
movq %rdi, %rbx
xorl %ebp, %ebp
movq 0x50(%rbx), %rax
leaq (,%rbp,4), %r14
addq %rbp, %r14
movq 0x20(%rax,%r14,8), %rcx
movq %rcx, 0x40(%rsp)
movups (%rax,%r14,8), %xmm0
movupd 0x10(%rax,%r14,8), %xmm1
movapd %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x20(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x9710
movslq 0x58(%rsp), %r13
testq %r13, %r13
jle 0xe940
movq %rax, %r12
xorps %xmm3, %xmm3
cvtss2sd 0x28(%rsp), %xmm3
xorps %xmm4, %xmm4
cvtss2sd 0x30(%rsp), %xmm4
movups 0x2c(%rsp), %xmm0
movss 0x34(%rsp), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
cvtps2pd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movaps %xmm1, 0x60(%rsp)
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movaps %xmm0, 0x70(%rsp)
movaps %xmm3, %xmm0
movaps 0x24888(%rip), %xmm2    # 0x330d0
xorps %xmm2, %xmm0
movaps %xmm4, %xmm1
xorps %xmm2, %xmm1
movlhps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
movaps %xmm4, 0x80(%rsp)
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movaps %xmm3, 0x90(%rsp)
shlq $0x3, %r14
xorl %r15d, %r15d
movsd (%r12), %xmm0
callq 0x9450
movaps %xmm0, 0xb0(%rsp)
movsd (%r12), %xmm0
callq 0x9860
testq %r15, %r15
je 0xe8c6
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movapd %xmm0, 0xa0(%rsp)
callq 0x94e0
movapd 0xa0(%rsp), %xmm0
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
addq $-0x28, %rax
jmp 0xe8cd
movq 0x50(%rbx), %rax
addq %r14, %rax
xorps %xmm1, %xmm1
cvtsd2ss 0x8(%r12), %xmm1
movss %xmm1, 0x20(%rax)
movapd %xmm0, %xmm4
movapd 0xb0(%rsp), %xmm3
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
movapd %xmm4, %xmm1
mulpd 0x60(%rsp), %xmm1
mulpd 0x70(%rsp), %xmm4
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movapd 0x90(%rsp), %xmm2
mulpd %xmm3, %xmm2
mulpd 0x80(%rsp), %xmm3
addpd %xmm1, %xmm3
cvtpd2ps %xmm3, %xmm1
addpd %xmm4, %xmm2
cvtpd2ps %xmm2, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movupd %xmm0, 0x8(%rax)
incq %r15
addq $0x10, %r12
cmpq %r15, %r13
jne 0xe86e
incq %rbp
cmpq 0x50(%rsp), %rbp
jne 0xe7a0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq