// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: code_calculate_distance
void code_calculate_distance(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d)
{
 /*!Last Changed 13.06.2006*/
 char st[MAXLENGTH];
 int *symbolic, *numeric, scount, ncount;
 code_set_variable(testcodefile, language, "sum", "0.0"); 
 code_for(testcodefile, language, "j", 0, d->featurecount - 1, 1); 
 code_array_index_variable(st, language, "testdataconverted", "j");
 code_set_variable(testcodefile, language, "x_j", st);
 code_2d_array_index_variable(st, language, "m", "i", "j");
 code_set_variable(testcodefile, language, "m_ij", st);
 code_switch(testcodefile, language, "j");
 symbolic = symbolic_features(d, &scount);
 numeric = numeric_features(d, &ncount);
 if (scount > 0)
  {
   code_case(testcodefile, language, symbolic, scount);
   code_if(testcodefile, language, "==", "m_ij", "x_j");
   code_set_variable(testcodefile, language, "sum", "sum + 1");
   code_endif(testcodefile, language);
   code_endcase(testcodefile, language);
  }
 if (ncount > 0)
  {
   code_case(testcodefile, language, numeric, ncount);
   code_set_variable(testcodefile, language, "sum", "sum + (x_j - m_ij) * (x_j - m_ij)");
   code_endcase(testcodefile, language);
  }
 safe_free(symbolic);
 safe_free(numeric);
 code_endswitch(testcodefile, language);
 code_endfor(testcodefile, language, "j");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a160, %rsp          # imm = 0x7A160
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3b409(%rip), %rdx     # 0xed31d
leaq 0x3b36a(%rip), %rcx     # 0xed285
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r8d
subl $0x1, %r8d
leaq 0x3b0e7(%rip), %rdx     # 0xed024
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a140(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3af99(%rip), %rdx     # 0xecef4
leaq 0x3b0c2(%rip), %rcx     # 0xed024
callq 0xb04c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a140(%rbp), %rcx
leaq 0x3b0bc(%rip), %rdx     # 0xed038
callq 0xafa00
leaq -0x7a140(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3a836(%rip), %rdx     # 0xec7c8
leaq 0x3b390(%rip), %rcx     # 0xed329
leaq 0x3b084(%rip), %r8      # 0xed024
callq 0xb0560
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a140(%rbp), %rcx
leaq 0x3af4c(%rip), %rdx     # 0xecf06
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3b057(%rip), %rdx     # 0xed024
callq 0xb0930
movq -0x18(%rbp), %rdi
leaq -0x7a154(%rbp), %rsi
callq 0x1dcd0
movq %rax, -0x7a148(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x7a158(%rbp), %rsi
callq 0x1de20
movq %rax, -0x7a150(%rbp)
cmpl $0x0, -0x7a154(%rbp)
jle 0xb2075
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x7a148(%rbp), %rdx
movl -0x7a154(%rbp), %ecx
callq 0xb06d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x33a98(%rip), %rdx     # 0xe5ac8
leaq 0x3aecf(%rip), %rcx     # 0xecf06
leaq 0x3affa(%rip), %r8      # 0xed038
callq 0xb0d00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3b2cc(%rip), %rdx     # 0xed31d
leaq 0x3aeb3(%rip), %rcx     # 0xecf0b
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0ec0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
cmpl $0x0, -0x7a158(%rbp)
jle 0xb20bd
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x7a150(%rbp), %rdx
movl -0x7a158(%rbp), %ecx
callq 0xb06d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3b278(%rip), %rdx     # 0xed31d
leaq 0x3ae67(%rip), %rcx     # 0xecf13
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
movq -0x7a148(%rbp), %rdi
callq 0x52e80
movq -0x7a150(%rbp), %rdi
callq 0x52e80
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb09e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3af35(%rip), %rdx     # 0xed024
callq 0xb13f0
addq $0x7a160, %rsp          # imm = 0x7A160
popq %rbp
retq
nopl (%rax)