// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/vl/svm.c
// Function: vl_svm_update_statistics
void _vl_svm_update_statistics (VlSvm *self)
{
  vl_size i, k ;
  double inner, p ;

  memset(&self->statistics, 0, sizeof(VlSvmStatistics)) ;

  self->statistics.regularizer = self->bias * self->bias ;
  for (i = 0; i < self->dimension; i++) {
    self->statistics.regularizer += self->model[i] * self->model[i] ;
  }
  self->statistics.regularizer *= self->lambda * 0.5 ;

  for (k = 0; k < self->numData ; k++) {
    p = (self->weights) ? self->weights[k] : 1.0 ;
    if (p <= 0) continue ;
    inner = self->innerProductFn(self->data, k, self->model) ;
    inner += self->bias * self->biasMultiplier ;
    self->scores[k] = inner ;
    self->statistics.loss += p * self->lossFn(inner, self->labels[k]) ;
    if (self->solver == VlSvmSolverSdca) {

      self->statistics.dualLoss -= p * self->conjugateLossFn(- self->alpha[k] / p, self->labels[k]) ;
    }
  }

  self->statistics.loss /= self->numData ;
  self->statistics.objective = self->statistics.regularizer + self->statistics.loss ;

  if (self->solver == VlSvmSolverSdca) {
    self->statistics.dualLoss /= self->numData ;
    self->statistics.dualObjective = - self->statistics.regularizer + self->statistics.dualLoss ;
    self->statistics.dualityGap = self->statistics.objective - self->statistics.dualObjective ;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
movups %xmm0, 0xf8(%rdi)
movups %xmm0, 0xe8(%rdi)
movups %xmm0, 0xc8(%rdi)
movups %xmm0, 0xb8(%rdi)
andq $0x0, 0x108(%rdi)
movsd 0x18(%rdi), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0xd8(%rdi)
movq 0x8(%rdi), %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x2b029
movq 0x10(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rbx)
incq %rcx
jmp 0x2b006
movsd 0x28(%rbx), %xmm1
mulsd 0x218a(%rip), %xmm1     # 0x2d1c0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rbx)
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
cmpq %rax, %r14
jae 0x2b11a
movq 0x48(%rbx), %rax
movsd 0x21da(%rip), %xmm1     # 0x2d238
testq %rax, %rax
je 0x2b077
movsd (%rax,%r14,8), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x2b112
movsd %xmm1, (%rsp)
movq 0x10(%rbx), %rdx
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq *0x90(%rbx)
movsd 0x18(%rbx), %xmm1
mulsd 0x20(%rbx), %xmm1
addsd %xmm1, %xmm0
movq 0x110(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
movq 0x40(%rbx), %rax
movsd (%rax,%r14,8), %xmm1
callq *0x70(%rbx)
movsd (%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0xe0(%rbx), %xmm0
movsd %xmm0, 0xe0(%rbx)
cmpl $0x2, (%rbx)
jne 0x2b112
movq 0x40(%rbx), %rax
movq 0x120(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
xorpd 0x1fb4(%rip), %xmm0     # 0x2d0a0
divsd %xmm1, %xmm0
movsd (%rax,%r14,8), %xmm1
callq *0x78(%rbx)
movsd 0xf0(%rbx), %xmm1
mulsd (%rsp), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0xf0(%rbx)
incq %r14
jmp 0x2b045
movq %rax, %xmm0
punpckldq 0x2039(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2041(%rip), %xmm0     # 0x2d170
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0xe0(%rbx), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rbx)
movsd 0xd8(%rbx), %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0xd0(%rbx)
cmpl $0x2, (%rbx)
jne 0x2b194
movsd 0xf0(%rbx), %xmm3
divsd %xmm1, %xmm3
movsd %xmm3, 0xf0(%rbx)
subsd %xmm2, %xmm3
movsd %xmm3, 0xe8(%rbx)
subsd %xmm3, %xmm0
movsd %xmm0, 0xf8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq