// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/gmm.c
// Function: vl_gmm_init_with_rand_data_f
static void
VL_XCAT(_vl_gmm_init_with_rand_data_, SFX)
(VlGMM * self,
 TYPE const * data,
 vl_size numData)
{
  vl_uindex i, k, dim ;
  VlKMeans * kmeans ;

  _vl_gmm_prepare_for_data(self, numData) ;

  /* initilaize priors of gaussians so they are equal and sum to one */
  for (i = 0 ; i < self->numClusters ; ++i) { ((TYPE*)self->priors)[i] = (TYPE) (1.0 / self->numClusters) ; }

  /* initialize diagonals of covariance matrices to data covariance */
  VL_XCAT(_vl_gmm_compute_init_sigma_, SFX) (self, data, self->covariances, self->dimension, numData);
  for (k = 1 ; k < self->numClusters ; ++ k) {
    for(dim = 0; dim < self->dimension; dim++) {
      *((TYPE*)self->covariances + k * self->dimension + dim) =
      *((TYPE*)self->covariances + dim) ;
    }
  }

  /* use kmeans++ initialization to pick points at random */
  kmeans = vl_kmeans_new(self->dataType,VlDistanceL2) ;
  vl_kmeans_init_centers_plus_plus(kmeans, data, self->dimension, numData, self->numClusters) ;
  memcpy(self->means, vl_kmeans_get_centers(kmeans), sizeof(TYPE) * self->dimension * self->numClusters) ;
  vl_kmeans_delete(kmeans) ;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x1a6e0
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x191ba
movq 0x40(%rsp), %rax
movq 0x10(%rax), %xmm1
movaps 0x3fff4(%rip), %xmm0    # 0x59160
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x3fff8(%rip), %xmm0    # 0x59170
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x3ff49(%rip), %xmm0    # 0x590d8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1914b
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x30(%rsp), %r8
callq 0x1a750
movq $0x1, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x19273
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x1925e
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rdx
imulq 0x8(%rdx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq 0x18(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x19202
jmp 0x19260
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x191e9
movq 0x40(%rsp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x91d0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x10(%rax), %r8
callq 0x9100
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x1a9b0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rdx
shlq $0x2, %rdx
movq 0x40(%rsp), %rax
imulq 0x10(%rax), %rdx
callq 0x9640
movq 0x10(%rsp), %rdi
callq 0x9290
addq $0x48, %rsp
retq
nopw (%rax,%rax)