// File: /workspace/github_c_makefile_star2_O3/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
xorpd %xmm0, %xmm0
movupd %xmm0, 0xd8(%rdi)
movupd %xmm0, 0xf8(%rdi)
movupd %xmm0, 0xe8(%rdi)
movupd %xmm0, 0xc8(%rdi)
movupd %xmm0, 0xb8(%rdi)
movq $0x0, 0x108(%rdi)
movsd 0x18(%rdi), %xmm1
mulsd %xmm1, %xmm1
movsd %xmm1, 0xd8(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x30c3e
movq 0x10(%rbx), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0xd8(%rbx)
incq %rdx
cmpq %rdx, %rax
jne 0x30c21
movsd 0x28(%rbx), %xmm0
mulsd 0x1595(%rip), %xmm0     # 0x321e0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rbx)
cmpq $0x0, 0x38(%rbx)
je 0x30d68
xorl %r14d, %r14d
movq 0x48(%rbx), %rax
movsd 0x15ff(%rip), %xmm1     # 0x32270
testq %rax, %rax
je 0x30c8a
movsd (%rax,%r14,8), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x30d25
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 0x30d25
movq 0x40(%rbx), %rax
movq 0x120(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
xorpd 0x13d1(%rip), %xmm0     # 0x320d0
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
movq 0x38(%rbx), %rax
cmpq %rax, %r14
jb 0x30c65
movsd 0xd8(%rbx), %xmm0
movq %rax, %xmm3
punpckldq 0x1436(%rip), %xmm3 # xmm3 = xmm3[0],mem[0],xmm3[1],mem[1]
subpd 0x143e(%rip), %xmm3     # 0x32190
movsd 0xe0(%rbx), %xmm1
movapd %xmm3, %xmm2
unpckhpd %xmm3, %xmm2            # xmm2 = xmm2[1],xmm3[1]
addsd %xmm3, %xmm2
jmp 0x30d70
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
divsd %xmm2, %xmm1
movsd %xmm1, 0xe0(%rbx)
addsd %xmm0, %xmm1
movsd %xmm1, 0xd0(%rbx)
cmpl $0x2, (%rbx)
jne 0x30db9
movsd 0xf0(%rbx), %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, 0xf0(%rbx)
subsd %xmm0, %xmm3
movsd %xmm3, 0xe8(%rbx)
subsd %xmm3, %xmm1
movsd %xmm1, 0xf8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq