// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
movslq 0x58(%rdi), %rax
xorl %ecx, %ecx
testq %rax, %rax
cmovleq %rcx, %rax
movq %rax, 0x48(%rsp)
leaq 0x20(%rsp), %r15
xorl %ecx, %ecx
cmpq 0x48(%rsp), %rcx
je 0xe084
movq 0x50(%rbx), %rax
movq %rcx, 0x50(%rsp)
imulq $0x28, %rcx, %r14
movq 0x20(%rax,%r14), %rcx
movq %rcx, 0x40(%rsp)
movups (%rax,%r14), %xmm0
movups 0x10(%rax,%r14), %xmm1
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
callq 0x9770
movq %rax, %r12
movslq 0x58(%rsp), %r13
cvtss2sd 0x28(%rsp), %xmm3
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 0x1f125(%rip), %xmm2    # 0x2d0a0
xorps %xmm2, %xmm0
movaps %xmm4, %xmm1
xorps %xmm2, %xmm1
testq %r13, %r13
movl $0x0, %eax
cmovleq %rax, %r13
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 $0x4, %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xe077
movsd (%r12,%rbp), %xmm0
callq 0x9470
movaps %xmm0, 0xb0(%rsp)
movsd (%r12,%rbp), %xmm0
callq 0x98d0
testq %rbp, %rbp
je 0xe007
movq %rbx, %rdi
movq %r15, %rsi
movapd %xmm0, 0xa0(%rsp)
callq 0x9510
movapd 0xa0(%rsp), %xmm0
movq 0x50(%rbx), %rax
imulq $0x28, 0x58(%rbx), %rcx
addq %rcx, %rax
addq $-0x28, %rax
jmp 0xe00e
movq 0x50(%rbx), %rax
addq %r14, %rax
cvtsd2ss 0x8(%r12,%rbp), %xmm5
movapd %xmm0, %xmm1
movapd 0xb0(%rsp), %xmm4
unpcklpd %xmm4, %xmm1            # xmm1 = xmm1[0],xmm4[0]
movapd %xmm1, %xmm2
mulpd 0x70(%rsp), %xmm1
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
movapd 0x90(%rsp), %xmm3
mulpd %xmm4, %xmm3
addpd %xmm1, %xmm3
mulpd 0x60(%rsp), %xmm2
mulpd 0x80(%rsp), %xmm4
addpd %xmm2, %xmm4
cvtpd2ps %xmm4, %xmm1
cvtpd2ps %xmm3, %xmm2
movss %xmm5, 0x20(%rax)
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movupd %xmm2, 0x8(%rax)
addq $0x10, %rbp
jmp 0xdfac
movq 0x50(%rsp), %rcx
incq %rcx
jmp 0xdedd
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq