// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a130, %rsp          # imm = 0x7A130
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, %r14
leaq 0x2c989(%rip), %rdx     # 0xa0c11
leaq 0x2c8ea(%rip), %rcx     # 0xa0b79
callq 0x72b25
movl 0x1bc(%r12), %r8d
decl %r8d
leaq 0x2c672(%rip), %r15     # 0xa0918
pushq $0x1
popq %r9
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x73938
leaq 0x2c528(%rip), %rdx     # 0xa07e8
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x7327f
leaq 0x2c653(%rip), %rdx     # 0xa092c
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x72b25
leaq 0x2bdcf(%rip), %rdx     # 0xa00bc
leaq 0x2c929(%rip), %rcx     # 0xa0c1d
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %r8
callq 0x7329c
leaq 0x2c4f2(%rip), %rdx     # 0xa07fa
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x734bf
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x13e3f
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x13efa
movq %rax, %r12
movl (%r13), %ecx
testl %ecx, %ecx
jle 0x743a5
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x732d6
leaq 0x24b37(%rip), %rdx     # 0x98e98
leaq 0x2c492(%rip), %rcx     # 0xa07fa
leaq 0x2c5bd(%rip), %r8      # 0xa092c
movq %r14, %rdi
movl %ebx, %esi
callq 0x736fc
leaq 0x2c891(%rip), %rdx     # 0xa0c11
leaq 0x2c478(%rip), %rcx     # 0xa07ff
movq %r14, %rdi
movl %ebx, %esi
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movq %r14, %rdi
movl %ebx, %esi
callq 0x7349f
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0x743dc
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x732d6
leaq 0x2c850(%rip), %rdx     # 0xa0c11
leaq 0x2c43f(%rip), %rcx     # 0xa0807
movq %r14, %rdi
movl %ebx, %esi
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x7349f
movq %r15, %rdi
callq 0x34ff7
movq %r12, %rdi
callq 0x34ff7
movq %r14, %rdi
movl %ebx, %esi
callq 0x734fe
movq %r14, %rdi
movl %ebx, %esi
callq 0x73b72
addq $0x7a130, %rsp          # imm = 0x7A130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq