// File: /workspace/github_c_makefile_star2_O1/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 $0xf4250, %rsp          # imm = 0xF4250
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, %r14
leaq 0x3077e(%rip), %rdx     # 0xadc15
leaq 0x306df(%rip), %rcx     # 0xadb7d
callq 0x7ba46
movl 0x1bc(%r12), %r8d
decl %r8d
leaq 0x30467(%rip), %r15     # 0xad91c
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7ca9f
leaq 0x3031b(%rip), %rdx     # 0xad7ec
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x7c24c
leaq 0x30446(%rip), %rdx     # 0xad930
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x7ba46
leaq 0x2fbc2(%rip), %rdx     # 0xad0c0
leaq 0x3071c(%rip), %rcx     # 0xadc21
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %r8
callq 0x7c269
leaq 0x302e5(%rip), %rdx     # 0xad7fe
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7c4fd
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14fc3
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x150b9
movq %rax, %r12
movl (%r13), %ecx
testl %ecx, %ecx
jle 0x7d5e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7c2a3
leaq 0x28982(%rip), %rsi     # 0xa5ef8
leaq 0x30281(%rip), %rdx     # 0xad7fe
leaq 0x303ac(%rip), %rcx     # 0xad930
leaq 0x7a130(%rsp), %r13
movl %ebx, %edi
movq %r13, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x7c75c
leaq 0x3066b(%rip), %rdx     # 0xadc15
leaq 0x30252(%rip), %rcx     # 0xad803
movq %r14, %rdi
movl %ebx, %esi
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
cmpl $0x3, %ebx
ja 0x7d5e8
cmpl $0x2, %ebx
je 0x7d5e8
leaq 0x2fdcb(%rip), %rdi     # 0xad3a1
movl $0x7, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0x7d638
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7c2a3
leaq 0x30611(%rip), %rdx     # 0xadc15
leaq 0x30200(%rip), %rcx     # 0xad80b
movq %r14, %rdi
movl %ebx, %esi
callq 0x7ba46
cmpl $0x3, %ebx
ja 0x7d638
cmpl $0x2, %ebx
je 0x7d638
leaq 0x2fd7b(%rip), %rdi     # 0xad3a1
movl $0x7, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movq %r15, %rdi
callq 0x39194
movq %r12, %rdi
callq 0x39194
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c565
movq %r14, %rdi
movl %ebx, %esi
callq 0x7cd49
addq $0xf4250, %rsp          # imm = 0xF4250
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq